Skip to content

Commit 4a0ec2d

Browse files
Theresa MorrisonTheresa Morrison
Theresa Morrison
authored and
Theresa Morrison
committed
Update interfaces for diagnoseMLD
Some previously optional arguments were made nonoptinal in the final version merged into dev/gfdl. So these areguents have been added to the call in MOM_generic_tracers.
1 parent c94ef4d commit 4a0ec2d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/diagnostics/MOM_diagnose_MLD.F90

+9-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ module MOM_diagnose_mld
3030
!> Diagnose a mixed layer depth (MLD) determined by a given density difference with the surface.
3131
!> This routine is appropriate in MOM_diabatic_aux due to its position within the time stepping.
3232
subroutine diagnoseMLDbyDensityDifference(id_MLD, h, tv, densityDiff, G, GV, US, diagPtr, &
33-
ref_h_mld, id_ref_z, id_ref_rho, id_N2subML, id_MLDsq, dz_subML)
33+
ref_h_mld, id_ref_z, id_ref_rho, id_N2subML, id_MLDsq, dz_subML, &
34+
MLD_out)
3435
type(ocean_grid_type), intent(in) :: G !< Grid type
3536
type(verticalGrid_type), intent(in) :: GV !< ocean vertical grid structure
3637
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
@@ -44,6 +45,8 @@ subroutine diagnoseMLDbyDensityDifference(id_MLD, h, tv, densityDiff, G, GV, US,
4445
real, intent(in) :: ref_h_mld !< Depth of the calculated "surface" densisty [Z ~> m]
4546
integer, intent(in) :: id_ref_z !< Handle (ID) of reference depth diagnostic
4647
integer, intent(in) :: id_ref_rho !< Handle (ID) of reference density diagnostic
48+
real, dimension(SZI_(G),SZJ_(G)), &
49+
optional, intent(inout) :: MLD_out !< Send MLD to other routines [Z ~> m]
4750
integer, optional, intent(in) :: id_N2subML !< Optional handle (ID) of subML stratification
4851
integer, optional, intent(in) :: id_MLDsq !< Optional handle (ID) of squared MLD
4952
real, optional, intent(in) :: dz_subML !< The distance over which to calculate N2subML
@@ -234,11 +237,13 @@ subroutine diagnoseMLDbyDensityDifference(id_MLD, h, tv, densityDiff, G, GV, US,
234237
if ((id_ref_z > 0) .and. (pRef_MLD(is)/=0.)) call post_data(id_ref_z, z_ref_diag , diagPtr)
235238
if (id_ref_rho > 0) call post_data(id_ref_rho, rhoSurf_2d , diagPtr)
236239

240+
if (present(MLD_out)) MLD_out(:,:)=MLD(:,:)
241+
237242
end subroutine diagnoseMLDbyDensityDifference
238243

239244
!> Diagnose a mixed layer depth (MLD) determined by the depth a given energy value would mix.
240245
!> This routine is appropriate in MOM_diabatic_aux due to its position within the time stepping.
241-
subroutine diagnoseMLDbyEnergy(id_MLD, h, tv, G, GV, US, Mixing_Energy, diagPtr)
246+
subroutine diagnoseMLDbyEnergy(id_MLD, h, tv, G, GV, US, Mixing_Energy, diagPtr, MLD_out)
242247
! Author: Brandon Reichl
243248
! Date: October 2, 2020
244249
! //
@@ -467,6 +472,8 @@ subroutine diagnoseMLDbyEnergy(id_MLD, h, tv, G, GV, US, Mixing_Energy, diagPtr)
467472
if (id_MLD(2) > 0) call post_data(id_MLD(2), MLD(:,:,2), diagPtr)
468473
if (id_MLD(3) > 0) call post_data(id_MLD(3), MLD(:,:,3), diagPtr)
469474

475+
if (present(MLD_out)) MLD_out(:,:)=MLD(:,:,1)
476+
470477
end subroutine diagnoseMLDbyEnergy
471478

472479
!> \namespace mom_diagnose_mld

src/tracer/MOM_generic_tracer.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ subroutine MOM_generic_tracer_column_physics(h_old, h_new, ea, eb, fluxes, Hml,
618618
mld_pha(:,:) = CS%mld_pha_val
619619
else
620620
if (CS%mld_pha_use_delta_rho) then
621-
call diagnoseMLDbyDensityDifference(-1, h_old, tv, CS%mld_pha_drho, G, GV, US, CS%diag, ref_h_mld=CS%mld_pha_href, MLD_out=mld_pha)
621+
call diagnoseMLDbyDensityDifference(-1, h_old, tv, CS%mld_pha_drho, G, GV, US, CS%diag, CS%mld_pha_href, id_ref_z=-1, id_ref_rho=-1, MLD_out=mld_pha)
622622
elseif (CS%mld_pha_use_delta_eng) then
623623
call diagnoseMLDbyEnergy((/-1, -1, -1/), h_old, tv, G, GV, US, (/CS%mld_pha_deng, CS%mld_pha_deng, CS%mld_pha_deng/), CS%diag, MLD_out=mld_pha)
624624
endif

0 commit comments

Comments
 (0)