Skip to content

Commit

Permalink
+Add units to 11 log_param calls
Browse files Browse the repository at this point in the history
  Add appropriate units arguments to 11 log_param calls that were missing them.
All answers are bitwise identical, but the logged output can change in some
cases.
  • Loading branch information
Hallberg-NOAA committed Dec 2, 2022
1 parent 7055b7c commit 1997c02
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/core/MOM_PressureForce_FV.F90
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ subroutine PressureForce_FV_init(Time, G, GV, US, param_file, diag, CS, tides_CS
CS%GFS_scale = 1.0
if (GV%g_prime(1) /= GV%g_Earth) CS%GFS_scale = GV%g_prime(1) / GV%g_Earth

call log_param(param_file, mdl, "GFS / G_EARTH", CS%GFS_scale)
call log_param(param_file, mdl, "GFS / G_EARTH", CS%GFS_scale, units="nondim")

end subroutine PressureForce_FV_init

Expand Down
2 changes: 1 addition & 1 deletion src/core/MOM_PressureForce_Montgomery.F90
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ subroutine PressureForce_Mont_init(Time, G, GV, US, param_file, diag, CS, tides_
CS%GFS_scale = 1.0
if (GV%g_prime(1) /= GV%g_Earth) CS%GFS_scale = GV%g_prime(1) / GV%g_Earth

call log_param(param_file, mdl, "GFS / G_EARTH", CS%GFS_scale)
call log_param(param_file, mdl, "GFS / G_EARTH", CS%GFS_scale, units="nondim")

end subroutine PressureForce_Mont_init

Expand Down
4 changes: 2 additions & 2 deletions src/core/MOM_barotropic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4802,8 +4802,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)
call log_param(param_file, mdl, "estimated maximum DTBT", CS%dtbt_max*US%T_to_s)
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")

! ubtav and vbtav, and perhaps ubt_IC and vbt_IC, are allocated and
! initialized in register_barotropic_restarts.
Expand Down
6 changes: 3 additions & 3 deletions src/core/MOM_verticalGrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ subroutine verticalGridInit( param_file, GV, US )
GV%RZ_to_H = GV%kg_m2_to_H * US%R_to_kg_m3 * US%Z_to_m

! Log derivative values.
call log_param(param_file, mdl, "M to THICKNESS", GV%m_to_H*H_rescale_factor)
call log_param(param_file, mdl, "M to THICKNESS rescaled by 2^-n", GV%m_to_H)
call log_param(param_file, mdl, "THICKNESS to M rescaled by 2^n", GV%H_to_m)
call log_param(param_file, mdl, "M to THICKNESS", GV%m_to_H*H_rescale_factor, units="H m-1")
call log_param(param_file, mdl, "M to THICKNESS rescaled by 2^-n", GV%m_to_H, units="2^n H m-1")
call log_param(param_file, mdl, "THICKNESS to M rescaled by 2^n", GV%H_to_m, units="2^-n m H-1")

allocate( GV%sInterface(nk+1) )
allocate( GV%sLayer(nk) )
Expand Down
2 changes: 1 addition & 1 deletion src/diagnostics/MOM_sum_output.F90
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ 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)
CS%max_Energy = 10.0 * maxvel**2
call log_param(param_file, mdl, "MAX_ENERGY as used", CS%max_Energy)
call log_param(param_file, mdl, "MAX_ENERGY as used", CS%max_Energy, units="m2 s-2")
endif

call get_param(param_file, mdl, "ENERGYFILE", energyfile, &
Expand Down
4 changes: 2 additions & 2 deletions src/framework/testing/MOM_file_parser_tests.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ subroutine test_log_param_real
call create_test_file(param_filename)

call open_param_file(param_filename, param)
call log_param(param, module_name, sample_param_name, sample, desc=desc)
call log_param(param, module_name, sample_param_name, sample, desc=desc, units="")
call close_param_file(param)
end subroutine test_log_param_real

Expand All @@ -1290,7 +1290,7 @@ subroutine test_log_param_real_array
call create_test_file(param_filename)

call open_param_file(param_filename, param)
call log_param(param, module_name, sample_param_name, sample, desc=desc)
call log_param(param, module_name, sample_param_name, sample, desc=desc, units="")
call close_param_file(param)
end subroutine test_log_param_real_array

Expand Down
2 changes: 1 addition & 1 deletion src/tracer/oil_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ 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))
call log_param(param_file, mdl, "OIL_DECAY_RATE", US%s_to_T*CS%oil_decay_rate(1:CS%ntr), units="s-1")

! 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 1997c02

Please sign in to comment.