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: object

State owned by the translated stokes_drift module.

Parameters:
EFactor_LWF16: float = 1.0
EFactor_RWH16: float = 1.0
La_SL: float = 1000000000000.0
La_SLP_RWH16: float = 1000000000000.0
La_SLP_VR12: float = 1000000000000.0
La_Turb: float = 1000000000000.0
ds: float = 5.0
ds_input: ScalarInput | None = None
ds_method: int = 0
dusdz: ndarray | None = None
dusdz_input: ProfileInput | None = None
dusdz_method: int = 0
dvsdz: ndarray | None = None
dvsdz_input: ProfileInput | None = None
dvsdz_method: int = 0
stokes_srf: ndarray | None = None
theta_WL: float = 0.0
theta_WW: float = 0.0
us0: float = 0.0
us0_input: ScalarInput | None = None
us0_method: int = 0
usprof: ndarray | None = None
usprof_input: ProfileInput | None = None
usprof_method: int = 0
uwnd: float = 0.0
uwnd_input: ScalarInput | None = None
uwnd_method: int = 0
vs0: float = 0.0
vs0_input: ScalarInput | None = None
vs0_method: int = 0
vsprof: ndarray | None = None
vsprof_input: ProfileInput | None = None
vsprof_method: int = 0
vwnd: float = 0.0
vwnd_input: ScalarInput | None = None
vwnd_method: int = 0
pygotm.stokes_drift.clean_stokes_drift(state)[source]

Release Stokes drift arrays and registered input handles.

Return type:

None

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.

Return type:

None

Parameters:
pygotm.stokes_drift.init_stokes_drift(state, **overrides)[source]

Initialise Stokes drift method selectors and scalar defaults.

Return type:

None

Parameters:
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:

None

Parameters:
pygotm.stokes_drift.langmuir_number(state, nlev, zi, hsw, u_taus, hbl, u10, v10)[source]

Compute Langmuir numbers and enhancement factors from Stokes drift.

Return type:

None

Parameters:
pygotm.stokes_drift.post_init_stokes_drift(state, nlev)[source]

Allocate memory and initialise Stokes drift diagnostics.

Return type:

None

Parameters:

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.

Return type:

None

Parameters:
pygotm.stokes_drift.stokes_drift_exp.stokes_drift_exp_batch(batch_size, nlev, z, zi, us0, vs0, ds, usprof, vsprof)[source]

Batch exponential Stokes drift profile over independent columns.

Return type:

None

Parameters:

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:

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.

Return type:

tuple[float, float, float]

Parameters:
pygotm.stokes_drift.stokes_drift_theory.stokes_drift_theory_batch(batch_size, nlev, z, zi, u10, v10, gravity, stokes_srf, usprof, vsprof, scalars)[source]

Batch empirical theory-wave Stokes drift profile.

Return type:

None

Parameters:
pygotm.stokes_drift.stokes_drift_theory.stokes_drift_theory_srf(u10, z_srf, gravity, us0_to_u10=0.0162)[source]

Return Stokes drift averaged over the surface layer.

Return type:

float

Parameters: