Skip to content

Commit b8a74cc

Browse files
Hallberg-NOAAmarshallward
authored andcommitted
*+Add calculate_specvol_derivs_UNESCO
Added the routine calculate_specvol_derivs_UNESCO to calculate the derivatives of specific volume with temperature and salinity to the MOM_EOS_UNESCO module. Also added some missing parentheses elsewhere in this module so that the answers will be invariant to complier version and optimization levels. Also revised the internal nomenclature of the parameters in this module to follow the conventions of the other EOS modules. Although the revised expressions are mathematically equivalent, this commit will change answers for any cases that use EQN_OF_STATE = "UNESCO". However, it is believed based on a survey of the MOM6 community that there are no active configurations that use this equation of state. There is a new publicly visible routine.
1 parent b5b69e7 commit b8a74cc

File tree

2 files changed

+204
-148
lines changed

2 files changed

+204
-148
lines changed

src/equation_of_state/MOM_EOS.F90

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module MOM_EOS
2727
use MOM_EOS_Jackett06, only : calculate_density_derivs_Jackett06, calculate_specvol_derivs_Jackett06
2828
use MOM_EOS_Jackett06, only : calculate_compress_Jackett06, calculate_density_second_derivs_Jackett06
2929
use MOM_EOS_UNESCO, only : calculate_density_unesco, calculate_spec_vol_unesco
30-
use MOM_EOS_UNESCO, only : calculate_density_derivs_unesco, calculate_density_unesco
30+
use MOM_EOS_UNESCO, only : calculate_density_derivs_unesco, calculate_specvol_derivs_UNESCO
3131
use MOM_EOS_UNESCO, only : calculate_density_second_derivs_UNESCO, calculate_compress_unesco
3232
use MOM_EOS_NEMO, only : calculate_density_nemo
3333
use MOM_EOS_NEMO, only : calculate_density_derivs_nemo
@@ -331,7 +331,7 @@ subroutine calculate_density_array(T, S, pressure, rho, start, npts, EOS, rho_re
331331
call calculate_density_linear(T, S, pressure, rho, start, npts, &
332332
EOS%Rho_T0_S0, EOS%dRho_dT, EOS%dRho_dS, rho_ref)
333333
case (EOS_UNESCO)
334-
call calculate_density_unesco(T, S, pressure, rho, start, npts, rho_ref)
334+
call calculate_density_UNESCO(T, S, pressure, rho, start, npts, rho_ref)
335335
case (EOS_WRIGHT)
336336
call calculate_density_wright(T, S, pressure, rho, start, npts, rho_ref)
337337
case (EOS_WRIGHT_FULL)
@@ -636,7 +636,7 @@ subroutine calculate_spec_vol_array(T, S, pressure, specvol, start, npts, EOS, s
636636
call calculate_spec_vol_linear(T, S, pressure, specvol, start, npts, &
637637
EOS%rho_T0_S0, EOS%drho_dT, EOS%drho_dS, spv_ref)
638638
case (EOS_UNESCO)
639-
call calculate_spec_vol_unesco(T, S, pressure, specvol, start, npts, spv_ref)
639+
call calculate_spec_vol_UNESCO(T, S, pressure, specvol, start, npts, spv_ref)
640640
case (EOS_WRIGHT)
641641
call calculate_spec_vol_wright(T, S, pressure, specvol, start, npts, spv_ref)
642642
case (EOS_WRIGHT_FULL)
@@ -931,7 +931,7 @@ subroutine calculate_density_derivs_array(T, S, pressure, drho_dT, drho_dS, star
931931
call calculate_density_derivs_linear(T, S, pressure, drho_dT, drho_dS, EOS%Rho_T0_S0, &
932932
EOS%dRho_dT, EOS%dRho_dS, start, npts)
933933
case (EOS_UNESCO)
934-
call calculate_density_derivs_unesco(T, S, pressure, drho_dT, drho_dS, start, npts)
934+
call calculate_density_derivs_UNESCO(T, S, pressure, drho_dT, drho_dS, start, npts)
935935
case (EOS_WRIGHT)
936936
call calculate_density_derivs_wright(T, S, pressure, drho_dT, drho_dS, start, npts)
937937
case (EOS_WRIGHT_FULL)
@@ -1333,12 +1333,7 @@ subroutine calculate_spec_vol_derivs_array(T, S, pressure, dSV_dT, dSV_dS, start
13331333
call calculate_specvol_derivs_linear(T, S, pressure, dSV_dT, dSV_dS, start, &
13341334
npts, EOS%Rho_T0_S0, EOS%dRho_dT, EOS%dRho_dS)
13351335
case (EOS_UNESCO)
1336-
call calculate_density_unesco(T, S, pressure, rho, start, npts)
1337-
call calculate_density_derivs_unesco(T, S, pressure, drho_dT, drho_dS, start, npts)
1338-
do j=start,start+npts-1
1339-
dSV_dT(j) = -dRho_DT(j)/(rho(j)**2)
1340-
dSV_dS(j) = -dRho_DS(j)/(rho(j)**2)
1341-
enddo
1336+
call calculate_specvol_derivs_UNESCO(T, S, pressure, dSV_dT, dSV_dS, start, npts)
13421337
case (EOS_WRIGHT)
13431338
call calculate_specvol_derivs_wright(T, S, pressure, dSV_dT, dSV_dS, start, npts)
13441339
case (EOS_WRIGHT_FULL)
@@ -1455,7 +1450,7 @@ subroutine calculate_compress_1d(T, S, pressure, rho, drho_dp, EOS, dom)
14551450
call calculate_compress_linear(Ta, Sa, pres, rho, drho_dp, is, npts, &
14561451
EOS%Rho_T0_S0, EOS%dRho_dT, EOS%dRho_dS)
14571452
case (EOS_UNESCO)
1458-
call calculate_compress_unesco(Ta, Sa, pres, rho, drho_dp, is, npts)
1453+
call calculate_compress_UNESCO(Ta, Sa, pres, rho, drho_dp, is, npts)
14591454
case (EOS_WRIGHT)
14601455
call calculate_compress_wright(Ta, Sa, pres, rho, drho_dp, is, npts)
14611456
case (EOS_WRIGHT_FULL)

0 commit comments

Comments
 (0)