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

fix: potential temp to temp conversion for MOM6 model_interpolate #782

Merged
merged 7 commits into from
Jan 14, 2025

Conversation

hkershaw-brown
Copy link
Member

Description:

All temperature observations were failing the forward operator for MOM6 because model_interpolate was only doing interpolation if the QTY was in the state & QTY_TEMPERATURE is not part of the model state.
MOM6 has QTY_POTENTIAL_TEMPERATURE so this needs converting to QTY_TEMPERATURE

Following the method in the POP model_mod. I haven't generalized the code across both model_mods 1) because the salinity units are different between the models 2) POP has depth of grid points static across the ensemble vs thickness in the state for MOM6, 3) I don't want to mess with the POP model_mod

pseudo code:

pressure = f(depth)
pot_temp = f(QTY_POTENTIAL_TEMPERATURE, QTY_SALINITY, pressure) 

Need to double check the units on pressure (dbars vs bars) and salinity (MSU vs PSU)
Note sure of the best name for the conversion routine "sensible_temp" or "in-situ_temp" or whatever.
Note sure what references need to be in the depth to pressure calculation (plop in the three that are in the pop model_mod?)

Also has fix 360.0_r8 for numbers that were missing _r8.

Fixes issue

fixes #773

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Documentation changes needed?

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

Tests

model_mod_check interpolate compare to values at grid points for variables that are in the state QTY_POTENTIAL_TEMPERATURE, QTY_SALINITY (in python notebook)
See unit notes above - need to check.

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Update conf.py

Checklist for release

  • Merge into main
  • Create release from the main branch with appropriate tag
  • Delete feature-branch

Testing Datasets

  • Dataset needed for testing available upon request
  • Dataset download instructions included
  • No dataset needed

fixes #773
Converts potential_temp (model) to in-situ temp (obs)
Following method in POP model_mod: #773 (comment)
Uses element function -  need to check with fortran standard has elemental.
@hkershaw-brown hkershaw-brown added the mom6 Modular Ocean Model label Dec 11, 2024
@johnsonbk
Copy link
Collaborator

@hkershaw-brown Do you have a testing dataset sitting somewhere on glade?

@hkershaw-brown
Copy link
Member Author

NWA regional:
/glade/derecho/scratch/hkershaw/DART/Crocodile/Enrico/filter_run

@johnsonbk
Copy link
Collaborator

Thanks!

@johnsonbk
Copy link
Collaborator

johnsonbk commented Jan 10, 2025

I've been able to test the model mod, adding all available observation types in WOD data and plotted the resulting obs.seq.final file:
/glade/work/johnsonb/git/DART_MOM6_test/models/MOM6/work/obs_seq.final

Using the look-at-obs.ipynb notebook results in this QC plot:

qc_flags

All of the observations were successfully assimilated except for:

  • One FLOAT_SALINITY observation north of French Guiana that wasn't assimilated because it had WOD_QC=9
  • Seven CTD_SALINITY observations along the coast of Nova Scotia and Newfoundland that had failed forward operators presumably due to where land is defined in the model domain (the plot from the notebook has much lower horizontal resolution than the model grid).

The latitude, longitude pairs of the seven failed forward operator locations are as follows:

  1. 44.6928 °N, 296.36 °E (63.64 °W) wet = 0
  2. 46.418 °N, 307.487 °E (52.513 °W) wet = 0
  3. 46.602 °N, 307.563 °E (52.437 °W) wet = 1
  4. 46.977 °N, 307.831 °E (52.169 °W) wet = 1
  5. 47.265 °N, 308.307 °E (51.693 °W) wet = 1
  6. 47.444 °N, 308.531 °E (51.469 °W) wet = 1
  7. 47.936 °N, 309.032 °E (50.968 °W) wet = 1

You can use ncview to check these locations against the model grid looking at the wet field in the geometry file:

/glade/work/johnsonb/git/DART_MOM6_test/models/MOM6/work/g.e215.G_JRA.TL319_t232.002.mom6.h.ocean_geometry.nc

In the wet field, 0 (false) corresponds to land and 1 (true) corresponds to ocean. The closest grid point to the first two of those failed forward operator locations is 0 in the wet field.

The remaining five failed forward operator locations have a value of 1 in the wet field but are over the Grand Banks of Newfoundland (a region of the ocean where the continental shelf extends far from shore). In these regions the forward operator is likely failing because there isn't an ocean value below the CTD_SALINITY reading to use for interpolating the expected observations. The POP model mod exhibits the same behavior in this region.

As far as I can tell, this model_mod is good to go.

@hkershaw-brown hkershaw-brown added the release! bundle with next release label Jan 13, 2025
@hkershaw-brown hkershaw-brown merged commit b96cb33 into main Jan 14, 2025
4 checks passed
@hkershaw-brown hkershaw-brown deleted the mom6-pot-temp branch January 14, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mom6 Modular Ocean Model release! bundle with next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug Feat request : MOM6 temperature interpolation
2 participants