@@ -458,8 +458,8 @@ subroutine propagate_int_tide(h, tv, Nb, Rho_bot, dt, G, GV, US, inttide_input_C
458
458
f2 = 0.25 * ((G% Coriolis2Bu(I,J) + G% Coriolis2Bu(I-1 ,J-1 )) + &
459
459
(G% Coriolis2Bu(I-1 ,J) + G% Coriolis2Bu(I,J-1 )))
460
460
if (CS% frequency(fr)** 2 > f2) then
461
- CS% En(i,j,a,fr,m) = CS% En(i,j,a,fr,m) + dt* frac_per_sector* (1.0 - CS% q_itides) * &
462
- CS% fraction_tidal_input(fr,m) * TKE_itidal_input(i,j,fr)
461
+ CS% En(i,j,a,fr,m) = CS% En(i,j,a,fr,m) + ( dt* frac_per_sector* (1.0 - CS% q_itides) * &
462
+ CS% fraction_tidal_input(fr,m) * TKE_itidal_input(i,j,fr))
463
463
else
464
464
! zero out input TKE value to get correct diagnostics
465
465
TKE_itidal_input(i,j,fr) = 0 .
@@ -472,8 +472,8 @@ subroutine propagate_int_tide(h, tv, Nb, Rho_bot, dt, G, GV, US, inttide_input_C
472
472
f2 = 0.25 * ((G% Coriolis2Bu(I,J) + G% Coriolis2Bu(I-1 ,J-1 )) + &
473
473
(G% Coriolis2Bu(I-1 ,J) + G% Coriolis2Bu(I,J-1 )))
474
474
if (CS% frequency(fr)** 2 > f2) then
475
- CS% En(i,j,a,fr,m) = CS% En(i,j,a,fr,m) + dt* frac_per_sector* (1.0 - CS% q_itides) * &
476
- CS% fraction_tidal_input(fr,m) * TKE_itidal_input(i,j,fr)
475
+ CS% En(i,j,a,fr,m) = CS% En(i,j,a,fr,m) + ( dt* frac_per_sector* (1.0 - CS% q_itides) * &
476
+ CS% fraction_tidal_input(fr,m) * TKE_itidal_input(i,j,fr))
477
477
else
478
478
! zero out input TKE value to get correct diagnostics
479
479
TKE_itidal_input(i,j,fr) = 0 .
@@ -676,7 +676,7 @@ subroutine propagate_int_tide(h, tv, Nb, Rho_bot, dt, G, GV, US, inttide_input_C
676
676
! Calculate loss rate and apply loss over the time step ; apply the same drag timescale
677
677
! to each En component (technically not correct; fix later)
678
678
En_b = CS% En(i,j,a,fr,m) ! save previous value
679
- En_a = CS% En(i,j,a,fr,m) / (1.0 + dt * CS% decay_rate) ! implicit update
679
+ En_a = CS% En(i,j,a,fr,m) / (1.0 + ( dt * CS% decay_rate) ) ! implicit update
680
680
CS% TKE_leak_loss(i,j,a,fr,m) = (En_b - En_a) * I_dt ! compute exact loss rate [H Z2 T-3 ~> m3 s-3 or W m-2]
681
681
CS% En(i,j,a,fr,m) = En_a ! update value
682
682
enddo ; enddo ; enddo ; enddo ; enddo
@@ -730,7 +730,7 @@ subroutine propagate_int_tide(h, tv, Nb, Rho_bot, dt, G, GV, US, inttide_input_C
730
730
call get_barotropic_tidal_vel(G, vel_btTide, CS% nFreq, inttide_input_CSp)
731
731
732
732
do fr= 1 ,CS% Nfreq ; do j= jsd,jed ; do i= isd,ied
733
- tot_vel_btTide2(i,j) = tot_vel_btTide2(i,j) + vel_btTide(i,j,fr)** 2
733
+ tot_vel_btTide2(i,j) = tot_vel_btTide2(i,j) + ( vel_btTide(i,j,fr)** 2 )
734
734
enddo ; enddo ; enddo
735
735
736
736
do k= 1 ,GV% ke ; do j= jsd,jed ; do i= isd,ied
@@ -741,15 +741,15 @@ subroutine propagate_int_tide(h, tv, Nb, Rho_bot, dt, G, GV, US, inttide_input_C
741
741
do m= 1 ,CS% NMode ; do fr= 1 ,CS% Nfreq ; do j= jsd,jed ; do i= isd,ied
742
742
I_D_here = 1.0 / (max (htot(i,j), CS% drag_min_depth))
743
743
drag_scale(i,j,fr,m) = CS% cdrag * sqrt (max (0.0 , US% L_to_Z** 2 * tot_vel_btTide2(i,j) + &
744
- tot_En_mode(i,j,fr,m) * I_D_here)) * GV% Z_to_H* I_D_here
744
+ ( tot_En_mode(i,j,fr,m) * I_D_here) )) * GV% Z_to_H* I_D_here
745
745
enddo ; enddo ; enddo ; enddo
746
746
else
747
747
do m= 1 ,CS% NMode ; do fr= 1 ,CS% Nfreq ; do j= jsd,jed ; do i= isd,ied
748
748
I_D_here = 1.0 / (max (htot(i,j), CS% drag_min_depth))
749
749
I_mass = GV% RZ_to_H * I_D_here
750
750
drag_scale(i,j,fr,m) = (CS% cdrag * (Rho_bot(i,j)* I_mass)) * &
751
751
sqrt (max (0.0 , US% L_to_Z** 2 * tot_vel_btTide2(i,j) + &
752
- tot_En_mode(i,j,fr,m) * I_D_here))
752
+ ( tot_En_mode(i,j,fr,m) * I_D_here) ))
753
753
enddo ; enddo ; enddo ; enddo
754
754
endif
755
755
@@ -760,7 +760,7 @@ subroutine propagate_int_tide(h, tv, Nb, Rho_bot, dt, G, GV, US, inttide_input_C
760
760
! Calculate loss rate and apply loss over the time step ; apply the same drag timescale
761
761
! to each En component (technically not correct; fix later)
762
762
En_b = CS% En(i,j,a,fr,m)
763
- En_a = CS% En(i,j,a,fr,m) / (1.0 + dt * drag_scale(i,j,fr,m)) ! implicit update
763
+ En_a = CS% En(i,j,a,fr,m) / (1.0 + ( dt * drag_scale(i,j,fr,m) )) ! implicit update
764
764
CS% TKE_quad_loss(i,j,a,fr,m) = (En_b - En_a) * I_dt
765
765
CS% En(i,j,a,fr,m) = En_a
766
766
enddo ; enddo ; enddo ; enddo ; enddo
@@ -816,13 +816,13 @@ subroutine propagate_int_tide(h, tv, Nb, Rho_bot, dt, G, GV, US, inttide_input_C
816
816
817
817
f2 = (0.25 * (G% CoriolisBu(I,J) + G% CoriolisBu(max (I-1 ,1 ),max (J-1 ,1 )) + &
818
818
G% CoriolisBu(I,max (J-1 ,1 )) + G% CoriolisBu(max (I-1 ,1 ),J)))** 2
819
- Kmag2 = (freq2 - f2) / (cn(i,j,m)** 2 + cn_subRO** 2 )
819
+ Kmag2 = (freq2 - f2) / (( cn(i,j,m)** 2 ) + ( cn_subRO** 2 ) )
820
820
821
821
822
822
! Back-calculate amplitude from energy equation
823
823
if ( (G% mask2dT(i,j) > 0.5 ) .and. (freq2* Kmag2 > 0.0 )) then
824
824
! Units here are [R Z ~> kg m-2]
825
- KE_term = 0.25 * GV% H_to_RZ* ( ((freq2 + f2) / (freq2* Kmag2))* US% L_to_Z** 2 * CS% int_U2(i,j,m) + &
825
+ KE_term = 0.25 * GV% H_to_RZ* ( ((( freq2 + f2) / (freq2* Kmag2))* US% L_to_Z** 2 * CS% int_U2(i,j,m) ) + &
826
826
CS% int_w2(i,j,m) )
827
827
PE_term = 0.25 * GV% H_to_RZ* ( CS% int_N2w2(i,j,m) / freq2 )
828
828
@@ -902,7 +902,7 @@ subroutine propagate_int_tide(h, tv, Nb, Rho_bot, dt, G, GV, US, inttide_input_C
902
902
! Calculate horizontal phase velocity magnitudes
903
903
f2 = 0.25 * ((G% Coriolis2Bu(I,J) + G% Coriolis2Bu(I-1 ,J-1 )) + &
904
904
(G% Coriolis2Bu(I-1 ,J) + G% Coriolis2Bu(I,J-1 )))
905
- Kmag2 = (freq2 - f2) / (cn(i,j,m)** 2 + cn_subRO** 2 )
905
+ Kmag2 = (freq2 - f2) / (( cn(i,j,m)** 2 ) + ( cn_subRO** 2 ) )
906
906
c_phase = 0.0
907
907
CS% TKE_Froude_loss(i,j,:,fr,m) = 0 . ! init for all angles
908
908
if (Kmag2 > 0.0 ) then
@@ -979,7 +979,7 @@ subroutine propagate_int_tide(h, tv, Nb, Rho_bot, dt, G, GV, US, inttide_input_C
979
979
if (CS% refl_pref_logical(i,j)) then
980
980
En_b = CS% En(i,j,a,fr,m)
981
981
En_a = (CS% En(i,j,a,fr,m) * (CS% En(i,j,a,fr,m) + en_subRO)) / &
982
- ((CS% En(i,j,a,fr,m) + en_subRO) + dt * CS% TKE_slope_loss(i,j,a,fr,m))
982
+ ((CS% En(i,j,a,fr,m) + en_subRO) + ( dt * CS% TKE_slope_loss(i,j,a,fr,m) ))
983
983
CS% TKE_residual_loss(i,j,a,fr,m) = (En_b - En_a) * I_dt
984
984
CS% En(i,j,a,fr,m) = En_a
985
985
endif
@@ -1328,7 +1328,7 @@ subroutine itidal_lowmode_loss(G, GV, US, CS, Nb, Rho_bot, Ub, En, TKE_loss_fixe
1328
1328
TKE_loss(i,j,a,fr,m) = frac_per_sector* TKE_loss_tot ! [H Z2 T-3 ~> m3 s-3 or W m-2]
1329
1329
loss_rate = TKE_loss(i,j,a,fr,m) / (En(i,j,a,fr,m) + En_negl) ! [T-1 ~> s-1]
1330
1330
En_b = En(i,j,a,fr,m)
1331
- En_a = En(i,j,a,fr,m) / (1.0 + dt* loss_rate)
1331
+ En_a = En(i,j,a,fr,m) / (1.0 + ( dt* loss_rate) )
1332
1332
TKE_loss(i,j,a,fr,m) = (En_b - En_a) * I_dt ! overwrite with exact value
1333
1333
En(i,j,a,fr,m) = En_a
1334
1334
enddo
@@ -1855,15 +1855,15 @@ subroutine refract(En, cn, freq, dt, G, US, NAngle, use_PPMang)
1855
1855
do j= js,je ; do I= is-1 ,ie
1856
1856
! wgt = 0 if local cn == 0, wgt = 0.5 if both contiguous values != 0
1857
1857
! and wgt = 1 if neighbour cn == 0
1858
- wgt1 = cnmask(i,j) - 0.5 * cnmask(i,j) * cnmask(i+1 ,j)
1859
- wgt2 = cnmask(i+1 ,j) - 0.5 * cnmask(i,j) * cnmask(i+1 ,j)
1860
- cn_u(I,j) = wgt1* cn(i,j) + wgt2* cn(i+1 ,j)
1858
+ wgt1 = cnmask(i,j) - ( 0.5 * cnmask(i,j) * cnmask(i+1 ,j) )
1859
+ wgt2 = cnmask(i+1 ,j) - ( 0.5 * cnmask(i,j) * cnmask(i+1 ,j) )
1860
+ cn_u(I,j) = ( wgt1* cn(i,j)) + ( wgt2* cn(i+1 ,j) )
1861
1861
enddo ; enddo
1862
1862
1863
1863
do J= js-1 ,je ; do i= is,ie
1864
- wgt1 = cnmask(i,j) - 0.5 * cnmask(i,j) * cnmask(i,j+1 )
1865
- wgt2 = cnmask(i,j+1 ) - 0.5 * cnmask(i,j) * cnmask(i,j+1 )
1866
- cn_v(i,J) = wgt1* cn(i,j) + wgt2* cn(i,j+1 )
1864
+ wgt1 = cnmask(i,j) - ( 0.5 * cnmask(i,j) * cnmask(i,j+1 ) )
1865
+ wgt2 = cnmask(i,j+1 ) - ( 0.5 * cnmask(i,j) * cnmask(i,j+1 ) )
1866
+ cn_v(i,J) = ( wgt1* cn(i,j)) + ( wgt2* cn(i,j+1 ) )
1867
1867
enddo ; enddo
1868
1868
1869
1869
Ifreq = 1.0 / freq
@@ -1915,7 +1915,7 @@ subroutine refract(En, cn, freq, dt, G, US, NAngle, use_PPMang)
1915
1915
1916
1916
! Determine the energy fluxes in angular orientation space.
1917
1917
do A= asd,aed ; do i= is,ie
1918
- CFL_ang(i,j,A) = (cos_angle(A) * Dl_Dt_Kmag(i) - sin_angle(A) * Dk_Dt_Kmag(i)) * dt_Angle_size
1918
+ CFL_ang(i,j,A) = (( cos_angle(A) * Dl_Dt_Kmag(i)) - ( sin_angle(A) * Dk_Dt_Kmag(i) )) * dt_Angle_size
1919
1919
if (abs (CFL_ang(i,j,A)) > 1.0 ) then
1920
1920
call MOM_error(WARNING, " refract: CFL exceeds 1." , .true. )
1921
1921
if (CFL_ang(i,j,A) > 1.0 ) then ; CFL_ang(i,j,A) = 1.0 ; else ; CFL_ang(i,j,A) = - 1.0 ; endif
@@ -2593,7 +2593,7 @@ subroutine propagate_x(En, speed_x, Cgx_av, dCgx, dt, G, US, Nangle, CS, LB, res
2593
2593
2594
2594
! Update reflected energy [H Z2 T-2 ~> m3 s-2 or J m-2]
2595
2595
do a= 1 ,Nangle ; do j= jsh,jeh ; do i= ish,ieh
2596
- En(i,j,a) = En(i,j,a) + G% IareaT(i,j)* (Fdt_m(i,j,a) + Fdt_p(i,j,a))
2596
+ En(i,j,a) = En(i,j,a) + ( G% IareaT(i,j)* (Fdt_m(i,j,a) + Fdt_p(i,j,a) ))
2597
2597
enddo ; enddo ; enddo
2598
2598
2599
2599
end subroutine propagate_x
0 commit comments