Skip to content

Commit

Permalink
+*Add MOM_temperature_convert.F90
Browse files Browse the repository at this point in the history
  Added the new module MOM_temperature_convert, which contains the elemental
functions poTemp_to_consTemp and consTemp_to_poTemp to convert potential
temperature to conservative temperature and the reverse.  These routines are
mathematically equivalent to the TEOS-10 functions gsw_ct_from_pt and
gsw_pt_from_ct, but with some refactoring and added parentheses to help ensure
identical answers across compilers or levels of optimization.  Also added the
new subroutines pot_temp_to_cons_temp and prac_saln_to_abs_saln, and added the
new optional argument use_TEOS to convert_temp_salt_for_TEOS10, and
cons_temp_to_pot_temp and abs_saln_to_prac_saln.

  The equivalency between the new code and their gsw_ counterparts is
demonstrated in new tests in the new function test_TS_conversion_consistency,
which in turn is called from EOS_unit_tests.

  All answers are mathematically equivalent, but because of the choice to use
the new code by default there could be changes at the level of roundoff in some
cases that use conservative temperature as their state variable but initialize
it from potential temperature.  There are not any such cases yet in the
MOM6-examples test suite, nor are there believed to be any such MOM6
configurations that are widely used.  This commit introduces a new module and
several new functions or subroutines with public interfaces.
  • Loading branch information
Hallberg-NOAA committed Apr 22, 2023
1 parent 7bf2b3a commit bf8f414
Show file tree
Hide file tree
Showing 2 changed files with 458 additions and 54 deletions.
Loading

0 comments on commit bf8f414

Please sign in to comment.