t_sGrid Derived Type

type, public, extends(c_sgrid) :: t_sGrid


Inherits

type~~t_sgrid~~InheritsGraph type~t_sgrid t_sGrid type~c_sgrid c_sgrid type~t_sgrid->type~c_sgrid

Inherited by

type~~t_sgrid~~InheritedByGraph type~t_sgrid t_sGrid type~t_sbase t_sBase type~t_sbase->type~t_sgrid grid type~t_transform_sfl t_transform_sfl type~t_transform_sfl->type~t_sgrid sgrid_sfl type~t_base t_base type~t_transform_sfl->type~t_base X1sfl_base, X2sfl_base, GZ_base, GZsfl_base type~t_base->type~t_sbase s type~t_sbase_disc t_sBase_disc type~t_sbase_disc->type~t_sbase type~t_sbase_spl t_sBase_spl type~t_sbase_spl->type~t_sbase

Components

Type Visibility Attributes Name Initial
logical, public :: initialized = .FALSE.
integer, public :: nElems

global number of radial elements

integer, public :: nElems_str

local number of radial elements per MPI subdomain !<<<<

integer, public :: nElems_end

local number of radial elements per MPI subdomain !<<<<

integer, public, ALLOCATABLE :: offset_elem(:)

allocated (0:nRanks), gives range on each rank: nElems_str:nElems_end=offset_elem(rank)+1:offset_elem(myRank+1)

integer, public :: grid_type

type of grid (stretching functions...)

real(kind=wp), public, ALLOCATABLE :: sp(:)

element point positions in [0,1], size(0:nElems)

real(kind=wp), public, ALLOCATABLE :: ds(:)

ds(i)=sp(i)-sp(i-1), size(1:nElems)


Type-Bound Procedures

procedure, public :: init => sGrid_init

  • private subroutine sGrid_init(sf, nElems_in, grid_type_in, sp_in)

    initialize the type sgrid with number of elements

    Arguments

    Type IntentOptional Attributes Name
    class(t_sGrid), intent(inout) :: sf

    self

    integer, intent(in) :: nElems_in

    total number of elements

    integer, intent(in) :: grid_type_in

    GRID_TYPE_UNIFORM, GRID_TYPE_SQRT_S, GRID_TYPE_S2, GRID_TYPE_BUMP

    real(kind=wp), intent(in), optional :: sp_in(0:nElems_in)

    inner grid point positions, first position should be 0, last should be 1.

procedure, public :: copy => sGrid_copy

  • private subroutine sGrid_copy(sf, tocopy)

    copy the type sgrid, copies sf <= tocopy ... call sf%copy(tocopy)

    Arguments

    Type IntentOptional Attributes Name
    class(t_sGrid), intent(inout) :: sf

    self

    class(c_sgrid), intent(in) :: tocopy

procedure, public :: compare => sGrid_compare

  • private subroutine sGrid_compare(sf, tocompare, is_same)

    compare to sf grid with input grid to see if they are the same

    Arguments

    Type IntentOptional Attributes Name
    class(t_sGrid), intent(in) :: sf

    self

    class(c_sgrid), intent(in) :: tocompare
    logical, intent(out) :: is_same

procedure, public :: free => sGrid_free

  • private subroutine sGrid_free(sf)

    finalize the type sgrid

    Arguments

    Type IntentOptional Attributes Name
    class(t_sGrid), intent(inout) :: sf

    self

procedure, public :: find_elem => sGrid_find_elem

  • private function sGrid_find_elem(sf, x) result(iElem)

    find grid cell for certain position

    Arguments

    Type IntentOptional Attributes Name
    class(t_sGrid), intent(in) :: sf

    self

    real(kind=wp), intent(in) :: x

    Return Value integer

Source Code

TYPE,EXTENDS(c_sgrid) :: t_sGrid
  LOGICAL :: initialized=.FALSE.
  !---------------------------------------------------------------------------------------------------------------------------------
  !input parameters
  INTEGER              :: nElems                   !! global number of radial elements
  INTEGER              :: nElems_str, nElems_end   !! local number of radial elements per MPI subdomain  !<<<<
  INTEGER,ALLOCATABLE  :: offset_elem(:)           !! allocated  (0:nRanks), gives range on each rank:
                                                   !!   nElems_str:nElems_end=offset_elem(rank)+1:offset_elem(myRank+1)
  INTEGER              :: grid_type                !! type of grid (stretching functions...)
  !---------------------------------------------------------------------------------------------------------------------------------
  REAL(wp),ALLOCATABLE :: sp(:)                    !! element point positions in [0,1], size(0:nElems)
  REAL(wp),ALLOCATABLE :: ds(:)                    !! ds(i)=sp(i)-sp(i-1), size(1:nElems)

  CONTAINS
  PROCEDURE :: init          => sGrid_init
  PROCEDURE :: copy          => sGrid_copy
  PROCEDURE :: compare       => sGrid_compare
  PROCEDURE :: free          => sGrid_free
  PROCEDURE :: find_elem     => sGrid_find_elem

END TYPE t_sGrid