module fd4_globaldef_mod module fd4_vartab_mod module fd4_domain_mod module fd4_iter_mod module netcdfTypes:
public type fd4_netcdf4_commSubroutines and functions:
public subroutine fd4_netcdf4_open (nfcomm, domain, filename, nfields, idx, st, err, int_opt) public subroutine fd4_netcdf4_close (nfcomm, err) public subroutine fd4_netcdf4_write (nfcomm, err, st_opt)
This implementation is very simple and not optimized for performance!
TODO:
Author: Matthias Lieber
public type fd4_netcdf4_comm type (fd4_domain), pointer :: domain => null () integer :: ncid integer, dimension (0:4) :: dimids integer, pointer, dimension (:) :: varid integer (kind=i_k) :: rec integer (kind=i_k), pointer, dimension (:) :: idx integer (kind=i_k), pointer, dimension (:) :: st logical :: interpolate integer (kind=i_k) :: maxnbins end type fd4_netcdf4_commComponents:
domain | the domain which owns the blocks to iterate |
ncid | NetCDF file handle |
dimids | NetCDF dimension IDs |
varid | NetCDF variable IDs |
rec | current output record (output time step) |
idx | field indices of the data fields to write |
st | time step indices of the data fields to write |
interpolate | interpolate face vars to center? |
maxnbins | max number of bins |
public subroutine fd4_netcdf4_open (nfcomm, domain, filename, nfields, idx, st, err, int_opt) type (fd4_netcdf4_comm), intent(inout) :: nfcomm type (fd4_domain), target, intent(in) :: domain character (len=*), intent(in) :: filename 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 logical, optional, intent(in) :: int_opt end subroutine fd4_netcdf4_openParameters:
nfcomm | FD4 NetCDF4 I/O Communicator |
domain | the domain |
filename | name of the file 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 |
int_opt | interpolate face vars to center? |
public subroutine fd4_netcdf4_close (nfcomm, err) type (fd4_netcdf4_comm), intent(inout) :: nfcomm integer (kind=i_k), intent(out) :: err end subroutine fd4_netcdf4_closeParameters:
nfcomm | FD4 NetCDF4 I/O Communicator |
err | error status: 0...ok |
public subroutine fd4_netcdf4_write (nfcomm, err, st_opt) type (fd4_netcdf4_comm), intent(inout), target :: nfcomm integer (kind=i_k), intent(out) :: err integer (kind=i_k), optional, target, intent(in), dimension (:) :: st_opt end subroutine fd4_netcdf4_writeParameters:
nfcomm | FD4 NetCDF4 I/O Communicator |
err | error status: 0...ok |
st_opt | time step indices of the data fields to write |
The optional st_opt parameter will overwrite the values given to fd4_netcdf4_open.