Stokes Drift¶
Stokes-drift profiles for Langmuir turbulence parameterisations. Multiple source options are supported: constant, exponential, file-based, or theoretical wave spectra (Li et al., 2017). Langmuir numbers \(La_{\rm Turb}\), \(La_{\rm SL}\), \(La_{\rm SLP}\) and enhancement factors are diagnosed from the Stokes drift and wind forcing.
Stokes-drift forcing for Langmuir turbulence.
Provides Stokes drift profiles \(u_s(z)\) and \(v_s(z)\) from several sources: a constant profile, an exponential wave-spectrum approximation, directional wave spectra read from file, or theoretical monochromatic wave theory. The Langmuir number \(La = \sqrt{u_\tau / u_s^{\rm surface}}\) is diagnosed for output.
- class pygotm.stokes_drift.StokesDriftState(usprof_method=0, vsprof_method=0, dusdz_method=0, dvsdz_method=0, uwnd_method=0, vwnd_method=0, us0_method=0, vs0_method=0, ds_method=0, us0=0.0, vs0=0.0, ds=5.0, uwnd=0.0, vwnd=0.0, usprof=None, vsprof=None, dusdz=None, dvsdz=None, stokes_srf=None, us0_input=None, vs0_input=None, ds_input=None, uwnd_input=None, vwnd_input=None, usprof_input=None, vsprof_input=None, dusdz_input=None, dvsdz_input=None, La_Turb=1000000000000.0, La_SL=1000000000000.0, La_SLP_VR12=1000000000000.0, La_SLP_RWH16=1000000000000.0, EFactor_LWF16=1.0, EFactor_RWH16=1.0, theta_WW=0.0, theta_WL=0.0)[source]¶
Bases:
objectState owned by the translated
stokes_driftmodule.- Parameters:
usprof_method (int)
vsprof_method (int)
dusdz_method (int)
dvsdz_method (int)
uwnd_method (int)
vwnd_method (int)
us0_method (int)
vs0_method (int)
ds_method (int)
us0 (float)
vs0 (float)
ds (float)
uwnd (float)
vwnd (float)
usprof (ndarray | None)
vsprof (ndarray | None)
dusdz (ndarray | None)
dvsdz (ndarray | None)
stokes_srf (ndarray | None)
us0_input (ScalarInput | None)
vs0_input (ScalarInput | None)
ds_input (ScalarInput | None)
uwnd_input (ScalarInput | None)
vwnd_input (ScalarInput | None)
usprof_input (ProfileInput | None)
vsprof_input (ProfileInput | None)
dusdz_input (ProfileInput | None)
dvsdz_input (ProfileInput | None)
La_Turb (float)
La_SL (float)
La_SLP_VR12 (float)
La_SLP_RWH16 (float)
EFactor_LWF16 (float)
EFactor_RWH16 (float)
theta_WW (float)
theta_WL (float)
-
ds_input:
ScalarInput|None= None¶
-
dusdz_input:
ProfileInput|None= None¶
-
dvsdz_input:
ProfileInput|None= None¶
-
us0_input:
ScalarInput|None= None¶
-
usprof_input:
ProfileInput|None= None¶
-
uwnd_input:
ScalarInput|None= None¶
-
vs0_input:
ScalarInput|None= None¶
-
vsprof_input:
ProfileInput|None= None¶
-
vwnd_input:
ScalarInput|None= None¶
- pygotm.stokes_drift.clean_stokes_drift(state)[source]¶
Release Stokes drift arrays and registered input handles.
- Return type:
- Parameters:
state (StokesDriftState)
- pygotm.stokes_drift.do_stokes_drift(state, nlev, z, zi, gravity, u10, v10)[source]¶
Wrapper for all subroutines that calculate the Stokes drift profile.
- pygotm.stokes_drift.init_stokes_drift(state, **overrides)[source]¶
Initialise Stokes drift method selectors and scalar defaults.
- Return type:
- Parameters:
state (StokesDriftState)
- pygotm.stokes_drift.init_stokes_drift_yaml(state, settings=None)[source]¶
Apply GOTM YAML-style Stokes drift method selectors.
The driver owns input registration. This helper mirrors the Fortran method selection rules and is useful for tests and non-driver callers.
- Return type:
- Parameters:
state (StokesDriftState)
- pygotm.stokes_drift.langmuir_number(state, nlev, zi, hsw, u_taus, hbl, u10, v10)[source]¶
Compute Langmuir numbers and enhancement factors from Stokes drift.
- pygotm.stokes_drift.post_init_stokes_drift(state, nlev)[source]¶
Allocate memory and initialise Stokes drift diagnostics.
- Return type:
- Parameters:
state (StokesDriftState)
nlev (int)
Exponential Profile¶
Exponential Stokes drift profile — translation of stokes_drift_exp.F90.
Calculates the Stokes drift profile from the surface Stokes drift us0,
vs0 and the Stokes penetration depth ds, assuming an exponential
vertical profile. The profile is averaged analytically over each grid cell.
Provides a single-column Numba kernel stokes_drift_exp() and a
parallel batch variant stokes_drift_exp_batch() for ensemble use.
Original FORTRAN authors: Qing Li.
- pygotm.stokes_drift.stokes_drift_exp.stokes_drift_exp(nlev, z, zi, us0, vs0, ds, usprof, vsprof)[source]¶
Calculate a grid-cell-averaged exponential Stokes drift profile.
Theory-Wave Profile¶
Theory-wave Stokes drift — translation of stokes_drift_theory.F90.
Calculates Stokes drift profiles from surface wind speed using the empirical ‘theory-wave’ approximation of Li et al. (2017). Two Numba kernels are provided:
stokes_drift_theory_srf()— Stokes drift averaged over the surface layer at a single depth.stokes_drift_theory()— full vertical profile plus surface valuesus0,vs0, and Stokes depthds.
A parallel batch variant stokes_drift_theory_batch() is also provided
for ensemble use. The constant US0_TO_U10 = 0.0162 is the ratio of
surface Stokes drift to 10-m wind speed.
Original FORTRAN authors: Qing Li; re-added to GOTM by Brandon Reichl.
- pygotm.stokes_drift.stokes_drift_theory.stokes_drift_theory(nlev, z, zi, u10, v10, gravity, stokes_srf, usprof, vsprof)[source]¶
Calculate a Li et al. (2017) empirical theory-wave Stokes profile.