Skip to content

Commit

Permalink
+(*)Fix a scaling bug in MOM_horizontal_regridding
Browse files Browse the repository at this point in the history
  Avoids using hard-coded dimensional tolerances in horizontal_regridding and
improves the documentation of the variables and their units in this file.
Without this change, calls to horiz_interp_and_extrap_tracer with a non-unity
conversion factor will exhibit unexpected changes in answers, and may have
wildly inappropriate amounts of smoothing of the interpolated values in arrays
that are initialized from z-space file.  However, the defaults are carefully
chosen to avoid changing answers in any cases that do not use rescaling of
tracer concentrations.  The specific changes include:

 - Add a new optional argument tr_iter_tol to the horiz_interp_and_extrap_tracer
   routines to set an appropriate dimensional threshold for when the post-fill
   smoothing of tracers should be considered to be adequate.

 - Make the dimensional crit argument to fill_miss_2d non-optional, and fill it
   with appropriate values in calls from the horiz_interp_and_extrap_tracer
   routines when tr_iter_tol is not present.  There should never be a hard-coded
   non-zero default for a dimensional variable!

 - Add a new optional scale argument to myStats

 - Eliminate the unused and unnecessary smooth logical argument to
   fill_miss_2d; the same functionality is obtained by setting the num_pass
   argument to 0.

 - Added to comments to document the units or unitlessness of the real
   variables in MOM_horizontal_regridding.F90.

 - Made minor changes to make the duplicated portions of the two
   horiz_interp_and_extrap_tracer similar.

By default, all answers are bitwise identical, but this corrects a subtle bug
with the use of the conversion factor argument in horiz_interp_and_extrap_tracer
calls.  There are new optional arguments to publicly visible routines.
  • Loading branch information
Hallberg-NOAA authored and marshallward committed May 10, 2022
1 parent 005c460 commit 0e8acd9
Showing 1 changed file with 259 additions and 220 deletions.
Loading

0 comments on commit 0e8acd9

Please sign in to comment.