Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31d4117

Browse files
committed
Correct a few more temperature and salin units
Corrected the units in comments describing some temperature and salinity variables that had been accidentally omitted from the previous commits in this sequence. Also rescaled some local temperature and salinity variables used in seamount_initialize_thickness and added missing unit conversion factors for several diagnostics in MOM_oda_incupd. All answers are bitwise identical.
1 parent 6d78d2b commit 31d4117

10 files changed

Lines changed: 62 additions & 61 deletions

src/core/MOM.F90

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ module MOM
182182
real ALLOCABLE_, dimension(NIMEM_,NJMEM_,NKMEM_) :: &
183183
h, & !< layer thickness [H ~> m or kg m-2]
184184
T, & !< potential temperature [C ~> degC]
185-
S !< salinity [ppt]
185+
S !< salinity [S ~> ppt]
186186
real ALLOCABLE_, dimension(NIMEMB_PTR_,NJMEM_,NKMEM_) :: &
187187
u, & !< zonal velocity component [L T-1 ~> m s-1]
188188
uh, & !< uh = u * h * dy at u grid points [H L2 T-1 ~> m3 s-1 or kg s-1]
@@ -286,10 +286,6 @@ module MOM
286286
real, dimension(:,:), pointer :: frac_shelf_h => NULL() !< fraction of total area occupied
287287
!! by ice shelf [nondim]
288288
real, dimension(:,:), pointer :: mass_shelf => NULL() !< Mass of ice shelf [R Z ~> kg m-2]
289-
real, dimension(:,:,:), pointer :: &
290-
h_pre_dyn => NULL(), & !< The thickness before the transports [H ~> m or kg m-2].
291-
T_pre_dyn => NULL(), & !< Temperature before the transports [degC].
292-
S_pre_dyn => NULL() !< Salinity before the transports [ppt].
293289
type(accel_diag_ptrs) :: ADp !< structure containing pointers to accelerations,
294290
!! for derived diagnostics (e.g., energy budgets)
295291
type(cont_diag_ptrs) :: CDp !< structure containing pointers to continuity equation
@@ -3600,15 +3596,15 @@ subroutine rotate_initial_state(u_in, v_in, h_in, T_in, S_in, &
36003596
real, dimension(:,:,:), intent(in) :: u_in !< Zonal velocity on the initial grid [L T-1 ~> m s-1]
36013597
real, dimension(:,:,:), intent(in) :: v_in !< Meridional velocity on the initial grid [L T-1 ~> m s-1]
36023598
real, dimension(:,:,:), intent(in) :: h_in !< Layer thickness on the initial grid [H ~> m or kg m-2]
3603-
real, dimension(:,:,:), intent(in) :: T_in !< Temperature on the initial grid [degC]
3604-
real, dimension(:,:,:), intent(in) :: S_in !< Salinity on the initial grid [ppt]
3599+
real, dimension(:,:,:), intent(in) :: T_in !< Temperature on the initial grid [C ~> degC]
3600+
real, dimension(:,:,:), intent(in) :: S_in !< Salinity on the initial grid [S ~> ppt]
36053601
logical, intent(in) :: use_temperature !< If true, temperature and salinity are active
36063602
integer, intent(in) :: turns !< The number quarter-turns to apply
36073603
real, dimension(:,:,:), intent(out) :: u !< Zonal velocity on the rotated grid [L T-1 ~> m s-1]
36083604
real, dimension(:,:,:), intent(out) :: v !< Meridional velocity on the rotated grid [L T-1 ~> m s-1]
36093605
real, dimension(:,:,:), intent(out) :: h !< Layer thickness on the rotated grid [H ~> m or kg m-2]
3610-
real, dimension(:,:,:), intent(out) :: T !< Temperature on the rotated grid [degC]
3611-
real, dimension(:,:,:), intent(out) :: S !< Salinity on the rotated grid [ppt]
3606+
real, dimension(:,:,:), intent(out) :: T !< Temperature on the rotated grid [C ~> degC]
3607+
real, dimension(:,:,:), intent(out) :: S !< Salinity on the rotated grid [S ~> ppt]
36123608

36133609
call rotate_vector(u_in, v_in, turns, u, v)
36143610
call rotate_array(h_in, turns, h)

src/ocean_data_assim/MOM_oda_incupd.F90

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,8 @@ subroutine apply_oda_incupd(h, tv, u, v, dt, G, GV, US, CS)
527527
real, dimension(SZK_(GV)) :: tmp_val1 ! data values remapped to model grid
528528
real, dimension(SZK_(GV)) :: hu, hv ! A column of thicknesses at u or v points [H ~> m or kg m-2]
529529

530-
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)) :: tmp_t !< A temporary array for t increments [degC]
531-
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)) :: tmp_s !< A temporary array for s increments [ppt]
530+
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)) :: tmp_t !< A temporary array for t increments [C ~> degC]
531+
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)) :: tmp_s !< A temporary array for s increments [S ~> ppt]
532532
real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)) :: tmp_u !< A temporary array for u increments [L T-1 ~> m s-1]
533533
real, dimension(SZI_(G),SZJB_(G),SZK_(GV)) :: tmp_v !< A temporary array for v increments [L T-1 ~> m s-1]
534534

@@ -726,6 +726,7 @@ subroutine apply_oda_incupd(h, tv, u, v, dt, G, GV, US, CS)
726726
if (CS%id_u_oda_inc > 0) call post_data(CS%id_u_oda_inc, tmp_u, CS%diag)
727727
if (CS%id_v_oda_inc > 0) call post_data(CS%id_v_oda_inc, tmp_v, CS%diag)
728728
endif
729+
!### The argument here seems wrong.
729730
if (CS%id_h_oda_inc > 0) call post_data(CS%id_h_oda_inc, h , CS%diag)
730731
if (CS%id_T_oda_inc > 0) call post_data(CS%id_T_oda_inc, tmp_t, CS%diag)
731732
if (CS%id_S_oda_inc > 0) call post_data(CS%id_S_oda_inc, tmp_s, CS%diag)
@@ -795,7 +796,7 @@ end subroutine output_oda_incupd_inc
795796
subroutine init_oda_incupd_diags(Time, G, GV, diag, CS, US)
796797
type(time_type), target, intent(in) :: Time !< The current model time
797798
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
798-
type(verticalGrid_type), intent(in) :: GV !< ocean vertical grid structure
799+
type(verticalGrid_type), intent(in) :: GV !< ocean vertical grid structure
799800
type(diag_ctrl), target, intent(inout) :: diag !< A structure that is used to regulate diagnostic
800801
!! output.
801802
type(oda_incupd_CS), pointer :: CS !< ALE sponge control structure
@@ -804,18 +805,17 @@ subroutine init_oda_incupd_diags(Time, G, GV, diag, CS, US)
804805
if (.not.associated(CS)) return
805806

806807
CS%diag => diag
807-
! These diagnostics of the state variables increments,useful for debugging the
808-
! ODA code.
808+
! These diagnostics of the state variables increments are useful for debugging the ODA code.
809809
CS%id_u_oda_inc = register_diag_field('ocean_model', 'u_oda_inc', diag%axesCuL, Time, &
810-
'Zonal velocity ODA inc.', 'm s-1')
810+
'Zonal velocity ODA inc.', 'm s-1', conversion=US%L_T_to_m_s)
811811
CS%id_v_oda_inc = register_diag_field('ocean_model', 'v_oda_inc', diag%axesCvL, Time, &
812-
'Meridional velocity ODA inc.', 'm s-1')
812+
'Meridional velocity ODA inc.', 'm s-1', conversion=US%L_T_to_m_s)
813813
CS%id_h_oda_inc = register_diag_field('ocean_model', 'h_oda_inc', diag%axesTL, Time, &
814-
'Layer Thickness ODA inc.', get_thickness_units(GV))
814+
'Layer Thickness ODA inc.', get_thickness_units(GV), conversion=GV%H_to_mks)
815815
CS%id_T_oda_inc = register_diag_field('ocean_model', 'T_oda_inc', diag%axesTL, Time, &
816-
'Temperature ODA inc.', 'degC')
816+
'Temperature ODA inc.', 'degC', conversion=US%C_to_degC)
817817
CS%id_S_oda_inc = register_diag_field('ocean_model', 'S_oda_inc', diag%axesTL, Time, &
818-
'Salinity ODA inc.', 'PSU')
818+
'Salinity ODA inc.', 'PSU', conversion=US%S_to_ppt)
819819

820820
end subroutine init_oda_incupd_diags
821821

src/parameterizations/vertical/MOM_CVMix_KPP.F90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,12 +1394,12 @@ subroutine KPP_NonLocalTransport_temp(CS, G, GV, h, nonLocalTrans, surfFlux, &
13941394
real, dimension(SZI_(G),SZJ_(G)), intent(in) :: surfFlux !< Surface flux of temperature
13951395
!! [C H T-1 ~> degC m s-1 or degC kg m-2 s-1]
13961396
real, intent(in) :: dt !< Time-step [T ~> s]
1397-
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(inout) :: scalar !< temperature [degC]
1397+
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(inout) :: scalar !< temperature [C ~> degC]
13981398
real, intent(in) :: C_p !< Seawater specific heat capacity
13991399
!! [Q C-1 ~> J kg-1 degC-1]
14001400

14011401
integer :: i, j, k
1402-
real, dimension( SZI_(G), SZJ_(G),SZK_(GV) ) :: dtracer ! Rate of tracer change [degC T-1 ~> degC s-1]
1402+
real, dimension( SZI_(G), SZJ_(G),SZK_(GV) ) :: dtracer ! Rate of tracer change [C T-1 ~> degC s-1]
14031403

14041404

14051405
dtracer(:,:,:) = 0.0
@@ -1458,10 +1458,10 @@ subroutine KPP_NonLocalTransport_saln(CS, G, GV, h, nonLocalTrans, surfFlux, dt,
14581458
real, dimension(SZI_(G),SZJ_(G)), intent(in) :: surfFlux !< Surface flux of salt
14591459
!! [S H T-1 ~> ppt m s-1 or ppt kg m-2 s-1]
14601460
real, intent(in) :: dt !< Time-step [T ~> s]
1461-
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(inout) :: scalar !< Salinity [ppt]
1461+
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(inout) :: scalar !< Salinity [S ~> ppt]
14621462

14631463
integer :: i, j, k
1464-
real, dimension( SZI_(G), SZJ_(G),SZK_(GV) ) :: dtracer ! Rate of tracer change [ppt T-1 ~> ppt s-1]
1464+
real, dimension( SZI_(G), SZJ_(G),SZK_(GV) ) :: dtracer ! Rate of tracer change [S T-1 ~> ppt s-1]
14651465

14661466

14671467
dtracer(:,:,:) = 0.0

src/parameterizations/vertical/MOM_bulk_mixed_layer.F90

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ subroutine convective_adjustment(h, u, v, R0, Rcv, T, S, eps, d_eb, &
761761
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: Rcv !< The coordinate defining potential
762762
!! density [R ~> kg m-3].
763763
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: T !< Layer temperatures [C ~> degC].
764-
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: S !< Layer salinities [ppt].
764+
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: S !< Layer salinities [S ~> ppt].
765765
real, dimension(SZI_(G),SZK_(GV)), intent(in) :: eps !< The negligibly small amount of water
766766
!! that will be left in each layer [H ~> m or kg m-2].
767767
real, dimension(SZI_(G),SZK_(GV)), intent(inout) :: d_eb !< The downward increase across a layer
@@ -908,7 +908,7 @@ subroutine mixedlayer_convection(h, d_eb, htot, Ttot, Stot, uhtot, vhtot, &
908908
real, dimension(SZI_(G),SZK0_(GV)), &
909909
intent(in) :: T !< Layer temperatures [C ~> degC].
910910
real, dimension(SZI_(G),SZK0_(GV)), &
911-
intent(in) :: S !< Layer salinities [ppt].
911+
intent(in) :: S !< Layer salinities [C ~> ppt].
912912
real, dimension(SZI_(G),SZK0_(GV)), &
913913
intent(in) :: R0 !< Potential density referenced to
914914
!! surface pressure [R ~> kg m-3].
@@ -940,7 +940,7 @@ subroutine mixedlayer_convection(h, d_eb, htot, Ttot, Stot, uhtot, vhtot, &
940940
!! shortwave radiation.
941941
real, dimension(max(nsw,1),SZI_(G)), intent(inout) :: Pen_SW_bnd !< The penetrating shortwave
942942
!! heating at the sea surface in each penetrating
943-
!! band [degC H ~> C m or degC kg m-2].
943+
!! band [C H ~> degC m or degC kg m-2].
944944
real, dimension(max(nsw,1),SZI_(G),SZK_(GV)), intent(in) :: opacity_band !< The opacity in each band of
945945
!! penetrating shortwave radiation [H-1 ~> m-1 or m2 kg-1].
946946
real, dimension(SZI_(G)), intent(out) :: Conv_En !< The buoyant turbulent kinetic energy source
@@ -1465,9 +1465,9 @@ subroutine mechanical_entrainment(h, d_eb, htot, Ttot, Stot, uhtot, vhtot, &
14651465
real, dimension(SZI_(G),SZK_(GV)), &
14661466
intent(in) :: v !< Zonal velocities interpolated to h points [L T-1 ~> m s-1].
14671467
real, dimension(SZI_(G),SZK0_(GV)), &
1468-
intent(in) :: T !< Layer temperatures [degC].
1468+
intent(in) :: T !< Layer temperatures [C ~> degC].
14691469
real, dimension(SZI_(G),SZK0_(GV)), &
1470-
intent(in) :: S !< Layer salinities [ppt].
1470+
intent(in) :: S !< Layer salinities [S ~> ppt].
14711471
real, dimension(SZI_(G),SZK0_(GV)), &
14721472
intent(in) :: R0 !< Potential density referenced to
14731473
!! surface pressure [R ~> kg m-3].
@@ -1478,7 +1478,7 @@ subroutine mechanical_entrainment(h, d_eb, htot, Ttot, Stot, uhtot, vhtot, &
14781478
intent(in) :: eps !< The negligibly small amount of water
14791479
!! that will be left in each layer [H ~> m or kg m-2].
14801480
real, dimension(SZI_(G)), intent(in) :: dR0_dT !< The partial derivative of R0 with respect to
1481-
!! temperature [R degC-1 ~> kg m-3 degC-1].
1481+
!! temperature [R C-1 ~> kg m-3 degC-1].
14821482
real, dimension(SZI_(G)), intent(in) :: dRcv_dT !< The partial derivative of Rcv with respect to
14831483
!! temperature [R C-1 ~> kg m-3 degC-1].
14841484
real, dimension(2,SZI_(G)), intent(in) :: cMKE !< Coefficients of HpE and HpE^2 used in calculating the
@@ -1832,8 +1832,8 @@ subroutine resort_ML(h, T, S, R0, Rcv, RcvTgt, eps, d_ea, d_eb, ksort, G, GV, CS
18321832
!! structure.
18331833
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: h !< Layer thickness [H ~> m or kg m-2].
18341834
!! Layer 0 is the new mixed layer.
1835-
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: T !< Layer temperatures [degC].
1836-
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: S !< Layer salinities [ppt].
1835+
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: T !< Layer temperatures [C ~> degC].
1836+
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: S !< Layer salinities [S ~> ppt].
18371837
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: R0 !< Potential density referenced to
18381838
!! surface pressure [R ~> kg m-3].
18391839
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: Rcv !< The coordinate defining
@@ -2151,8 +2151,8 @@ subroutine mixedlayer_detrain_2(h, T, S, R0, Rcv, RcvTgt, dt, dt_diag, d_ea, j,
21512151
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
21522152
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: h !< Layer thickness [H ~> m or kg m-2].
21532153
!! Layer 0 is the new mixed layer.
2154-
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: T !< Potential temperature [degC].
2155-
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: S !< Salinity [ppt].
2154+
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: T !< Potential temperature [C ~> degC].
2155+
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: S !< Salinity [S ~> ppt].
21562156
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: R0 !< Potential density referenced to
21572157
!! surface pressure [R ~> kg m-3].
21582158
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: Rcv !< The coordinate defining potential
@@ -3040,8 +3040,8 @@ subroutine mixedlayer_detrain_1(h, T, S, R0, Rcv, RcvTgt, dt, dt_diag, d_ea, d_e
30403040
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
30413041
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: h !< Layer thickness [H ~> m or kg m-2].
30423042
!! Layer 0 is the new mixed layer.
3043-
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: T !< Potential temperature [degC].
3044-
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: S !< Salinity [ppt].
3043+
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: T !< Potential temperature [C ~> degC].
3044+
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: S !< Salinity [S ~> ppt].
30453045
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: R0 !< Potential density referenced to
30463046
!! surface pressure [R ~> kg m-3].
30473047
real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: Rcv !< The coordinate defining potential

src/parameterizations/vertical/MOM_full_convection.F90

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -270,22 +270,22 @@ end subroutine full_convection
270270
!! above and below, including partial calculations from a tridiagonal solver.
271271
function is_unstable(dRho_dT, dRho_dS, h_a, h_b, mix_A, mix_B, T_a, T_b, S_a, S_b, &
272272
Te_aa, Te_bb, Se_aa, Se_bb, d_A, d_B)
273-
real, intent(in) :: dRho_dT !< The derivative of in situ density with temperature [R degC-1 ~> kg m-3 degC-1]
274-
real, intent(in) :: dRho_dS !< The derivative of in situ density with salinity [R ppt-1 ~> kg m-3 ppt-1]
273+
real, intent(in) :: dRho_dT !< The derivative of in situ density with temperature [R C-1 ~> kg m-3 degC-1]
274+
real, intent(in) :: dRho_dS !< The derivative of in situ density with salinity [R S-1 ~> kg m-3 ppt-1]
275275
real, intent(in) :: h_a !< The thickness of the layer above [H ~> m or kg m-2]
276276
real, intent(in) :: h_b !< The thickness of the layer below [H ~> m or kg m-2]
277277
real, intent(in) :: mix_A !< The time integrated mixing rate of the interface above [H ~> m or kg m-2]
278278
real, intent(in) :: mix_B !< The time integrated mixing rate of the interface below [H ~> m or kg m-2]
279-
real, intent(in) :: T_a !< The initial temperature of the layer above [degC]
280-
real, intent(in) :: T_b !< The initial temperature of the layer below [degC]
281-
real, intent(in) :: S_a !< The initial salinity of the layer below [ppt]
282-
real, intent(in) :: S_b !< The initial salinity of the layer below [ppt]
283-
real, intent(in) :: Te_aa !< The estimated temperature two layers above rescaled by d_A [degC]
284-
real, intent(in) :: Te_bb !< The estimated temperature two layers below rescaled by d_B [degC]
285-
real, intent(in) :: Se_aa !< The estimated salinity two layers above rescaled by d_A [ppt]
286-
real, intent(in) :: Se_bb !< The estimated salinity two layers below rescaled by d_B [ppt]
287-
real, intent(in) :: d_A !< The rescaling dependency across the interface above, nondim.
288-
real, intent(in) :: d_B !< The rescaling dependency across the interface below, nondim.
279+
real, intent(in) :: T_a !< The initial temperature of the layer above [C ~> degC]
280+
real, intent(in) :: T_b !< The initial temperature of the layer below [C ~> degC]
281+
real, intent(in) :: S_a !< The initial salinity of the layer below [S ~> ppt]
282+
real, intent(in) :: S_b !< The initial salinity of the layer below [S ~> ppt]
283+
real, intent(in) :: Te_aa !< The estimated temperature two layers above rescaled by d_A [C ~> degC]
284+
real, intent(in) :: Te_bb !< The estimated temperature two layers below rescaled by d_B [C ~> degC]
285+
real, intent(in) :: Se_aa !< The estimated salinity two layers above rescaled by d_A [S ~> ppt]
286+
real, intent(in) :: Se_bb !< The estimated salinity two layers below rescaled by d_B [S ~> ppt]
287+
real, intent(in) :: d_A !< The rescaling dependency across the interface above [nondim]
288+
real, intent(in) :: d_B !< The rescaling dependency across the interface below [nondim]
289289
logical :: is_unstable !< The return value, true if the profile is statically unstable
290290
!! around the interface in question.
291291

src/parameterizations/vertical/MOM_opacity.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ subroutine absorbRemainingSW(G, GV, US, h, opacity_band, nsw, optics, j, dt, H_l
568568
real, dimension(SZI_(G)), optional, intent(inout) :: Ttot !< Depth integrated mixed layer
569569
!! temperature [C H ~> degC m or degC kg m-2]
570570
real, dimension(SZI_(G),SZK_(GV)), optional, intent(in) :: dSV_dT !< The partial derivative of specific volume
571-
!! with temperature [R-1 degC-1 ~> m3 kg-1 degC-1]
571+
!! with temperature [R-1 C-1 ~> m3 kg-1 degC-1]
572572
real, dimension(SZI_(G),SZK_(GV)), optional, intent(inout) :: TKE !< The TKE sink from mixing the heating
573573
!! throughout a layer [R Z3 T-2 ~> J m-2].
574574

0 commit comments

Comments
 (0)