Skip to content

Changes to support H rescaling#672

Merged
adcroft merged 13 commits into
mom-ocean:dev/gfdlfrom
Hallberg-NOAA:reform_convert_thickness
Dec 18, 2017
Merged

Changes to support H rescaling#672
adcroft merged 13 commits into
mom-ocean:dev/gfdlfrom
Hallberg-NOAA:reform_convert_thickness

Conversation

@Hallberg-NOAA
Copy link
Copy Markdown
Collaborator

This PR covers a large set of changes that will prevent answers from changing when H_TO_M or H_TO_KG_M2 are rescaled by integer powers of 2. All answers in the test cases are bitwise identical when H_TO_M is not rescaled.

  Added a new function, transport_remap_grid_needed, that indicates whether it
is necessary to calculate the diagnostic grids for transports, and then only
call diag_update_remap_grids if it is necessary.  Without this change, the model
will fail to run if no transports are being remapped but any other diagnostic
fields are being remapped.  If the model does run, all answers are bitwise
identical.
  Rescaled thickness weighting in global_layer_mean and global_volume_mean to
avoid overflow or underflow for extreme values of H_to_m.  This does not change
answers, but makes the code more robust.  All answers are bitwise identical.
  Corrected a required argument name and comment in int_density_dz_generic_plm
from H_subroundoff to dz_subroundoff to reflect the fact that the argument
dz_neglect is a geometric height difference, not a thickness (in m or kg m-2 or
whatever) difference.  Also added a fatal argument if anyone very tries to use
int_density_dz_generic_plm_analytic, which from inspection simply can not be
right, but thankfully appears not to be used ever.  All answers are bitwise
identical.
  Replaced the hard-coded parameter LARGE_VAL inside of MOM_entrain_diffusive
with an equivalent parameter that is rescaled appropriately when H_TO_M is
changed.  All answers are bitwise identical when H_TO_M=1, but answers can
change slightly for very small values of H_TO_M.  All existing test cases are
bitwise identical.
  Corrected the accumulation of one of the work terms contributing to GMwork and
MEKE%GM_src so that it now gives answers that are robust to changes in H_TO_M.
Also corrected the units written out with 6 diagnostic diffusivities, so
available_diags files will change. Answers remain unchanged if H_TO_M=1, and no
test case solutions change.
  Corrected the unit conversion from H to m inside of the calculation of
SkinBuoyFlux, so it now works properly when H_to_m is not 1.  Also cleaned up
this calculation to avoid the use of array syntax in calculations.  This will
change answers in test cases that use some variants of ePBL with H_TO_M not
equal to 1, but answers do not change in existing test cases.
  Corrected the calculation of the modal structure when H_to_m is not 1.  This
particular code failed because remapping_core_h requires that the input and
output grids use the same units.  This can change answers, but does not change
any of the existing test cases.
  Corrected the rescaling of Coef_x and Coef_y when doing checksums and only
report these checksums if the arrays are in use.  All answers are bitwise
identical.
  Changed H_subroundoff to dz_neglect in a call to int_density_dz_generic_plm,
reflecting the fact that this particular argument is for an actual vertical
geopotential height difference, which will not scale the same way as the
internal representation of thickness.  This changes answers if H_TO_M is not 1,
but answers are bitwise identical in all existing test cases.
  Corrected an expression that combined two variables with units of H and m in
ePBL.  This code is only exercised with certain options for the shape of the
diffusivity, and all existing test cases are bitwise identical.
  Corrected the unit conversion from H to m inside of the calculation of
SkinBuoyFlux, so it now works properly when H_to_m is not 1.  Also cleaned up
this calculation to avoid the use of array syntax in calculations.  This will
change answers in test cases that use some variants of ePBL with H_TO_M not
equal to 1, but answers do not change in existing test cases.
  Changed the value for a tiny amount of TKE from 1e-300 to 1e-150  to avoid
underflow when H_to_m is much less than 1 in one sensitivity calculation as a
part of an iteration in the mechanical entrainment portion of the bulk mixed
layer code.  This does not change any answer in existing test cases.
  Added new optional arguments for the thicknesses to neglect to all of the
remapping code where a neglected thickness is used.
  The subroutines that were changed include: remapping_core_h, remapping_core_w,
build_reconstructions_1d, {PCM, PLM,PPM,PQM}_reconstruction,
{PLM,PPM}_boundary_extrapolation, edge_values_..., edge_slopes_...,
build_and_interpolate_grid, remapByProjection, remapByDeltaZ,
integrateReconOnInterval, build_{rho,hycom1,SLight}_column, and
build_rho_column_iteratively.
  The internal work routines P3M_interpolation and {PPM,P3M}_limiter have new
required arguments. Also, to accomodate the new optional h_neglect arguments,
internally h_neglect was renamed hNeglect in many places. This change will
enable this code to reproduce across changes in the internal representation of
thickness, once the optional arguments are used.  All answers are bitwise
identical.
@Hallberg-NOAA
Copy link
Copy Markdown
Collaborator Author

Being tested by pipeline #3009.

@adcroft adcroft merged commit 833591e into mom-ocean:dev/gfdl Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants