Module fd4_vartab_mod


Uses:
    module fd4_globaldef_mod
Types:
    public type fd4_vartab
    public type fd4_varinfo
Variables:
    integer (kind=i_k), public, parameter :: FD4_VARNAME_LEN = 64
    integer (kind=i_k), public, parameter :: FD4_CELLC = 0
    integer (kind=i_k), public, parameter :: FD4_FACEX = 1
    integer (kind=i_k), public, parameter :: FD4_FACEY = 2
    integer (kind=i_k), public, parameter :: FD4_FACEZ = 3
    real (kind=r_k), private, parameter :: real_variable = 0_r_k
    real (kind=r_k), public, parameter :: FD4_NOTHRES = huge (real_variable)
Subroutines and functions:
    public subroutine fd4_vartab_create_varinfo (vartab, varinfo, err)
    public subroutine fd4_vartab_check (vartab, err)

Variable table - a table for definition of data fields.

TODO:

Author: Matthias Lieber


Description of Types

fd4_vartab

public type fd4_vartab
    character (len=FD4_VARNAME_LEN) :: name
    integer (kind=i_k) :: nbins = 1
    integer (kind=i_k) :: nsteps = 1
    logical :: dynamic = .false.
    real (kind=r_k) :: vnull = 0.0_r_k
    real (kind=r_k) :: vthres = FD4_NOTHRES
    integer (kind=i_k) :: facevar = FD4_CELLC
end type fd4_vartab
Components:
name descriptive name of the variable
nbins number of bins of the variable
nsteps number of time steps for this variable
dynamic allocate data field dynamical?
vnull initialization value of this variable
vthres threshold to trigger block creation/removal
facevar indicator whether this variable is a face variable
This type represents an entry in the variable table.

Currently, cell-centered and face-centered variables are supported.

Hint: FD4 can do some optimizations when all variables have the same vnull.

fd4_varinfo

public type fd4_varinfo
    integer (kind=i_k), pointer, dimension (:,:,:) :: fields
    integer (kind=i_k) :: maxnsteps
    integer (kind=i_k), dimension (0:3) :: field_len
    logical :: all_vars_same_vnull
    logical :: vthres_mode
end type fd4_varinfo
Components:
fields start and end indices of static fields for fd4_block
maxnsteps maximal number of time steps in vartab
field_len sum of all bins of all variables for cell-centered and facevars
all_vars_same_vnull true if all variables have the same vnull
vthres_mode true if any variable has a vthres /= FD4_NOTHRES
This type contains some global information about the whole variable table.

Use fd4_vartab_create_varinfo to create this info from the vartab.


Description of Subroutines and Functions

fd4_vartab_create_varinfo

public subroutine fd4_vartab_create_varinfo (vartab, varinfo, err)
    type (fd4_vartab), intent(in), dimension (:) :: vartab
    type (fd4_varinfo), intent(inout) :: varinfo
    integer (kind=i_k), intent(out) :: err
end subroutine fd4_vartab_create_varinfo
Parameters:
vartab The variable table
varinfo The variable table info
err error status, 0 if ok (always 0 at error level < L3)
Create fd4_varinfo from vartab.

fd4_vartab_check

public subroutine fd4_vartab_check (vartab, err)
    type (fd4_vartab), intent(in), dimension (:) :: vartab
    integer (kind=i_k), intent(out) :: err
end subroutine fd4_vartab_check
Parameters:
vartab The variable table
err error status, 0 if table is ok, else index of failed variable
Check the variable table.

Returns when the first error is found. Checks for: