Skip to content
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
10 changes: 7 additions & 3 deletions model/dyn_core.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ subroutine dyn_core(npx, npy, npz, ng, sphum, nq, bdt, n_map, n_split, zvir, cp,
endif

#ifndef ROT3
if ( it/=n_split) &
if ( .not. flagstruct%regional .and. it/=n_split) &
call start_group_halo_update(i_pack(8), u, v, domain, gridtype=DGRID_NE)
#endif
call timing_off('COMM_TOTAL')
Expand Down Expand Up @@ -1201,8 +1201,12 @@ subroutine dyn_core(npx, npy, npz, ng, sphum, nq, bdt, n_map, n_split, zvir, cp,
isd, ied, jsd, jed, &
reg_bc_update_time,it )

call mpp_update_domains(u, v, domain, gridtype=DGRID_NE)
end if
#ifndef ROT3
if (it/=n_split) &
call start_group_halo_update(i_pack(8), u, v, domain, gridtype=DGRID_NE)
#endif

endif

if ( do_diag_debug_dyn ) then
call debug_column_dyn( pt, delp, delz, u, v, w, q, heat_source, cappa, akap, &
Expand Down
91 changes: 66 additions & 25 deletions model/fv_regional_bc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,17 @@ subroutine setup_regional_BC(Atm &
else
nrows_blend=nrows_blend_in_data !<-- # of blending rows in the BC files.
endif

IF ( north_bc .or. south_bc ) THEN
IF ( nrows_blend_user > jed - nhalo_model - (jsd + nhalo_model) + 1 ) THEN
call mpp_error(FATAL,'Number of blending rows is greater than the north-south tile size!')
ENDIF
ENDIF
IF ( west_bc .or. east_bc ) THEN
IF ( nrows_blend_user > ied - nhalo_model - (isd + nhalo_model) + 1 ) THEN
call mpp_error(FATAL,'Number of blending rows is greater than the east-west tile size!')
ENDIF
ENDIF
!
call check(nf90_close(ncid)) !<-- Close the BC file for now.
!
Expand Down Expand Up @@ -4378,7 +4389,7 @@ subroutine regional_boundary_update(array &
!
real,dimension(:,:,:),pointer :: bc_t0,bc_t1 !<-- Boundary data at the two bracketing times.
!
logical :: blend,call_interp
logical :: blend,call_interp,blendtmp
!
!---------------------------------------------------------------------
!*********************************************************************
Expand Down Expand Up @@ -4422,13 +4433,21 @@ subroutine regional_boundary_update(array &
i2=ied+1
endif
!
j1=jsd
j2=js-1
j1=jsd ! -2 -- outermost boundary ghost zone
j2=js-1 ! 0 -- first boundary ghost zone
!
IF ( east_bc ) THEN
i1_blend=is
ELSE
i1_blend=isd !is-nhalo_model
ENDIF
IF ( west_bc ) THEN
i2_blend=ie
ELSE
i2_blend=ied ! ie+nhalo_model
ENDIF
if(trim(bc_vbl_name)=='uc'.or.trim(bc_vbl_name)=='v'.or.trim(bc_vbl_name)=='divgd')then
i2_blend=ie+1
i2_blend=i2_blend+1 ! ie+1
endif
j1_blend=js
j2_blend=js+nrows_blend_user-1
Expand Down Expand Up @@ -4463,8 +4482,19 @@ subroutine regional_boundary_update(array &
!
i1_blend=is
i2_blend=ie
if(trim(bc_vbl_name)=='uc'.or.trim(bc_vbl_name)=='v'.or.trim(bc_vbl_name)=='divgd')then
i2_blend=ie+1
IF ( east_bc ) THEN
i1_blend=is
ELSE
i1_blend=isd !is-nhalo_model
ENDIF
IF ( west_bc ) THEN
i2_blend=ie
ELSE
i2_blend=ied ! ie+nhalo_model
ENDIF
if(trim(bc_vbl_name)=='uc'.or.trim(bc_vbl_name)=='v'.or.trim(bc_vbl_name)=='divgd')then
! i2_blend=ie+1
i2_blend=i2_blend+1
endif
j2_blend=je
if(trim(bc_vbl_name)=='u'.or.trim(bc_vbl_name)=='vc'.or.trim(bc_vbl_name)=='divgd')then
Expand Down Expand Up @@ -4509,16 +4539,21 @@ subroutine regional_boundary_update(array &
endif
endif
!
i1_blend=is
i2_blend=is+nrows_blend_user-1
! Note: Original code checked for corner region and avoided overlap, but changed this to blend corners from both boundaries
i1_blend=is
i2_blend=is+nrows_blend_user-1

IF ( north_bc ) THEN
j1_blend=js
ELSE
j1_blend=jsd !js-nhalo_model
ENDIF
IF ( south_bc ) THEN
j2_blend=je
if(north_bc)then
j1_blend=js+nrows_blend_user !<-- North BC already handles nrows_blend_user blending rows
endif
if(south_bc)then
j2_blend=je-nrows_blend_user !<-- South BC already handles nrows_blend_user blending rows
endif
ELSE
j2_blend=jed ! ie+nhalo_model
ENDIF

if(trim(bc_vbl_name)=='u'.or.trim(bc_vbl_name)=='vc'.or.trim(bc_vbl_name)=='divgd')then
j2_blend=j2_blend+1
endif
Expand Down Expand Up @@ -4564,16 +4599,20 @@ subroutine regional_boundary_update(array &
endif
endif
!
! Note: Original code checked for corner region and avoided overlap, but changed this to blend corners from both boundaries
i1_blend=i1-nrows_blend_user
i2_blend=i1-1

IF ( north_bc ) THEN
j1_blend=js
ELSE
j1_blend=jsd !is-nhalo_model
ENDIF
IF ( south_bc ) THEN
j2_blend=je
if(north_bc)then
j1_blend=js+nrows_blend_user !<-- North BC already handled nrows_blend_user blending rows.
endif
if(south_bc)then
j2_blend=je-nrows_blend_user !<-- South BC already handled nrows_blend_user blending rows.
endif
ELSE
j2_blend=jed ! ie+nhalo_model
ENDIF
if(trim(bc_vbl_name)=='u'.or.trim(bc_vbl_name)=='vc'.or.trim(bc_vbl_name)=='divgd')then
j2_blend=j2_blend+1
endif
Expand All @@ -4589,6 +4628,8 @@ subroutine regional_boundary_update(array &
!*** then update the boundary points.
!---------------------------------------------------------------------
!


if(call_interp)then
!
call retrieve_bc_variable_data(bc_vbl_name &
Expand Down Expand Up @@ -4815,7 +4856,7 @@ subroutine bc_time_interpolation(array &

!
!---------------------------------------------------------------------
!
! Set values in the boundary points only
do k=1,ubnd_z
do j=j1,j2
do i=i1,i2
Expand Down Expand Up @@ -4846,7 +4887,7 @@ subroutine bc_time_interpolation(array &
!-----------
!
if(nside==1.and.north_bc)then
rdenom=1./real(j2_blend-j_bc-1)
rdenom=1./real(Max(1,j2_blend-j_bc-1))
do k=1,ubnd_z
do j=j1_blend,j2_blend
factor_dist=exp(-(blend_exp1+blend_exp2*(j-j_bc-1)*rdenom)) !<-- Exponential falloff of blending weights.
Expand All @@ -4865,7 +4906,7 @@ subroutine bc_time_interpolation(array &
!-----------
!
if(nside==2.and.south_bc)then
rdenom=1./real(j_bc-j1_blend-1)
rdenom=1./real(Max(1,j_bc-j1_blend-1))
do k=1,ubnd_z
do j=j1_blend,j2_blend
factor_dist=exp(-(blend_exp1+blend_exp2*(j_bc-j-1)*rdenom)) !<-- Exponential falloff of blending weights.
Expand All @@ -4883,7 +4924,7 @@ subroutine bc_time_interpolation(array &
!----------
!
if(nside==3.and.east_bc)then
rdenom=1./real(i2_blend-i_bc-1)
rdenom=1./real(Max(1,i2_blend-i_bc-1))
do k=1,ubnd_z
do j=j1_blend,j2_blend
do i=i1_blend,i2_blend
Expand All @@ -4904,7 +4945,7 @@ subroutine bc_time_interpolation(array &
!----------
!
if(nside==4.and.west_bc)then
rdenom=1./real(i_bc-i1_blend-1)
rdenom=1./real(Max(1, i_bc-i1_blend-1))
do k=1,ubnd_z
do j=j1_blend,j2_blend
do i=i1_blend,i2_blend
Expand Down