NOAA-GFDL / ocean_BGC

4 stars 27 forks source link

+Optional verbosity control for generic_tracer code #1

Closed Hallberg-NOAA closed 4 years ago

Hallberg-NOAA commented 4 years ago

This commit includes three distinct changes to the generic_tracer code to regulate output verbosity, increase robustness, and make available for a module use a variable size that is required to use the generic_tracer_utilities. Specifically these changes are:

  1. Added optional verbosity arguments to g_tracer_print_info, g_tracer_flux_init and generic_tracer_register, to allow for the run-time specification of the volume of diagnostic output. Some are directly implemented in the generic tracer code, while others pass through to an existing optional argument in aof_set_coupler_flux.

  2. Added a generic_tracer_register_called module variable to generic_tracer.F90. Because of the way generic_tracer_register is structured and allocates data, there will be problems if it is executed more than once. This new module variable allows it to be called multiple times without the damaging effects of executing it more than once. This regulation is more appropriate to occur in the generic_tracer module, because the coding conventions for this module make extensive use of module data, whereas MOM6 does not do this.

  3. Make the variable fm_string_len publicly available from the g_tracer_utils module. Several routines in g_tracer_utils specify that this is the required length of their character array arguments, so this variable should be shared from this module, rather than requiring calling modules to reference another infrastructure module.

nikizadehgfdl commented 4 years ago

@jessluo this passed regression test. Please click on review button and add your review.