FORCES
FORtran lib for Comp. Env. Sys.
|
Writing netcdf files. More...
Data Types | |
type | attribute |
NetCDF attribute. More... | |
type | dims |
NetCDF dims. More... | |
interface | dump_netcdf |
Variable simple write in netcdf. More... | |
interface | var2nc |
Extended dump_netcdf for multiple variables. More... | |
type | variable |
NetCDF variable. More... | |
Functions/Subroutines | |
subroutine, public | close_netcdf (ncid) |
Closes netcdf file stream. | |
subroutine, public | create_netcdf (filename, ncid, lfs, netcdf4, deflate_level) |
Open and write on new netcdf file. | |
subroutine | dump_netcdf_1d_sp (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_2d_sp (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_3d_sp (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_4d_sp (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_5d_sp (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_1d_dp (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_2d_dp (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_3d_dp (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_4d_dp (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_5d_dp (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_1d_i4 (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_2d_i4 (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_3d_i4 (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_4d_i4 (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | dump_netcdf_5d_i4 (filename, arr, append, lfs, netcdf4, deflate_level) |
subroutine | var2nc_1d_i4 (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_1d_sp (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_1d_dp (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_2d_i4 (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_2d_sp (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_2d_dp (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_3d_i4 (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_3d_sp (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_3d_dp (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_4d_i4 (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_4d_sp (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_4d_dp (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_5d_i4 (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_5d_sp (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine | var2nc_5d_dp (f_name, arr, dnames, v_name, dim_unlimited, long_name, units, missing_value, attributes, create, ncid, nrec) |
subroutine, public | write_dynamic_netcdf (ncid, irec) |
dynamic writer | |
subroutine, public | write_static_netcdf (ncid) |
static writer | |
integer(i4) function | open_netcdf (f_name, create) |
subroutine | check (status) |
Variables | |
integer(i4), parameter, public | nmaxdim = 5 |
nr. max dimensions | |
integer(i4), parameter, public | nmaxatt = 20 |
nr. max attributes | |
integer(i4), parameter, public | maxlen = 256 |
nr. string length | |
integer(i4), parameter, public | ngatt = 20 |
nr. global attributes | |
integer(i4), parameter, public | nattdim = 2 |
dim array of attribute values | |
integer(i4), public | nvars |
nr. variables | |
integer(i4), public | ndims |
nr. dimensions | |
type(dims), dimension(:), allocatable, public | dnc |
dimensions list | |
type(variable), dimension(:), allocatable, public | v |
variable list, THIS STRUCTURE WILL BE WRITTEN IN THE FILE | |
type(attribute), dimension(ngatt), public | gatt |
global attributes for netcdf | |
Writing netcdf files.
Subroutines for writing arrays on nc file using the netcdf4 library.
COPYING
and COPYING.LESSER
provided with this software. The complete GNU license text can also be found at http://www.gnu.org/licenses/.
|
private |
Definition at line 5647 of file mo_ncwrite.f90.
subroutine, public mo_ncwrite::close_netcdf | ( | integer(i4), intent(in) | ncid | ) |
Closes netcdf file stream.
Closes a stream of an open netcdf file and saves the file.
Example
See test_mo_ncwrite.
Literature
[in] | integer(i4) :: ncid | Stream id of an open netcdf file which shall be closed |
Definition at line 351 of file mo_ncwrite.f90.
Referenced by create_netcdf().
subroutine, public mo_ncwrite::create_netcdf | ( | character(len = *), intent(in) | filename, |
integer(i4), intent(out) | ncid, | ||
logical, intent(in), optional | lfs, | ||
logical, intent(in), optional | netcdf4, | ||
integer(i4), intent(in), optional | deflate_level | ||
) |
Open and write on new netcdf file.
This subroutine will open a new netcdf file and write the variable attributes stored in the structure V in the file. Therefore V has to be already set. See the file set_netcdf in test_mo_ncwrite for an example.
Literature
[in] | character(len=maxLen) :: File | Filename of file to be written |
[in] | logical, optional :: lfs | True: enable netcdf3 large file support, i.e. 64-bit offset |
[in] | logical, optional :: logical | True: use netcdf4 format |
[in] | integer(i4), optional :: deflate_level | compression level in netcdf4 (default: 1) |
[out] | integer(i4) :: ncid | integer value of the stream for the opened file |
Definition at line 404 of file mo_ncwrite.f90.
References close_netcdf(), dnc, gatt, ndims, ngatt, mo_string_utils::nonull(), nvars, and v.
|
private |
Definition at line 1264 of file mo_ncwrite.f90.
|
private |
Definition at line 2012 of file mo_ncwrite.f90.
|
private |
Definition at line 517 of file mo_ncwrite.f90.
|
private |
Definition at line 1414 of file mo_ncwrite.f90.
|
private |
Definition at line 2162 of file mo_ncwrite.f90.
|
private |
Definition at line 667 of file mo_ncwrite.f90.
|
private |
Definition at line 1564 of file mo_ncwrite.f90.
|
private |
Definition at line 2312 of file mo_ncwrite.f90.
|
private |
Definition at line 817 of file mo_ncwrite.f90.
|
private |
Definition at line 1714 of file mo_ncwrite.f90.
|
private |
Definition at line 2461 of file mo_ncwrite.f90.
|
private |
Definition at line 966 of file mo_ncwrite.f90.
|
private |
Definition at line 1863 of file mo_ncwrite.f90.
|
private |
Definition at line 2610 of file mo_ncwrite.f90.
|
private |
Definition at line 1115 of file mo_ncwrite.f90.
|
private |
Definition at line 5626 of file mo_ncwrite.f90.
|
private |
Definition at line 3103 of file mo_ncwrite.f90.
|
private |
Definition at line 2762 of file mo_ncwrite.f90.
|
private |
Definition at line 2933 of file mo_ncwrite.f90.
|
private |
Definition at line 3633 of file mo_ncwrite.f90.
|
private |
Definition at line 3273 of file mo_ncwrite.f90.
|
private |
Definition at line 3453 of file mo_ncwrite.f90.
|
private |
Definition at line 4174 of file mo_ncwrite.f90.
|
private |
Definition at line 3813 of file mo_ncwrite.f90.
|
private |
Definition at line 3993 of file mo_ncwrite.f90.
|
private |
Definition at line 4718 of file mo_ncwrite.f90.
|
private |
Definition at line 4354 of file mo_ncwrite.f90.
|
private |
Definition at line 4536 of file mo_ncwrite.f90.
|
private |
Definition at line 5244 of file mo_ncwrite.f90.
|
private |
Definition at line 4900 of file mo_ncwrite.f90.
|
private |
Definition at line 5072 of file mo_ncwrite.f90.
subroutine, public mo_ncwrite::write_dynamic_netcdf | ( | integer(i4), intent(in) | ncid, |
integer(i4), intent(in) | irec | ||
) |
dynamic writer
This routine writes data, where one dimension has the unlimited attribute. Therefore, the number of the record which should be written has to be specified. See: http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90.html
[in] | integer(i4) :: nc | stream id of an open netcdf file where data should be written can be obtained by an create_netcdf call |
[in] | integer(i4) :: rec | record id of record which will be written in the file |
Definition at line 5446 of file mo_ncwrite.f90.
subroutine, public mo_ncwrite::write_static_netcdf | ( | integer(i4), intent(in) | ncid | ) |
static writer
This routines writes static data in the netcdf file that is data where no dimension has the unlimited attribute. See: http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90.html
[in] | integer(i4) :: ncid | stream id of an open netcdf file where data should be written can be obtained by an create_netcdf call |
Definition at line 5548 of file mo_ncwrite.f90.
type (dims), dimension(:), allocatable, public mo_ncwrite::dnc |
global attributes for netcdf
Definition at line 105 of file mo_ncwrite.f90.
Referenced by create_netcdf().
integer(i4), parameter, public mo_ncwrite::maxlen = 256 |
nr. string length
Definition at line 42 of file mo_ncwrite.f90.
integer(i4), parameter, public mo_ncwrite::nattdim = 2 |
dim array of attribute values
Definition at line 44 of file mo_ncwrite.f90.
integer(i4), public mo_ncwrite::ndims |
integer(i4), parameter, public mo_ncwrite::ngatt = 20 |
integer(i4), parameter, public mo_ncwrite::nmaxatt = 20 |
nr. max attributes
Definition at line 41 of file mo_ncwrite.f90.
integer(i4), parameter, public mo_ncwrite::nmaxdim = 5 |
nr. max dimensions
Definition at line 40 of file mo_ncwrite.f90.
integer(i4), public mo_ncwrite::nvars |
nr. variables
Definition at line 101 of file mo_ncwrite.f90.
Referenced by create_netcdf(), write_dynamic_netcdf(), and write_static_netcdf().
type(variable), dimension(:), allocatable, public mo_ncwrite::v |
variable list, THIS STRUCTURE WILL BE WRITTEN IN THE FILE
Definition at line 104 of file mo_ncwrite.f90.
Referenced by create_netcdf(), write_dynamic_netcdf(), and write_static_netcdf().