t_sol_var_MHD3D Derived Type

type, public, extends(c_sol_var) :: t_sol_var_MHD3D


Inherits

type~~t_sol_var_mhd3d~~InheritsGraph type~t_sol_var_mhd3d t_sol_var_MHD3D type~c_sol_var c_sol_var type~t_sol_var_mhd3d->type~c_sol_var

Components

Type Visibility Attributes Name Initial
integer, public :: nVars
logical, public :: initialized = .FALSE.
real(kind=wp), public :: W_MHD3D
real(kind=wp), public, CONTIGUOUS, POINTER :: X1(:,:)

X1 variable, shape=(base_s%nBase,base_f%mn_mode)

real(kind=wp), public, CONTIGUOUS, POINTER :: X2(:,:)

X2 variable

real(kind=wp), public, CONTIGUOUS, POINTER :: LA(:,:)

lambda variable

real(kind=wp), public, CONTIGUOUS, POINTER :: q(:)

1d array container for all variables (is the one allocated)

integer, public, ALLOCATABLE :: varsize(:,:)

varsize(a,b): size of rank a of variable b =1..nvars

integer, public, ALLOCATABLE :: offset(:)

offset(0:nvars): size of variable b =offset(b)-offset(b-1)


Type-Bound Procedures

procedure, public :: init => sol_var_MHD3D_init

  • private subroutine sol_var_MHD3D_init(sf, varsize)

    initialize (=allocate) sf of type t_sol_var

    Arguments

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

    sf

    integer, intent(in) :: varsize(:)

procedure, public :: free => sol_var_MHD3D_free

  • private subroutine sol_var_MHD3D_free(sf)

    free (=deallocate) sf of type t_sol_var_MHD3D

    Arguments

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

    sf

procedure, public :: copy => sol_var_MHD3D_copy

procedure, public :: set_to_solvar => sol_var_MHD3D_set_to_solvar

  • private subroutine sol_var_MHD3D_set_to_solvar(sf, toset, scal_in)

    set variabes X1,X2,LA of toset => sf, optional argument to scale toset with a scalar (for example -1.0_wp)

    Arguments

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

    sf

    class(c_sol_var), intent(in) :: toset
    real(kind=wp), intent(in), optional :: scal_in

procedure, public :: set_to_scalar => sol_var_MHD3D_set_to_scalar

  • private subroutine sol_var_MHD3D_set_to_scalar(sf, scalar)

    set all variables to scalar

    Arguments

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

    sf

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

generic, public :: set_to => set_to_solvar, set_to_scalar

  • private subroutine sol_var_MHD3D_set_to_solvar(sf, toset, scal_in)

    set variabes X1,X2,LA of toset => sf, optional argument to scale toset with a scalar (for example -1.0_wp)

    Arguments

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

    sf

    class(c_sol_var), intent(in) :: toset
    real(kind=wp), intent(in), optional :: scal_in
  • private subroutine sol_var_MHD3D_set_to_scalar(sf, scalar)

    set all variables to scalar

    Arguments

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

    sf

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

procedure, public :: norm_2 => sol_var_MHD3D_norm_2

  • private function sol_var_MHD3D_norm_2(sf) result(norm_2)

    |X|^2, where X is of type t_var_sol, so three values are returned: |X1|^2,|X2|^2,|LA|^2

    Arguments

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

    self

    Return Value real(kind=wp), (sf%nvars)

procedure, public :: AXBY => sol_var_MHD3D_AXBY

  • private subroutine sol_var_MHD3D_AXBY(sf, aa, X, bb, Y)

    res=aX+bY , where X,Y,res are of type t_var_sol

    Arguments

    Type IntentOptional Attributes Name
    class(t_sol_var_MHD3D), intent(inout) :: sf
    real(kind=wp), intent(in) :: aa
    class(c_sol_var), intent(in) :: X
    real(kind=wp), intent(in) :: bb
    class(c_sol_var), intent(in) :: Y

Source Code

TYPE,EXTENDS(c_sol_var) :: t_sol_var_MHD3D
  !---------------------------------------------------------------------------------------------------------------------------------
  LOGICAL               :: initialized=.FALSE.
  !---------------------------------------------------------------------------------------------------------------------------------
  REAL(wp)              :: W_MHD3D
  REAL(wp),CONTIGUOUS,POINTER :: X1(:,:)    !! X1 variable, shape=(base_s%nBase,base_f%mn_mode)
  REAL(wp),CONTIGUOUS,POINTER :: X2(:,:)    !! X2 variable
  REAL(wp),CONTIGUOUS,POINTER :: LA(:,:)    !! lambda variable
  REAL(wp),CONTIGUOUS,POINTER :: q(:)       !! 1d array container for all variables (is the one allocated)
  INTEGER, ALLOCATABLE  :: varsize(:,:)     !! varsize(a,b): size of rank a of variable b =1..nvars
  INTEGER, ALLOCATABLE  :: offset(:)        !! offset(0:nvars): size of variable b =offset(b)-offset(b-1)
  !---------------------------------------------------------------------------------------------------------------------------------
  CONTAINS

  PROCEDURE  :: init          => sol_var_MHD3D_init
  PROCEDURE  :: free          => sol_var_MHD3D_free
  PROCEDURE  :: copy          => sol_var_MHD3D_copy
  PROCEDURE  :: set_to_solvar => sol_var_MHD3D_set_to_solvar
  PROCEDURE  :: set_to_scalar => sol_var_MHD3D_set_to_scalar
  GENERIC    :: set_to        => set_to_solvar,set_to_scalar  !chooses right routine depending on input type!
  PROCEDURE  :: norm_2        => sol_var_MHD3D_norm_2
  PROCEDURE  :: AXBY          => sol_var_MHD3D_AXBY
  !---------------------------------------------------------------------------------------------------------------------------------
END TYPE t_sol_var_MHD3D