Skip to content

Commit 0162098

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 1344e7c commit 0162098

13 files changed

+144
-147
lines changed

config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90

Lines changed: 25 additions & 22 deletions
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]
@@ -698,7 +698,7 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS, dt_
698698
rigidity_at_h, & ! Ice rigidity at tracer points [L4 Z-1 T-1 ~> m3 s-1]
699699
net_mass_src, & ! A temporary of net mass sources [R Z T-1 ~> kg m-2 s-1].
700700
ustar_tmp, & ! A temporary array of ustar values [Z T-1 ~> m s-1].
701-
tau_mag_tmp ! A temporary array of surface stress magnitudes [R Z L T-2 ~> Pa]
701+
tau_mag_tmp ! A temporary array of surface stress magnitudes [R Z2 T-2 ~> Pa]
702702

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

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

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

962963
logical :: do_ustar, do_gustless, do_tau_mag, do_gustless_tau_mag
963964
integer :: wind_stagger ! AGRID, BGRID_NE, or CGRID_NE (integers from MOM_domains)
@@ -969,7 +970,7 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
969970
Isqh = G%IscB-halo ; Ieqh = G%IecB+halo ; Jsqh = G%JscB-halo ; Jeqh = G%JecB+halo
970971
i0 = is - index_bounds(1) ; j0 = js - index_bounds(3)
971972

972-
IRho0 = US%L_to_Z / CS%Rho0
973+
IRho0 = 1.0 / CS%Rho0
973974
stress_conversion = US%Pa_to_RLZ_T2 * CS%wind_stress_multiplier
974975

975976
do_ustar = present(ustar) ; do_gustless = present(gustless_ustar)
@@ -1073,6 +1074,8 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
10731074
! parametizations. The background gustiness (for example with a relatively small value
10741075
! of 0.02 Pa) is intended to give reasonable behavior in regions of very weak winds.
10751076
if (associated(IOB%stress_mag)) then
1077+
Pa_to_RZ2_T2 = US%Pa_to_RLZ_T2 * US%L_to_Z
1078+
10761079
if (do_ustar .or. do_tau_mag) then ; do j=js,je ; do i=is,ie
10771080
gustiness = CS%gust_const
10781081
if (CS%read_gust_2d) then
@@ -1084,27 +1087,27 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
10841087
gustiness = CS%gust(i,j)
10851088
endif
10861089
if (do_tau_mag) &
1087-
mag_tau(i,j) = gustiness + US%Pa_to_RLZ_T2*IOB%stress_mag(i-i0,j-j0)
1090+
mag_tau(i,j) = gustiness + Pa_to_RZ2_T2*IOB%stress_mag(i-i0,j-j0)
10881091
if (do_gustless_tau_mag) &
1089-
gustless_mag_tau(i,j) = US%Pa_to_RLZ_T2*IOB%stress_mag(i-i0,j-j0)
1092+
gustless_mag_tau(i,j) = Pa_to_RZ2_T2*IOB%stress_mag(i-i0,j-j0)
10901093
if (do_ustar) &
1091-
ustar(i,j) = sqrt(gustiness*IRho0 + IRho0*US%Pa_to_RLZ_T2*IOB%stress_mag(i-i0,j-j0))
1094+
ustar(i,j) = sqrt(gustiness*IRho0 + IRho0*Pa_to_RZ2_T2*IOB%stress_mag(i-i0,j-j0))
10921095
enddo ; enddo ; endif
10931096
if (CS%answer_date < 20190101) then
10941097
if (do_gustless) then ; do j=js,je ; do i=is,ie
1095-
gustless_ustar(i,j) = sqrt(US%Pa_to_RLZ_T2*US%L_to_Z*IOB%stress_mag(i-i0,j-j0) / CS%Rho0)
1098+
gustless_ustar(i,j) = sqrt(Pa_to_RZ2_T2*IOB%stress_mag(i-i0,j-j0) / CS%Rho0)
10961099
enddo ; enddo ; endif
10971100
else
10981101
if (do_gustless) then ; do j=js,je ; do i=is,ie
1099-
gustless_ustar(i,j) = sqrt(IRho0 * US%Pa_to_RLZ_T2*IOB%stress_mag(i-i0,j-j0))
1102+
gustless_ustar(i,j) = sqrt(IRho0 * Pa_to_RZ2_T2*IOB%stress_mag(i-i0,j-j0))
11001103
enddo ; enddo ; endif
11011104
endif
11021105
elseif (wind_stagger == BGRID_NE) then
11031106
do j=js,je ; do i=is,ie
11041107
tau_mag = 0.0 ; gustiness = CS%gust_const
11051108
if (((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + &
11061109
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0.0) then
1107-
tau_mag = sqrt(((G%mask2dBu(I,J)*((taux_in_B(I,J)**2) + (tauy_in_B(I,J)**2)) + &
1110+
tau_mag = US%L_to_Z * sqrt(((G%mask2dBu(I,J)*((taux_in_B(I,J)**2) + (tauy_in_B(I,J)**2)) + &
11081111
G%mask2dBu(I-1,J-1)*((taux_in_B(I-1,J-1)**2) + (tauy_in_B(I-1,J-1)**2))) + &
11091112
(G%mask2dBu(I,J-1)*((taux_in_B(I,J-1)**2) + (tauy_in_B(I,J-1)**2)) + &
11101113
G%mask2dBu(I-1,J)*((taux_in_B(I-1,J)**2) + (tauy_in_B(I-1,J)**2))) ) / &
@@ -1115,21 +1118,21 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
11151118
if (do_tau_mag) mag_tau(i,j) = gustiness + tau_mag
11161119
if (do_gustless_tau_mag) gustless_mag_tau(i,j) = tau_mag
11171120
if (CS%answer_date < 20190101) then
1118-
if (do_gustless) gustless_ustar(i,j) = sqrt(US%L_to_Z*tau_mag / CS%Rho0)
1121+
if (do_gustless) gustless_ustar(i,j) = sqrt(tau_mag / CS%Rho0)
11191122
else
11201123
if (do_gustless) gustless_ustar(i,j) = sqrt(IRho0 * tau_mag)
11211124
endif
11221125
enddo ; enddo
11231126
elseif (wind_stagger == AGRID) then
11241127
do j=js,je ; do i=is,ie
1125-
tau_mag = G%mask2dT(i,j) * sqrt((taux_in_A(i,j)**2) + (tauy_in_A(i,j)**2))
1128+
tau_mag = G%mask2dT(i,j) * US%L_to_Z * sqrt((taux_in_A(i,j)**2) + (tauy_in_A(i,j)**2))
11261129
gustiness = CS%gust_const
11271130
if (CS%read_gust_2d .and. (G%mask2dT(i,j) > 0.0)) gustiness = CS%gust(i,j)
11281131
if (do_ustar) ustar(i,j) = sqrt(gustiness*IRho0 + IRho0 * tau_mag)
11291132
if (do_tau_mag) mag_tau(i,j) = gustiness + tau_mag
11301133
if (do_gustless_tau_mag) gustless_mag_tau(i,j) = tau_mag
11311134
if (CS%answer_date < 20190101) then
1132-
if (do_gustless) gustless_ustar(i,j) = sqrt(US%L_to_Z*tau_mag / CS%Rho0)
1135+
if (do_gustless) gustless_ustar(i,j) = sqrt(tau_mag / CS%Rho0)
11331136
else
11341137
if (do_gustless) gustless_ustar(i,j) = sqrt(IRho0 * tau_mag)
11351138
endif
@@ -1143,7 +1146,7 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
11431146
if ((G%mask2dCv(i,J-1) + G%mask2dCv(i,J)) > 0.0) &
11441147
tauy2 = (G%mask2dCv(i,J-1)*(tauy_in_C(i,J-1)**2) + G%mask2dCv(i,J)*(tauy_in_C(i,J)**2)) / &
11451148
(G%mask2dCv(i,J-1) + G%mask2dCv(i,J))
1146-
tau_mag = sqrt(taux2 + tauy2)
1149+
tau_mag = US%L_to_Z * sqrt(taux2 + tauy2)
11471150

11481151
gustiness = CS%gust_const
11491152
if (CS%read_gust_2d) gustiness = CS%gust(i,j)
@@ -1152,7 +1155,7 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
11521155
if (do_tau_mag) mag_tau(i,j) = gustiness + tau_mag
11531156
if (do_gustless_tau_mag) gustless_mag_tau(i,j) = tau_mag
11541157
if (CS%answer_date < 20190101) then
1155-
if (do_gustless) gustless_ustar(i,j) = sqrt(US%L_to_Z*tau_mag / CS%Rho0)
1158+
if (do_gustless) gustless_ustar(i,j) = sqrt(tau_mag / CS%Rho0)
11561159
else
11571160
if (do_gustless) gustless_ustar(i,j) = sqrt(IRho0 * tau_mag)
11581161
endif
@@ -1616,7 +1619,7 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, wind_stagger)
16161619
"an input file", default=.false.)
16171620
call get_param(param_file, mdl, "GUST_CONST", CS%gust_const, &
16181621
"The background gustiness in the winds.", &
1619-
units="Pa", default=0.0, scale=US%Pa_to_RLZ_T2)
1622+
units="Pa", default=0.0, scale=US%Pa_to_RLZ_T2*US%L_to_Z)
16201623
if (CS%read_gust_2d) then
16211624
call get_param(param_file, mdl, "GUST_2D_FILE", gust_file, &
16221625
"The file in which the wind gustiness is found in "//&
@@ -1627,7 +1630,7 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, wind_stagger)
16271630
! NOTE: There are certain cases where FMS is unable to read this file, so
16281631
! we use read_netCDF_data in place of MOM_read_data.
16291632
call read_netCDF_data(gust_file, 'gustiness', CS%gust, G%Domain, &
1630-
rescale=US%Pa_to_RLZ_T2) ! units in file should be [Pa]
1633+
rescale=US%Pa_to_RLZ_T2*US%L_to_Z) ! units in file should be [Pa]
16311634
endif
16321635
call get_param(param_file, mdl, "DEFAULT_ANSWER_DATE", default_answer_date, &
16331636
"This sets the default value for the various _ANSWER_DATE parameters.", &

config_src/drivers/FMS_cap/ocean_model_MOM.F90

Lines changed: 0 additions & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
835835
((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + (G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) )
836836
if (CS%read_gust_2d) gustiness = CS%gust(i,j)
837837
endif
838-
forces%tau_mag(i,j) = gustiness + tau_mag
838+
forces%tau_mag(i,j) = US%L_to_Z*(gustiness + tau_mag)
839839
forces%ustar(i,j) = sqrt(gustiness*Irho0 + Irho0*tau_mag)
840840
enddo ; enddo
841841
call pass_vector(forces%taux, forces%tauy, G%Domain, halo=1)
@@ -861,7 +861,7 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
861861
do j=js,je ; do i=is,ie
862862
gustiness = CS%gust_const
863863
if (CS%read_gust_2d .and. (G%mask2dT(i,j) > 0.0)) gustiness = CS%gust(i,j)
864-
forces%tau_mag(i,j) = gustiness + G%mask2dT(i,j) * sqrt((taux_at_h(i,j)**2) + (tauy_at_h(i,j)**2))
864+
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)))
865865
forces%ustar(i,j) = sqrt(gustiness*Irho0 + Irho0 * G%mask2dT(i,j) * &
866866
sqrt((taux_at_h(i,j)**2) + (tauy_at_h(i,j)**2)))
867867
!forces%omega_w2x(i,j) = atan(tauy_at_h(i,j), taux_at_h(i,j))
@@ -884,10 +884,10 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
884884
G%mask2dCv(i,J)*(forces%tauy(i,J)**2)) / (G%mask2dCv(i,J-1) + G%mask2dCv(i,J))
885885

886886
if (CS%read_gust_2d) then
887-
forces%tau_mag(i,j) = CS%gust(i,j) + sqrt(taux2 + tauy2)
887+
forces%tau_mag(i,j) = US%L_to_Z*(CS%gust(i,j) + sqrt(taux2 + tauy2))
888888
forces%ustar(i,j) = sqrt(CS%gust(i,j)*Irho0 + Irho0*sqrt(taux2 + tauy2))
889889
else
890-
forces%tau_mag(i,j) = CS%gust_const + sqrt(taux2 + tauy2)
890+
forces%tau_mag(i,j) = US%L_to_Z*(CS%gust_const + sqrt(taux2 + tauy2))
891891
forces%ustar(i,j) = sqrt(CS%gust_const*Irho0 + Irho0*sqrt(taux2 + tauy2))
892892
endif
893893
enddo ; enddo

0 commit comments

Comments
 (0)