![]() |
mHM
The mesoscale Hydrological Model
|
Reads forcing input data. More...
Functions/Subroutines | |
| subroutine, public | read_nc (folder, nrows, ncols, varname, mask, data, target_period, lower, upper, nctimestep, filename, nocheck, maskout, is_meteo, bound_error, ntstepforcingday) |
| Reads forcing input in NetCDF file format. | |
| subroutine, public | read_const_nc (folder, nrows, ncols, varname, data, filename) |
| Reads time independent forcing input in NetCDF file format. | |
| subroutine, public | read_weights_nc (folder, nrows, ncols, varname, data, mask, lower, upper, nocheck, maskout, filename, bound_error) |
| Reads weights for meteo forcings input in NetCDF file format. | |
| subroutine | get_time_vector_and_select (var, fname, inctimestep, time_start, time_cnt, target_period) |
| Extract time vector in unit julian hours and get supposed time step in hours. | |
Reads forcing input data.
This module is to read forcing input data contained in netcdf files, e.g. temperature, precipitation, total_runoff, lai. Timesteps can be hourly, daily, monthly, and annual. The module provides a subroutine for NetCDF files only. First, the dimensions given are cross-checked with header.txt information. Second, the data of the specified period are read from the specified directory. If the optional lower and/or upper bound for the data values is given, the read data are checked for validity. The program is stopped if any value lies out of range.
COPYING and COPYING.LESSER provided with this software. The complete GNU license text can also be found at http://www.gnu.org/licenses/.
|
private |
Extract time vector in unit julian hours and get supposed time step in hours.
| [in] | var | variable of interest |
| [in] | fname | fname of ncfile for error message |
| [out] | inctimestep | flag for requested time step |
| [out] | time_start | time_start index of time selection |
| [out] | time_cnt | time_count of indexes of time selection |
| [in] | target_period | reference period |
Definition at line 487 of file mo_read_nc.f90.
Referenced by read_nc().
| subroutine, public mo_read_nc::read_const_nc | ( | character(len=*), intent(in) | folder, |
| integer(i4), intent(in) | nrows, | ||
| integer(i4), intent(in) | ncols, | ||
| character(len=*), intent(in) | varname, | ||
| real(dp), dimension(:,:), intent(out), allocatable | data, | ||
| character(256), intent(in), optional | filename ) |
Reads time independent forcing input in NetCDF file format.
Reads time independent netCDF forcing files.
First, the dimensions given are cross-checked with header.txt information. Second, the data of the specified period are read from the specified directory. If the optional lower and/or upper bound for the data values is given, the read data are checked for validity. The program is stopped if any value lies out of range.
If the optinal argument nocheck is true, the data are not checked for coverage with the input mask. Additionally in this case an mask of vild data points can be received from the routine in maskout.
| [in] | folder | folder where data are stored |
| [in] | nrows | number of rows of data fields: |
| [in] | ncols | number of columns of data fields: |
| [in] | varname | name of NetCDF variable |
| [out] | data | data read in |
| [in] | filename | name of file, defaults to varName |
Definition at line 272 of file mo_read_nc.f90.
Referenced by mo_mrm_riv_temp_class::init_area(), and mo_mrm_read_data::mrm_read_bankfull_runoff().
| subroutine, public mo_read_nc::read_nc | ( | character(len = *), intent(in) | folder, |
| integer(i4), intent(in) | nrows, | ||
| integer(i4), intent(in) | ncols, | ||
| character(len = *), intent(in) | varname, | ||
| logical, dimension(:, :), intent(in) | mask, | ||
| real(dp), dimension(:, :, :), intent(out), allocatable | data, | ||
| type(period), intent(in), optional | target_period, | ||
| real(dp), intent(in), optional | lower, | ||
| real(dp), intent(in), optional | upper, | ||
| integer(i4), intent(in), optional | nctimestep, | ||
| character(256), intent(in), optional | filename, | ||
| logical, intent(in), optional | nocheck, | ||
| logical, dimension(:, :, :), intent(out), optional, allocatable | maskout, | ||
| logical, intent(in), optional | is_meteo, | ||
| logical, intent(in), optional | bound_error, | ||
| integer(i4), intent(inout), optional | ntstepforcingday ) |
Reads forcing input in NetCDF file format.
Reads netCDF forcing files. First, the dimensions given are cross-checked with header.txt information. Second, the data of the specified period are read from the specified directory. If the optional lower and/or upper bound for the data values is given, the read data are checked for validity. The program is stopped if any value lies out of range. If the optinal argument nocheck is true, the data are not checked for coverage with the input mask. Additionally in this case an mask of vild data points can be received from the routine in maskout.
| [in] | folder | Name of the folder where data are stored |
| [in] | nrows | Number of datapoints in longitudinal direction |
| [in] | ncols | Number of datapoints in latitudinal direction |
| [in] | varname | Name of variable name to read |
| [in] | mask | mask of valid data fields |
| [out] | data | Data matrixdim_1 = longitude, dim_2 = latitude, dim_3 = time |
| [in] | target_period | Period the data are needed for |
| [in] | lower | Lower bound for check of validity of data values |
| [in] | upper | Upper bound for check of validity of data values |
| [in] | nctimestep | timestep in netcdf file |
| [in] | filename | name of file, defaults to varName |
| [in] | nocheck | .TRUE. if check for nodata values deactivated, default = .FALSE. - check is done |
| [out] | maskout | mask of validdata points |
| [in] | is_meteo | logical whether meteorology is currently read |
| [in] | bound_error | .FALSE. to only warn about bound (lower, upper) violations, default = .TRUE. - raise an error |
| [in,out] | ntstepforcingday | Number of datapoints in longitudinal direction |
Definition at line 66 of file mo_read_nc.f90.
References get_time_vector_and_select().
Referenced by mo_meteo_helper::meteo_forcings_wrapper(), mo_mrm_read_data::mrm_read_total_runoff(), mo_prepare_gridded_lai::prepare_gridded_daily_lai_data(), and mo_read_optional_data::readoptidataobs().
| subroutine, public mo_read_nc::read_weights_nc | ( | character(len = *), intent(in) | folder, |
| integer(i4), intent(in) | nrows, | ||
| integer(i4), intent(in) | ncols, | ||
| character(len = *), intent(in) | varname, | ||
| real(dp), dimension(:, :, :, :), intent(out), allocatable | data, | ||
| logical, dimension(:, :), intent(in) | mask, | ||
| real(dp), intent(in), optional | lower, | ||
| real(dp), intent(in), optional | upper, | ||
| logical, intent(in), optional | nocheck, | ||
| logical, dimension(:, :, :, :), intent(out), optional, allocatable | maskout, | ||
| character(256), intent(in), optional | filename, | ||
| logical, intent(in), optional | bound_error ) |
Reads weights for meteo forcings input in NetCDF file format.
Reads netCDF weight files. First, the dimensions given are cross-checked with header.txt information. If the optional lower and/or upper bound for the data values is given, the read data are checked for validity. The program is stopped if any value lies out of range. If the optinal argument nocheck is true, the data are not checked for coverage with the input mask. Additionally in this case an mask of vild data points can be received from the routine in maskout.
| [in] | folder | Name of the folder where data are stored |
| [in] | nrows | Number of datapoints in longitudinal direction |
| [in] | ncols | Number of datapoints in latitudinal direction |
| [in] | varname | Name of variable name to read |
| [out] | data | Data matrixdim_1 = longitude, dim_2 = latitude, dim_3 = months, dim_4 = hours |
| [in] | mask | mask of valid data fields |
| [in] | lower | Lower bound for check of validity of data values |
| [in] | upper | Upper bound for check of validity of data values |
| [in] | nocheck | .TRUE. if check for nodata values deactivateddefault = .FALSE. - check is done |
| [in] | filename | name of variable, defaults to fileName |
| [out] | maskout | ! mask of validdata points |
| [in] | bound_error | .FALSE. to only warn about bound (lower, upper) violations, default = .TRUE. - raise an error |
Definition at line 343 of file mo_read_nc.f90.
Referenced by mo_meteo_helper::meteo_weights_wrapper().