Skip to content

Commit

Permalink
Use unscale argument in 10 log_param calls
Browse files Browse the repository at this point in the history
  Use the new unscale optional argument in 10 log_param calls for real
variables.  All answers and output are bitwise identical.
  • Loading branch information
Hallberg-NOAA authored and marshallward committed Feb 13, 2023
1 parent f54956e commit ad56b29
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/core/MOM_barotropic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4804,8 +4804,8 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
endif
if ((dtbt_tmp > 0.0) .and. (dtbt_input > 0.0)) calc_dtbt = .false.

call log_param(param_file, mdl, "DTBT as used", CS%dtbt*US%T_to_s, units="s")
call log_param(param_file, mdl, "estimated maximum DTBT", CS%dtbt_max*US%T_to_s, units="s")
call log_param(param_file, mdl, "DTBT as used", CS%dtbt, units="s", unscale=US%T_to_s)
call log_param(param_file, mdl, "estimated maximum DTBT", CS%dtbt_max, units="s", unscale=US%T_to_s)

! ubtav and vbtav, and perhaps ubt_IC and vbt_IC, are allocated and
! initialized in register_barotropic_restarts.
Expand Down
3 changes: 2 additions & 1 deletion src/diagnostics/MOM_sum_output.F90
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ subroutine MOM_sum_output_init(G, GV, US, param_file, directory, ntrnc, &
"The maximum velocity allowed before the velocity "//&
"components are truncated.", units="m s-1", default=3.0e8, scale=US%m_s_to_L_T)
CS%max_Energy = 10.0 * maxvel**2
call log_param(param_file, mdl, "MAX_ENERGY as used", US%L_T_to_m_s**2*CS%max_Energy, units="m2 s-2")
call log_param(param_file, mdl, "MAX_ENERGY as used", CS%max_Energy, &
units="m2 s-2", unscale=US%L_T_to_m_s**2)
endif

call get_param(param_file, mdl, "ENERGYFILE", energyfile, &
Expand Down
9 changes: 5 additions & 4 deletions src/initialization/MOM_fixed_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,13 @@ subroutine MOM_initialize_topography(D, max_depth, G, PF, US)
"Unrecognized topography setup '"//trim(config)//"'")
end select
if (max_depth>0.) then
call log_param(PF, mdl, "MAXIMUM_DEPTH", max_depth*US%Z_to_m, &
"The maximum depth of the ocean.", units="m")
call log_param(PF, mdl, "MAXIMUM_DEPTH", max_depth, &
"The maximum depth of the ocean.", units="m", unscale=US%Z_to_m)
else
max_depth = diagnoseMaximumDepth(D,G)
call log_param(PF, mdl, "!MAXIMUM_DEPTH", max_depth*US%Z_to_m, &
"The (diagnosed) maximum depth of the ocean.", units="m", like_default=.true.)
call log_param(PF, mdl, "!MAXIMUM_DEPTH", max_depth, &
"The (diagnosed) maximum depth of the ocean.", &
units="m", unscale=US%Z_to_m, like_default=.true.)
endif
if (trim(config) /= "DOME") then
call limit_topography(D, G, PF, max_depth, US)
Expand Down
4 changes: 2 additions & 2 deletions src/parameterizations/vertical/MOM_bkgnd_mixing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ subroutine bkgnd_mixing_init(Time, G, GV, US, param_file, diag, CS, physical_OBL
if (abs(CS%Kd_tot_ml - CS%Kd) > 1.0e-15*abs(CS%Kd)) &
call MOM_error(WARNING, "KDML is a depricated parameter. Use KD_ML_TOT instead.")
endif
call log_param(param_file, mdl, "KD_ML_TOT", CS%Kd_tot_ml*US%Z2_T_to_m2_s, &
call log_param(param_file, mdl, "KD_ML_TOT", CS%Kd_tot_ml, &
"The total diapcynal diffusivity in the surface mixed layer when there is "//&
"not a physically based parameterization of mixing in the mixed layer, such "//&
"as bulk mixed layer or KPP or ePBL.", &
units="m2 s-1", default=CS%Kd*US%Z2_T_to_m2_s)
units="m2 s-1", default=CS%Kd*US%Z2_T_to_m2_s, unscale=US%Z2_T_to_m2_s)

call get_param(param_file, mdl, "HMIX_FIXED", CS%Hmix, &
"The prescribed depth over which the near-surface "//&
Expand Down
5 changes: 3 additions & 2 deletions src/parameterizations/vertical/MOM_energetic_PBL.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2321,9 +2321,10 @@ subroutine energetic_PBL_init(Time, G, GV, US, param_file, diag, CS)
!/ Logging parameters
! This gives a minimum decay scale that is typically much less than Angstrom.
CS%ustar_min = 2e-4*CS%omega*(GV%Angstrom_Z + GV%H_to_Z*GV%H_subroundoff)
call log_param(param_file, mdl, "!EPBL_USTAR_MIN", CS%ustar_min*US%Z_to_m*US%s_to_T, &
call log_param(param_file, mdl, "!EPBL_USTAR_MIN", CS%ustar_min, &
"The (tiny) minimum friction velocity used within the "//&
"ePBL code, derived from OMEGA and ANGSTROM.", units="m s-1", &
"ePBL code, derived from OMEGA and ANGSTROM.", &
units="m s-1", unscale=US%Z_to_m*US%s_to_T, &
like_default=.true.)


Expand Down
8 changes: 4 additions & 4 deletions src/parameterizations/vertical/MOM_vert_friction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2339,14 +2339,14 @@ subroutine vertvisc_init(MIS, Time, G, GV, US, param_file, diag, ADp, dirs, &
call MOM_error(WARNING, "KVML is a deprecated parameter. Use KV_ML_INVZ2 instead.")
endif
if (CS%Kvml_invZ2 < 0.0) CS%Kvml_invZ2 = 0.0
call log_param(param_file, mdl, "KV_ML_INVZ2", US%Z2_T_to_m2_s*CS%Kvml_invZ2, &
call log_param(param_file, mdl, "KV_ML_INVZ2", CS%Kvml_invZ2, &
"An extra kinematic viscosity in a mixed layer of thickness HMIX_FIXED, "//&
"with the actual viscosity scaling as 1/(z*HMIX_FIXED)^2, where z is the "//&
"distance from the surface, to allow for finite wind stresses to be "//&
"transmitted through infinitesimally thin surface layers. This is an "//&
"older option for numerical convenience without a strong physical basis, "//&
"and its use is now discouraged.", &
units="m2 s-1", default=0.0)
units="m2 s-1", default=0.0, unscale=US%Z2_T_to_m2_s)
endif

if (.not.CS%bottomdraglaw) then
Expand All @@ -2364,10 +2364,10 @@ subroutine vertvisc_init(MIS, Time, G, GV, US, param_file, diag, ADp, dirs, &
CS%Kv_extra_bbl = Kv_BBL - CS%Kv
endif
endif
call log_param(param_file, mdl, "KV_EXTRA_BBL", US%Z2_T_to_m2_s*CS%Kv_extra_bbl, &
call log_param(param_file, mdl, "KV_EXTRA_BBL", CS%Kv_extra_bbl, &
"An extra kinematic viscosity in the benthic boundary layer. "//&
"KV_EXTRA_BBL is not used if BOTTOMDRAGLAW is true.", &
units="m2 s-1", default=0.0)
units="m2 s-1", default=0.0, unscale=US%Z2_T_to_m2_s)
endif
call get_param(param_file, mdl, "HBBL", CS%Hbbl, &
"The thickness of a bottom boundary layer with a viscosity increased by "//&
Expand Down
3 changes: 2 additions & 1 deletion src/tracer/oil_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ function register_oil_tracer(HI, GV, US, param_file, CS, tr_Reg, restart_CS)
endif
endif
enddo
call log_param(param_file, mdl, "OIL_DECAY_RATE", US%s_to_T*CS%oil_decay_rate(1:CS%ntr), units="s-1")
call log_param(param_file, mdl, "OIL_DECAY_RATE", CS%oil_decay_rate(1:CS%ntr), &
units="s-1", unscale=US%s_to_T)

! This needs to be changed if the units of tracer are changed above.
if (GV%Boussinesq) then ; flux_units = "kg s-1"
Expand Down

0 comments on commit ad56b29

Please sign in to comment.