Skip to content

Commit

Permalink
Rest of fix for issue NOAA-EMC#54.
Browse files Browse the repository at this point in the history
  • Loading branch information
kshedstrom committed Apr 6, 2022
1 parent 41757c7 commit 57a1a8a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
6 changes: 4 additions & 2 deletions src/ALE/MOM_ALE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,10 @@ subroutine ALE_regrid_accelerated(CS, G, GV, h, tv, n, u, v, OBC, Reg, dt, dzReg

! remap from original grid onto new grid
do j = G%jsc-1,G%jec+1 ; do i = G%isc-1,G%iec+1
call remapping_core_h(CS%remapCS, nz, h_orig(i,j,:), tv%S(i,j,:), nz, h(i,j,:), tv_local%S(i,j,:))
call remapping_core_h(CS%remapCS, nz, h_orig(i,j,:), tv%T(i,j,:), nz, h(i,j,:), tv_local%T(i,j,:))
call remapping_core_h(CS%remapCS, nz, h_orig(i,j,:), tv%S(i,j,:), nz, h(i,j,:), tv_local%S(i,j,:), &
GV%H_subroundoff, GV%H_subroundoff)
call remapping_core_h(CS%remapCS, nz, h_orig(i,j,:), tv%T(i,j,:), nz, h(i,j,:), tv_local%T(i,j,:), &
GV%H_subroundoff, GV%H_subroundoff)
enddo ; enddo

! starting grid for next iteration
Expand Down
24 changes: 16 additions & 8 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4007,19 +4007,22 @@ subroutine update_OBC_segment_data(G, GV, US, OBC, tv, h, Time)
call remapping_core_h(OBC%remap_CS, &
segment%field(m)%nk_src,segment%field(m)%dz_src(I,J,:), &
segment%field(m)%buffer_src(I,J,:), &
GV%ke, h_stack, segment%field(m)%buffer_dst(I,J,:))
GV%ke, h_stack, segment%field(m)%buffer_dst(I,J,:), &
GV%H_subroundoff, GV%H_subroundoff)
elseif (G%mask2dCu(I,j)>0.) then
h_stack(:) = h(i+ishift,j,:)
call remapping_core_h(OBC%remap_CS, &
segment%field(m)%nk_src,segment%field(m)%dz_src(I,J,:), &
segment%field(m)%buffer_src(I,J,:), &
GV%ke, h_stack, segment%field(m)%buffer_dst(I,J,:))
GV%ke, h_stack, segment%field(m)%buffer_dst(I,J,:), &
GV%H_subroundoff, GV%H_subroundoff)
elseif (G%mask2dCu(I,j+1)>0.) then
h_stack(:) = h(i+ishift,j+1,:)
call remapping_core_h(OBC%remap_CS, &
segment%field(m)%nk_src,segment%field(m)%dz_src(I,j,:), &
segment%field(m)%buffer_src(I,J,:), &
GV%ke, h_stack, segment%field(m)%buffer_dst(I,J,:))
GV%ke, h_stack, segment%field(m)%buffer_dst(I,J,:), &
GV%H_subroundoff, GV%H_subroundoff)
endif
enddo
else
Expand All @@ -4034,7 +4037,8 @@ subroutine update_OBC_segment_data(G, GV, US, OBC, tv, h, Time)
call remapping_core_h(OBC%remap_CS, &
segment%field(m)%nk_src, scl_fac*segment%field(m)%dz_src(I,j,:), &
segment%field(m)%buffer_src(I,j,:), &
GV%ke, h(i+ishift,j,:), segment%field(m)%buffer_dst(I,j,:))
GV%ke, h(i+ishift,j,:), segment%field(m)%buffer_dst(I,j,:), &
GV%H_subroundoff, GV%H_subroundoff)
endif
enddo
endif
Expand All @@ -4053,19 +4057,22 @@ subroutine update_OBC_segment_data(G, GV, US, OBC, tv, h, Time)
call remapping_core_h(OBC%remap_CS, &
segment%field(m)%nk_src,segment%field(m)%dz_src(I,J,:), &
segment%field(m)%buffer_src(I,J,:), &
GV%ke, h_stack, segment%field(m)%buffer_dst(I,J,:))
GV%ke, h_stack, segment%field(m)%buffer_dst(I,J,:), &
GV%H_subroundoff, GV%H_subroundoff)
elseif (G%mask2dCv(i,J)>0.) then
h_stack(:) = h(i,j+jshift,:)
call remapping_core_h(OBC%remap_CS, &
segment%field(m)%nk_src,segment%field(m)%dz_src(I,J,:), &
segment%field(m)%buffer_src(I,J,:), &
GV%ke, h_stack, segment%field(m)%buffer_dst(I,J,:))
GV%ke, h_stack, segment%field(m)%buffer_dst(I,J,:), &
GV%H_subroundoff, GV%H_subroundoff)
elseif (G%mask2dCv(i+1,J)>0.) then
h_stack(:) = h(i+1,j+jshift,:)
call remapping_core_h(OBC%remap_CS, &
segment%field(m)%nk_src,segment%field(m)%dz_src(I,J,:), &
segment%field(m)%buffer_src(I,J,:), &
GV%ke, h_stack, segment%field(m)%buffer_dst(I,J,:))
GV%ke, h_stack, segment%field(m)%buffer_dst(I,J,:), &
GV%H_subroundoff, GV%H_subroundoff)
endif
enddo
else
Expand All @@ -4080,7 +4087,8 @@ subroutine update_OBC_segment_data(G, GV, US, OBC, tv, h, Time)
call remapping_core_h(OBC%remap_CS, &
segment%field(m)%nk_src, scl_fac*segment%field(m)%dz_src(i,J,:), &
segment%field(m)%buffer_src(i,J,:), &
GV%ke, h(i,j+jshift,:), segment%field(m)%buffer_dst(i,J,:))
GV%ke, h(i,j+jshift,:), segment%field(m)%buffer_dst(i,J,:), &
GV%H_subroundoff, GV%H_subroundoff)
endif
enddo
endif
Expand Down
8 changes: 4 additions & 4 deletions src/ocean_data_assim/MOM_oda_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ subroutine set_prior_tracer(Time, G, GV, h, tv, CS)
! remap temperature and salinity from the ensemble member to the analysis grid
do j=G%jsc,G%jec ; do i=G%isc,G%iec
call remapping_core_h(CS%remapCS, GV%ke, h(i,j,:), tv%T(i,j,:), &
CS%nk, CS%h(i,j,:), T(i,j,:))
CS%nk, CS%h(i,j,:), T(i,j,:), GV%H_subroundoff, GV%H_subroundoff)
call remapping_core_h(CS%remapCS, GV%ke, h(i,j,:), tv%S(i,j,:), &
CS%nk, CS%h(i,j,:), S(i,j,:))
CS%nk, CS%h(i,j,:), S(i,j,:), GV%H_subroundoff, GV%H_subroundoff)
enddo ; enddo
! cast ensemble members to the analysis domain
do m=1,CS%ensemble_size
Expand Down Expand Up @@ -671,9 +671,9 @@ subroutine apply_oda_tracer_increments(dt, Time_end, G, GV, tv, h, CS)
isc=G%isc; iec=G%iec; jsc=G%jsc; jec=G%jec
do j=jsc,jec; do i=isc,iec
call remapping_core_h(CS%remapCS, CS%nk, CS%h(i,j,:), T(i,j,:), &
G%ke, h(i,j,:), T_inc(i,j,:))
G%ke, h(i,j,:), T_inc(i,j,:), GV%H_subroundoff, GV%H_subroundoff)
call remapping_core_h(CS%remapCS, CS%nk, CS%h(i,j,:), S(i,j,:), &
G%ke, h(i,j,:), S_inc(i,j,:))
G%ke, h(i,j,:), S_inc(i,j,:), GV%H_subroundoff, GV%H_subroundoff)
enddo; enddo


Expand Down
2 changes: 1 addition & 1 deletion src/parameterizations/vertical/MOM_tidal_mixing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ subroutine calculate_CVMix_tidal(h, j, N2_int, G, GV, US, CS, Kv, Kd_lay, Kd_int
! remap from input z coordinate to model coordinate:
tidal_qe_md = 0.0
call remapping_core_h(CS%remap_cs, size(CS%h_src), CS%h_src, CS%tidal_qe_3d_in(i,j,:), &
GV%ke, h_m, tidal_qe_md)
GV%ke, h_m, tidal_qe_md, GV%H_subroundoff, GV%H_subroundoff)

! form the Schmittner coefficient that is based on 3D q*E, which is formed from
! summing q_i*TidalConstituent_i over the number of constituents.
Expand Down
6 changes: 4 additions & 2 deletions src/tracer/MOM_lateral_boundary_diffusion.F90
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,10 @@ subroutine fluxes_layer_method(boundary, ke, hbl_L, hbl_R, h_L, h_R, phi_L, phi_
allocate(F_layer_z(nk), source=0.0)

! remap tracer to dz_top
call remapping_core_h(CS%remap_cs, ke, h_L(:), phi_L(:), nk, dz_top(:), phi_L_z(:))
call remapping_core_h(CS%remap_cs, ke, h_R(:), phi_R(:), nk, dz_top(:), phi_R_z(:))
call remapping_core_h(CS%remap_cs, ke, h_L(:), phi_L(:), nk, dz_top(:), phi_L_z(:), &
CS%H_subroundoff, CS%H_subroundoff)
call remapping_core_h(CS%remap_cs, ke, h_R(:), phi_R(:), nk, dz_top(:), phi_R_z(:), &
CS%H_subroundoff, CS%H_subroundoff)

! Calculate vertical indices containing the boundary layer in dz_top
call boundary_k_range(boundary, nk, dz_top, hbl_L, k_top_L, zeta_top_L, k_bot_L, zeta_bot_L)
Expand Down

0 comments on commit 57a1a8a

Please sign in to comment.