Skip to content

Commit

Permalink
Updates to Stokes drift terms, primarily the pressure gradient routine.
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
breichl committed Jan 14, 2022
1 parent dc93bde commit 58874a5
Show file tree
Hide file tree
Showing 4 changed files with 321 additions and 172 deletions.
18 changes: 15 additions & 3 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -657,16 +657,15 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
else
CS%p_surf_end => forces%p_surf
endif

if (CS%UseWaves) then
! Update wave information, which is presently kept static over each call to step_mom
call enable_averages(time_interval, Time_start + real_to_time(US%T_to_s*time_interval), CS%diag)
call Update_Stokes_Drift(G, GV, US, Waves, h, forces%ustar, time_interval)
call Update_Stokes_Drift(G, GV, US, Waves, h, forces%ustar, time_interval, do_dyn)
call disable_averaging(CS%diag)
endif
else ! not do_dyn.
if (CS%UseWaves) then ! Diagnostics are not enabled in this call.
call Update_Stokes_Drift(G, GV, US, Waves, h, fluxes%ustar, time_interval)
call Update_Stokes_Drift(G, GV, US, Waves, h, fluxes%ustar, time_interval, do_dyn)
endif
endif

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

if (CS%thickness_diffuse .and. .not.CS%thickness_diffuse_first) then
call cpu_clock_begin(id_clock_thick_diff)
Expand Down
4 changes: 2 additions & 2 deletions src/core/MOM_CoriolisAdv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1353,11 +1353,11 @@ subroutine CoriolisAdv_init(Time, G, GV, US, param_file, diag, AD, CS)
'Zonal Acceleration from Relative Vorticity', 'm s-2', conversion=US%L_T2_to_m_s2)
if (CS%id_rvxv > 0) call safe_alloc_ptr(AD%rv_x_v,IsdB,IedB,jsd,jed,nz)

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

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

Expand Down
9 changes: 5 additions & 4 deletions src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module MOM_dynamics_split_RK2
use MOM_vert_friction, only : updateCFLtruncationValue
use MOM_verticalGrid, only : verticalGrid_type, get_thickness_units
use MOM_verticalGrid, only : get_flux_units, get_tr_flux_units
use MOM_wave_interface, only: wave_parameters_CS, Stokes_PGF_Add_FD
use MOM_wave_interface, only: wave_parameters_CS, Stokes_PGF

implicit none ; private

Expand Down Expand Up @@ -478,10 +478,11 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, Time_local, dt, forces, p_s
Use_Stokes_PGF = associated(Waves)
if (Use_Stokes_PGF) Use_Stokes_PGF = Waves%Stokes_PGF
if (Use_Stokes_PGF) then
call Stokes_PGF_Add_FD(G, GV, h, u, v, CS%PFu_Stokes, CS%PFv_Stokes, Waves)
call Stokes_PGF(G, GV, h, u, v, CS%PFu_Stokes, CS%PFv_Stokes, Waves)

! We are adding Stokes_PGF to hydrostatic PGF here. The diag PFu/PFv
! will therefore report the sum total PGF and we avoid other
! modifications in the code. The PFu_Stokes can be output within the waves routines.
! modifications in the code. The PFu_Stokes is output within the waves routines.
if (.not.Waves%Passive_Stokes_PGF) then
do k=1,nz
do j=js,je ; do I=Isq,Ieq
Expand Down Expand Up @@ -740,7 +741,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, Time_local, dt, forces, p_s
Use_Stokes_PGF = associated(Waves)
if (Use_Stokes_PGF) Use_Stokes_PGF = Waves%Stokes_PGF
if (Use_Stokes_PGF) then
call Stokes_PGF_Add_FD(G, GV, h, u, v, CS%PFu_Stokes, CS%PFv_Stokes, Waves)
call Stokes_PGF(G, GV, h, u, v, CS%PFu_Stokes, CS%PFv_Stokes, Waves)
if (.not.Waves%Passive_Stokes_PGF) then
do k=1,nz
do j=js,je ; do I=Isq,Ieq
Expand Down
Loading

0 comments on commit 58874a5

Please sign in to comment.