@@ -1032,28 +1032,49 @@ subroutine PressureForce_FV_Bouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_atm
1032
1032
e(i,j,nz+1 ) = - G% bathyT(i,j)
1033
1033
enddo ; enddo
1034
1034
1035
- ! Self-attraction and loading (SAL) and tides (old answers)
1036
- ! SAL and tidal geopotential height anomalies are calculated and added as corrections to interface heights.
1037
- ! The following code is for recovering old answers only. The algorithm moves interface heights before density
1038
- ! calculations, and therefore is incorrect without SSH_IN_EOS_PRESSURE_FOR_PGF=True (added in August 2024).
1039
- ! See the code right after Pa calculation loop for the new method.
1040
- if (CS% tides .and. CS% tides_answer_date<= 20230630 ) then
1035
+ ! The following two if-blocks are used to recover old answers for self-attraction and loading
1036
+ ! (SAL) and tides only. The old algorithm moves interface heights before density calculations,
1037
+ ! and therefore is incorrect without SSH_IN_EOS_PRESSURE_FOR_PGF=True (added in August 2024).
1038
+ ! See the code right after Pa calculation loop for the new algorithm.
1039
+
1040
+ ! Calculate and add SAL geopotential anomaly to interface height (old answers)
1041
+ if (CS% calculate_SAL .and. CS% tides_answer_date<= 20250131 ) then
1041
1042
! $OMP parallel do default(shared)
1042
1043
do j= Jsq,Jeq+1
1043
1044
do i= Isq,Ieq+1
1044
- SSH(i,j) = min (- G% bathyT(i,j) - G% Z_ref, 0.0 ) ! reference bottom pressure
1045
+ SSH(i,j) = min (- G% bathyT(i,j) - G% Z_ref, 0.0 )
1045
1046
enddo
1046
1047
do k= 1 ,nz ; do i= Isq,Ieq+1
1047
1048
SSH(i,j) = SSH(i,j) + h(i,j,k)* GV% H_to_Z
1048
1049
enddo ; enddo
1049
1050
enddo
1050
1051
call calc_SAL(SSH, e_sal, G, CS% SAL_CSp, tmp_scale= US% Z_to_m)
1051
- call calc_tidal_forcing_legacy(CS% Time, e_sal, e_sal_and_tide, e_tidal_eq, e_tidal_sal, &
1052
- G, US, CS% tides_CSp)
1053
- ! $OMP parallel do default(shared)
1054
- do j= Jsq,Jeq+1 ; do i= Isq,Ieq+1
1055
- e(i,j,nz+1 ) = e(i,j,nz+1 ) - e_sal_and_tide(i,j)
1056
- enddo ; enddo
1052
+
1053
+ if (CS% tides_answer_date> 20230630 ) then ! answers_date between [20230701, 20250131]
1054
+ ! $OMP parallel do default(shared)
1055
+ do j= Jsq,Jeq+1 ; do i= Isq,Ieq+1
1056
+ e(i,j,nz+1 ) = e(i,j,nz+1 ) - e_sal(i,j)
1057
+ enddo ; enddo
1058
+ endif
1059
+ endif
1060
+
1061
+ ! Calculate and add tidal geopotential anomaly to interface height (old answers)
1062
+ if (CS% tides .and. CS% tides_answer_date<= 20250131 ) then
1063
+ if (CS% tides_answer_date> 20230630 ) then ! answers_date between [20230701, 20250131]
1064
+ call calc_tidal_forcing(CS% Time, e_tidal_eq, e_tidal_sal, G, US, CS% tides_CSp)
1065
+ ! $OMP parallel do default(shared)
1066
+ do j= Jsq,Jeq+1 ; do i= Isq,Ieq+1
1067
+ e(i,j,nz+1 ) = e(i,j,nz+1 ) - (e_tidal_eq(i,j) + e_tidal_sal(i,j))
1068
+ enddo ; enddo
1069
+ else ! answers_date before 20230701
1070
+ if (.not. CS% calculate_SAL) e_sal(:,:) = 0.0
1071
+ call calc_tidal_forcing_legacy(CS% Time, e_sal, e_sal_and_tide, e_tidal_eq, e_tidal_sal, &
1072
+ G, US, CS% tides_CSp)
1073
+ ! $OMP parallel do default(shared)
1074
+ do j= Jsq,Jeq+1 ; do i= Isq,Ieq+1
1075
+ e(i,j,nz+1 ) = e(i,j,nz+1 ) - e_sal_and_tide(i,j)
1076
+ enddo ; enddo
1077
+ endif
1057
1078
endif
1058
1079
1059
1080
! $OMP parallel do default(shared)
@@ -1201,8 +1222,8 @@ subroutine PressureForce_FV_Bouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_atm
1201
1222
enddo ; enddo
1202
1223
enddo
1203
1224
1204
- ! Self-attraction and loading ( SAL) (new answers)
1205
- if (CS% calculate_SAL .and. CS% tides_answer_date> 20230630 ) then
1225
+ ! Calculate and add SAL geopotential anomaly to interface height (new answers)
1226
+ if (CS% calculate_SAL .and. CS% tides_answer_date> 20250131 ) then
1206
1227
if (CS% sal_use_bpa) then
1207
1228
! $OMP parallel do default(shared)
1208
1229
do j= Jsq,Jeq+1 ; do i= Isq,Ieq+1
@@ -1225,8 +1246,8 @@ subroutine PressureForce_FV_Bouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_atm
1225
1246
enddo ; endif
1226
1247
endif
1227
1248
1228
- ! Tides (new answers)
1229
- if (CS% tides .and. CS% tides_answer_date> 20230630 ) then
1249
+ ! Calculate and add tidal geopotential anomaly to interface height (new answers)
1250
+ if (CS% tides .and. CS% tides_answer_date> 20250131 ) then
1230
1251
call calc_tidal_forcing(CS% Time, e_tidal_eq, e_tidal_sal, G, US, CS% tides_CSp)
1231
1252
if (.not. CS% bq_sal_tides) then ; do K= 1 ,nz+1
1232
1253
! $OMP parallel do default(shared)
@@ -1812,11 +1833,13 @@ subroutine PressureForce_FV_init(Time, G, GV, US, param_file, diag, CS, SAL_CSp,
1812
1833
call get_param(param_file, ' ' , " DEFAULT_ANSWER_DATE" , default_answer_date, default= 99991231 )
1813
1834
if (CS% tides) &
1814
1835
call get_param(param_file, mdl, " TIDES_ANSWER_DATE" , CS% tides_answer_date, " The vintage of " // &
1815
- " self-attraction and loading (SAL) and tidal forcing calculations. In both " // &
1816
- " Boussinesq and non-Boussinesq modes, values below 20230701 recover the old " // &
1817
- " answers in which the SAL is part of the tidal forcing calculation. The " // &
1818
- " change is due to a reordered summation and the difference is only at bit " // &
1819
- " level." , default= 20230630 , do_not_log= (.not. CS% tides))
1836
+ " self-attraction and loading (SAL) and tidal forcing calculations. Setting " // &
1837
+ " dates before 20230701 recovers old answers (Boussinesq and non-Boussinesq " // &
1838
+ " modes) when SAL is part of the tidal forcing calculation. The answer " // &
1839
+ " difference is only at bit level and due to a reordered summation. Setting " // &
1840
+ " dates before 20250201 recovers answers (Boussinesq mode) that interface " // &
1841
+ " heights are modified before pressure force integrals are calculated." , &
1842
+ default= 20230630 , do_not_log= (.not. CS% tides))
1820
1843
call get_param(param_file, mdl, " CALCULATE_SAL" , CS% calculate_SAL, &
1821
1844
" If true, calculate self-attraction and loading." , default= CS% tides)
1822
1845
if (CS% calculate_SAL) &
@@ -1844,9 +1867,9 @@ subroutine PressureForce_FV_init(Time, G, GV, US, param_file, diag, CS, SAL_CSp,
1844
1867
" pressure used in the equation of state calculations for the Boussinesq pressure " // &
1845
1868
" gradient forces, including adjustments for atmospheric or sea-ice pressure." , &
1846
1869
default= .false. , do_not_log= .not. GV% Boussinesq)
1847
- if (CS% tides .and. CS% tides_answer_date<= 20230630 .and. CS% use_SSH_in_Z0p) &
1870
+ if (CS% tides .and. CS% tides_answer_date<= 20250131 .and. CS% use_SSH_in_Z0p) &
1848
1871
call MOM_error(FATAL, trim (mdl) // " , PressureForce_FV_init: SSH_IN_EOS_PRESSURE_FOR_PGF " // &
1849
- " needs to be FALSE to recover tide answers before 20230701 ." )
1872
+ " needs to be FALSE to recover tide answers before 20250131 ." )
1850
1873
1851
1874
call get_param(param_file, " MOM" , " USE_REGRIDDING" , use_ALE, &
1852
1875
" If True, use the ALE algorithm (regridding/remapping). " // &
0 commit comments