legendre Module

For computing direct and inverse Legendre transforms.


Uses

  • module~~legendre~~UsesGraph module~legendre legendre module~geometry geometry module~legendre->module~geometry module~types types module~legendre->module~types module~params params module~legendre->module~params module~geometry->module~types module~geometry->module~params iso_fortran_env iso_fortran_env module~types->iso_fortran_env module~params->module~types

Used by

  • module~~legendre~~UsedByGraph module~legendre legendre proc~modfourier_delete ModFourier_delete proc~modfourier_delete->module~legendre module~fourier fourier module~fourier->module~legendre proc~gen_sppt gen_sppt proc~gen_sppt->module~legendre module~spectral spectral proc~gen_sppt->module~spectral proc~modfourier_initialize ModFourier_initialize proc~modfourier_initialize->module~legendre module~spectral->module~fourier proc~modspectral_delete ModSpectral_delete proc~modspectral_delete->module~fourier proc~modspectral_initialize ModSpectral_initialize proc~modspectral_initialize->module~fourier module~model_state model_state module~model_state->module~spectral module~prognostics prognostics module~prognostics->module~spectral module~prognostics->module~model_state module~time_stepping time_stepping module~time_stepping->module~spectral proc~check_diagnostics check_diagnostics proc~check_diagnostics->module~spectral proc~get_grid_point_tendencies get_grid_point_tendencies proc~get_grid_point_tendencies->module~spectral proc~get_grid_point_tendencies->module~model_state proc~get_spectral_tendencies get_spectral_tendencies proc~get_spectral_tendencies->module~spectral proc~get_spectral_tendencies->module~model_state proc~get_physical_tendencies get_physical_tendencies proc~get_physical_tendencies->module~spectral proc~get_physical_tendencies->module~model_state proc~do_single_step do_single_step proc~do_single_step->module~spectral proc~do_single_step->module~model_state proc~do_single_step->module~time_stepping proc~get_tendencies get_tendencies proc~get_tendencies->module~model_state proc~initialize_geopotential initialize_geopotential proc~initialize_geopotential->module~model_state proc~modelstate_init_sst_anom modelstate_init_sst_anom proc~modelstate_init_sst_anom->module~model_state proc~initialize_boundaries initialize_boundaries proc~initialize_boundaries->module~model_state proc~land_model_init land_model_init proc~land_model_init->module~model_state proc~initialize_coupler initialize_coupler proc~initialize_coupler->module~model_state proc~run_land_model run_land_model proc~run_land_model->module~model_state proc~set_forcing set_forcing proc~set_forcing->module~model_state proc~transform_spectral2grid transform_spectral2grid proc~transform_spectral2grid->module~prognostics proc~apply_grid_filter apply_grid_filter proc~apply_grid_filter->module~prognostics proc~sea_model_init sea_model_init proc~sea_model_init->module~model_state proc~run_sea_model run_sea_model proc~run_sea_model->module~model_state module~speedy_driver speedy_driver module~speedy_driver->module~model_state proc~transform_grid2spectral transform_grid2spectral proc~transform_grid2spectral->module~prognostics proc~couple_sea_land couple_sea_land proc~couple_sea_land->module~model_state proc~couple_land_atm couple_land_atm proc~couple_land_atm->module~model_state proc~set_geopotential set_geopotential proc~set_geopotential->module~model_state proc~first_step first_step proc~first_step->module~model_state proc~initialize_state initialize_state proc~initialize_state->module~model_state proc~initialize_state->module~prognostics proc~initialize_state->module~time_stepping proc~get_zonal_average_fields get_zonal_average_fields proc~get_zonal_average_fields->module~model_state proc~get_shortwave_rad_fluxes get_shortwave_rad_fluxes proc~get_shortwave_rad_fluxes->module~model_state proc~step step proc~step->module~model_state proc~couple_sea_atm couple_sea_atm proc~couple_sea_atm->module~model_state

Contents


Derived Types

type, public :: ModLegendre_t

Legendre module variables

Components

TypeVisibility AttributesNameInitial
logical, private :: mod_legendre_initialized =.false.
real(kind=8), private, allocatable, dimension(:, :):: epsi
real(kind=8), private, allocatable, dimension(:, :, :):: cpol
real(kind=8), private, allocatable, dimension(:, :):: repsi
integer, private, allocatable, dimension(:):: nsh2
real(kind=8), private, allocatable, dimension(:):: wt
class(ModGeometry_t), private, pointer:: mod_geometry=> null()

Spectral module instance

logical, private :: mod_geometry_initialized =.false.

Type-Bound Procedures

procedure, public :: initialize => ModLegendre_initialize
procedure, public :: legendre => ModLegendre_legendre
procedure, public :: legendre_inv => ModLegendre_legendre_inv
procedure, public :: delete => ModLegendre_delete
procedure, public :: legendre_poly => ModLegendre_legendre_poly

Functions

private function ModLegendre_legendre_inv(this, input) result(output)

Computes inverse Legendre transformation. The Legendre polynomials (cpol) and the triangular shape definition (nsh2) needs to be initialized and passed to the function.

Arguments

Type IntentOptional AttributesName
class(ModLegendre_t), intent(in) :: this
real(kind=p), intent(in) :: input(2*mx,nx)

Input field

Return Value real(kind=p) (2*mx,il)

Output field

private function ModLegendre_legendre(this, input) result(output)

Computes direct Legendre transformation. The Legendre polynomials (cpol), the triangular shape definition (nsh2), and the gaussian weights (wt) used for the integration of the Legendre transform needs to be initialized and passed to the function.

Arguments

Type IntentOptional AttributesName
class(ModLegendre_t), intent(in) :: this
real(kind=p), intent(in) :: input(2*mx,il)

Input field

Return Value real(kind=p) (2*mx,nx)

Output field

private function get_weights() result(w)

Compute Gaussian weights for direct Legendre transform

Arguments

None

Return Value real(kind=p) (iy)

Weights in gaussian quadrature (sum should equal 1.0)

private function ModLegendre_legendre_poly(this, j) result(poly)

Compute associated Legendre polynomials at given latitude.

Arguments

Type IntentOptional AttributesName
class(ModLegendre_t), intent(in) :: this
integer, intent(in) :: j

The latitude index to compute the polynomials at

Return Value real(kind=p) (mx,nx)

The Legendre polynomials


Subroutines

public subroutine ModLegendre_initialize(this, mod_geometry)

Initializes Legendre transforms and constants used for other subroutines that manipulate spherical harmonics. The Legendre polynomials Epsilon function used for various spectral calculations 1/epsi Used for defining shape of spectral triangle Gaussian weights used for integration in direct Legendre transform

Arguments

Type IntentOptional AttributesName
class(ModLegendre_t), intent(inout) :: this
class(ModGeometry_t), intent(in), target:: mod_geometry

public subroutine ModLegendre_delete(this)

Arguments

Type IntentOptional AttributesName
class(ModLegendre_t), intent(inout) :: this