Modified Euler’s Method

This module contains the functions associated with the modified Euler time-stepping scheme. The associated coefficients and the method are outlined in the Methods section of this documentation.

SWAMPE.modEuler_tdiff.delta_timestep(etam0, etam1, deltam0, deltam1, Phim0, Phim1, I, J, M, N, Am, Bm, Cm, Dm, Em, Fm, Gm, Um, Vm, Pmn, Hmn, w, tstepcoeff1, tstepcoeff2, mJarray, narray, PhiFm, dt, a, Phibar, taurad, taudrag, forcflag, diffflag, sigma, sigmaPhi, test, t)

This function timesteps the divergence delta forward.

Parameters:
  • etam0 (array of float) – Fourier coefficents of absolute vorticity for one time step

  • etam1 (array of float) – Fourier coefficents of absolute vorticity for the following time step

  • deltam0 (array of float) – Fourier coefficents of divergence for one time step

  • deltam1 (array of float) – Fourier coefficents of divergence for the following time step

  • Phim0 (array of float) – Fourier coefficents of geopotential for one time step

  • Phim1 (array of float) – Fourier coefficents of geopotential for the following time step

  • I (int) – number of longitudes

  • J (int) – number of Gaussian latitudes

  • N (int) – highest degree of the Legendre functions for m=0

  • Am (array of float) – Fourier coefficients of the nonlinear component A=U*eta

  • Bm (array of float) – Fourier coefficients of the nonlinear component B=V*eta

  • Cm (array of float) – Fourier coefficients of the nonlinear component C=U*Phi

  • Dm (array of float) – Fourier coefficients of the nonlinear component D=V*Phi

  • Em (array of float) – Fourier coefficients of the nonlinear component E=(U^2+V^2)/(2(1-mu^2))

  • Fm (array of float) – Fourier coefficients of the zonal component of wind forcing

  • Gm (array of float) – Fourier coefficients of the meridional component of wind forcing

  • Um (array of float) – Fourier coefficients of the zonal component of wind

  • Vm (array of float) – Fourier coefficients of the meridional component of wind

  • fmn (array of float) – spectral coefficients of the Coriolis force

  • Pmn (array of float) – associated legendre functions evaluated at the Gaussian latitudes mus up to wavenumber M

  • Hmn (array of float) – derivatives of the associated legendre functions evaluated at the Gaussian latitudes mus up to wavenumber M

  • w (array of float) – Gauss Legendre weights

  • tstepcoeff (array of float) – coefficient for time-stepping of the form 2dt/(a(1-mus^2))

  • tstepcoeff2 (array of float) – time stepping coefficient of the form 2dt/a^2

  • tstepcoeffmn (array of float) – an array of coefficients a/(n(n+1))

  • marray (array of float) – coefficients equal to m=0,1,…,M in a matrix M+1xN+1

  • mJarray (array of float) – coefficients equal to m=0,1,…,M in a matrix M+1xJ

  • narray (array of float) – array n(n+1) in a matrix M+1xN+1

  • PhiFm – Fourier coefficients of the geopotential forcing

  • dt (float) – time step, in seconds

  • a (float) – planetary radius, m

  • Phibar (float) – time-invariant spatial mean geopotential, height of the top layer

  • taurad (float) – radiative timescale

  • taudrag (float) – drag timescale

  • forcflag (float) – forcing flag

  • diffflag (float) – hyperdiffusion filter flag

  • sigma (array of float) – hyperdiffusion filter coefficients for absolute vorticity and divergence

  • sigmaPhi (array of float) – hyperdiffusion filter coefficients for geopotential

  • test (int) – number of test, defaults to None

  • t (int) – number of current time step

Returns:

  • deltamntstep

    Updated spectral coefficients of divergence

  • newdeltatstep

    Updated divergence

Return type:

array of float

SWAMPE.modEuler_tdiff.eta_timestep(etam0, etam1, deltam0, deltam1, Phim0, Phim1, I, J, M, N, Am, Bm, Cm, Dm, Em, Fm, Gm, Um, Vm, Pmn, Hmn, w, tstepcoeff1, tstepcoeff2, mJarray, narray, PhiFm, dt, a, Phibar, taurad, taudrag, forcflag, diffflag, sigma, sigmaPhi, test, t)

This function timesteps the absolute vorticity eta forward.

Parameters:
  • etam0 (array of float) – Fourier coefficents of absolute vorticity for one time step

  • etam1 (array of float) – Fourier coefficents of absolute vorticity for the following time step

  • deltam0 (array of float) – Fourier coefficents of divergence for one time step

  • deltam1 (array of float) – Fourier coefficents of divergence for the following time step

  • Phim0 (array of float) – Fourier coefficents of geopotential for one time step

  • Phim1 (array of float) – Fourier coefficents of geopotential for the following time step

  • I (int) – number of longitudes

  • J (int) – number of Gaussian latitudes

  • N (int) – highest degree of the Legendre functions for m=0

  • Am (array of float) – Fourier coefficients of the nonlinear component A=U*eta

  • Bm (array of float) – Fourier coefficients of the nonlinear component B=V*eta

  • Cm (array of float) – Fourier coefficients of the nonlinear component C=U*Phi

  • Dm (array of float) – Fourier coefficients of the nonlinear component D=V*Phi

  • Em (array of float) – Fourier coefficients of the nonlinear component E=(U^2+V^2)/(2(1-mu^2))

  • Fm (array of float) – Fourier coefficients of the zonal component of wind forcing

  • Gm (array of float) – Fourier coefficients of the meridional component of wind forcing

  • Um (array of float) – Fourier coefficients of the zonal component of wind

  • Vm (array of float) – Fourier coefficients of the meridional component of wind

  • fmn (array of float) – spectral coefficients of the Coriolis force

  • Pmn (array of float) – associated legendre functions evaluated at the Gaussian latitudes mus up to wavenumber M

  • Hmn (array of float) – derivatives of the associated legendre functions evaluated at the Gaussian latitudes mus up to wavenumber M

  • w (array of float) – Gauss Legendre weights

  • tstepcoeff (array of float) – coefficient for time-stepping of the form 2dt/(a(1-mus^2))

  • tstepcoeff2 (array of float) – time stepping coefficient of the form 2dt/a^2

  • tstepcoeffmn (array of float) – an array of coefficients a/(n(n+1))

  • marray (array of float) – coefficients equal to m=0,1,…,M in a matrix M+1xN+1

  • mJarray (array of float) – coefficients equal to m=0,1,…,M in a matrix M+1xJ

  • narray (array of float) – array n(n+1) in a matrix M+1xN+1

  • PhiFm – Fourier coefficients of the geopotential forcing

  • dt (float) – time step, in seconds

  • a (float) – planetary radius, m

  • Phibar (float) – time-invariant spatial mean geopotential, height of the top layer

  • taurad (float) – radiative timescale

  • taudrag (float) – drag timescale

  • forcflag (float) – forcing flag

  • diffflag (float) – hyperdiffusion filter flag

  • sigma (array of float) – hyperdiffusion filter coefficients for absolute vorticity and divergence

  • sigmaPhi (array of float) – hyperdiffusion filter coefficients for geopotential

  • test (int) – number of test, defaults to None

  • t (int) – number of current time step

Returns:

  • etamntstep

    Updated spectral coefficients of absolute vorticity

  • newetatstep

    Updated absolute vorticity

Return type:

array of float

SWAMPE.modEuler_tdiff.phi_timestep(etam0, etam1, deltam0, deltam1, Phim0, Phim1, I, J, M, N, Am, Bm, Cm, Dm, Em, Fm, Gm, Um, Vm, Pmn, Hmn, w, tstepcoeff1, tstepcoeff2, mJarray, narray, PhiFm, dt, a, Phibar, taurad, taudrag, forcflag, diffflag, sigma, sigmaPhi, test, t)

This function timesteps the geopotential Phi forward.

Parameters:
  • etam0 (array of float) – Fourier coefficents of absolute vorticity for one time step

  • etam1 (array of float) – Fourier coefficents of absolute vorticity for the following time step

  • deltam0 (array of float) – Fourier coefficents of divergence for one time step

  • deltam1 (array of float) – Fourier coefficents of divergence for the following time step

  • Phim0 (array of float) – Fourier coefficents of geopotential for one time step

  • Phim1 (array of float) – Fourier coefficents of geopotential for the following time step

  • I (int) – number of longitudes

  • J (int) – number of Gaussian latitudes

  • N (int) – highest degree of the Legendre functions for m=0

  • Am (array of float) – Fourier coefficients of the nonlinear component A=U*eta

  • Bm (array of float) – Fourier coefficients of the nonlinear component B=V*eta

  • Cm (array of float) – Fourier coefficients of the nonlinear component C=U*Phi

  • Dm (array of float) – Fourier coefficients of the nonlinear component D=V*Phi

  • Em (array of float) – Fourier coefficients of the nonlinear component E=(U^2+V^2)/(2(1-mu^2))

  • Fm (array of float) – Fourier coefficients of the zonal component of wind forcing

  • Gm (array of float) – Fourier coefficients of the meridional component of wind forcing

  • Um (array of float) – Fourier coefficients of the zonal component of wind

  • Vm (array of float) – Fourier coefficients of the meridional component of wind

  • fmn (array of float) – spectral coefficients of the Coriolis force

  • Pmn (array of float) – associated legendre functions evaluated at the Gaussian latitudes mus up to wavenumber M

  • Hmn (array of float) – derivatives of the associated legendre functions evaluated at the Gaussian latitudes mus up to wavenumber M

  • w (array of float) – Gauss Legendre weights

  • tstepcoeff (array of float) – coefficient for time-stepping of the form 2dt/(a(1-mus^2))

  • tstepcoeff2 (array of float) – time stepping coefficient of the form 2dt/a^2

  • tstepcoeffmn (array of float) – an array of coefficients a/(n(n+1))

  • marray (array of float) – coefficients equal to m=0,1,…,M in a matrix M+1xN+1

  • mJarray (array of float) – coefficients equal to m=0,1,…,M in a matrix M+1xJ

  • narray (array of float) – array n(n+1) in a matrix M+1xN+1

  • PhiFm – Fourier coefficients of the geopotential forcing

  • dt (float) – time step, in seconds

  • a (float) – planetary radius, m

  • Phibar (float) – time-invariant spatial mean geopotential, height of the top layer

  • taurad (float) – radiative timescale

  • taudrag (float) – drag timescale

  • forcflag (float) – forcing flag

  • diffflag (float) – hyperdiffusion filter flag

  • sigma (array of float) – hyperdiffusion filter coefficients for absolute vorticity and divergence

  • sigmaPhi (array of float) – hyperdiffusion filter coefficients for geopotential

  • test (int) – number of test, defaults to None

  • t (int) – number of current time step

Returns:

  • Phimntstep

    Updated spectral coefficients of geopotential

  • newPhitstep

    Updated geopotential

Return type:

array of float