Skip to content

Commit 5fe59ad

Browse files
committed
+Revise the rescaled units of forces%tau_mag
Revised the rescaled units of forces%tau_mag, fluxes%tau_mag and fluxes%tau_mag_gustless from [R Z L T-2 ~> Pa] to [R Z2 T-2 ~> Pa] to avoid the need for further rescaling when this field is used to calculate turbulent friction velocities and TKE fluxes in 29 places. However, this requires the addition of other rescaling factors when forces%tau_mag is set from the wind stresses. A total of 40 rescaling factors were eliminated, while another 36 were added, all where the components of the wind stress are used to calculate the magnitude of the wind stress. Several other internal variables were also rescaled analogously for simplicity. All answers are bitwise identical, but there are changes to the rescaling factors for three elements in a transparent type.
1 parent a40bbb9 commit 5fe59ad

13 files changed

+144
-147
lines changed

config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90

+25-22
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ module MOM_surface_forcing_gfdl
8585
!! type without any further adjustments to drive the ocean dynamics.
8686
!! The actual net mass source may differ due to corrections.
8787

88-
real :: gust_const !< Constant unresolved background gustiness for ustar [R L Z T-2 ~> Pa]
88+
real :: gust_const !< Constant unresolved background gustiness for ustar [R Z2 T-2 ~> Pa]
8989
logical :: read_gust_2d !< If true, use a 2-dimensional gustiness supplied from an input file.
9090
real, pointer, dimension(:,:) :: &
9191
BBL_tidal_dis => NULL() !< Tidal energy dissipation in the bottom boundary layer that can act as a
9292
!! source of energy for bottom boundary layer mixing [R Z L2 T-3 ~> W m-2]
9393
real, pointer, dimension(:,:) :: &
9494
gust => NULL() !< A spatially varying unresolved background gustiness that
95-
!! contributes to ustar [R L Z T-2 ~> Pa]. gust is used when read_gust_2d is true.
95+
!! contributes to ustar [R Z2 T-2 ~> Pa]. gust is used when read_gust_2d is true.
9696
real, pointer, dimension(:,:) :: &
9797
ustar_tidal => NULL() !< Tidal contribution to the bottom friction velocity [Z T-1 ~> m s-1]
9898
real :: cd_tides !< Drag coefficient that applies to the tides [nondim]
@@ -693,7 +693,7 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS, dt_
693693
rigidity_at_h, & ! Ice rigidity at tracer points [L4 Z-1 T-1 ~> m3 s-1]
694694
net_mass_src, & ! A temporary of net mass sources [R Z T-1 ~> kg m-2 s-1].
695695
ustar_tmp, & ! A temporary array of ustar values [Z T-1 ~> m s-1].
696-
tau_mag_tmp ! A temporary array of surface stress magnitudes [R Z L T-2 ~> Pa]
696+
tau_mag_tmp ! A temporary array of surface stress magnitudes [R Z2 T-2 ~> Pa]
697697

698698
real :: I_GEarth ! The inverse of the gravitational acceleration [T2 Z L-2 ~> s2 m-1]
699699
real :: Kv_rho_ice ! (CS%Kv_sea_ice / CS%density_sea_ice) [L4 Z-2 T-1 R-1 ~> m5 s-1 kg-1]
@@ -934,10 +934,10 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
934934
!! any contributions from gustiness [Z T-1 ~> m s-1].
935935
real, dimension(SZI_(G),SZJ_(G)), &
936936
optional, intent(inout) :: mag_tau !< The magintude of the wind stress at tracer points
937-
!! including subgridscale variability and gustiness [R Z L T-2 ~> Pa]
937+
!! including subgridscale variability and gustiness [R Z2 T-2 ~> Pa]
938938
real, dimension(SZI_(G),SZJ_(G)), &
939939
optional, intent(out) :: gustless_mag_tau !< The magintude of the wind stress at tracer points
940-
!! without any contributions from gustiness [R Z L T-2 ~> Pa]
940+
!! without any contributions from gustiness [R Z2 T-2 ~> Pa]
941941
integer, optional, intent(in) :: tau_halo !< The halo size of wind stresses to set, 0 by default.
942942

943943
! Local variables
@@ -948,11 +948,12 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
948948
real, dimension(SZIB_(G),SZJB_(G)) :: taux_in_B ! Zonal wind stresses [R Z L T-2 ~> Pa] at q points
949949
real, dimension(SZIB_(G),SZJB_(G)) :: tauy_in_B ! Meridional wind stresses [R Z L T-2 ~> Pa] at q points
950950

951-
real :: gustiness ! unresolved gustiness that contributes to ustar [R Z L T-2 ~> Pa]
952-
real :: Irho0 ! Inverse of the mean density rescaled to [Z L-1 R-1 ~> m3 kg-1]
951+
real :: gustiness ! unresolved gustiness that contributes to ustar [R Z2 T-2 ~> Pa]
952+
real :: Irho0 ! Inverse of the Boussinesq mean density [R-1 ~> m3 kg-1]
953953
real :: taux2, tauy2 ! squared wind stresses [R2 Z2 L2 T-4 ~> Pa2]
954-
real :: tau_mag ! magnitude of the wind stress [R Z L T-2 ~> Pa]
954+
real :: tau_mag ! magnitude of the wind stress [R Z2 T-2 ~> Pa]
955955
real :: stress_conversion ! A unit conversion factor from Pa times any stress multiplier [R Z L T-2 Pa-1 ~> 1]
956+
real :: Pa_to_RZ2_T2 ! The combination of unit conversion factors used for mag_tau [R Z2 T-2 Pa-1 ~> 1]
956957

957958
logical :: do_ustar, do_gustless, do_tau_mag, do_gustless_tau_mag
958959
integer :: wind_stagger ! AGRID, BGRID_NE, or CGRID_NE (integers from MOM_domains)
@@ -964,7 +965,7 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
964965
Isqh = G%IscB-halo ; Ieqh = G%IecB+halo ; Jsqh = G%JscB-halo ; Jeqh = G%JecB+halo
965966
i0 = is - index_bounds(1) ; j0 = js - index_bounds(3)
966967

967-
IRho0 = US%L_to_Z / CS%Rho0
968+
IRho0 = 1.0 / CS%Rho0
968969
stress_conversion = US%Pa_to_RLZ_T2 * CS%wind_stress_multiplier
969970

970971
do_ustar = present(ustar) ; do_gustless = present(gustless_ustar)
@@ -1068,6 +1069,8 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
10681069
! parametizations. The background gustiness (for example with a relatively small value
10691070
! of 0.02 Pa) is intended to give reasonable behavior in regions of very weak winds.
10701071
if (associated(IOB%stress_mag)) then
1072+
Pa_to_RZ2_T2 = US%Pa_to_RLZ_T2 * US%L_to_Z
1073+
10711074
if (do_ustar .or. do_tau_mag) then ; do j=js,je ; do i=is,ie
10721075
gustiness = CS%gust_const
10731076
if (CS%read_gust_2d) then
@@ -1079,27 +1082,27 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
10791082
gustiness = CS%gust(i,j)
10801083
endif
10811084
if (do_tau_mag) &
1082-
mag_tau(i,j) = gustiness + US%Pa_to_RLZ_T2*IOB%stress_mag(i-i0,j-j0)
1085+
mag_tau(i,j) = gustiness + Pa_to_RZ2_T2*IOB%stress_mag(i-i0,j-j0)
10831086
if (do_gustless_tau_mag) &
1084-
gustless_mag_tau(i,j) = US%Pa_to_RLZ_T2*IOB%stress_mag(i-i0,j-j0)
1087+
gustless_mag_tau(i,j) = Pa_to_RZ2_T2*IOB%stress_mag(i-i0,j-j0)
10851088
if (do_ustar) &
1086-
ustar(i,j) = sqrt(gustiness*IRho0 + IRho0*US%Pa_to_RLZ_T2*IOB%stress_mag(i-i0,j-j0))
1089+
ustar(i,j) = sqrt(gustiness*IRho0 + IRho0*Pa_to_RZ2_T2*IOB%stress_mag(i-i0,j-j0))
10871090
enddo ; enddo ; endif
10881091
if (CS%answer_date < 20190101) then
10891092
if (do_gustless) then ; do j=js,je ; do i=is,ie
1090-
gustless_ustar(i,j) = sqrt(US%Pa_to_RLZ_T2*US%L_to_Z*IOB%stress_mag(i-i0,j-j0) / CS%Rho0)
1093+
gustless_ustar(i,j) = sqrt(Pa_to_RZ2_T2*IOB%stress_mag(i-i0,j-j0) / CS%Rho0)
10911094
enddo ; enddo ; endif
10921095
else
10931096
if (do_gustless) then ; do j=js,je ; do i=is,ie
1094-
gustless_ustar(i,j) = sqrt(IRho0 * US%Pa_to_RLZ_T2*IOB%stress_mag(i-i0,j-j0))
1097+
gustless_ustar(i,j) = sqrt(IRho0 * Pa_to_RZ2_T2*IOB%stress_mag(i-i0,j-j0))
10951098
enddo ; enddo ; endif
10961099
endif
10971100
elseif (wind_stagger == BGRID_NE) then
10981101
do j=js,je ; do i=is,ie
10991102
tau_mag = 0.0 ; gustiness = CS%gust_const
11001103
if (((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + &
11011104
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0.0) then
1102-
tau_mag = sqrt(((G%mask2dBu(I,J)*((taux_in_B(I,J)**2) + (tauy_in_B(I,J)**2)) + &
1105+
tau_mag = US%L_to_Z * sqrt(((G%mask2dBu(I,J)*((taux_in_B(I,J)**2) + (tauy_in_B(I,J)**2)) + &
11031106
G%mask2dBu(I-1,J-1)*((taux_in_B(I-1,J-1)**2) + (tauy_in_B(I-1,J-1)**2))) + &
11041107
(G%mask2dBu(I,J-1)*((taux_in_B(I,J-1)**2) + (tauy_in_B(I,J-1)**2)) + &
11051108
G%mask2dBu(I-1,J)*((taux_in_B(I-1,J)**2) + (tauy_in_B(I-1,J)**2))) ) / &
@@ -1110,21 +1113,21 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
11101113
if (do_tau_mag) mag_tau(i,j) = gustiness + tau_mag
11111114
if (do_gustless_tau_mag) gustless_mag_tau(i,j) = tau_mag
11121115
if (CS%answer_date < 20190101) then
1113-
if (do_gustless) gustless_ustar(i,j) = sqrt(US%L_to_Z*tau_mag / CS%Rho0)
1116+
if (do_gustless) gustless_ustar(i,j) = sqrt(tau_mag / CS%Rho0)
11141117
else
11151118
if (do_gustless) gustless_ustar(i,j) = sqrt(IRho0 * tau_mag)
11161119
endif
11171120
enddo ; enddo
11181121
elseif (wind_stagger == AGRID) then
11191122
do j=js,je ; do i=is,ie
1120-
tau_mag = G%mask2dT(i,j) * sqrt((taux_in_A(i,j)**2) + (tauy_in_A(i,j)**2))
1123+
tau_mag = G%mask2dT(i,j) * US%L_to_Z * sqrt((taux_in_A(i,j)**2) + (tauy_in_A(i,j)**2))
11211124
gustiness = CS%gust_const
11221125
if (CS%read_gust_2d .and. (G%mask2dT(i,j) > 0.0)) gustiness = CS%gust(i,j)
11231126
if (do_ustar) ustar(i,j) = sqrt(gustiness*IRho0 + IRho0 * tau_mag)
11241127
if (do_tau_mag) mag_tau(i,j) = gustiness + tau_mag
11251128
if (do_gustless_tau_mag) gustless_mag_tau(i,j) = tau_mag
11261129
if (CS%answer_date < 20190101) then
1127-
if (do_gustless) gustless_ustar(i,j) = sqrt(US%L_to_Z*tau_mag / CS%Rho0)
1130+
if (do_gustless) gustless_ustar(i,j) = sqrt(tau_mag / CS%Rho0)
11281131
else
11291132
if (do_gustless) gustless_ustar(i,j) = sqrt(IRho0 * tau_mag)
11301133
endif
@@ -1138,7 +1141,7 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
11381141
if ((G%mask2dCv(i,J-1) + G%mask2dCv(i,J)) > 0.0) &
11391142
tauy2 = (G%mask2dCv(i,J-1)*(tauy_in_C(i,J-1)**2) + G%mask2dCv(i,J)*(tauy_in_C(i,J)**2)) / &
11401143
(G%mask2dCv(i,J-1) + G%mask2dCv(i,J))
1141-
tau_mag = sqrt(taux2 + tauy2)
1144+
tau_mag = US%L_to_Z * sqrt(taux2 + tauy2)
11421145

11431146
gustiness = CS%gust_const
11441147
if (CS%read_gust_2d) gustiness = CS%gust(i,j)
@@ -1147,7 +1150,7 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
11471150
if (do_tau_mag) mag_tau(i,j) = gustiness + tau_mag
11481151
if (do_gustless_tau_mag) gustless_mag_tau(i,j) = tau_mag
11491152
if (CS%answer_date < 20190101) then
1150-
if (do_gustless) gustless_ustar(i,j) = sqrt(US%L_to_Z*tau_mag / CS%Rho0)
1153+
if (do_gustless) gustless_ustar(i,j) = sqrt(tau_mag / CS%Rho0)
11511154
else
11521155
if (do_gustless) gustless_ustar(i,j) = sqrt(IRho0 * tau_mag)
11531156
endif
@@ -1611,7 +1614,7 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, wind_stagger)
16111614
"an input file", default=.false.)
16121615
call get_param(param_file, mdl, "GUST_CONST", CS%gust_const, &
16131616
"The background gustiness in the winds.", &
1614-
units="Pa", default=0.0, scale=US%Pa_to_RLZ_T2)
1617+
units="Pa", default=0.0, scale=US%Pa_to_RLZ_T2*US%L_to_Z)
16151618
if (CS%read_gust_2d) then
16161619
call get_param(param_file, mdl, "GUST_2D_FILE", gust_file, &
16171620
"The file in which the wind gustiness is found in "//&
@@ -1622,7 +1625,7 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, wind_stagger)
16221625
! NOTE: There are certain cases where FMS is unable to read this file, so
16231626
! we use read_netCDF_data in place of MOM_read_data.
16241627
call read_netCDF_data(gust_file, 'gustiness', CS%gust, G%Domain, &
1625-
rescale=US%Pa_to_RLZ_T2) ! units in file should be [Pa]
1628+
rescale=US%Pa_to_RLZ_T2*US%L_to_Z) ! units in file should be [Pa]
16261629
endif
16271630
call get_param(param_file, mdl, "DEFAULT_ANSWER_DATE", default_answer_date, &
16281631
"This sets the default value for the various _ANSWER_DATE parameters.", &

config_src/drivers/FMS_cap/ocean_model_MOM.F90

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ module ocean_model_mod
3232
use MOM_file_parser, only : get_param, log_version, close_param_file, param_file_type
3333
use MOM_forcing_type, only : forcing, mech_forcing, allocate_forcing_type
3434
use MOM_forcing_type, only : fluxes_accumulate, get_net_mass_forcing
35-
use MOM_forcing_type, only : copy_back_forcing_fields
3635
use MOM_forcing_type, only : forcing_diagnostics, mech_forcing_diags
3736
use MOM_get_input, only : Get_MOM_Input, directories
3837
use MOM_grid, only : ocean_grid_type

config_src/drivers/STALE_mct_cap/mom_surface_forcing_mct.F90

+4-4
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
774774
((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + (G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) )
775775
if (CS%read_gust_2d) gustiness = CS%gust(i,j)
776776
endif
777-
forces%tau_mag(i,j) = gustiness + tau_mag
777+
forces%tau_mag(i,j) = US%L_to_Z*(gustiness + tau_mag)
778778
forces%ustar(i,j) = sqrt(gustiness*Irho0 + Irho0*tau_mag)
779779
enddo ; enddo
780780

@@ -800,7 +800,7 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
800800
do j=js,je ; do i=is,ie
801801
gustiness = CS%gust_const
802802
if (CS%read_gust_2d .and. (G%mask2dT(i,j) > 0.0)) gustiness = CS%gust(i,j)
803-
forces%tau_mag(i,j) = gustiness + G%mask2dT(i,j) * sqrt((taux_at_h(i,j)**2) + (tauy_at_h(i,j)**2))
803+
forces%tau_mag(i,j) = US%L_to_Z*(gustiness + G%mask2dT(i,j) * sqrt((taux_at_h(i,j)**2) + (tauy_at_h(i,j)**2)))
804804
forces%ustar(i,j) = sqrt(gustiness*Irho0 + Irho0 * G%mask2dT(i,j) * &
805805
sqrt((taux_at_h(i,j)**2) + (tauy_at_h(i,j)**2)))
806806
enddo ; enddo
@@ -822,10 +822,10 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
822822
G%mask2dCv(i,J)*(forces%tauy(i,J)**2)) / (G%mask2dCv(i,J-1) + G%mask2dCv(i,J))
823823

824824
if (CS%read_gust_2d) then
825-
forces%tau_mag(i,j) = CS%gust(i,j) + sqrt(taux2 + tauy2)
825+
forces%tau_mag(i,j) = US%L_to_Z*(CS%gust(i,j) + sqrt(taux2 + tauy2))
826826
forces%ustar(i,j) = sqrt(CS%gust(i,j)*Irho0 + Irho0*sqrt(taux2 + tauy2))
827827
else
828-
forces%tau_mag(i,j) = CS%gust_const + sqrt(taux2 + tauy2)
828+
forces%tau_mag(i,j) = US%L_to_Z*(CS%gust_const + sqrt(taux2 + tauy2))
829829
forces%ustar(i,j) = sqrt(CS%gust_const*Irho0 + Irho0*sqrt(taux2 + tauy2))
830830
endif
831831
enddo ; enddo

config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90

+4-4
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
836836
((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + (G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) )
837837
if (CS%read_gust_2d) gustiness = CS%gust(i,j)
838838
endif
839-
forces%tau_mag(i,j) = gustiness + tau_mag
839+
forces%tau_mag(i,j) = US%L_to_Z*(gustiness + tau_mag)
840840
forces%ustar(i,j) = sqrt(gustiness*Irho0 + Irho0*tau_mag)
841841
enddo ; enddo
842842
call pass_vector(forces%taux, forces%tauy, G%Domain, halo=1)
@@ -862,7 +862,7 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
862862
do j=js,je ; do i=is,ie
863863
gustiness = CS%gust_const
864864
if (CS%read_gust_2d .and. (G%mask2dT(i,j) > 0.0)) gustiness = CS%gust(i,j)
865-
forces%tau_mag(i,j) = gustiness + G%mask2dT(i,j) * sqrt((taux_at_h(i,j)**2) + (tauy_at_h(i,j)**2))
865+
forces%tau_mag(i,j) = US%L_to_Z*(gustiness + G%mask2dT(i,j) * sqrt((taux_at_h(i,j)**2) + (tauy_at_h(i,j)**2)))
866866
forces%ustar(i,j) = sqrt(gustiness*Irho0 + Irho0 * G%mask2dT(i,j) * &
867867
sqrt((taux_at_h(i,j)**2) + (tauy_at_h(i,j)**2)))
868868
!forces%omega_w2x(i,j) = atan(tauy_at_h(i,j), taux_at_h(i,j))
@@ -885,10 +885,10 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
885885
G%mask2dCv(i,J)*(forces%tauy(i,J)**2)) / (G%mask2dCv(i,J-1) + G%mask2dCv(i,J))
886886

887887
if (CS%read_gust_2d) then
888-
forces%tau_mag(i,j) = CS%gust(i,j) + sqrt(taux2 + tauy2)
888+
forces%tau_mag(i,j) = US%L_to_Z*(CS%gust(i,j) + sqrt(taux2 + tauy2))
889889
forces%ustar(i,j) = sqrt(CS%gust(i,j)*Irho0 + Irho0*sqrt(taux2 + tauy2))
890890
else
891-
forces%tau_mag(i,j) = CS%gust_const + sqrt(taux2 + tauy2)
891+
forces%tau_mag(i,j) = US%L_to_Z*(CS%gust_const + sqrt(taux2 + tauy2))
892892
forces%ustar(i,j) = sqrt(CS%gust_const*Irho0 + Irho0*sqrt(taux2 + tauy2))
893893
endif
894894
enddo ; enddo

0 commit comments

Comments
 (0)