FORCES
FORtran lib for Comp. Env. Sys.
|
Reading netcdf files. More...
Data Types | |
interface | get_ncvar |
Read array from NC file. More... | |
Functions/Subroutines | |
integer(i4) function, dimension(5), public | get_ncdim (filename, variable, printinfo, ndims) |
Dimension of netcdf variable. | |
subroutine, public | get_ncdimatt (filename, variable, dimname, dimlen) |
Name and size of variable in netcdf. | |
subroutine, public | get_ncvaratt (filename, varname, attname, attvalues, fid, dtype) |
Get attribute of netcdf variable. | |
subroutine | get_ncvar_0d_sp (filename, varname, dat, fid) |
subroutine | get_ncvar_0d_dp (filename, varname, dat, fid) |
subroutine | get_ncvar_1d_sp (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_1d_dp (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_2d_sp (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_2d_dp (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_3d_sp (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_3d_dp (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_4d_sp (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_4d_dp (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_5d_sp (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_5d_dp (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_0d_i4 (filename, varname, dat, fid) |
subroutine | get_ncvar_1d_i4 (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_2d_i4 (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_3d_i4 (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_4d_i4 (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_5d_i4 (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_0d_i1 (filename, varname, dat, fid) |
subroutine | get_ncvar_1d_i1 (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_2d_i1 (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_3d_i1 (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_4d_i1 (filename, varname, dat, start, a_count, fid) |
subroutine | get_ncvar_5d_i1 (filename, varname, dat, start, a_count, fid) |
integer(i4) function, public | ncopen (fname) |
Open netcdf file. | |
subroutine, public | ncclose (ncid) |
Closes netcdf file. | |
subroutine | get_info (varname, ncid, varid, xtype, dl, info, ndims) |
Get variable info from netcdf files. | |
subroutine | check (status) |
Reading netcdf files.
Subroutines for reading arrays from 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 2170 of file mo_ncread.f90.
|
private |
Get variable info from netcdf files.
This subroutine is PRIVATE and therefore does not exist outside of this module.
This subroutine inquires the nc file. Given the Variable name and the stream of the nc file, this subroutine determines the variable id, the kind of the variable and the length of the dimensions in the file.
See: http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90/ -> NF90-INQUIRE for detailed information.
Definition at line 2119 of file mo_ncread.f90.
Referenced by get_ncdim(), get_ncdimatt(), and get_ncvaratt().
integer(i4) function, dimension(5), public mo_ncread::get_ncdim | ( | character(len = *), intent(in) | filename, |
character(len = *), intent(in) | variable, | ||
logical, intent(in), optional | printinfo, | ||
integer(i4), intent(out), optional | ndims | ||
) |
Dimension of netcdf variable.
Gets the dimensions of variable in a netcdf file.
Literature
[in] | character(len=*) :: Filename | Filename of netcdf file |
[in] | character(len=*) :: Variable | Variable name exactly as specified in the file |
[in] | logical, optional :: PrintInfo | If given and true, information about dimension and their lengths will be printed to standard output. |
integer(i4), dimension(5) :: Get_NcDim | Dimension length, -1 if dimension does not exist |
[out] | integer(i4), optional :: ndims | # of dimensions |
Definition at line 127 of file mo_ncread.f90.
References get_info(), and get_ncdim().
Referenced by get_ncdim(), get_ncdimatt(), and get_ncvaratt().
subroutine, public mo_ncread::get_ncdimatt | ( | character(len = *), intent(in) | filename, |
character(len = *), intent(in) | variable, | ||
character(len = *), dimension(:), intent(out), allocatable | dimname, | ||
integer(i4), dimension(:), intent(out), optional, allocatable | dimlen | ||
) |
Name and size of variable in netcdf.
Gets the name and size of the dimensions of a variable in a netcdf file
Example
Filename = 'test.nc' Varname = 'data' call Get_NcDimAtt(Filename, Varname, DimNames, DimLen)
See example in test directory.
Literature
[in] | character(len=*), intent(in) :: Filename | Filename of netcdf file. |
[in] | character(len=*), intent(in) :: Variable | Variable name exactly as specified in the file. |
[out] | integer(i4), dimension(:), allocatable, optional, intent(out) :: DimLen | Allocatable array with the size of the dimensions |
character(len=*), dimension(:), allocatable, intent(out) :: DimName | Allocatable array with the names of the dimensions. |
Definition at line 192 of file mo_ncread.f90.
References get_info(), and get_ncdim().
|
private |
Definition at line 380 of file mo_ncread.f90.
|
private |
Definition at line 1621 of file mo_ncread.f90.
|
private |
Definition at line 1202 of file mo_ncread.f90.
|
private |
Definition at line 341 of file mo_ncread.f90.
|
private |
Definition at line 497 of file mo_ncread.f90.
|
private |
Definition at line 1661 of file mo_ncread.f90.
|
private |
Definition at line 1242 of file mo_ncread.f90.
|
private |
Definition at line 419 of file mo_ncread.f90.
|
private |
Definition at line 654 of file mo_ncread.f90.
|
private |
Definition at line 1737 of file mo_ncread.f90.
|
private |
Definition at line 1318 of file mo_ncread.f90.
|
private |
Definition at line 575 of file mo_ncread.f90.
|
private |
Definition at line 812 of file mo_ncread.f90.
|
private |
Definition at line 1813 of file mo_ncread.f90.
|
private |
Definition at line 1394 of file mo_ncread.f90.
|
private |
Definition at line 732 of file mo_ncread.f90.
|
private |
Definition at line 968 of file mo_ncread.f90.
|
private |
Definition at line 1889 of file mo_ncread.f90.
|
private |
Definition at line 1470 of file mo_ncread.f90.
|
private |
Definition at line 890 of file mo_ncread.f90.
|
private |
Definition at line 1124 of file mo_ncread.f90.
|
private |
Definition at line 1965 of file mo_ncread.f90.
|
private |
Definition at line 1546 of file mo_ncread.f90.
|
private |
Definition at line 1046 of file mo_ncread.f90.
subroutine, public mo_ncread::get_ncvaratt | ( | character(len = *), intent(in) | filename, |
character(len = *), intent(in) | varname, | ||
character(len = *), intent(in) | attname, | ||
character(len = *), intent(out) | attvalues, | ||
integer(i4), intent(in), optional | fid, | ||
integer(i4), intent(out), optional | dtype | ||
) |
Get attribute of netcdf variable.
Gets the values of an particular attribute of an variable.
Example
Filename = 'test.nc' VarName = 'data' AttName = 'units' call Get_NcDimAtt(Filename, Varname, AttName, AttValues)
See example in test directory.
Literature
[in] | character(len=*), intent(in) :: FileName | Filename of netcdf file. |
[in] | character(len=*), intent(in) :: VarName | Variable name exactly as specified in the file. |
[in] | character(len=*), intent(in) :: AttName | Attribute name exactly as specified for the Variable. |
[in] | integer(i4), optional, intent(in) :: fid | File handle of opened netcdf file |
[in] | integer(i4), optional, intent(in) :: dtype | Datatype (ineteger,float) see NetCDF convention (unidata.ucar) |
character(len=*), intent(out) :: AttValues | Values of the Attribute. |
Definition at line 270 of file mo_ncread.f90.
References get_info(), and get_ncdim().
subroutine, public mo_ncread::ncclose | ( | integer(i4), intent(in) | ncid | ) |
Closes netcdf file.
Closes a netcdf file by file handle
Example
Literature
[in] | ncid | - file handle of open netcdf file |
Definition at line 2093 of file mo_ncread.f90.
integer(i4) function, public mo_ncread::ncopen | ( | character(len = *), intent(in) | fname | ) |
Open netcdf file.
Opens a netcdf file and returns file handle
Example
Literature
[in] | character(len=*) :: Fname | Filename of file to open |
[out] | integer(i4) :: NcOpen | id of opened stream |
Definition at line 2061 of file mo_ncread.f90.
References ncopen().
Referenced by ncopen().