Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+(*)Fix problems with generic_tracer_min_max
Revise MOM_generic_tracer_min_max and array_global_min_max to fix several problems that had previously been noted, and to make the location arguments optional, reflecting that they are optional in the calling routine. This requires a revision to the order of arguments to MOM_generic_tracer_min_max. The interface to array_global_min_max was extensively revised and simplified to replace several previous arguments with a single new ocean_grid_type argument, to make the location arguments optional, and add an optional unscale argument. This commit fixes a number of problems that had previously been noted with array_global_min_max, including that: (1) It actually returns the global minimum and maximum values of the tracer; (2) It gives a position that is independent of the domain decomposition and grid rotation; (3) For all-zero arrays it correctly reports 0 for the minimum and maximum; (4) It properly handles unscaling of the input array; (5) It does not use a 3-d mask array that is actually just a 2-d mask array; (6) It is more efficient by grouping the global minimum and maximum calls. This commit also adds or revises comments to document the units and purpose of the remaining undocumented real variables in MOM_generic_tracer.F90. These changes were tested and verified to be correct by calling array_global_min_max for temperatures and salinities from write_energy, but those changes were not included in this commit. This commit also adds an optional verbosity argument to g_tracer_flux_init in config_src/external/GFDL_ocean_BGC/generic_tracer_utils.F90, reflecting a change to ocean_BGC/generic_tracers/generic_tracer_utils.F90 that was adopted in August of 2020, and is uses this new verbosity argument in the call from MOM_generic_flux_init. While all solutions are bitwise identical, there are changes (corrections) in some diagnostic output, and there are changes to the arguments of publicly visible routines.
- Loading branch information