Skip to content

Rescale topography during initialization#884

Merged
adcroft merged 22 commits into
mom-ocean:dev/gfdlfrom
Hallberg-NOAA:rescale_topography
Nov 19, 2018
Merged

Rescale topography during initialization#884
adcroft merged 22 commits into
mom-ocean:dev/gfdlfrom
Hallberg-NOAA:rescale_topography

Conversation

@Hallberg-NOAA
Copy link
Copy Markdown
Collaborator

Altered the various initialize_topography routines so that they can optionally
rescale the units of the bottom depth during initialization, and then use this
new capability in MOM6. (SIS2 and the ice shelf code use the same routines for
initializing topography but still do any rescaling outside of the routines to
initialize_topography. No answers or parameter_doc files are changed. The list of
commits in this PR include:

  Use US%m_to_Z in place of G%Zd_to_m to convert units from m to Z in
set_up_ALE_sponge_vel_field_varying, whic required adding a unit_scale_type
argument.  All answers are bitwise identical.
  Recast internal depth and height variables in MOM_internal_tides to use units
of Z instead of m.  This required adding a unit_scale_type arguments to
internal_tides_init and itidal_lowmode_loss, and a modified call from
diabatic_driver_init.  All answers are bitwise identical.
  Recast internal depth and height variables in MOM_tidal_mixing to use units of
Z instead of m.  This required adding a unit_scale_type arguments to the
internal subroutines read_tidal_energy and read_tidal_constituents.  Also
eliminated the use of where statements and array syntax, which are strongly
discouraged because they can operate on uninitialized points in the halo
regions.  All answers are bitwise identical.
  Use US%m_to_Z in place of 1/G%Zd_to_m to convert units from m to Z in
tracer_Z_init.  This required adding a unit_scale_type argument to tracer_Z_init
and 4 subroutines that used the previous interface to tracer_Z_init.  All
answers are bitwise identical.
  Added a unit_scale_type argument to diag_remap_update and a pointer to a
unit_scale_type structure to diag_mediator_init and store a this pointer in
the diag_ctrl type, all to accomodate rescaling of depths via US%Z_to_m instead
of G%Zd_to_m.  All answers are bitwise identical.
  Added a unit_scale_type argument to MOM_initialize_fixed and moved the call to
rescale_dyn_horgrid_bathymetry into MOM_initialize_fixed immediately after the
call to MOM_initialize_topography.  Also added a unit_scale_type argument to
mask_outside_OBCs and open_boundary_config to accomodate rescaling of depths via
US%Z_to_m instead of G%Zd_to_m.  All answers are bitwise identical.
  Added a unit_scale_type argument to MOM_sum_output_init, depth_list_setup,
read_depth_list and write_depth_list, and used elements of this type to rescale
depth variables in place of G%Zd_to_m.  All answers are bitwise identical.
  Added an optional unit_scale_type argument to initialize_masks and
write_ocean_geometry_file, and used elements of this type to rescale depth
variables in place of G%Zd_to_m.  All answers are bitwise identical.
  Eliminated Zd_to_m from dyn_horgrid_type and ocean_grid_type.  Instead, any
dimensional rescaling uses elements of unit_scale_types.  All answers are
bitwise identical.
  Recast two internal variables used in the call to set_dtbt from within
barotropic_init to have units of Z instead of m and m2 Z-1 s-2 instead of m s-2,
simplifying the code, and expanding dimensional consistency testing.  All
answers are bitwise identical in the MOM6 test cases, including rescaling Z over
a large range.
  Rescaled ustar_gustless and the ustar argument to get_Langmuir_number from m/s
to Z/s, and added a unit_scale_type argument to set_derived_forcing fields. Also
rolled some unit conversion factors into Irho0, simplifying several lines of the
code in extract_IOB_stresses.  All answers are bitwise identical.
  Added an optional unit_scale_type argument to DOME_initialize_topography, and
if it is present the unit conversion of the topography from m to Z occurs within
this initialization routine.   All answers are bitwise identical.
  Added an optional unit_scale_type argument to ISOMIP_initialize_topography,
and if it is present the unit conversion of the topography from m to Z occurs
within this initialization routine.   All answers are bitwise identical.
  Added an optional unit_scale_type argument to Kelvin_initialize_topography,
and if it is present the unit conversion of the topography from m to Z occurs
within this initialization routine.   All answers are bitwise identical.
  Added an optional unit_scale_type argument to Phillips_initialize_topography,
and if it is present the unit conversion of the topography from m to Z occurs
within this initialization routine.   All answers are bitwise identical.
  Added an optional unit_scale_type argument to benchmark_initialize_topography,
and if it is present the unit conversion of the topography from m to Z occurs
within this initialization routine.   All answers are bitwise identical.
  Added an optional unit_scale_type argument to shelfwave_initialize_topography,
and if it is present the unit conversion of the topography from m to Z occurs
within this initialization routine.   All answers are bitwise identical.
  Added an optional unit_scale_type argument to USER_initialize_topography,
and if it is present the unit conversion of the topography from m to Z occurs
within this initialization routine.   All answers are bitwise identical.
  Clarified comments in several initialize_topography routines to explain that
they will set the topography using the same units as the input value of
mad_depth. All answers are bitwise identical.
  Added an optional unit_scale_type argument to initialize_topography_from_file,
apply_topography_edits_from_file, initialize_topography_named and
limit_topography, which if present causes the topography to be scaled to units
of Z when it is first set up.  In addition, optional unit_scale_type arguments
were added to all of the routines in MOM_shared_initialization and
MOM_grid_initialize where they will eventually be needed so that the various
components using this code (i.e., MOM6 and SIS2) can have a graceful transition
to the new interfaces.  All answers are bitwise identical.
  Use new use_scale_type arguments in the call to MOM_initialize_topography and
eliminated the call to rescale_dyn_horgrid_bathymetry in MOM_initialize_fixed,
so the rescaling of the topography to units of Z happens when it is being set up
via the various initialize_topography routines.  All answers in the GFDL
MOM6-examples test cases are bitwise identical, including rescaling Z over
a large range.
@Hallberg-NOAA
Copy link
Copy Markdown
Collaborator Author

This PR is being tested with https://gitlab.gfdl.noaa.gov/ogrp/MOM6/pipelines/6349.

This PR builds upon the changes in NOAA-GFDL#883, and hence should be dealt with after that one.

@adcroft adcroft merged commit 604a716 into mom-ocean:dev/gfdl Nov 19, 2018
@Hallberg-NOAA Hallberg-NOAA deleted the rescale_topography branch July 30, 2021 19:00
Hallberg-NOAA pushed a commit to herrwang0/MOM6 that referenced this pull request Jul 11, 2025
* Change MOM_generic_tracer into a stub

This PR removes the content from the functions and routines in MOM_generic_tracer to turn it into a stub.
In addition, the other modules in config_src/external/GFDL_ocean_BGC are removed since they are no longer called anywhere.

* Clean up module use statements

Remove unneeded use statements.

* Add fatal error if stub code is called

A fatal error has been added to register_MOM_generic_tracer which
will occur if the stub version of MOM_generic_tracer has been
compiled but use_generic_tracer is true.

* Fix missing '&' at continued line

---------

Co-authored-by: Theresa Cordero <Theresa.Cordero@gaea65.ncrc.gov>
Co-authored-by: Theresa Cordero <Theresa.Cordero@gaea63.ncrc.gov>
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