module fd4_globaldef_mod module fd4_vartab_mod module fd4_domain_mod module fd4_util_modTypes:
public type fd4_vis5d_attributesVariables:
integer (kind=i_k), private, dimension (0:3,2) :: abnd integer (kind=i_k), private :: numfields real, private, allocatable, dimension (:,:,:) :: array4 integer, private :: t = -1 integer, private, dimension (3,2) :: a4bnd real (kind=r_k), private, allocatable, dimension (:,:,:,:) :: arrayk integer (kind=i_k), private, allocatable, dimension (:) :: index integer (kind=i_k), private, allocatable, dimension (:) :: step type (fd4_domain), private, pointer :: d logical, private :: do_zswapSubroutines and functions:
public subroutine fd4_vis5d_open (domain, filename, nsteps, nfields, idx, st, err, cs, attr, zswap) public subroutine fd4_vis5d_write (err, idx, st) public subroutine fd4_vis5d_close (err)
Only one open-write-close sequence can work at the same time, because this method uses global variables (v5d also has this limitation, so there's no chance to make it better).
Vis5D coordinate system:
Coordinates: Wind directions: z y A .-------> V | N | N |W E |W E | S x | S .-------> V W UBy translating x and y coordinates, following rules are valid for fd4_vis5d_mod:
Coordinates: Wind directions: A A y | N V | N |W E |W E | S | S .-------> .-------> z x W UThe following translation is applied:
x_t = y y_t = -x
TODO:
Author: Matthias Lieber
public type fd4_vis5d_attributes integer :: projection real, dimension (7) :: proj_args integer :: vertical real, pointer, dimension (:) :: vert_args end type fd4_vis5d_attributesComponents:
projection | type of map projection |
proj_args | projection arguments |
vertical | type of vertical coordinate system |
vert_args | vertical coordinate system arguments (needs to be allocated) |
public subroutine fd4_vis5d_open (domain, filename, nsteps, nfields, idx, st, err, cs, attr, zswap) type (fd4_domain), intent(in), target :: domain character (len=*), intent(in) :: filename integer (kind=i_k), intent(in) :: nsteps integer (kind=i_k), intent(in) :: nfields integer (kind=i_k), intent(in), dimension (nfields) :: idx integer (kind=i_k), intent(in), dimension (nfields) :: st integer (kind=i_k), intent(out) :: err real (kind=r_k), optional, intent(in), dimension (3) :: cs type (fd4_vis5d_attributes), optional, target, intent(in) :: attr logical, optional, intent(in) :: zswap end subroutine fd4_vis5d_openParameters:
domain | the domain |
filename | name of the file to write |
nsteps | number of time steps to write |
nfields | number of data fields to write |
idx | field indices of the data fields to write |
st | time step indices of the data fields to write |
err | error status: 0...ok |
cs | grid cell size in x, y, z |
attr | additional attributes for map projection and vertical coordinate system |
zswap | swap z coordinate indexes in output? |
You must know which variables and how many time steps you will write when calling this function!
cs will be ignored if attr is present.
public subroutine fd4_vis5d_write (err, idx, st) integer (kind=i_k), intent(out) :: err integer (kind=i_k), optional, intent(in), dimension (numfields) :: idx integer (kind=i_k), optional, intent(in), dimension (numfields) :: st end subroutine fd4_vis5d_writeParameters:
err | error status: 0...ok |
idx | field indices of the data fields to write |
st | time step indices of the data fields to write |
The optional idx and st parameters will overwrite the global variables. numfields must be the same as nfields in fd4_vis5d_open.
public subroutine fd4_vis5d_close (err) integer (kind=i_k), intent(out) :: err end subroutine fd4_vis5d_closeParameters:
err | error status: 0...ok |