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

Framework for writing parameters to netCDF format #643

Merged
merged 1 commit into from
Nov 10, 2017
Merged

Framework for writing parameters to netCDF format #643

merged 1 commit into from
Nov 10, 2017

Conversation

jkrasting
Copy link
Contributor

This PR introduces a framework to write useful parameters to a netCDF file. Several of us have run into instances where offline analyses and scripts have used hard-coded values for Rho0 and Cp that differ from those used in the model simulation. The introduction of this “ocean_parameters.nc” file will help ameliorate some of those issues and allow scripts/analyses to load these values on a per-experiment basis.

@StephenGriffies also specifies CMOR names and attributes for these in the 2016 OMIP description paper - specifically for ‘rhozero’ and ‘cpocean’. These attributes are included in the register_diag calls.

In this commit:

  • Added write_parameter_fields subroutine to MOM.F90
  • Makes use of the FMS Diag Manager "scalar_axis", which
    is added as axes%axesNull

And a sample diag_table used for testing:

"ocean_model", "C_p", "C_p", "ocean_parameters", "all", .false., "none", 1 
"ocean_model", "Rho_0", "Rho_0"," ocean_parameters", "all", .false., "none", 1 
"ocean_model", "cpocean", "cpocean", "ocean_parameters", "all", .false., "none", 1 
"ocean_model", "rhozero", "rhozero", "ocean_parameters", "all", .false., "none", 1

  - Added write_parameter_fields subroutine to MOM.F90
  - Makes use of the FMS Diag Manager "scalar_axis", which
    is added as axes%axesNull
@Hallberg-NOAA
Copy link
Collaborator

Thank you, @jkrasting, for this useful addition.

Over time, we collectively seem to have acquired the unfortunate habit of adding a great many diagnostics directly to MOM.F90, which has now become severely bloated at more than 4200 lines with almost a hundred diagostics, obfuscating the intent of the code and severely inhibiting any future top-level restructuring of the MOM6 code. This particular PR is a good example of something that need not be in MOM.F90, and could easily be added to one of the files in the diagnostics sub-directory.

In the future, any diagnostics added directly to MOM.F90 should only occur with the greatest deliberation and a really good justification why they could not be added somewhere lower in the MOM6 code tree.

@jkrasting
Copy link
Contributor Author

Yes, we've discussed this before @Hallberg-NOAA.

Despite your legitimate concerns about excess diagnostics in MOM.F90, I included this new code here for two reasons:

  1. The new ocean_parameters.nc file is extremely similar in concept to the ocean_static.nc file. The code for both files should be co-located.
  2. The parameters should be limited to broad, cross-cutting parameters - such as Cp, Rho, gravity, etc. We should be relatively juducious about which parameters to include in this file. It should NOT be a duplicate of the MOM_parameter.doc file, but it does need to include parameters that are relevant to offline analysis and are prone to changing with different experiments.

@Hallberg-NOAA Hallberg-NOAA merged commit a54339d into mom-ocean:dev/gfdl Nov 10, 2017
marshallward pushed a commit to Hallberg-NOAA/MOM6 that referenced this pull request Jun 3, 2024
* Add rescaling paramter to KD Shear

Add a parameted (beta) to rescale the distance to the nearest solid
boundary that is used within calculation of kappa shear. While rescaling
this value is unphysical, this adjustment can be thought of as not
allowing shear instabilities to grow up to the full distance to the
nearest boundary because of other turbulent processes which would disrupt
their growth.

* Rename parameter and swtich to multiplication

Rename the parameter beta to lz_rescale to be more descriptive.
To avoid two divisions in a single line, the inverse of lz_rescale
is calculated and stored as I_lz_rescale_sqr. Where the calculation
is done logic has been added to check that lz_rescale is greater
than zero to avoid dividing by zero or making lz_rescale negative.

* Add Comment where lz_rescale is used

Based on Wei's suggestion, add a comment where lz_rescale is used
and put the multiplication by I_lz_rescale to the next line.

* Remove Trailing whitespace

---------

Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea53.ncrc.gov>
Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea57.ncrc.gov>
Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea54.ncrc.gov>
Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea55.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