Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c5f1d44

Browse files
brandon.reichlbrandon.reichl
authored andcommitted
Updating name of Stokes PGF routine to be more descriptive.
1 parent a6de11c commit c5f1d44

2 files changed

Lines changed: 135 additions & 126 deletions

File tree

src/core/MOM_dynamics_split_RK2.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module MOM_dynamics_split_RK2
6060
use MOM_vert_friction, only : updateCFLtruncationValue
6161
use MOM_verticalGrid, only : verticalGrid_type, get_thickness_units
6262
use MOM_verticalGrid, only : get_flux_units, get_tr_flux_units
63-
use MOM_wave_interface, only: wave_parameters_CS, Stokes_PGF
63+
use MOM_wave_interface, only: wave_parameters_CS, Stokes_PGF_Add_FD
6464

6565
implicit none ; private
6666

@@ -463,7 +463,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, Time_local, dt, forces, p_s
463463
Use_Stokes_PGF = associated(Waves)
464464
if (Use_Stokes_PGF) Use_Stokes_PGF = Waves%Stokes_PGF
465465
if (Use_Stokes_PGF) then
466-
call Stokes_PGF(G, GV, h, u, v, CS%PFu_Stokes, CS%PFv_Stokes, Waves)
466+
call Stokes_PGF_Add_FD(G, GV, h, u, v, CS%PFu_Stokes, CS%PFv_Stokes, Waves)
467467
! We are adding Stokes_PGF to hydrostatic PGF here. The diag PFu/PFv
468468
! will therefore report the sum total PGF and we avoid other
469469
! modifications in the code. The PFu_Stokes can be output within the waves routines.
@@ -725,7 +725,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, Time_local, dt, forces, p_s
725725
Use_Stokes_PGF = associated(Waves)
726726
if (Use_Stokes_PGF) Use_Stokes_PGF = Waves%Stokes_PGF
727727
if (Use_Stokes_PGF) then
728-
call Stokes_PGF(G, GV, h, u, v, CS%PFu_Stokes, CS%PFv_Stokes, Waves)
728+
call Stokes_PGF_Add_FD(G, GV, h, u, v, CS%PFu_Stokes, CS%PFv_Stokes, Waves)
729729
if (.not.Waves%Passive_Stokes_PGF) then
730730
do k=1,nz
731731
do j=js,je ; do I=Isq,Ieq

src/user/MOM_wave_interface.F90

Lines changed: 132 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ module MOM_wave_interface
3030
! called in step_mom.
3131
public get_Langmuir_Number ! Public interface to compute Langmuir number called from
3232
! ePBL or KPP routines.
33-
public Stokes_PGF ! Public interface to compute Stokes-shear modifications to pressure gradient force
33+
public Stokes_PGF_Add_FD ! Public interface to compute Stokes-shear modifications to pressure gradient force
34+
! using an additive, finite difference method
3435
public StokesMixing ! NOT READY - Public interface to add down-Stokes gradient
3536
! momentum mixing (e.g. the approach of Harcourt 2013/2015)
3637
public CoriolisStokes ! NOT READY - Public interface to add Coriolis-Stokes acceleration
@@ -54,7 +55,7 @@ module MOM_wave_interface
5455
!! True if Stokes vortex force is used
5556
logical, public :: Stokes_PGF !< Developmental:
5657
!! True if Stokes shear pressure Gradient force is used
57-
logical, public :: Passive_Stokes_PGF !< Keeps Stokes_PGF on, but doesn't affect dynamics
58+
logical, public :: Passive_Stokes_PGF !< Keeps Stokes_PGF on, but doesn't affect dynamics
5859
logical, public :: Stokes_DDT !< Developmental:
5960
!! True if Stokes d/dt is used
6061
real, allocatable, dimension(:,:,:), public :: &
@@ -461,9 +462,9 @@ subroutine MOM_wave_interface_init(time, G, GV, US, param_file, CS, diag )
461462
CS%id_3dstokes_x = register_diag_field('ocean_model','3d_stokes_x', &
462463
CS%diag%axesCuL,Time,'3d Stokes drift (x)', 'm s-1', conversion=US%L_T_to_m_s)
463464
CS%id_ddt_3dstokes_y = register_diag_field('ocean_model','dvdt_Stokes', &
464-
CS%diag%axesCvL,Time,'d/dt Stokes drift (meridional)','m s-2')!Needs conversion
465+
CS%diag%axesCvL,Time,'d/dt Stokes drift (meridional)','m s-2')
465466
CS%id_ddt_3dstokes_x = register_diag_field('ocean_model','dudt_Stokes', &
466-
CS%diag%axesCuL,Time,'d/dt Stokes drift (zonal)','m s-2')!Needs conversion
467+
CS%diag%axesCuL,Time,'d/dt Stokes drift (zonal)','m s-2')
467468
CS%id_PFv_Stokes = register_diag_field('ocean_model','PFv_Stokes', &
468469
CS%diag%axesCvL,Time,'PF from Stokes drift (meridional)','m s-2')!Needs conversion
469470
CS%id_PFu_Stokes = register_diag_field('ocean_model','PFu_Stokes', &
@@ -565,14 +566,15 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, h, ustar, dt)
565566
real :: La ! The local Langmuir number [nondim]
566567
integer :: ii, jj, kk, b, iim1, jjm1
567568
real :: idt ! 1 divided by the time step
568-
569+
569570
one_cm = 0.01*US%m_to_Z
570571
min_level_thick_avg = 1.e-3*US%m_to_Z
571572
idt = 1.0/dt
572573

574+
! Getting Stokes drift profile from previous step
573575
CS%ddt_us_x(:,:,:) = CS%US_x(:,:,:)
574576
CS%ddt_us_y(:,:,:) = CS%US_y(:,:,:)
575-
577+
576578
! 1. If Test Profile Option is chosen
577579
! Computing mid-point value from surface value and decay wavelength
578580
if (CS%WaveMethod==TESTPROF) then
@@ -810,9 +812,11 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, h, ustar, dt)
810812
enddo
811813
enddo
812814

815+
! Finding tendency of Stokes drift over the time step to apply
816+
! as an acceleration to the models current.
813817
CS%ddt_us_x(:,:,:) = (CS%US_x(:,:,:) - CS%ddt_us_x(:,:,:)) * idt
814818
CS%ddt_us_y(:,:,:) = (CS%US_y(:,:,:) - CS%ddt_us_y(:,:,:)) * idt
815-
819+
816820
! Output any desired quantities
817821
if (CS%id_surfacestokes_y>0) &
818822
call post_data(CS%id_surfacestokes_y, CS%us0_y, CS%diag)
@@ -1422,8 +1426,56 @@ subroutine StokesMixing(G, GV, dt, h, u, v, Waves )
14221426

14231427
end subroutine StokesMixing
14241428

1425-
!> Computes tendency due to Stokes pressure gradient force
1426-
subroutine Stokes_PGF(G, GV, h, u, v, PFu_Stokes, PFv_Stokes, CS )
1429+
!> Solver to add Coriolis-Stokes to model
1430+
!! Still in development and not meant for general use.
1431+
!! Can be activated (with code intervention) for LES comparison
1432+
!! CHECK THAT RIGHT TIMESTEP IS PASSED IF YOU USE THIS**
1433+
!!
1434+
!! Not accessed in the standard code.
1435+
subroutine CoriolisStokes(G, GV, dt, h, u, v, WAVES, US)
1436+
type(ocean_grid_type), &
1437+
intent(in) :: G !< Ocean grid
1438+
type(verticalGrid_type), &
1439+
intent(in) :: GV !< Ocean vertical grid
1440+
real, intent(in) :: dt !< Time step of MOM6 [T ~> s]
1441+
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
1442+
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
1443+
real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), &
1444+
intent(inout) :: u !< Velocity i-component [L T-1 ~> m s-1]
1445+
real, dimension(SZI_(G),SZJB_(G),SZK_(GV)), &
1446+
intent(inout) :: v !< Velocity j-component [L T-1 ~> m s-1]
1447+
type(Wave_parameters_CS), &
1448+
pointer :: Waves !< Surface wave related control structure.
1449+
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
1450+
! Local variables
1451+
real :: DVel ! A rescaled velocity change [L T-2 ~> m s-2]
1452+
integer :: i,j,k
1453+
1454+
do k = 1, GV%ke
1455+
do j = G%jsc, G%jec
1456+
do I = G%iscB, G%iecB
1457+
DVel = 0.25*(WAVES%us_y(i,j+1,k)+WAVES%us_y(i-1,j+1,k))*G%CoriolisBu(i,j+1) + &
1458+
0.25*(WAVES%us_y(i,j,k)+WAVES%us_y(i-1,j,k))*G%CoriolisBu(i,j)
1459+
u(I,j,k) = u(I,j,k) + DVEL*dt
1460+
enddo
1461+
enddo
1462+
enddo
1463+
1464+
do k = 1, GV%ke
1465+
do J = G%jscB, G%jecB
1466+
do i = G%isc, G%iec
1467+
DVel = 0.25*(WAVES%us_x(i+1,j,k)+WAVES%us_x(i+1,j-1,k))*G%CoriolisBu(i+1,j) + &
1468+
0.25*(WAVES%us_x(i,j,k)+WAVES%us_x(i,j-1,k))*G%CoriolisBu(i,j)
1469+
v(i,J,k) = v(i,j,k) - DVEL*dt
1470+
enddo
1471+
enddo
1472+
enddo
1473+
end subroutine CoriolisStokes
1474+
1475+
1476+
!> Computes tendency due to Stokes pressure gradient force using an
1477+
!! additive finite difference method
1478+
subroutine Stokes_PGF_Add_FD(G, GV, h, u, v, PFu_Stokes, PFv_Stokes, CS )
14271479
type(ocean_grid_type), &
14281480
intent(in) :: G !< Ocean grid
14291481
type(verticalGrid_type), &
@@ -1449,17 +1501,16 @@ subroutine Stokes_PGF(G, GV, h, u, v, PFu_Stokes, PFv_Stokes, CS )
14491501
real :: z_top_l, z_top_r ! The height of the top of the cell (left/right index) [Z ~> m].
14501502
real :: z_mid_l, z_mid_r ! The height of the middle of the cell (left/right index) [Z ~> m].
14511503
real :: h_l, h_r ! The thickness of the cell (left/right index) [Z ~> m].
1452-
real :: wavenum,TwoKexpL, TwoKexpR !TMP DELETE THIS
1453-
integer :: i,j,k
1454-
1455-
! Comput the Stokes contribution to the pressure gradient force
1504+
real :: TwoKexpL, TwoKexpR
1505+
integer :: i,j,k,l
14561506

1507+
! Compute the Stokes contribution to the pressure gradient force
14571508
PFu_Stokes(:,:,:) = 0.0
14581509
PFv_Stokes(:,:,:) = 0.0
14591510

1460-
wavenum = (2.*3.14)/50.
14611511
do j = G%jsc, G%jec ; do I = G%iscB, G%iecB
14621512
if (G%mask2dCu(I,j)>0.5) then
1513+
14631514
z_top_l = 0.0
14641515
z_top_r = 0.0
14651516
P_Stokes_l = 0.0
@@ -1469,37 +1520,39 @@ subroutine Stokes_PGF(G, GV, h, u, v, PFu_Stokes, PFv_Stokes, CS )
14691520
h_r = h(i+1,j,k)
14701521
z_mid_l = z_top_l - 0.5*h_l
14711522
z_mid_r = z_top_r - 0.5*h_r
1472-
TwoKexpL = (2.*wavenum)*exp(2*wavenum*z_mid_l)
1473-
TwoKexpR = (2.*wavenum)*exp(2*wavenum*z_mid_r)
1474-
!UL -> I-1 & I, j
1475-
!UR -> I & I+1, j
1476-
!VL -> i, J-1 & J
1477-
!VR -> i+1, J-1 & J
1478-
dUs_dz_l = TwoKexpL*0.5 * &
1479-
(CS%Us0_x(I-1,j)*G%mask2dCu(I-1,j) + &
1480-
CS%Us0_x(I,j)*G%mask2dCu(I,j))
1481-
dUs_dz_r = TwoKexpR*0.5 * &
1482-
(CS%Us0_x(I,j)*G%mask2dCu(I,j) + &
1483-
CS%Us0_x(I+1,j)*G%mask2dCu(I+1,j))
1484-
dVs_dz_l = TwoKexpL*0.5 * &
1485-
(CS%Us0_y(i,J-1)*G%mask2dCv(i,J-1) + &
1486-
CS%Us0_y(i,J)*G%mask2dCv(i,J))
1487-
dVs_dz_r = TwoKexpR*0.5 * &
1488-
(CS%Us0_y(i+1,J-1)*G%mask2dCv(i+1,J-1) + &
1489-
CS%Us0_y(i+1,J)*G%mask2dCv(i+1,J))
1490-
u_l = 0.5*(u(I-1,j,k)*G%mask2dCu(I-1,j) + &
1491-
u(I,j,k)*G%mask2dCu(I,j))
1492-
u_r = 0.5*(u(I,j,k)*G%mask2dCu(I,j) + &
1493-
u(I+1,j,k)*G%mask2dCu(I+1,j))
1494-
v_l = 0.5*(v(i,J-1,k)*G%mask2dCv(i,J-1) + &
1495-
v(i,J,k)*G%mask2dCv(i,J))
1496-
v_r = 0.5*(v(i+1,J-1,k)*G%mask2dCv(i+1,J-1) + &
1497-
v(i+1,J,k)*G%mask2dCv(i+1,J))
1498-
if (G%mask2dT(i,j)>0.5) &
1499-
P_Stokes_l = P_Stokes_l + h_l*(dUs_dz_l*u_l+dVs_dz_l*v_l)
1500-
if (G%mask2dT(i+1,j)>0.5) &
1501-
P_Stokes_r = P_Stokes_r + h_r*(dUs_dz_r*u_r+dVs_dz_r*v_r)
1502-
PFu_Stokes(I,j,k) = (P_Stokes_r - P_Stokes_l)*G%IdxCu(I,j)
1523+
do l = 1, CS%numbands
1524+
TwoKexpL = (2.*CS%WaveNum_Cen(l))*exp(2*CS%WaveNum_Cen(l)*z_mid_l)
1525+
TwoKexpR = (2.*CS%WaveNum_Cen(l))*exp(2*CS%WaveNum_Cen(l)*z_mid_r)
1526+
!UL -> I-1 & I, j
1527+
!UR -> I & I+1, j
1528+
!VL -> i, J-1 & J
1529+
!VR -> i+1, J-1 & J
1530+
dUs_dz_l = TwoKexpL*0.5 * &
1531+
(CS%Stkx0(I-1,j,l)*G%mask2dCu(I-1,j) + &
1532+
CS%Stkx0(I,j,l)*G%mask2dCu(I,j))
1533+
dUs_dz_r = TwoKexpR*0.5 * &
1534+
(CS%Stkx0(I,j,l)*G%mask2dCu(I,j) + &
1535+
CS%Stkx0(I+1,j,l)*G%mask2dCu(I+1,j))
1536+
dVs_dz_l = TwoKexpL*0.5 * &
1537+
(CS%Stky0(i,J-1,l)*G%mask2dCv(i,J-1) + &
1538+
CS%Stky0(i,J,l)*G%mask2dCv(i,J))
1539+
dVs_dz_r = TwoKexpR*0.5 * &
1540+
(CS%Stky0(i+1,J-1,l)*G%mask2dCv(i+1,J-1) + &
1541+
CS%Stky0(i+1,J,l)*G%mask2dCv(i+1,J))
1542+
u_l = 0.5*(u(I-1,j,k)*G%mask2dCu(I-1,j) + &
1543+
u(I,j,k)*G%mask2dCu(I,j))
1544+
u_r = 0.5*(u(I,j,k)*G%mask2dCu(I,j) + &
1545+
u(I+1,j,k)*G%mask2dCu(I+1,j))
1546+
v_l = 0.5*(v(i,J-1,k)*G%mask2dCv(i,J-1) + &
1547+
v(i,J,k)*G%mask2dCv(i,J))
1548+
v_r = 0.5*(v(i+1,J-1,k)*G%mask2dCv(i+1,J-1) + &
1549+
v(i+1,J,k)*G%mask2dCv(i+1,J))
1550+
if (G%mask2dT(i,j)>0.5) &
1551+
P_Stokes_l = P_Stokes_l + h_l*(dUs_dz_l*u_l+dVs_dz_l*v_l)
1552+
if (G%mask2dT(i+1,j)>0.5) &
1553+
P_Stokes_r = P_Stokes_r + h_r*(dUs_dz_r*u_r+dVs_dz_r*v_r)
1554+
PFu_Stokes(I,j,k) = PFu_Stokes(I,j,k) + (P_Stokes_r - P_Stokes_l)*G%IdxCu(I,j)
1555+
enddo
15031556
z_top_l = z_top_l - h_l
15041557
z_top_r = z_top_r - h_r
15051558
enddo
@@ -1516,37 +1569,39 @@ subroutine Stokes_PGF(G, GV, h, u, v, PFu_Stokes, PFv_Stokes, CS )
15161569
h_r = h(i,j+1,k)
15171570
z_mid_l = z_top_l - 0.5*h_l
15181571
z_mid_r = z_top_r - 0.5*h_r
1519-
TwoKexpL = (2.*wavenum)*exp(2*wavenum*z_mid_l)
1520-
TwoKexpR = (2.*wavenum)*exp(2*wavenum*z_mid_r)
1521-
!UL -> I-1 & I, j
1522-
!UR -> I-1 & I, j+1
1523-
!VL -> i, J & J-1
1524-
!VR -> i, J & J+1
1525-
dUs_dz_l = TwoKexpL*0.5 * &
1526-
(CS%Us0_x(I-1,j)*G%mask2dCu(I-1,j) + &
1527-
CS%Us0_x(I,j)*G%mask2dCu(I,j))
1528-
dUs_dz_r = TwoKexpR*0.5 * &
1529-
(CS%Us0_x(I-1,j+1)*G%mask2dCu(I-1,j+1) + &
1530-
CS%Us0_x(I,j+1)*G%mask2dCu(I,j+1))
1531-
dVs_dz_l = TwoKexpL*0.5 * &
1532-
(CS%Us0_y(i,J-1)*G%mask2dCv(i,J-1) + &
1533-
CS%Us0_y(i,J)*G%mask2dCv(i,J))
1534-
dVs_dz_r = TwoKexpR*0.5 * &
1535-
(CS%Us0_y(i,J)*G%mask2dCv(i,J) + &
1536-
CS%Us0_y(i,J+1)*G%mask2dCv(i,J+1))
1537-
u_l = 0.5*(u(I-1,j,k)*G%mask2dCu(I-1,j) + &
1538-
u(I,j,k)*G%mask2dCu(I,j))
1539-
u_r = 0.5*(u(I-1,j+1,k)*G%mask2dCu(I-1,j+1) + &
1540-
u(I,j+1,k)*G%mask2dCu(I,j+1))
1541-
v_l = 0.5*(v(i,J-1,k)*G%mask2dCv(i,J-1) + &
1542-
v(i,J,k)*G%mask2dCv(i,J))
1543-
v_r = 0.5*(v(i,J,k)*G%mask2dCv(i,J) + &
1544-
v(i,J+1,k)*G%mask2dCv(i,J+1))
1545-
if (G%mask2dT(i,j)>0.5) &
1546-
P_Stokes_l = P_Stokes_l + h_l*(dUs_dz_l*u_l+dVs_dz_l*v_l)
1547-
if (G%mask2dT(i,j+1)>0.5) &
1548-
P_Stokes_r = P_Stokes_r + h_r*(dUs_dz_r*u_r+dVs_dz_r*v_r)
1549-
PFv_Stokes(i,J,k) = (P_Stokes_r - P_Stokes_l)*G%IdyCv(i,J)
1572+
do l = 1, CS%numbands
1573+
TwoKexpL = (2.*CS%WaveNum_Cen(l))*exp(2*CS%WaveNum_Cen(l)*z_mid_l)
1574+
TwoKexpR = (2.*CS%WaveNum_Cen(l))*exp(2*CS%WaveNum_Cen(l)*z_mid_r)
1575+
!UL -> I-1 & I, j
1576+
!UR -> I-1 & I, j+1
1577+
!VL -> i, J & J-1
1578+
!VR -> i, J & J+1
1579+
dUs_dz_l = TwoKexpL*0.5 * &
1580+
(CS%Stkx0(I-1,j,l)*G%mask2dCu(I-1,j) + &
1581+
CS%Stkx0(I,j,l)*G%mask2dCu(I,j))
1582+
dUs_dz_r = TwoKexpR*0.5 * &
1583+
(CS%Stkx0(I-1,j+1,l)*G%mask2dCu(I-1,j+1) + &
1584+
CS%Stkx0(I,j+1,l)*G%mask2dCu(I,j+1))
1585+
dVs_dz_l = TwoKexpL*0.5 * &
1586+
(CS%Stky0(i,J-1,l)*G%mask2dCv(i,J-1) + &
1587+
CS%Stky0(i,J,l)*G%mask2dCv(i,J))
1588+
dVs_dz_r = TwoKexpR*0.5 * &
1589+
(CS%Stky0(i,J,l)*G%mask2dCv(i,J) + &
1590+
CS%Stky0(i,J+1,l)*G%mask2dCv(i,J+1))
1591+
u_l = 0.5*(u(I-1,j,k)*G%mask2dCu(I-1,j) + &
1592+
u(I,j,k)*G%mask2dCu(I,j))
1593+
u_r = 0.5*(u(I-1,j+1,k)*G%mask2dCu(I-1,j+1) + &
1594+
u(I,j+1,k)*G%mask2dCu(I,j+1))
1595+
v_l = 0.5*(v(i,J-1,k)*G%mask2dCv(i,J-1) + &
1596+
v(i,J,k)*G%mask2dCv(i,J))
1597+
v_r = 0.5*(v(i,J,k)*G%mask2dCv(i,J) + &
1598+
v(i,J+1,k)*G%mask2dCv(i,J+1))
1599+
if (G%mask2dT(i,j)>0.5) &
1600+
P_Stokes_l = P_Stokes_l + h_l*(dUs_dz_l*u_l+dVs_dz_l*v_l)
1601+
if (G%mask2dT(i,j+1)>0.5) &
1602+
P_Stokes_r = P_Stokes_r + h_r*(dUs_dz_r*u_r+dVs_dz_r*v_r)
1603+
PFv_Stokes(i,J,k) = PFv_Stokes(i,J,k) + (P_Stokes_r - P_Stokes_l)*G%IdyCv(i,J)
1604+
enddo
15501605
z_top_l = z_top_l - h_l
15511606
z_top_r = z_top_r - h_r
15521607
enddo
@@ -1558,53 +1613,7 @@ subroutine Stokes_PGF(G, GV, h, u, v, PFu_Stokes, PFv_Stokes, CS )
15581613
if (CS%id_PFu_Stokes>0) &
15591614
call post_data(CS%id_PFu_Stokes, PFu_Stokes, CS%diag)
15601615

1561-
end subroutine Stokes_PGF
1562-
1563-
!> Solver to add Coriolis-Stokes to model
1564-
!! Still in development and not meant for general use.
1565-
!! Can be activated (with code intervention) for LES comparison
1566-
!! CHECK THAT RIGHT TIMESTEP IS PASSED IF YOU USE THIS**
1567-
!!
1568-
!! Not accessed in the standard code.
1569-
subroutine CoriolisStokes(G, GV, dt, h, u, v, WAVES, US)
1570-
type(ocean_grid_type), &
1571-
intent(in) :: G !< Ocean grid
1572-
type(verticalGrid_type), &
1573-
intent(in) :: GV !< Ocean vertical grid
1574-
real, intent(in) :: dt !< Time step of MOM6 [T ~> s]
1575-
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
1576-
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
1577-
real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), &
1578-
intent(inout) :: u !< Velocity i-component [L T-1 ~> m s-1]
1579-
real, dimension(SZI_(G),SZJB_(G),SZK_(GV)), &
1580-
intent(inout) :: v !< Velocity j-component [L T-1 ~> m s-1]
1581-
type(Wave_parameters_CS), &
1582-
pointer :: Waves !< Surface wave related control structure.
1583-
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
1584-
! Local variables
1585-
real :: DVel ! A rescaled velocity change [L T-2 ~> m s-2]
1586-
integer :: i,j,k
1587-
1588-
do k = 1, GV%ke
1589-
do j = G%jsc, G%jec
1590-
do I = G%iscB, G%iecB
1591-
DVel = 0.25*(WAVES%us_y(i,j+1,k)+WAVES%us_y(i-1,j+1,k))*G%CoriolisBu(i,j+1) + &
1592-
0.25*(WAVES%us_y(i,j,k)+WAVES%us_y(i-1,j,k))*G%CoriolisBu(i,j)
1593-
u(I,j,k) = u(I,j,k) + DVEL*dt
1594-
enddo
1595-
enddo
1596-
enddo
1597-
1598-
do k = 1, GV%ke
1599-
do J = G%jscB, G%jecB
1600-
do i = G%isc, G%iec
1601-
DVel = 0.25*(WAVES%us_x(i+1,j,k)+WAVES%us_x(i+1,j-1,k))*G%CoriolisBu(i+1,j) + &
1602-
0.25*(WAVES%us_x(i,j,k)+WAVES%us_x(i,j-1,k))*G%CoriolisBu(i,j)
1603-
v(i,J,k) = v(i,j,k) - DVEL*dt
1604-
enddo
1605-
enddo
1606-
enddo
1607-
end subroutine CoriolisStokes
1616+
end subroutine Stokes_PGF_Add_FD
16081617

16091618
!> Computes wind speed from ustar_air based on COARE 3.5 Cd relationship
16101619
!! Probably doesn't belong in this module, but it is used here to estimate

0 commit comments

Comments
 (0)