Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obc tracers, part 2 #617

Merged
merged 14 commits into from
Oct 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ cache:
# Install tools and clone the configurations repository
before_install:
- git clone https://github.com/adcroft/house_cleaning.git
- rm -rf MOM6-examples/
# This line clones MOM6-examples when there is no cache
- test -f MOM6-examples/README.md || (rm -rf MOM6-examples && git clone https://github.com/NOAA-GFDL/MOM6-examples.git)

Expand Down
21 changes: 21 additions & 0 deletions src/core/MOM_CoriolisAdv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,27 @@ subroutine CorAdCalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, CS)
do j=Jsq-1,Jeq+2 ; do I=Isq-1,Ieq+2
Area_h(i,j) = G%mask2dT(i,j) * G%areaT(i,j)
enddo ; enddo
if (associated(OBC)) then ; do n=1,OBC%number_of_segments
if (.not. OBC%segment(n)%on_pe) cycle
I = OBC%segment(n)%HI%IsdB ; J = OBC%segment(n)%HI%JsdB
if (OBC%segment(n)%is_N_or_S .and. (J >= Jsq-1) .and. (J <= Jeq+1)) then
do i = max(Isq-1,OBC%segment(n)%HI%isd), min(Ieq+2,OBC%segment(n)%HI%ied)
if (OBC%segment(n)%direction == OBC_DIRECTION_N) then
Area_h(i,j+1) = Area_h(i,j)
else ! (OBC%segment(n)%direction == OBC_DIRECTION_S)
Area_h(i,j) = Area_h(i,j+1)
endif
enddo
elseif (OBC%segment(n)%is_E_or_W .and. (I >= Isq-1) .and. (I <= Ieq+1)) then
do j = max(Jsq-1,OBC%segment(n)%HI%jsd), min(Jeq+2,OBC%segment(n)%HI%jed)
if (OBC%segment(n)%direction == OBC_DIRECTION_E) then
Area_h(i+1,j) = Area_h(i,j)
else ! (OBC%segment(n)%direction == OBC_DIRECTION_W)
Area_h(i,j) = Area_h(i+1,j)
endif
enddo
endif
enddo ; endif
!$OMP parallel do default(private) shared(Isq,Ieq,Jsq,Jeq,G,Area_h,Area_q)
do J=Jsq-1,Jeq+1 ; do I=Isq-1,Ieq+1
Area_q(i,j) = (Area_h(i,j) + Area_h(i+1,j+1)) + &
Expand Down
64 changes: 37 additions & 27 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ end subroutine open_boundary_impose_normal_slope
!! Also adjust u- and v-point cell area on specified open boundaries.
subroutine open_boundary_impose_land_mask(OBC, G, areaCu, areaCv)
type(ocean_OBC_type), pointer :: OBC !< Open boundary control structure
type(dyn_horgrid_type), intent(in) :: G !< Ocean grid structure
type(dyn_horgrid_type), intent(inout) :: G !< Ocean grid structure
real, dimension(SZIB_(G),SZJ_(G)), intent(inout) :: areaCu !< Area of a u-cell (m2)
real, dimension(SZI_(G),SZJB_(G)), intent(inout) :: areaCv !< Area of a u-cell (m2)
! Local variables
Expand All @@ -1134,12 +1134,22 @@ subroutine open_boundary_impose_land_mask(OBC, G, areaCu, areaCv)
I=segment%HI%IsdB
do j=segment%HI%jsd,segment%HI%jed
if (G%mask2dCu(I,j) == 0) OBC%segnum_u(I,j) = OBC_NONE
if (segment%direction == OBC_DIRECTION_W) then
G%mask2dT(i,j) = 0
else
G%mask2dT(i+1,j) = 0
endif
enddo
else
! Sweep along v-segments and delete the OBC for blocked points.
J=segment%HI%JsdB
do i=segment%HI%isd,segment%HI%ied
if (G%mask2dCv(i,J) == 0) OBC%segnum_v(i,J) = OBC_NONE
if (segment%direction == OBC_DIRECTION_S) then
G%mask2dT(i,j) = 0
else
G%mask2dT(i,j+1) = 0
endif
enddo
endif
enddo
Expand Down Expand Up @@ -1633,32 +1643,32 @@ subroutine set_tracer_data(OBC, tv, h, G, PF, tracer_Reg)
enddo
endif

do n=1,OBC%number_of_segments
segment => OBC%segment(n)
if (.not. segment%on_pe) cycle

if (segment%direction == OBC_DIRECTION_E) then
I=segment%HI%IsdB
do k=1,G%ke ; do j=segment%HI%jsd,segment%HI%jed
h(i+1,j,k) = h(i,j,k)
enddo; enddo
elseif (segment%direction == OBC_DIRECTION_W) then
I=segment%HI%IsdB
do k=1,G%ke ; do j=segment%HI%jsd,segment%HI%jed
h(i,j,k) = h(i+1,j,k)
enddo; enddo
elseif (segment%direction == OBC_DIRECTION_N) then
J=segment%HI%JsdB
do k=1,G%ke ; do i=segment%HI%isd,segment%HI%ied
h(i,j+1,k) = h(i,j,k)
enddo; enddo
elseif (segment%direction == OBC_DIRECTION_S) then
J=segment%HI%JsdB
do k=1,G%ke ; do i=segment%HI%isd,segment%HI%ied
h(i,j,k) = h(i,j+1,k)
enddo; enddo
endif
enddo
! do n=1,OBC%number_of_segments
! segment => OBC%segment(n)
! if (.not. segment%on_pe) cycle

! if (segment%direction == OBC_DIRECTION_E) then
! I=segment%HI%IsdB
! do k=1,G%ke ; do j=segment%HI%jsd,segment%HI%jed
! h(i+1,j,k) = h(i,j,k)
! enddo; enddo
! elseif (segment%direction == OBC_DIRECTION_W) then
! I=segment%HI%IsdB
! do k=1,G%ke ; do j=segment%HI%jsd,segment%HI%jed
! h(i,j,k) = h(i+1,j,k)
! enddo; enddo
! elseif (segment%direction == OBC_DIRECTION_N) then
! J=segment%HI%JsdB
! do k=1,G%ke ; do i=segment%HI%isd,segment%HI%ied
! h(i,j+1,k) = h(i,j,k)
! enddo; enddo
! elseif (segment%direction == OBC_DIRECTION_S) then
! J=segment%HI%JsdB
! do k=1,G%ke ; do i=segment%HI%isd,segment%HI%ied
! h(i,j,k) = h(i,j+1,k)
! enddo; enddo
! endif
! enddo

end subroutine set_tracer_data

Expand Down
7 changes: 4 additions & 3 deletions src/initialization/MOM_state_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1629,9 +1629,10 @@ subroutine initialize_sponges_file(G, GV, use_temperature, tv, param_file, CSp,
type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters.
type(sponge_CS), pointer :: CSp !< A pointer that is set to point to the control
!! structure for this module (in layered mode).
type(ALE_sponge_CS), pointer :: ALE_CSp !< A pointer that is set to point to the control
!! structure for this module (in ALE mode).
type(time_type), intent(in) :: Time
type(ALE_sponge_CS), pointer :: ALE_CSp !< A pointer that is set to point to the control
!! structure for this module (in ALE mode).
type(time_type), intent(in) :: Time !< Time at the start of the run segment. Time_in
!! overrides any value set for Time.

! Local variables
real, allocatable, dimension(:,:,:) :: eta ! The target interface heights, in m.
Expand Down
Loading