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)
TODO:
Author: Matthias Lieber
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 |
Currently, cell-centered and face-centered variables are supported.
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 |
Use fd4_vartab_create_varinfo to create this info from the vartab.
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) |
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 |
Returns when the first error is found. Checks for: