@@ -30,7 +30,8 @@ module MOM_diagnose_mld
30
30
! > Diagnose a mixed layer depth (MLD) determined by a given density difference with the surface.
31
31
! > This routine is appropriate in MOM_diabatic_aux due to its position within the time stepping.
32
32
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 )
34
35
type (ocean_grid_type), intent (in ) :: G ! < Grid type
35
36
type (verticalGrid_type), intent (in ) :: GV ! < ocean vertical grid structure
36
37
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,
44
45
real , intent (in ) :: ref_h_mld ! < Depth of the calculated "surface" densisty [Z ~> m]
45
46
integer , intent (in ) :: id_ref_z ! < Handle (ID) of reference depth diagnostic
46
47
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]
47
50
integer , optional , intent (in ) :: id_N2subML ! < Optional handle (ID) of subML stratification
48
51
integer , optional , intent (in ) :: id_MLDsq ! < Optional handle (ID) of squared MLD
49
52
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,
234
237
if ((id_ref_z > 0 ) .and. (pRef_MLD(is)/= 0 .)) call post_data(id_ref_z, z_ref_diag , diagPtr)
235
238
if (id_ref_rho > 0 ) call post_data(id_ref_rho, rhoSurf_2d , diagPtr)
236
239
240
+ if (present (MLD_out)) MLD_out(:,:)= MLD(:,:)
241
+
237
242
end subroutine diagnoseMLDbyDensityDifference
238
243
239
244
! > Diagnose a mixed layer depth (MLD) determined by the depth a given energy value would mix.
240
245
! > 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 )
242
247
! Author: Brandon Reichl
243
248
! Date: October 2, 2020
244
249
! //
@@ -467,6 +472,8 @@ subroutine diagnoseMLDbyEnergy(id_MLD, h, tv, G, GV, US, Mixing_Energy, diagPtr)
467
472
if (id_MLD(2 ) > 0 ) call post_data(id_MLD(2 ), MLD(:,:,2 ), diagPtr)
468
473
if (id_MLD(3 ) > 0 ) call post_data(id_MLD(3 ), MLD(:,:,3 ), diagPtr)
469
474
475
+ if (present (MLD_out)) MLD_out(:,:)= MLD(:,:,1 )
476
+
470
477
end subroutine diagnoseMLDbyEnergy
471
478
472
479
! > \namespace mom_diagnose_mld
0 commit comments