TUV-x
Loading...
Searching...
No Matches
Data Types | Functions/Subroutines | Variables
musica_io_netcdf Module Reference

The io_netcdf_t type and related functions. More...

Data Types

interface  io_netcdf_t
 NetCDF file reader. More...
 

Functions/Subroutines

type(io_netcdf_t) function, pointer constructor (file_name, read_only)
 Constructor for NetCDF file readers.
 
subroutine read_0d_double (this, variable_name, container, requestor_name)
 Reads 0D double-precision floating-pointer data.
 
subroutine read_1d_double (this, variable_name, container, requestor_name)
 Reads 1D double-precision floating-pointer data.
 
subroutine read_2d_double (this, variable_name, container, requestor_name)
 Reads 2D double-precision floating-pointer data.
 
subroutine read_3d_double (this, variable_name, container, requestor_name)
 Reads 3D double-precision floating-pointer data.
 
subroutine read_4d_double (this, variable_name, container, requestor_name)
 Reads 4D double-precision floating-pointer data.
 
subroutine read_0d_int (this, variable_name, container, requestor_name)
 Reads 0D integer data.
 
subroutine read_1d_int (this, variable_name, container, requestor_name)
 Reads 1D integer data.
 
subroutine write_0d_double (this, variable_name, variable_data, requestor_name)
 Writes 0D double data.
 
subroutine write_1d_double (this, variable_name, dimensions, variable_data, requestor_name)
 Writes 1D double data. More...
 
subroutine write_2d_double (this, variable_name, dimensions, variable_data, requestor_name)
 Writes 2D double data. More...
 
subroutine write_3d_double (this, variable_name, dimensions, variable_data, requestor_name)
 Writes 3D double data. More...
 
subroutine write_4d_double (this, variable_name, dimensions, variable_data, requestor_name)
 Writes 4D double data. More...
 
subroutine write_0d_int (this, variable_name, variable_data, requestor_name)
 Writes 0D int data.
 
subroutine write_1d_int (this, variable_name, dimensions, variable_data, requestor_name)
 Writes 1D int data. More...
 
subroutine append_0d_double (this, variable_name, variable_units, append_dimension, append_index, variable_data, requestor_name)
 Writes 0D double data to append 1D double data. More...
 
subroutine append_1d_double (this, variable_name, variable_units, append_dimension, append_index, dimensions, variable_data, requestor_name)
 Writes 1D double data to append 2D double data. More...
 
subroutine append_2d_double (this, variable_name, variable_units, append_dimension, append_index, dimensions, variable_data, requestor_name)
 Writes 2D double data to append 3D double data. More...
 
subroutine append_3d_double (this, variable_name, variable_units, append_dimension, append_index, dimensions, variable_data, requestor_name)
 Writes 3D double data to append 4D double data. More...
 
subroutine append_0d_int (this, variable_name, variable_units, append_dimension, append_index, variable_data, requestor_name)
 Writes 0D int data to append 1D int data. More...
 
logical function exists_char (this, variable_name, requestor_name)
 Returns whether a variable exists in the file.
 
logical function exists_string (this, variable_name, requestor_name)
 Returns whether a variable exists in the file.
 
type(string_t) function, dimension(:), allocatable variable_dimensions (this, variable_name, requestor_name)
 Returns the dimension names for a given variable.
 
type(string_t) function variable_units (this, variable_name, requestor_name)
 Returns the units for a given variable.
 
subroutine set_variable_units (this, variable_name, units, requestor_name)
 Sets the units for a given variable.
 
logical function is_open (this)
 Returns whether a file is open or not.
 
integer function variable_id (this, variable_name)
 Returns a variable's id in the NetCDF file.
 
integer function, dimension(:), allocatable dimension_sizes (this, variable_name)
 Returns the dimensions for variable in the NetCDF file.
 
integer function check_add_dimension (this, dim_name, dim_size)
 Checks if a dimension exists and verifies its size. More...
 
subroutine check_add_variable (this, variable_name, variable_units, variable_type, append_dimension, dimensions, dimension_sizes, varid, dimids, start_ids)
 Checks for an appendable variable in the file and adds it if it does not exist yet.
 
subroutine finalize (this)
 Finalizes a NetCDF file reader.
 
subroutine check_status (code, status, error_message)
 Checks a NetCDF status code and fail with a message if an error occurred. More...
 

Variables

integer, parameter kunknownfileid = -9999
 

Detailed Description

The io_netcdf_t type and related functions.

Function/Subroutine Documentation

◆ append_0d_double()

subroutine musica_io_netcdf::append_0d_double ( class(io_netcdf_t), intent(inout)  this,
type(string_t), intent(in)  variable_name,
type(string_t), intent(in)  variable_units,
type(string_t), intent(in)  append_dimension,
integer, intent(in)  append_index,
real(kind=musica_dk), intent(in)  variable_data,
character(len=*), intent(in)  requestor_name 
)

Writes 0D double data to append 1D double data.

If the provided dimensions do not exist, they will be created based on the shape of the given data. If they do exist, they must be compatible with the shape of the given data.

◆ append_0d_int()

subroutine musica_io_netcdf::append_0d_int ( class(io_netcdf_t), intent(inout)  this,
type(string_t), intent(in)  variable_name,
type(string_t), intent(in)  variable_units,
type(string_t), intent(in)  append_dimension,
integer, intent(in)  append_index,
integer, intent(in)  variable_data,
character(len=*), intent(in)  requestor_name 
)

Writes 0D int data to append 1D int data.

If the provided dimensions do not exist, they will be created based on the shape of the given data. If they do exist, they must be compatible with the shape of the given data.

◆ append_1d_double()

subroutine musica_io_netcdf::append_1d_double ( class(io_netcdf_t), intent(inout)  this,
type(string_t), intent(in)  variable_name,
type(string_t), intent(in)  variable_units,
type(string_t), intent(in)  append_dimension,
integer, intent(in)  append_index,
type(string_t), intent(in)  dimensions,
real(kind=musica_dk), dimension(:), intent(in)  variable_data,
character(len=*), intent(in)  requestor_name 
)

Writes 1D double data to append 2D double data.

If the provided dimensions do not exist, they will be created based on the shape of the given data. If they do exist, they must be compatible with the shape of the given data.

◆ append_2d_double()

subroutine musica_io_netcdf::append_2d_double ( class(io_netcdf_t), intent(inout)  this,
type(string_t), intent(in)  variable_name,
type(string_t), intent(in)  variable_units,
type(string_t), intent(in)  append_dimension,
integer, intent(in)  append_index,
type(string_t), dimension(2), intent(in)  dimensions,
real(kind=musica_dk), dimension(:,:), intent(in)  variable_data,
character(len=*), intent(in)  requestor_name 
)

Writes 2D double data to append 3D double data.

If the provided dimensions do not exist, they will be created based on the shape of the given data. If they do exist, they must be compatible with the shape of the given data.

◆ append_3d_double()

subroutine musica_io_netcdf::append_3d_double ( class(io_netcdf_t), intent(inout)  this,
type(string_t), intent(in)  variable_name,
type(string_t), intent(in)  variable_units,
type(string_t), intent(in)  append_dimension,
integer, intent(in)  append_index,
type(string_t), dimension(3), intent(in)  dimensions,
real(kind=musica_dk), dimension(:,:,:), intent(in)  variable_data,
character(len=*), intent(in)  requestor_name 
)

Writes 3D double data to append 4D double data.

If the provided dimensions do not exist, they will be created based on the shape of the given data. If they do exist, they must be compatible with the shape of the given data.

◆ check_add_dimension()

integer function musica_io_netcdf::check_add_dimension ( class(io_netcdf_t), intent(inout)  this,
character(len=*), intent(in)  dim_name,
integer, intent(in)  dim_size 
)

Checks if a dimension exists and verifies its size.

If the dimension does not exist, it is created. The dimension id is returned.

◆ check_status()

subroutine musica_io_netcdf::check_status ( integer, intent(in)  code,
integer, intent(in)  status,
character(len=*), intent(in)  error_message 
)

Checks a NetCDF status code and fail with a message if an error occurred.

Parameters
[in]codeUnique code to associate with any failure
[in]statusNetCDF status code
[in]error_messageError message to display on failure

◆ write_1d_double()

subroutine musica_io_netcdf::write_1d_double ( class(io_netcdf_t), intent(inout)  this,
type(string_t), intent(in)  variable_name,
type(string_t), intent(in)  dimensions,
real(kind=musica_dk), dimension(:), intent(in)  variable_data,
character(len=*), intent(in)  requestor_name 
)

Writes 1D double data.

If the provided dimensions do not exist, they will be created based on the shape of the given data. If they do exist, they must be compatible with the shape of the given data.

◆ write_1d_int()

subroutine musica_io_netcdf::write_1d_int ( class(io_netcdf_t), intent(inout)  this,
type(string_t), intent(in)  variable_name,
type(string_t), intent(in)  dimensions,
integer, dimension(:), intent(in)  variable_data,
character(len=*), intent(in)  requestor_name 
)

Writes 1D int data.

If the provided dimensions do not exist, they will be created based on the shape of the given data. If they do exist, they must be compatible with the shape of the given data.

◆ write_2d_double()

subroutine musica_io_netcdf::write_2d_double ( class(io_netcdf_t), intent(inout)  this,
type(string_t), intent(in)  variable_name,
type(string_t), dimension(2), intent(in)  dimensions,
real(kind=musica_dk), dimension(:,:), intent(in)  variable_data,
character(len=*), intent(in)  requestor_name 
)

Writes 2D double data.

If the provided dimensions do not exist, they will be created based on the shape of the given data. If they do exist, they must be compatible with the shape of the given data.

◆ write_3d_double()

subroutine musica_io_netcdf::write_3d_double ( class(io_netcdf_t), intent(inout)  this,
type(string_t), intent(in)  variable_name,
type(string_t), dimension(3), intent(in)  dimensions,
real(kind=musica_dk), dimension(:,:,:), intent(in)  variable_data,
character(len=*), intent(in)  requestor_name 
)

Writes 3D double data.

If the provided dimensions do not exist, they will be created based on the shape of the given data. If they do exist, they must be compatible with the shape of the given data.

◆ write_4d_double()

subroutine musica_io_netcdf::write_4d_double ( class(io_netcdf_t), intent(inout)  this,
type(string_t), intent(in)  variable_name,
type(string_t), dimension(4), intent(in)  dimensions,
real(kind=musica_dk), dimension(:,:,:,:), intent(in)  variable_data,
character(len=*), intent(in)  requestor_name 
)

Writes 4D double data.

If the provided dimensions do not exist, they will be created based on the shape of the given data. If they do exist, they must be compatible with the shape of the given data.