Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+*Non-Boussinesq tracer initialization in Z-units #556

Merged

Conversation

Hallberg-NOAA
Copy link
Member

The series of 3 commits in this pull request adds the ability to remap and initialize tracers and similar scalars using input and output grids that are defined in depth space or other arbitrary vertical grids, rather than assuming that we are working with thicknesses (in H units). The specific changes to enable this new capability include adding new optional arguments to ALE_remap_scalar() and MOM_initialize_tracer_from_Z(), along with the new functions set_h_neglect() and set_dz_neglect() in the MOM_regridding module. This new capability is exercised for temperatures and salinities that are initialized with MOM_temp_salt_initialize_from_Z() when Z_INIT_REMAP_GENERAL = False.

The MOM_generic tracer code was also revised to use thickness_to_dz() to convert the models grid and then initialize the generic tracers from a Z-space file working entirely with the layer vertical extents (in Z-units) rather than the layer thicknesses (in H-units). Similar changes were also made to MOM_generic_tracer_column_physics() for the vertical layer extents that are used in calls to generic_tracer_source().

There are no changes in answers in Boussinesq mode, but when this new capability is used in fully non-Boussinesq mode it avoids using the Boussinesq reference density and it does change answers. All answers in the existing regression test suite are bitwise identical. There are two new publicly visible functions, a new mandatory argument to initialize_MOM_generic_tracer() and new optional arguments to 2 other routines.

The commits in this PR include:

  • 894646098 *+non-Boussinesq revisions to MOM_generic_tracer
  • 037c4f1d7 (*)MOM_temp_salt_init_from_Z Z-unit tracer remap
  • 2b88cebee +ALE_remap_scalar with arbitrary thickness units

@Hallberg-NOAA Hallberg-NOAA added enhancement New feature or request answer-changing A change in results (actual or potential) labels Jan 28, 2024
Copy link

codecov bot commented Jan 28, 2024

Codecov Report

Attention: 62 lines in your changes are missing coverage. Please review.

Comparison is base (07bace6) 37.21% compared to head (d554e62) 37.21%.

Files Patch % Lines
src/tracer/MOM_generic_tracer.F90 0.00% 30 Missing ⚠️
src/ALE/MOM_regridding.F90 17.64% 13 Missing and 1 partial ⚠️
src/ALE/MOM_ALE.F90 30.00% 6 Missing and 1 partial ⚠️
...nitialization/MOM_tracer_initialization_from_Z.F90 0.00% 7 Missing ⚠️
src/initialization/MOM_state_initialization.F90 50.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           dev/gfdl     #556      +/-   ##
============================================
- Coverage     37.21%   37.21%   -0.01%     
============================================
  Files           271      271              
  Lines         80405    80430      +25     
  Branches      14992    14995       +3     
============================================
+ Hits          29925    29931       +6     
- Misses        44919    44937      +18     
- Partials       5561     5562       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

  This commit add the new optional arguments h_neglect and h_neglect_edge to
ALE_remap_scalar to allow for the thicknesses used in this routine to be
provided in any self-consistent units, including [Z ~> m], instead of just
[H ~> m or kg m-2].  To help make use of this new capability, this commit also
adds the new functions set_h_neglect and set_dz_neglect to the MOM_regridding
module.  build_grid_rho and build_grid_HyCOM1 have been refactored to use
set_h_neglect in place of the corresponding duplicated code blocks.

  This commit also adds the new optional argument h_in_Z_units to
MOM_initialize_tracer_from_Z, which in turn uses this new capability for
ALE_remap_scalar to use vertical layer extents (in Z units) rather than
thicknesses (in H units).

  Although there are new optional arguments to public interfaces, they are not
yet being exercised with this commit so no answers are changed.  Moreover, even
if they were being exercised, all Boussinesq solutions would give identical
answers.
  Revise MOM_temp_salt_initialize_from_Z in cases when Z_INIT_REMAP_GENERAL is
False to call ALE_remap_scalar with vertical layer extents (in Z units) rather
than layer thicknesses (in H units).  When in fully non-Boussinesq mode, this
same routine uses dz_to_thickness (using the full equation of state) rather than
dz_to_thickness_simple to initialize the layer thicknesses.  Boussinesq answers
are bitwise identical, but answers can change in some fully non-Boussinesq
cases.
  Revised initialize_MOM_generic_tracer to use thickness_to_dz to get the layer
vertical extents and then provide these to MOM_initialize_tracer_from_Z to read
in initial generic tracer concentrations from Z-space files.  The previous
approach inappropriately used an simple multiplicative rescaling (via a call to
dz_to_thickness_simple in MOM_initialize_tracer_from_Z) by a factor that
includes the Boussinesq reference density when in non-Boussinesq mode.  A new
thermo_vars_type arguments was added to initialize_MOM_generic_tracer to allow
for this change.

  Also revised MOM_generic_tracer_column_physics to use thickness_to_dz instead
of a simple multiplicative rescaling to get the layer vertical extents (in m)
that are used in calls to generic_tracer_source.  The multiplicative factor that
was used previously (GV%H_to_m) includes the Boussinesq reference density and
hence is inappropriate in non-Boussinesq mode; using thickness_to_dz avoids
this.

  Also added comments documenting the meaning and units of about 30 real
variables in the MOM_generic_tracer routines.

  There is a new mandatory argument to initialize_MOM_generic_tracer.  All
Boussinseq mode answers are bitwise identical, but in non-Boussinesq mode mode
generic tracer answers are changed by avoiding the use of the Boussinesq
reference density in several places.
@marshallward marshallward merged commit 9a6ddee into NOAA-GFDL:dev/gfdl Feb 7, 2024
12 checks passed
@Hallberg-NOAA Hallberg-NOAA deleted the ALE_remap_scalar_in_Z branch May 10, 2024 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answer-changing A change in results (actual or potential) enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants