Question about derived parameters with log_param()
Closed this issue · 2 comments
There are a number of log_param
() calls, mostly for derived parameters, never log these parameters anywhere by default. Subroutine log_param_*
() only writes parameters to MOM_parameter_doc
when description is given. Without descriptions, log_param
() calls log parameters, along with all the other parameters, to stdout, but only when SEND_LOG_TO_STDOUT
is True (default false).
I think it makes sense to ignore the derived parameters in MOM_parameter_doc
, and I suspect this behavior is by design. I wonder if it would of any benefits to make this less opaque, maybe by simply editing the description of SEND_LOG_TO_STDOUT
? Or adding another MOM_parameter_doc
file for derived parameters?
A few examples:
MOM6/src/core/MOM_PressureForce_FV.F90
Line 1030 in d90ff6b
MOM6/src/core/MOM_verticalGrid.F90
Lines 234 to 236 in d90ff6b
MOM6/src/core/MOM_barotropic.F90
Lines 4916 to 4917 in d90ff6b
After thinking this over, it seems like the solution here is a more explicit description of what gets sent to the log file and stdout in the doxygen comments describing the log_to_stdout
and log_open
elements of the param_file_type
in about lines 78-80 of MOM_file_parser.F90. Would you be willing to give this a try in a PR, @herrwang0 ?
The issue was raised as I did not find MOM parameters (both run-time and derivative) logged anywhere other than MOM_parameter_doc.
By design, MOM parameters are always logged in stdlog
. If SEND_LOG_TO_STDOUT
is true, they are also logged in stdout
.
I reexamined my runs and found that the reason MOM parameters were not logged in stdlog
was due to compiler inconsistency between my libfms.a and MOM6.
So, I think there is no need to make changes to the code. It may be helpful to document somewhere about the relationship between MOM_parameter_doc
, stdlog
and stdout
, so that first time and unfamiliar users can be better informed.