![]() |
mHM
The mesoscale Hydrological Model
|
Reads spatial input data. More...
Data Types | |
| interface | read_spatial_data_ascii |
| Reads spatial data files of ASCII format. More... | |
| interface | read_spatial_data_nc |
| Reads spatial data files of nc format. More... | |
| interface | read_spatial_data_nc_or_ascii |
| Reads spatial data files of nc or ASCII format. More... | |
Functions/Subroutines | |
| subroutine | read_spatial_data_ascii_dp (filename, fileunit, header_ncols, header_nrows, header_xllcorner, header_yllcorner, header_cellsize, data, mask) |
| TODO: add description. | |
| subroutine | read_spatial_data_ascii_i4 (filename, fileunit, header_ncols, header_nrows, header_xllcorner, header_yllcorner, header_cellsize, data, mask) |
| TODO: add description. | |
| subroutine, public | read_header_ascii (filename, fileunit, header_ncols, header_nrows, header_xllcorner, header_yllcorner, header_cellsize, header_nodata) |
| Reads header lines of ASCII files. | |
| subroutine, public | check_header (ncols, nrows, xllcorner, yllcorner, cellsize, ref_ncols, ref_nrows, ref_xllcorner, ref_yllcorner, ref_cellsize, tolerance, context) |
| subroutine, public | read_header_nc_or_ascii (filepath, fileunit, header_ncols, header_nrows, header_xllcorner, header_yllcorner, header_cellsize, header_nodata, varname) |
| Read header information from either NetCDF or ASCII depending on file name/presence. | |
| subroutine, public | check_uniform_axis (var, cellsize, origin, increasing, tol) |
| check if given axis is a uniform axis. | |
| logical function | is_x_axis (var) |
| check if given variable is a x-axis. | |
| logical function | is_y_axis (var) |
| check if given variable is a y-axis. | |
| logical function | is_lon_coord (var) |
| check if given variable is a lon coordinate. | |
| logical function | is_lat_coord (var) |
| check if given variable is a lat coordinate. | |
| subroutine, public | get_header_info_from_nc (ncname, fileunit, header_ncols, header_nrows, header_xllcorner, header_yllcorner, header_cellsize, header_nodata, mask, var) |
| Read NetCDF header information (matching read_header_ascii signature) | |
| character(len=256) function | determine_data_var_name (nc, ncname) |
| subroutine | read_spatial_data_nc_i4 (ncname, data, maskout, ncols, nrows, xllcorner, yllcorner, cellsize, nodata_value, varname) |
| Read file from filepath. | |
| subroutine | read_spatial_data_nc_dp (ncname, data, maskout, ncols, nrows, xllcorner, yllcorner, cellsize, nodata_value, varname) |
| Read file from filepath. | |
| subroutine | read_spatial_data_nc_or_ascii_dp (filepath, fileunit, header_ncols, header_nrows, header_xllcorner, header_yllcorner, header_cellsize, data, maskout, out_ncols, out_nrows, out_xllcorner, out_yllcorner, out_cellsize, out_nodata_value) |
| Read file from filepath. | |
| subroutine | read_spatial_data_nc_or_ascii_i4 (filepath, fileunit, header_ncols, header_nrows, header_xllcorner, header_yllcorner, header_cellsize, data, maskout, out_ncols, out_nrows, out_xllcorner, out_yllcorner, out_cellsize, out_nodata_value) |
| Read file from filepath. | |
Reads spatial input data.
This module is to read spatial input data, e.g. dem, aspect, flow direction. The module provides a subroutine for ASCII files. (Subroutine for NetCDF files will come with release 5.1). The data are read from the specified directory.
COPYING and COPYING.LESSER provided with this software. The complete GNU license text can also be found at http://www.gnu.org/licenses/.
| subroutine, public mo_read_spatial_data::check_header | ( | integer(i4), intent(in) | ncols, |
| integer(i4), intent(in) | nrows, | ||
| real(dp), intent(in) | xllcorner, | ||
| real(dp), intent(in) | yllcorner, | ||
| real(dp), intent(in) | cellsize, | ||
| integer(i4), intent(in) | ref_ncols, | ||
| integer(i4), intent(in) | ref_nrows, | ||
| real(dp), intent(in) | ref_xllcorner, | ||
| real(dp), intent(in) | ref_yllcorner, | ||
| real(dp), intent(in) | ref_cellsize, | ||
| real(dp), intent(in), optional | tolerance, | ||
| character(*), intent(in), optional | context ) |
Definition at line 447 of file mo_read_spatial_data.f90.
References mo_common_constants::defaulttolerance_dp.
Referenced by mo_meteo_handler::init_level2(), mo_read_spatial_data::read_spatial_data_ascii::read_spatial_data_ascii_dp(), and mo_read_spatial_data::read_spatial_data_ascii::read_spatial_data_ascii_i4().
| subroutine, public mo_read_spatial_data::check_uniform_axis | ( | type(ncvariable), intent(in) | var, |
| real(dp), intent(out), optional | cellsize, | ||
| real(dp), intent(out), optional | origin, | ||
| logical, intent(out), optional | increasing, | ||
| real(dp), intent(in), optional | tol ) |
check if given axis is a uniform axis.
| [in] | var | NetCDF variable for corresponding axis |
| [out] | cellsize | cellsize of the uniform axis |
| [out] | origin | origin of the axis vertices |
| [out] | increasing | whether the axis has increasing values |
| [in] | tol | tolerance for cell size comparisson (default: 1.e-7) |
Definition at line 559 of file mo_read_spatial_data.f90.
Referenced by get_header_info_from_nc().
|
private |
Definition at line 845 of file mo_read_spatial_data.f90.
Referenced by get_header_info_from_nc(), mo_read_spatial_data::read_spatial_data_nc::read_spatial_data_nc_dp(), and mo_read_spatial_data::read_spatial_data_nc::read_spatial_data_nc_i4().
| subroutine, public mo_read_spatial_data::get_header_info_from_nc | ( | character(*), intent(in) | ncname, |
| integer(i4), intent(in) | fileunit, | ||
| integer(i4), intent(out) | header_ncols, | ||
| integer(i4), intent(out) | header_nrows, | ||
| real(dp), intent(out) | header_xllcorner, | ||
| real(dp), intent(out) | header_yllcorner, | ||
| real(dp), intent(out) | header_cellsize, | ||
| real(dp), intent(out) | header_nodata, | ||
| logical, dimension(:,:), intent(out), optional, allocatable | mask, | ||
| character(*), intent(in), optional | var ) |
Read NetCDF header information (matching read_header_ascii signature)
Reads grid metadata (ncols, nrows, corner, cellsize, nodata) from a NetCDF file.
| [in] | ncname | NetCDF filename |
| [in] | fileunit | Unused (kept for signature compatibility) |
| [out] | header_ncols | number of columns |
| [out] | header_nrows | number of rows |
| [out] | header_xllcorner | lower left x |
| [out] | header_yllcorner | lower left y |
| [out] | header_cellsize | cell size |
| [out] | header_nodata | nodata value |
| [in] | var | optional variable name |
Definition at line 742 of file mo_read_spatial_data.f90.
References check_uniform_axis(), determine_data_var_name(), is_lat_coord(), is_lon_coord(), is_x_axis(), and is_y_axis().
Referenced by read_header_nc_or_ascii(), mo_read_spatial_data::read_spatial_data_nc::read_spatial_data_nc_dp(), and mo_read_spatial_data::read_spatial_data_nc::read_spatial_data_nc_i4().
|
private |
check if given variable is a lat coordinate.
logical :: is_lat_coord | [in] | var | NetCDF variable to check |
Definition at line 710 of file mo_read_spatial_data.f90.
References is_lat_coord().
Referenced by get_header_info_from_nc(), and is_lat_coord().
|
private |
check if given variable is a lon coordinate.
logical :: is_lon_coord | [in] | var | NetCDF variable to check |
Definition at line 678 of file mo_read_spatial_data.f90.
References is_lon_coord().
Referenced by get_header_info_from_nc(), and is_lon_coord().
|
private |
check if given variable is a x-axis.
logical :: is_x_axis | [in] | var | NetCDF variable to check |
Definition at line 632 of file mo_read_spatial_data.f90.
References is_x_axis().
Referenced by get_header_info_from_nc(), and is_x_axis().
|
private |
check if given variable is a y-axis.
logical :: is_y_axis | [in] | var | NetCDF variable to check |
Definition at line 655 of file mo_read_spatial_data.f90.
References is_y_axis().
Referenced by get_header_info_from_nc(), and is_y_axis().
| subroutine, public mo_read_spatial_data::read_header_ascii | ( | character(len = *), intent(in) | filename, |
| integer(i4), intent(in) | fileunit, | ||
| integer(i4), intent(out) | header_ncols, | ||
| integer(i4), intent(out) | header_nrows, | ||
| real(dp), intent(out) | header_xllcorner, | ||
| real(dp), intent(out) | header_yllcorner, | ||
| real(dp), intent(out) | header_cellsize, | ||
| real(dp), intent(out) | header_nodata ) |
Reads header lines of ASCII files.
Reads header lines of ASCII files, e.g. dem, aspect, flow direction.
| [in] | character(len = *) :: filename | Name of file and its location |
| [in] | integer(i4) :: fileunit | File unit for open file |
| [out] | integer(i4) :: header_nCols | Reference number of columns |
| [out] | integer(i4) :: header_nRows | Reference number of rows |
| [out] | real(dp) :: header_xllcorner | Reference lower left corner (x) |
| [out] | real(dp) :: header_yllcorner | Reference lower left corner (y) |
| [out] | real(dp) :: header_cellsize | Reference cell size [m] |
| [out] | real(dp) :: header_nodata | Reference nodata value |
Definition at line 398 of file mo_read_spatial_data.f90.
References mo_common_constants::nodata_dp.
Referenced by mo_meteo_handler::init_level2(), read_header_nc_or_ascii(), mo_read_spatial_data::read_spatial_data_ascii::read_spatial_data_ascii_dp(), mo_read_spatial_data::read_spatial_data_ascii::read_spatial_data_ascii_i4(), mo_read_spatial_data::read_spatial_data_nc_or_ascii::read_spatial_data_nc_or_ascii_dp(), and mo_read_spatial_data::read_spatial_data_nc_or_ascii::read_spatial_data_nc_or_ascii_i4().
| subroutine, public mo_read_spatial_data::read_header_nc_or_ascii | ( | character(len=*), intent(in) | filepath, |
| integer(i4), intent(in) | fileunit, | ||
| integer(i4), intent(out) | header_ncols, | ||
| integer(i4), intent(out) | header_nrows, | ||
| real(dp), intent(out) | header_xllcorner, | ||
| real(dp), intent(out) | header_yllcorner, | ||
| real(dp), intent(out) | header_cellsize, | ||
| real(dp), intent(out) | header_nodata, | ||
| character(len=*), intent(in), optional | varname ) |
Read header information from either NetCDF or ASCII depending on file name/presence.
Definition at line 522 of file mo_read_spatial_data.f90.
References get_header_info_from_nc(), and read_header_ascii().
Referenced by mo_common_read_data::read_dem().
|
private |
TODO: add description.
TODO: add description
| [in] | character(len = *) :: filename | filename with location |
| [in] | integer(i4) :: fileunit | unit for opening the file |
| [in] | integer(i4) :: header_nCols | number of columns of data fields: |
| [in] | integer(i4) :: header_nRows | number of rows of data fields: |
| [in] | real(dp) :: header_xllcorner | header read in lower left corner |
| [in] | real(dp) :: header_yllcorner | header read in lower left corner |
| [in] | real(dp) :: header_cellsize | header read in cellsize |
| [out] | real(dp), dimension(:, :) :: data | data |
| [out] | logical, dimension(:, :) :: mask | mask |
Definition at line 139 of file mo_read_spatial_data.f90.
|
private |
TODO: add description.
TODO: add description
| [in] | character(len = *) :: filename | filename with location |
| [in] | integer(i4) :: fileunit | unit for opening the file |
| [in] | integer(i4) :: header_nCols | number of columns of data fields: |
| [in] | integer(i4) :: header_nRows | number of rows of data fields: |
| [in] | real(dp) :: header_xllcorner | header read in lower left corner |
| [in] | real(dp) :: header_yllcorner | header read in lower left corner |
| [in] | real(dp) :: header_cellsize | header read in cellsize |
| [out] | integer(i4), dimension(:, :) :: data | data |
| [out] | logical, dimension(:, :) :: mask | mask |
Definition at line 268 of file mo_read_spatial_data.f90.
|
private |
Read file from filepath.
If there is a nc file with the correct name it is prefered over the asci file.
TODO: add description
Definition at line 981 of file mo_read_spatial_data.f90.
|
private |
Read file from filepath.
If there is a nc file with the correct name it is prefered over the asci file.
TODO: add description
Definition at line 908 of file mo_read_spatial_data.f90.
|
private |
Read file from filepath.
If there is a nc file with the correct name it is prefered over the asci file.
TODO: add description
Definition at line 1056 of file mo_read_spatial_data.f90.
|
private |
Read file from filepath.
If there is a nc file with the correct name it is prefered over the asci file.
TODO: add description
Definition at line 1176 of file mo_read_spatial_data.f90.