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

Skip to content

Commit 58874a5

Browse files
brandon.reichlbrandon.reichl
authored andcommitted
Updates to Stokes drift terms, primarily the pressure gradient routine.
- Replaces Stokes-induced pressure anomaly gradient routine with more accurate method that explicitly integrates the Stokes-shear force contribution to the pressure. Includes diagnostics for the pressure anomaly to verify. - Updates the Stokes time derivative to only be updated on dynamics time-steps. Adds additional storage of previous step that is also only updated on the dynamics time-steps. - Update so that the surface Stokes drift output when using the exponential surfbands option is the surface Stokes drift and not averaged over a layer near the surface. - Minor rename for clarity in Update_Surface_Waves using data_override to clarify the time that wave terms are computed. - Adds diagnostic tracking Stokes time tendency term for verification. - Updates Stokes diagnostic names for conformity. - Fix allocation of CS%STKy0 from u grid to v grid.
1 parent dc93bde commit 58874a5

4 files changed

Lines changed: 321 additions & 172 deletions

File tree

src/core/MOM.F90

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,16 +657,15 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
657657
else
658658
CS%p_surf_end => forces%p_surf
659659
endif
660-
661660
if (CS%UseWaves) then
662661
! Update wave information, which is presently kept static over each call to step_mom
663662
call enable_averages(time_interval, Time_start + real_to_time(US%T_to_s*time_interval), CS%diag)
664-
call Update_Stokes_Drift(G, GV, US, Waves, h, forces%ustar, time_interval)
663+
call Update_Stokes_Drift(G, GV, US, Waves, h, forces%ustar, time_interval, do_dyn)
665664
call disable_averaging(CS%diag)
666665
endif
667666
else ! not do_dyn.
668667
if (CS%UseWaves) then ! Diagnostics are not enabled in this call.
669-
call Update_Stokes_Drift(G, GV, US, Waves, h, fluxes%ustar, time_interval)
668+
call Update_Stokes_Drift(G, GV, US, Waves, h, fluxes%ustar, time_interval, do_dyn)
670669
endif
671670
endif
672671

@@ -1108,6 +1107,19 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, &
11081107
enddo; enddo
11091108
call pass_vector(u,v,G%Domain)
11101109
endif
1110+
! Added an additional output to track Stokes drift time tendency.
1111+
! It is mostly for debugging, and perhaps doesn't need to hang
1112+
! around permanently.
1113+
if (Waves%Stokes_DDT .and. (Waves%id_3dstokes_y_from_ddt>0)) then
1114+
do J=jsq,jeq ; do i=is,ie
1115+
Waves%us_y_from_ddt(i,J,:) = Waves%us_y_from_ddt(i,J,:) + Waves%ddt_us_y(i,J,:)*dt
1116+
enddo; enddo
1117+
endif
1118+
if (Waves%Stokes_DDT .and. (Waves%id_3dstokes_x_from_ddt>0)) then
1119+
do j=js,je ; do I=isq,ieq
1120+
Waves%us_x_from_ddt(I,j,:) = Waves%us_x_from_ddt(I,j,:) + Waves%ddt_us_x(I,j,:)*dt
1121+
enddo; enddo
1122+
endif
11111123

11121124
if (CS%thickness_diffuse .and. .not.CS%thickness_diffuse_first) then
11131125
call cpu_clock_begin(id_clock_thick_diff)

src/core/MOM_CoriolisAdv.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,11 +1353,11 @@ subroutine CoriolisAdv_init(Time, G, GV, US, param_file, diag, AD, CS)
13531353
'Zonal Acceleration from Relative Vorticity', 'm s-2', conversion=US%L_T2_to_m_s2)
13541354
if (CS%id_rvxv > 0) call safe_alloc_ptr(AD%rv_x_v,IsdB,IedB,jsd,jed,nz)
13551355

1356-
CS%id_CAuS = register_diag_field('ocean_model', 'CAuS', diag%axesCuL, Time, &
1356+
CS%id_CAuS = register_diag_field('ocean_model', 'CAu_Stokes', diag%axesCuL, Time, &
13571357
'Zonal Acceleration from Stokes Vorticity', 'm-1 s-2', conversion=US%L_T2_to_m_s2)
13581358
! add to AD
13591359

1360-
CS%id_CAvS = register_diag_field('ocean_model', 'CAvS', diag%axesCvL, Time, &
1360+
CS%id_CAvS = register_diag_field('ocean_model', 'CAv_Stokes', diag%axesCvL, Time, &
13611361
'Meridional Acceleration from Stokes Vorticity', 'm-1 s-2', conversion=US%L_T2_to_m_s2)
13621362
! add to AD
13631363

src/core/MOM_dynamics_split_RK2.F90

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ module MOM_dynamics_split_RK2
6666
use MOM_vert_friction, only : updateCFLtruncationValue
6767
use MOM_verticalGrid, only : verticalGrid_type, get_thickness_units
6868
use MOM_verticalGrid, only : get_flux_units, get_tr_flux_units
69-
use MOM_wave_interface, only: wave_parameters_CS, Stokes_PGF_Add_FD
69+
use MOM_wave_interface, only: wave_parameters_CS, Stokes_PGF
7070

7171
implicit none ; private
7272

@@ -478,10 +478,11 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, Time_local, dt, forces, p_s
478478
Use_Stokes_PGF = associated(Waves)
479479
if (Use_Stokes_PGF) Use_Stokes_PGF = Waves%Stokes_PGF
480480
if (Use_Stokes_PGF) then
481-
call Stokes_PGF_Add_FD(G, GV, h, u, v, CS%PFu_Stokes, CS%PFv_Stokes, Waves)
481+
call Stokes_PGF(G, GV, h, u, v, CS%PFu_Stokes, CS%PFv_Stokes, Waves)
482+
482483
! We are adding Stokes_PGF to hydrostatic PGF here. The diag PFu/PFv
483484
! will therefore report the sum total PGF and we avoid other
484-
! modifications in the code. The PFu_Stokes can be output within the waves routines.
485+
! modifications in the code. The PFu_Stokes is output within the waves routines.
485486
if (.not.Waves%Passive_Stokes_PGF) then
486487
do k=1,nz
487488
do j=js,je ; do I=Isq,Ieq
@@ -740,7 +741,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, Time_local, dt, forces, p_s
740741
Use_Stokes_PGF = associated(Waves)
741742
if (Use_Stokes_PGF) Use_Stokes_PGF = Waves%Stokes_PGF
742743
if (Use_Stokes_PGF) then
743-
call Stokes_PGF_Add_FD(G, GV, h, u, v, CS%PFu_Stokes, CS%PFv_Stokes, Waves)
744+
call Stokes_PGF(G, GV, h, u, v, CS%PFu_Stokes, CS%PFv_Stokes, Waves)
744745
if (.not.Waves%Passive_Stokes_PGF) then
745746
do k=1,nz
746747
do j=js,je ; do I=Isq,Ieq

0 commit comments

Comments
 (0)