Skip to content

Commit

Permalink
(*)Offline tracer read bug fix
Browse files Browse the repository at this point in the history
  Corrected bugs in the offline tracer code that were preventing it from
reproducing across processor counts (and perhaps working sensibly at all). All
answers and output in the MOM6-examples regression suite are bitwise identical.
Although answers with the offline tracer code will change because of the bug
fix, because of some bugs that were fixed in another recent commit, it was
previously impossible to have run the offline tracer cases at all.
  • Loading branch information
Hallberg-NOAA committed Dec 10, 2021
1 parent 90739be commit 05edb63
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/tracer/MOM_offline_aux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -673,21 +673,23 @@ subroutine update_offline_from_files(G, GV, nk_input, mean_file, sum_file, snap_
vhtr(:,:,:) = 0.0
! Time-summed fields
call MOM_read_vector(sum_file, 'uhtr_sum', 'vhtr_sum', uhtr(:,:,1:nk_input), &
vhtr(:,:,1:nk_input), G%Domain, timelevel=ridx_sum)
vhtr(:,:,1:nk_input), G%Domain, timelevel=ridx_sum, &
scale=GV%kg_m2_to_H)
call MOM_read_data(snap_file, 'h_end', h_end(:,:,1:nk_input), G%Domain, &
timelevel=ridx_snap,position=CENTER)
call MOM_read_data(mean_file, 'temp', temp_mean(:,:,1:nk_input), G%Domain, &
timelevel=ridx_sum,position=CENTER)
call MOM_read_data(mean_file, 'salt', salt_mean(:,:,1:nk_input), G%Domain, &
timelevel=ridx_sum,position=CENTER)
endif

do j=js,je ; do i=is,ie
if (G%mask2dT(i,j)>0.) then
temp_mean(:,:,nk_input:nz) = temp_mean(i,j,nk_input)
salt_mean(:,:,nk_input:nz) = salt_mean(i,j,nk_input)
endif
enddo ; enddo
! Fill temperature and salinity downward from the deepest input data.
do k=nk_input+1,nz ; do j=js,je ; do i=is,ie
if (G%mask2dT(i,j)>0.) then
temp_mean(i,j,k) = temp_mean(i,j,nk_input)
salt_mean(i,j,k) = salt_mean(i,j,nk_input)
endif
enddo ; enddo ; enddo
endif

! Check if reading vertical diffusivities or entrainment fluxes
call MOM_read_data( mean_file, 'Kd_interface', Kd(:,:,1:nk_input+1), G%Domain, &
Expand Down

0 comments on commit 05edb63

Please sign in to comment.