Skip to content

Commit e4df846

Browse files
committed
Merge remote-tracking branch 'MAIN/main' into feature/update-to-main-20240824
2 parents 00f8ea2 + ce58a32 commit e4df846

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+850
-837
lines changed

config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90

+7-7
Original file line numberDiff line numberDiff line change
@@ -1088,10 +1088,10 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
10881088
tau_mag = 0.0 ; gustiness = CS%gust_const
10891089
if (((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + &
10901090
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0.0) then
1091-
tau_mag = sqrt(((G%mask2dBu(I,J)*(taux_in_B(I,J)**2 + tauy_in_B(I,J)**2) + &
1092-
G%mask2dBu(I-1,J-1)*(taux_in_B(I-1,J-1)**2 + tauy_in_B(I-1,J-1)**2)) + &
1093-
(G%mask2dBu(I,J-1)*(taux_in_B(I,J-1)**2 + tauy_in_B(I,J-1)**2) + &
1094-
G%mask2dBu(I-1,J)*(taux_in_B(I-1,J)**2 + tauy_in_B(I-1,J)**2)) ) / &
1091+
tau_mag = sqrt(((G%mask2dBu(I,J)*((taux_in_B(I,J)**2) + (tauy_in_B(I,J)**2)) + &
1092+
G%mask2dBu(I-1,J-1)*((taux_in_B(I-1,J-1)**2) + (tauy_in_B(I-1,J-1)**2))) + &
1093+
(G%mask2dBu(I,J-1)*((taux_in_B(I,J-1)**2) + (tauy_in_B(I,J-1)**2)) + &
1094+
G%mask2dBu(I-1,J)*((taux_in_B(I-1,J)**2) + (tauy_in_B(I-1,J)**2))) ) / &
10951095
((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + (G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) )
10961096
if (CS%read_gust_2d) gustiness = CS%gust(i,j)
10971097
endif
@@ -1105,7 +1105,7 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
11051105
enddo ; enddo
11061106
elseif (wind_stagger == AGRID) then
11071107
do j=js,je ; do i=is,ie
1108-
tau_mag = G%mask2dT(i,j) * sqrt(taux_in_A(i,j)**2 + tauy_in_A(i,j)**2)
1108+
tau_mag = G%mask2dT(i,j) * sqrt((taux_in_A(i,j)**2) + (tauy_in_A(i,j)**2))
11091109
gustiness = CS%gust_const
11101110
if (CS%read_gust_2d .and. (G%mask2dT(i,j) > 0.0)) gustiness = CS%gust(i,j)
11111111
if (do_ustar) ustar(i,j) = sqrt(gustiness*IRho0 + IRho0 * tau_mag)
@@ -1120,10 +1120,10 @@ subroutine extract_IOB_stresses(IOB, index_bounds, Time, G, US, CS, taux, tauy,
11201120
do j=js,je ; do i=is,ie
11211121
taux2 = 0.0 ; tauy2 = 0.0
11221122
if ((G%mask2dCu(I-1,j) + G%mask2dCu(I,j)) > 0.0) &
1123-
taux2 = (G%mask2dCu(I-1,j)*taux_in_C(I-1,j)**2 + G%mask2dCu(I,j)*taux_in_C(I,j)**2) / &
1123+
taux2 = (G%mask2dCu(I-1,j)*(taux_in_C(I-1,j)**2) + G%mask2dCu(I,j)*(taux_in_C(I,j)**2)) / &
11241124
(G%mask2dCu(I-1,j) + G%mask2dCu(I,j))
11251125
if ((G%mask2dCv(i,J-1) + G%mask2dCv(i,J)) > 0.0) &
1126-
tauy2 = (G%mask2dCv(i,J-1)*tauy_in_C(i,J-1)**2 + G%mask2dCv(i,J)*tauy_in_C(i,J)**2) / &
1126+
tauy2 = (G%mask2dCv(i,J-1)*(tauy_in_C(i,J-1)**2) + G%mask2dCv(i,J)*(tauy_in_C(i,J)**2)) / &
11271127
(G%mask2dCv(i,J-1) + G%mask2dCv(i,J))
11281128
tau_mag = sqrt(taux2 + tauy2)
11291129

config_src/drivers/STALE_mct_cap/mom_surface_forcing_mct.F90

+10-10
Original file line numberDiff line numberDiff line change
@@ -767,10 +767,10 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
767767
tau_mag = 0.0 ; gustiness = CS%gust_const
768768
if (((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + &
769769
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0.0) then
770-
tau_mag = sqrt(((G%mask2dBu(I,J)*(taux_at_q(I,J)**2 + tauy_at_q(I,J)**2) + &
771-
G%mask2dBu(I-1,J-1)*(taux_at_q(I-1,J-1)**2 + tauy_at_q(I-1,J-1)**2)) + &
772-
(G%mask2dBu(I,J-1)*(taux_at_q(I,J-1)**2 + tauy_at_q(I,J-1)**2) + &
773-
G%mask2dBu(I-1,J)*(taux_at_q(I-1,J)**2 + tauy_at_q(I-1,J)**2)) ) / &
770+
tau_mag = sqrt(((G%mask2dBu(I,J)*((taux_at_q(I,J)**2) + (tauy_at_q(I,J)**2)) + &
771+
G%mask2dBu(I-1,J-1)*((taux_at_q(I-1,J-1)**2) + (tauy_at_q(I-1,J-1)**2))) + &
772+
(G%mask2dBu(I,J-1)*((taux_at_q(I,J-1)**2) + (tauy_at_q(I,J-1)**2)) + &
773+
G%mask2dBu(I-1,J)*((taux_at_q(I-1,J)**2) + (tauy_at_q(I-1,J)**2))) ) / &
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
@@ -800,9 +800,9 @@ 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) = 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) * &
805-
sqrt(taux_at_h(i,j)**2 + tauy_at_h(i,j)**2))
805+
sqrt((taux_at_h(i,j)**2) + (tauy_at_h(i,j)**2)))
806806
enddo ; enddo
807807

808808
else ! C-grid wind stresses.
@@ -813,13 +813,13 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
813813
do j=js,je ; do i=is,ie
814814
taux2 = 0.0
815815
if ((G%mask2dCu(I-1,j) + G%mask2dCu(I,j)) > 0.0) &
816-
taux2 = (G%mask2dCu(I-1,j)*forces%taux(I-1,j)**2 + &
817-
G%mask2dCu(I,j)*forces%taux(I,j)**2) / (G%mask2dCu(I-1,j) + G%mask2dCu(I,j))
816+
taux2 = (G%mask2dCu(I-1,j)*(forces%taux(I-1,j)**2) + &
817+
G%mask2dCu(I,j)*(forces%taux(I,j)**2)) / (G%mask2dCu(I-1,j) + G%mask2dCu(I,j))
818818

819819
tauy2 = 0.0
820820
if ((G%mask2dCv(i,J-1) + G%mask2dCv(i,J)) > 0.0) &
821-
tauy2 = (G%mask2dCv(i,J-1)*forces%tauy(i,J-1)**2 + &
822-
G%mask2dCv(i,J)*forces%tauy(i,J)**2) / (G%mask2dCv(i,J-1) + G%mask2dCv(i,J))
821+
tauy2 = (G%mask2dCv(i,J-1)*(forces%tauy(i,J-1)**2) + &
822+
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
825825
forces%tau_mag(i,j) = CS%gust(i,j) + sqrt(taux2 + tauy2)

config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90

+10-10
Original file line numberDiff line numberDiff line change
@@ -829,10 +829,10 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
829829
tau_mag = 0.0 ; gustiness = CS%gust_const
830830
if (((G%mask2dBu(I,J) + G%mask2dBu(I-1,J-1)) + &
831831
(G%mask2dBu(I,J-1) + G%mask2dBu(I-1,J))) > 0.0) then
832-
tau_mag = sqrt(((G%mask2dBu(I,J)*(taux_at_q(I,J)**2 + tauy_at_q(I,J)**2) + &
833-
G%mask2dBu(I-1,J-1)*(taux_at_q(I-1,J-1)**2 + tauy_at_q(I-1,J-1)**2)) + &
834-
(G%mask2dBu(I,J-1)*(taux_at_q(I,J-1)**2 + tauy_at_q(I,J-1)**2) + &
835-
G%mask2dBu(I-1,J)*(taux_at_q(I-1,J)**2 + tauy_at_q(I-1,J)**2)) ) / &
832+
tau_mag = sqrt(((G%mask2dBu(I,J)*((taux_at_q(I,J)**2) + (tauy_at_q(I,J)**2)) + &
833+
G%mask2dBu(I-1,J-1)*((taux_at_q(I-1,J-1)**2) + (tauy_at_q(I-1,J-1)**2))) + &
834+
(G%mask2dBu(I,J-1)*((taux_at_q(I,J-1)**2) + (tauy_at_q(I,J-1)**2)) + &
835+
G%mask2dBu(I-1,J)*((taux_at_q(I-1,J)**2) + (tauy_at_q(I-1,J)**2))) ) / &
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
@@ -862,9 +862,9 @@ 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) = 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) * &
867-
sqrt(taux_at_h(i,j)**2 + tauy_at_h(i,j)**2))
867+
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))
869869
enddo ; enddo
870870
call pass_vector(forces%taux, forces%tauy, G%Domain, halo=1)
@@ -876,13 +876,13 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
876876
do j=js,je ; do i=is,ie
877877
taux2 = 0.0
878878
if ((G%mask2dCu(I-1,j) + G%mask2dCu(I,j)) > 0.0) &
879-
taux2 = (G%mask2dCu(I-1,j)*forces%taux(I-1,j)**2 + &
880-
G%mask2dCu(I,j)*forces%taux(I,j)**2) / (G%mask2dCu(I-1,j) + G%mask2dCu(I,j))
879+
taux2 = (G%mask2dCu(I-1,j)*(forces%taux(I-1,j)**2) + &
880+
G%mask2dCu(I,j)*(forces%taux(I,j)**2)) / (G%mask2dCu(I-1,j) + G%mask2dCu(I,j))
881881

882882
tauy2 = 0.0
883883
if ((G%mask2dCv(i,J-1) + G%mask2dCv(i,J)) > 0.0) &
884-
tauy2 = (G%mask2dCv(i,J-1)*forces%tauy(i,J-1)**2 + &
885-
G%mask2dCv(i,J)*forces%tauy(i,J)**2) / (G%mask2dCv(i,J-1) + G%mask2dCv(i,J))
884+
tauy2 = (G%mask2dCv(i,J-1)*(forces%tauy(i,J-1)**2) + &
885+
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
888888
forces%tau_mag(i,j) = CS%gust(i,j) + sqrt(taux2 + tauy2)

config_src/drivers/solo_driver/MOM_surface_forcing.F90

+28-28
Original file line numberDiff line numberDiff line change
@@ -533,13 +533,13 @@ subroutine wind_forcing_gyres(sfc_state, forces, day, G, US, CS)
533533
! set the friction velocity
534534
if (CS%answer_date < 20190101) then
535535
if (associated(forces%tau_mag)) then ; do j=js,je ; do i=is,ie
536-
forces%tau_mag(i,j) = CS%gust_const + sqrt(0.5*((forces%tauy(i,J-1)**2 + forces%tauy(i,J)**2) + &
537-
(forces%taux(I-1,j)**2 + forces%taux(I,j)**2)))
536+
forces%tau_mag(i,j) = CS%gust_const + sqrt(0.5*(((forces%tauy(i,J-1)**2) + (forces%tauy(i,J)**2)) + &
537+
((forces%taux(I-1,j)**2) + (forces%taux(I,j)**2))))
538538
enddo ; enddo ; endif
539539
if (associated(forces%ustar)) then ; do j=js,je ; do i=is,ie
540540
forces%ustar(i,j) = sqrt(US%L_to_Z * ((CS%gust_const/CS%Rho0) + &
541-
sqrt(0.5*(forces%tauy(i,J-1)*forces%tauy(i,J-1) + forces%tauy(i,J)*forces%tauy(i,J) + &
542-
forces%taux(I-1,j)*forces%taux(I-1,j) + forces%taux(I,j)*forces%taux(I,j)))/CS%Rho0) )
541+
sqrt(0.5*((forces%tauy(i,J-1)**2) + (forces%tauy(i,J)**2) + &
542+
(forces%taux(I-1,j)**2) + (forces%taux(I,j)**2)))/CS%Rho0) )
543543
enddo ; enddo ; endif
544544
else
545545
call stresses_to_ustar(forces, G, US, CS)
@@ -743,19 +743,19 @@ subroutine wind_forcing_from_file(sfc_state, forces, day, G, US, CS)
743743
if (.not.read_Ustar) then
744744
if (CS%read_gust_2d) then
745745
if (associated(forces%tau_mag)) then ; do j=js,je ; do i=is,ie
746-
forces%tau_mag(i,j) = CS%gust(i,j) + sqrt(temp_x(i,j)**2 + temp_y(i,j)**2)
746+
forces%tau_mag(i,j) = CS%gust(i,j) + sqrt((temp_x(i,j)**2) + (temp_y(i,j)**2))
747747
enddo ; enddo ; endif
748748
if (associated(forces%ustar)) then ; do j=js,je ; do i=is,ie
749-
tau_mag = CS%gust(i,j) + sqrt(temp_x(i,j)**2 + temp_y(i,j)**2)
749+
tau_mag = CS%gust(i,j) + sqrt((temp_x(i,j)**2) + (temp_y(i,j)**2))
750750
forces%ustar(i,j) = sqrt(tau_mag * US%L_to_Z / CS%Rho0)
751751
enddo ; enddo ; endif
752752
else
753753
if (associated(forces%tau_mag)) then ; do j=js,je ; do i=is,ie
754-
forces%tau_mag(i,j) = CS%gust_const + sqrt(temp_x(i,j)**2 + temp_y(i,j)**2)
754+
forces%tau_mag(i,j) = CS%gust_const + sqrt((temp_x(i,j)**2) + (temp_y(i,j)**2))
755755
enddo ; enddo ; endif
756756
if (associated(forces%ustar)) then ; do j=js,je ; do i=is,ie
757757
forces%ustar(i,j) = sqrt(US%L_to_Z * (CS%gust_const/CS%Rho0 + &
758-
sqrt(temp_x(i,j)*temp_x(i,j) + temp_y(i,j)*temp_y(i,j)) / CS%Rho0) )
758+
sqrt((temp_x(i,j)**2) + (temp_y(i,j)**2)) / CS%Rho0) )
759759
enddo ; enddo ; endif
760760
endif
761761
endif
@@ -797,25 +797,25 @@ subroutine wind_forcing_from_file(sfc_state, forces, day, G, US, CS)
797797
if (CS%read_gust_2d) then
798798
if (associated(forces%tau_mag)) then ; do j=js,je ; do i=is,ie
799799
forces%tau_mag(i,j) = CS%gust(i,j) + &
800-
sqrt(0.5*((forces%tauy(i,J-1)**2 + forces%tauy(i,J)**2) + &
801-
(forces%taux(I-1,j)**2 + forces%taux(I,j)**2)))
800+
sqrt(0.5*(((forces%tauy(i,J-1)**2) + (forces%tauy(i,J)**2)) + &
801+
((forces%taux(I-1,j)**2) + (forces%taux(I,j)**2))))
802802
enddo ; enddo ; endif
803803
if (associated(forces%ustar)) then ; do j=js,je ; do i=is,ie
804804
tau_mag = CS%gust(i,j) + &
805-
sqrt(0.5*((forces%tauy(i,J-1)**2 + forces%tauy(i,J)**2) + &
806-
(forces%taux(I-1,j)**2 + forces%taux(I,j)**2)))
805+
sqrt(0.5*(((forces%tauy(i,J-1)**2) + (forces%tauy(i,J)**2)) + &
806+
((forces%taux(I-1,j)**2) + (forces%taux(I,j)**2))))
807807
forces%ustar(i,j) = sqrt( tau_mag * US%L_to_Z / CS%Rho0 )
808808
enddo ; enddo ; endif
809809
else
810810
if (associated(forces%tau_mag)) then ; do j=js,je ; do i=is,ie
811811
forces%tau_mag(i,j) = CS%gust_const + &
812-
sqrt(0.5*((forces%tauy(i,J-1)**2 + forces%tauy(i,J)**2) + &
813-
(forces%taux(I-1,j)**2 + forces%taux(I,j)**2)))
812+
sqrt(0.5*(((forces%tauy(i,J-1)**2) + (forces%tauy(i,J)**2)) + &
813+
((forces%taux(I-1,j)**2) + (forces%taux(I,j)**2))))
814814
enddo ; enddo ; endif
815815
if (associated(forces%ustar)) then ; do j=js,je ; do i=is,ie
816816
forces%ustar(i,j) = sqrt(US%L_to_Z * ( (CS%gust_const/CS%Rho0) + &
817-
sqrt(0.5*((forces%tauy(i,J-1)**2 + forces%tauy(i,J)**2) + &
818-
(forces%taux(I-1,j)**2 + forces%taux(I,j)**2)))/CS%Rho0))
817+
sqrt(0.5*(((forces%tauy(i,J-1)**2) + (forces%tauy(i,J)**2)) + &
818+
((forces%taux(I-1,j)**2) + (forces%taux(I,j)**2))))/CS%Rho0))
819819
enddo ; enddo ; endif
820820
endif
821821
endif
@@ -885,21 +885,21 @@ subroutine wind_forcing_by_data_override(sfc_state, forces, day, G, US, CS)
885885
if (CS%read_gust_2d) then
886886
call data_override(G%Domain, 'gust', CS%gust, day, scale=US%Pa_to_RLZ_T2)
887887
if (associated(forces%tau_mag)) then ; do j=G%jsc,G%jec ; do i=G%isc,G%iec
888-
forces%tau_mag(i,j) = sqrt(temp_x(i,j)**2 + temp_y(i,j)**2) + CS%gust(i,j)
888+
forces%tau_mag(i,j) = sqrt((temp_x(i,j)**2) + (temp_y(i,j)**2)) + CS%gust(i,j)
889889
enddo ; enddo ; endif
890890
do j=G%jsc,G%jec ; do i=G%isc,G%iec
891-
tau_mag = sqrt(temp_x(i,j)**2 + temp_y(i,j)**2) + CS%gust(i,j)
891+
tau_mag = sqrt((temp_x(i,j)**2) + (temp_y(i,j)**2)) + CS%gust(i,j)
892892
ustar_loc(i,j) = sqrt( tau_mag * US%L_to_Z / CS%Rho0 )
893893
enddo ; enddo
894894
else
895895
if (associated(forces%tau_mag)) then
896896
do j=G%jsc,G%jec ; do i=G%isc,G%iec
897-
forces%tau_mag(i,j) = sqrt(temp_x(i,j)**2 + temp_y(i,j)**2) + CS%gust_const
897+
forces%tau_mag(i,j) = sqrt((temp_x(i,j)**2) + (temp_y(i,j)**2)) + CS%gust_const
898898
! ustar_loc(i,j) = sqrt( forces%tau_mag(i,j) * US%L_to_Z / CS%Rho0 )
899899
enddo ; enddo
900900
endif
901901
do j=G%jsc,G%jec ; do i=G%isc,G%iec
902-
ustar_loc(i,j) = sqrt(US%L_to_Z * (sqrt(temp_x(i,j)**2 + temp_y(i,j)**2)/CS%Rho0 + &
902+
ustar_loc(i,j) = sqrt(US%L_to_Z * (sqrt((temp_x(i,j)**2) + (temp_y(i,j)**2))/CS%Rho0 + &
903903
CS%gust_const/CS%Rho0))
904904
enddo ; enddo
905905
endif
@@ -945,25 +945,25 @@ subroutine stresses_to_ustar(forces, G, US, CS)
945945
if (CS%read_gust_2d) then
946946
if (associated(forces%tau_mag)) then ; do j=js,je ; do i=is,ie
947947
forces%tau_mag(i,j) = CS%gust(i,j) + &
948-
sqrt(0.5*((forces%tauy(i,J-1)**2 + forces%tauy(i,J)**2) + &
949-
(forces%taux(I-1,j)**2 + forces%taux(I,j)**2)))
948+
sqrt(0.5*(((forces%tauy(i,J-1)**2) + (forces%tauy(i,J)**2)) + &
949+
((forces%taux(I-1,j)**2) + (forces%taux(I,j)**2))))
950950
enddo ; enddo ; endif
951951
if (associated(forces%ustar)) then ; do j=js,je ; do i=is,ie
952952
tau_mag = CS%gust(i,j) + &
953-
sqrt(0.5*((forces%tauy(i,J-1)**2 + forces%tauy(i,J)**2) + &
954-
(forces%taux(I-1,j)**2 + forces%taux(I,j)**2)))
953+
sqrt(0.5*(((forces%tauy(i,J-1)**2) + (forces%tauy(i,J)**2)) + &
954+
((forces%taux(I-1,j)**2) + (forces%taux(I,j)**2))))
955955
forces%ustar(i,j) = sqrt( tau_mag * I_rho )
956956
enddo ; enddo ; endif
957957
else
958958
if (associated(forces%tau_mag)) then ; do j=js,je ; do i=is,ie
959959
forces%tau_mag(i,j) = CS%gust_const + &
960-
sqrt(0.5*((forces%tauy(i,J-1)**2 + forces%tauy(i,J)**2) + &
961-
(forces%taux(I-1,j)**2 + forces%taux(I,j)**2)))
960+
sqrt(0.5*(((forces%tauy(i,J-1)**2) + (forces%tauy(i,J)**2)) + &
961+
((forces%taux(I-1,j)**2) + (forces%taux(I,j)**2))))
962962
enddo ; enddo ; endif
963963
if (associated(forces%ustar)) then ; do j=js,je ; do i=is,ie
964964
tau_mag = CS%gust_const + &
965-
sqrt(0.5*((forces%tauy(i,J-1)**2 + forces%tauy(i,J)**2) + &
966-
(forces%taux(I-1,j)**2 + forces%taux(I,j)**2)))
965+
sqrt(0.5*(((forces%tauy(i,J-1)**2) + (forces%tauy(i,J)**2)) + &
966+
((forces%taux(I-1,j)**2) + (forces%taux(I,j)**2))))
967967
forces%ustar(i,j) = sqrt( tau_mag * I_rho )
968968
enddo ; enddo ; endif
969969
endif

config_src/drivers/solo_driver/user_surface_forcing.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ subroutine USER_wind_forcing(sfc_state, forces, day, G, US, CS)
9191
if (associated(forces%ustar)) then ; do j=js,je ; do i=is,ie
9292
! This expression can be changed if desired, but need not be.
9393
forces%tau_mag(i,j) = G%mask2dT(i,j) * (CS%gust_const + &
94-
sqrt(0.5*(forces%taux(I-1,j)**2 + forces%taux(I,j)**2) + &
95-
0.5*(forces%tauy(i,J-1)**2 + forces%tauy(i,J)**2)))
94+
sqrt(0.5*((forces%taux(I-1,j)**2) + (forces%taux(I,j)**2)) + &
95+
0.5*((forces%tauy(i,J-1)**2) + (forces%tauy(i,J)**2))))
9696
if (associated(forces%ustar)) &
9797
forces%ustar(i,j) = G%mask2dT(i,j) * sqrt(forces%tau_mag(i,j) * (US%L_to_Z/CS%Rho0))
9898
enddo ; enddo ; endif

src/ALE/regrid_edge_values.F90

+4-4
Original file line numberDiff line numberDiff line change
@@ -748,10 +748,10 @@ subroutine end_value_h4(dz, u, Csys)
748748
Wt(2,4) = -4.0 * I_h1234 * (I_h23 * (I_h123 + I_h234)) ! Wt*h1^3 > -4* (h1/h23)*(1+h1/h234)
749749
Wt(3,4) = 4.0 * I_denom ! = 4.0*I_h1234 * I_h234 * I_h34 ! Wt*h1^3 < 4 * (h1/h234)*(h1/h34)
750750

751-
Csys(1) = ((u(1) + Wt(1,1) * (u(2)-u(1))) + Wt(2,1) * (u(3)-u(2))) + Wt(3,1) * (u(4)-u(3))
752-
Csys(2) = (Wt(1,2) * (u(2)-u(1)) + Wt(2,2) * (u(3)-u(2))) + Wt(3,2) * (u(4)-u(3))
753-
Csys(3) = (Wt(1,3) * (u(2)-u(1)) + Wt(2,3) * (u(3)-u(2))) + Wt(3,3) * (u(4)-u(3))
754-
Csys(4) = (Wt(1,4) * (u(2)-u(1)) + Wt(2,4) * (u(3)-u(2))) + Wt(3,4) * (u(4)-u(3))
751+
Csys(1) = ((u(1) + (Wt(1,1) * (u(2)-u(1)))) + (Wt(2,1) * (u(3)-u(2)))) + (Wt(3,1) * (u(4)-u(3)))
752+
Csys(2) = ((Wt(1,2) * (u(2)-u(1))) + (Wt(2,2) * (u(3)-u(2)))) + (Wt(3,2) * (u(4)-u(3)))
753+
Csys(3) = ((Wt(1,3) * (u(2)-u(1))) + (Wt(2,3) * (u(3)-u(2)))) + (Wt(3,3) * (u(4)-u(3)))
754+
Csys(4) = ((Wt(1,4) * (u(2)-u(1))) + (Wt(2,4) * (u(3)-u(2)))) + (Wt(3,4) * (u(4)-u(3)))
755755

756756
! endif ! End of non-uniform layer thickness branch.
757757

0 commit comments

Comments
 (0)