PartMC
2.3.0
|
Wrapper functions for NetCDF. These all take a NetCDF ncid
in data mode and return with it again in data mode. Shifting to define mode is handled internally within each subroutine.
More...
Public Member Functions | |
subroutine | pmc_nc_check (status) |
Check the status of a NetCDF function call. More... | |
subroutine | pmc_nc_check_msg (status, error_msg) |
Check the status of a NetCDF function call and prints the given error message on failure. More... | |
subroutine | pmc_nc_open_read (filename, ncid) |
Open a NetCDF file for reading. More... | |
subroutine | pmc_nc_open_write (filename, ncid) |
Open a NetCDF file for writing. More... | |
subroutine | pmc_nc_close (ncid) |
Close a NetCDF file. More... | |
subroutine | pmc_nc_write_info (ncid, uuid, source, write_rank, write_n_proc) |
Write basic information to a NetCDF file. More... | |
subroutine | pmc_nc_read_real (ncid, var, name, must_be_present) |
Read a single real from a NetCDF file. More... | |
subroutine | pmc_nc_read_integer (ncid, var, name, must_be_present) |
Read a single integer from a NetCDF file. More... | |
subroutine | pmc_nc_read_real_1d (ncid, var, name, must_be_present) |
Read a simple real array from a NetCDF file. More... | |
subroutine | pmc_nc_read_integer_1d (ncid, var, name, must_be_present) |
Read a simple integer array from a NetCDF file. More... | |
subroutine | pmc_nc_read_real_2d (ncid, var, name, must_be_present) |
Read a simple real 2D array from a NetCDF file. More... | |
subroutine | pmc_nc_read_integer_2d (ncid, var, name, must_be_present) |
Read a simple integer 2D array from a NetCDF file. More... | |
subroutine | pmc_nc_write_atts (ncid, varid, unit, long_name, standard_name, description) |
Write attributes for a variable to a NetCDF file. More... | |
subroutine | pmc_nc_write_real (ncid, var, name, unit, long_name, standard_name, description) |
Write a single real to a NetCDF file. More... | |
subroutine | pmc_nc_write_integer (ncid, var, name, unit, long_name, standard_name, description) |
Write a single integer to a NetCDF file. More... | |
subroutine | pmc_nc_ensure_dim (ncid, dim_name, dimid, dim_size, array_dim) |
Create a dimension if necessary, or check its size if it already exists. In any case return the dimid . More... | |
subroutine | pmc_nc_write_real_1d (ncid, var, name, dimids, dim_name, unit, long_name, standard_name, description) |
Write a simple real array to a NetCDF file. More... | |
subroutine | pmc_nc_write_integer_1d (ncid, var, name, dimids, dim_name, unit, long_name, standard_name, description) |
Write a simple integer array to a NetCDF file. More... | |
subroutine | pmc_nc_write_real_2d (ncid, var, name, dimids, dim_name_1, dim_name_2, unit, long_name, standard_name, description) |
Write a simple real 2D array to a NetCDF file. More... | |
subroutine | pmc_nc_write_integer_2d (ncid, var, name, dimids, dim_name_1, dim_name_2, unit, long_name, standard_name, description) |
Write a simple integer 2D array to a NetCDF file. More... | |
Wrapper functions for NetCDF. These all take a NetCDF ncid
in data mode and return with it again in data mode. Shifting to define mode is handled internally within each subroutine.
Definition at line 11 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_check | ( | integer, intent(in) | status | ) |
Check the status of a NetCDF function call.
[in] | status | Status return value. |
Definition at line 22 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_check_msg | ( | integer, intent(in) | status, |
character(len=*), intent(in) | error_msg | ||
) |
Check the status of a NetCDF function call and prints the given error message on failure.
[in] | status | Status return value. |
[in] | error_msg | Error message in case of failure. |
Definition at line 37 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_close | ( | integer, intent(in) | ncid | ) |
Close a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
Definition at line 85 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_ensure_dim | ( | integer, intent(in) | ncid, |
character(len=*), intent(in) | dim_name, | ||
integer, intent(out) | dimid, | ||
integer, intent(in) | dim_size, | ||
integer, intent(in) | array_dim | ||
) |
Create a dimension if necessary, or check its size if it already exists. In any case return the dimid
.
[in] | ncid | NetCDF file ID, in data mode. |
[in] | dim_name | NetCDF dimension name for the variable. |
[out] | dimid | NetCDF dimension ID. |
[in] | dim_size | Size of dimension. |
[in] | array_dim | Dimension within data array that this NetCDF dim corresponds to. |
Definition at line 461 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_open_read | ( | character(len=*), intent(in) | filename, |
integer, intent(out) | ncid | ||
) |
Open a NetCDF file for reading.
[in] | filename | Filename of NetCDF file to open. |
[out] | ncid | NetCDF file ID, in data mode. |
Definition at line 54 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_open_write | ( | character(len=*), intent(in) | filename, |
integer, intent(out) | ncid | ||
) |
Open a NetCDF file for writing.
[in] | filename | Filename of NetCDF file to open. |
[out] | ncid | NetCDF file ID, in data mode, returns in data mode. |
Definition at line 69 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_read_integer | ( | integer, intent(in) | ncid, |
integer, intent(out) | var, | ||
character(len=*), intent(in) | name, | ||
logical, intent(in), optional | must_be_present | ||
) |
Read a single integer from a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[out] | var | Data to write. |
[in] | name | Variable name in NetCDF file. |
[in] | must_be_present | Whether the variable must be present in the NetCDF file (default .true.). |
Definition at line 183 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_read_integer_1d | ( | integer, intent(in) | ncid, |
integer, dimension(:), intent(out) | var, | ||
character(len=*), intent(in) | name, | ||
logical, intent(in), optional | must_be_present | ||
) |
Read a simple integer array from a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[out] | var | Data to read, must be correctly sized. |
[in] | name | Variable name in NetCDF file. |
[in] | must_be_present | Whether the variable must be present in the NetCDF file (default .true.). |
Definition at line 253 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_read_integer_2d | ( | integer, intent(in) | ncid, |
integer, dimension(:,:), intent(out) | var, | ||
character(len=*), intent(in) | name, | ||
logical, intent(in), optional | must_be_present | ||
) |
Read a simple integer 2D array from a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[out] | var | Data to read, must be correctly sized. |
[in] | name | Variable name in NetCDF file. |
[in] | must_be_present | Whether the variable must be present in the NetCDF file (default .true.). |
Definition at line 323 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_read_real | ( | integer, intent(in) | ncid, |
real(kind=dp), intent(out) | var, | ||
character(len=*), intent(in) | name, | ||
logical, intent(in), optional | must_be_present | ||
) |
Read a single real from a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[out] | var | Data to write. |
[in] | name | Variable name in NetCDF file. |
[in] | must_be_present | Whether the variable must be present in the NetCDF file (default .true.). |
Definition at line 148 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_read_real_1d | ( | integer, intent(in) | ncid, |
real(kind=dp), dimension(:), intent(out) | var, | ||
character(len=*), intent(in) | name, | ||
logical, intent(in), optional | must_be_present | ||
) |
Read a simple real array from a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[out] | var | Data to read, must be correctly sized. |
[in] | name | Variable name in NetCDF file. |
[in] | must_be_present | Whether the variable must be present in the NetCDF file (default .true.). |
Definition at line 218 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_read_real_2d | ( | integer, intent(in) | ncid, |
real(kind=dp), dimension(:,:), intent(out) | var, | ||
character(len=*), intent(in) | name, | ||
logical, intent(in), optional | must_be_present | ||
) |
Read a simple real 2D array from a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[out] | var | Data to read, must be correctly sized. |
[in] | name | Variable name in NetCDF file. |
[in] | must_be_present | Whether the variable must be present in the NetCDF file (default .true.). |
Definition at line 288 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_write_atts | ( | integer, intent(in) | ncid, |
integer, intent(in) | varid, | ||
character(len=*), intent(in), optional | unit, | ||
character(len=*), intent(in), optional | long_name, | ||
character(len=*), intent(in), optional | standard_name, | ||
character(len=*), intent(in), optional | description | ||
) |
Write attributes for a variable to a NetCDF file.
[in] | ncid | NetCDF file ID, in define mode. |
[in] | varid | Variable ID to write attributes for. |
[in] | unit | Unit of variable. |
[in] | long_name | Long name of variable. |
[in] | standard_name | Standard name of variable. |
[in] | description | Description of variable. |
Definition at line 358 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_write_info | ( | integer, intent(in) | ncid, |
character(len=pmc_uuid_len), intent(in) | uuid, | ||
character(len=*), intent(in) | source, | ||
integer, intent(in), optional | write_rank, | ||
integer, intent(in), optional | write_n_proc | ||
) |
Write basic information to a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[in] | uuid | UUID for this data set. |
[in] | source | Source name for this data. |
[in] | write_rank | Rank to write into file. |
[in] | write_n_proc | Number of processes to write into file. |
Definition at line 97 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_write_integer | ( | integer, intent(in) | ncid, |
integer, intent(in) | var, | ||
character(len=*), intent(in) | name, | ||
character(len=*), intent(in), optional | unit, | ||
character(len=*), intent(in), optional | long_name, | ||
character(len=*), intent(in), optional | standard_name, | ||
character(len=*), intent(in), optional | description | ||
) |
Write a single integer to a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[in] | var | Data to write. |
[in] | name | Variable name in NetCDF file. |
[in] | unit | Unit of variable. |
[in] | long_name | Long name of variable. |
[in] | standard_name | Standard name of variable. |
[in] | description | Description of variable. |
Definition at line 427 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_write_integer_1d | ( | integer, intent(in) | ncid, |
integer, dimension(:), intent(in) | var, | ||
character(len=*), intent(in) | name, | ||
integer, dimension(1), intent(in), optional | dimids, | ||
character(len=*), intent(in), optional | dim_name, | ||
character(len=*), intent(in), optional | unit, | ||
character(len=*), intent(in), optional | long_name, | ||
character(len=*), intent(in), optional | standard_name, | ||
character(len=*), intent(in), optional | description | ||
) |
Write a simple integer array to a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[in] | var | Data to write. |
[in] | name | Variable name in NetCDF file. |
[in] | dimids | NetCDF dimension IDs of the variable (either this or dim_name must be present). |
[in] | dim_name | NetCDF dimension name for the variable (either this or dimids must be present). |
[in] | unit | Unit of variable. |
[in] | long_name | Long name of variable. |
[in] | standard_name | Standard name of variable. |
[in] | description | Description of variable. |
Definition at line 553 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_write_integer_2d | ( | integer, intent(in) | ncid, |
integer, dimension(:,:), intent(in) | var, | ||
character(len=*), intent(in) | name, | ||
integer, dimension(2), intent(in), optional | dimids, | ||
character(len=*), intent(in), optional | dim_name_1, | ||
character(len=*), intent(in), optional | dim_name_2, | ||
character(len=*), intent(in), optional | unit, | ||
character(len=*), intent(in), optional | long_name, | ||
character(len=*), intent(in), optional | standard_name, | ||
character(len=*), intent(in), optional | description | ||
) |
Write a simple integer 2D array to a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[in] | var | Data to write. |
[in] | name | Variable name in NetCDF file. |
[in] | dimids | NetCDF dimension IDs of the variable (either dimids or both dim_name_1 and dim_name_2 must be present). |
[in] | dim_name_1 | First NetCDF dimension name for the variable (either dimids or both dim_name_1 and dim_name 2 must be present). |
[in] | dim_name_2 | Second NetCDF dimension name for the variable (either dimids or both dim_name_1 and dim_name 2 must be present). |
[in] | unit | Unit of variable. |
[in] | long_name | Long name of variable. |
[in] | standard_name | Standard name of variable. |
[in] | description | Description of variable. |
Definition at line 656 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_write_real | ( | integer, intent(in) | ncid, |
real(kind=dp), intent(in) | var, | ||
character(len=*), intent(in) | name, | ||
character(len=*), intent(in), optional | unit, | ||
character(len=*), intent(in), optional | long_name, | ||
character(len=*), intent(in), optional | standard_name, | ||
character(len=*), intent(in), optional | description | ||
) |
Write a single real to a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[in] | var | Data to write. |
[in] | name | Variable name in NetCDF file. |
[in] | unit | Unit of variable. |
[in] | long_name | Long name of variable. |
[in] | standard_name | Standard name of variable. |
[in] | description | Description of variable. |
Definition at line 394 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_write_real_1d | ( | integer, intent(in) | ncid, |
real(kind=dp), dimension(:), intent(in) | var, | ||
character(len=*), intent(in) | name, | ||
integer, dimension(1), intent(in), optional | dimids, | ||
character(len=*), intent(in), optional | dim_name, | ||
character(len=*), intent(in), optional | unit, | ||
character(len=*), intent(in), optional | long_name, | ||
character(len=*), intent(in), optional | standard_name, | ||
character(len=*), intent(in), optional | description | ||
) |
Write a simple real array to a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[in] | var | Data to write. |
[in] | name | Variable name in NetCDF file. |
[in] | dimids | NetCDF dimension IDs of the variable (either this or dim_name must be present). |
[in] | dim_name | NetCDF dimension name for the variable (either this or dimids must be present). |
[in] | unit | Unit of variable. |
[in] | long_name | Long name of variable. |
[in] | standard_name | Standard name of variable. |
[in] | description | Description of variable. |
Definition at line 504 of file netcdf.F90.
subroutine pmc_netcdf::pmc_nc_write_real_2d | ( | integer, intent(in) | ncid, |
real(kind=dp), dimension(:,:), intent(in) | var, | ||
character(len=*), intent(in) | name, | ||
integer, dimension(2), intent(in), optional | dimids, | ||
character(len=*), intent(in), optional | dim_name_1, | ||
character(len=*), intent(in), optional | dim_name_2, | ||
character(len=*), intent(in), optional | unit, | ||
character(len=*), intent(in), optional | long_name, | ||
character(len=*), intent(in), optional | standard_name, | ||
character(len=*), intent(in), optional | description | ||
) |
Write a simple real 2D array to a NetCDF file.
[in] | ncid | NetCDF file ID, in data mode. |
[in] | var | Data to write. |
[in] | name | Variable name in NetCDF file. |
[in] | dimids | NetCDF dimension IDs of the variable (either dimids or both dim_name_1 and dim_name_2 must be present). |
[in] | dim_name_1 | First NetCDF dimension name for the variable (either dimids or both dim_name_1 and dim_name 2 must be present). |
[in] | dim_name_2 | Second NetCDF dimension name for the variable (either dimids or both dim_name_1 and dim_name 2 must be present). |
[in] | unit | Unit of variable. |
[in] | long_name | Long name of variable. |
[in] | standard_name | Standard name of variable. |
[in] | description | Description of variable. |
Definition at line 602 of file netcdf.F90.