Module fd4_vis5d_mod


Uses:
    module fd4_globaldef_mod
    module fd4_vartab_mod
    module fd4_domain_mod
    module fd4_util_mod
Types:
    public type fd4_vis5d_attributes
Variables:
    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_zswap
Subroutines and functions:
    public subroutine fd4_vis5d_open (domain, filename, nsteps, nfields, idx, st, err, cs, attr, zswap)
    public subroutine fd4_vis5d_write (err, idx_opt, st_opt)
    public subroutine fd4_vis5d_close (err)

Write data of an fd4_domain to Vis5D file.

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       U
 
By 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       U   
 
The following translation is applied:
 
  x_t =  y
  y_t = -x
 

TODO:

Author: Matthias Lieber


Description of Types

fd4_vis5d_attributes

public type fd4_vis5d_attributes
    integer :: projection
    real, dimension (7) :: proj_args
    integer :: vertical
    real, pointer, dimension (:) :: vert_args
end type fd4_vis5d_attributes
Components:
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)
optional attributes for fd4_vis5d_open to specify map projection and vertical coordinate system


Description of Subroutines and Functions

fd4_vis5d_open

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_open
Parameters:
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?
Open Vis5D file.

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.


fd4_vis5d_write

public subroutine fd4_vis5d_write (err, idx_opt, st_opt)
    integer (kind=i_k), intent(out) :: err
    integer (kind=i_k), optional, intent(in), dimension (numfields) :: idx_opt
    integer (kind=i_k), optional, intent(in), dimension (numfields) :: st_opt
end subroutine fd4_vis5d_write
Parameters:
err error status: 0...ok
idx_opt field indices of the data fields to write
st_opt time step indices of the data fields to write
Write current data of the domain to Vis5D file.

The optional idx and st parameters will overwrite the global variables. numfields must be the same as nfields in fd4_vis5d_open.


fd4_vis5d_close

public subroutine fd4_vis5d_close (err)
    integer (kind=i_k), intent(out) :: err
end subroutine fd4_vis5d_close
Parameters:
err error status: 0...ok
Close Vis5D file.