13 USE mo_kind,
ONLY : i4, dp
14 use mo_message,
only: message, error_message
44 use mo_append,
only : append
52 use mo_string_utils,
only : num2str
57 integer(i4) :: domainid, idomain
60 character(256) :: fname
62 real(dp),
dimension(:, :),
allocatable :: data_dp_2d
64 type(
grid),
pointer :: level0_idomain
79 if (idomain .gt. 1)
then
80 if (
domainmeta%L0DataFrom(idomain) < idomain)
then
82 call message(
' Using dem of domain ', &
84 trim(adjustl(num2str(idomain))),
'...')
92 call message(
' Reading dem for domain: ', trim(adjustl(num2str(domainid))),
' ...')
97 level0_idomain%nrows, level0_idomain%ncols, level0_idomain%xllcorner, &
98 level0_idomain%yllcorner, level0_idomain%cellsize, level0_idomain%nodata_value)
102 call error_message(
'***ERROR: resolutionHydrology (L1) should be smaller than the input data resolution (L0)', raise=.false.)
103 call error_message(
' check set-up (in mhm.nml) for domain: ', trim(adjustl(num2str(domainid))),
' ...')
109 level0_idomain%nrows, level0_idomain%ncols, level0_idomain%xllcorner, &
110 level0_idomain%yllcorner, level0_idomain%cellsize, data_dp_2d, level0_idomain%mask)
113 data_dp_2d = merge(data_dp_2d,
nodata_dp, level0_idomain%mask)
115 call append(
l0_elev, pack(data_dp_2d, level0_idomain%mask))
117 deallocate(data_dp_2d)
119 level0_idomain%nCells = count(level0_idomain%mask)
144 use mo_append,
only : append, paste
150 use mo_string_utils,
only : num2str
155 integer(i4) :: domainid, idomain, ivar
158 character(256) :: fname
160 integer(i4),
dimension(:, :),
allocatable :: data_i4_2d
162 integer(i4),
dimension(:, :),
allocatable :: datamatrix_i4
164 logical,
dimension(:, :),
allocatable :: mask_2d
166 type(
grid),
pointer :: level0_idomain
176 if (
domainmeta%L0DataFrom(idomain) < idomain)
then
177 call message(
' Using lcover of domain ', &
178 trim(adjustl(num2str(
domainmeta%L0DataFrom(idomain)))),
' for domain: ',&
179 trim(adjustl(num2str(domainid))),
'...')
185 call message(
' Reading lcover for domain: ', trim(adjustl(num2str(domainid))),
' ...')
191 level0_idomain%nrows, level0_idomain%ncols, level0_idomain%xllcorner, &
192 level0_idomain%yllcorner, level0_idomain%cellsize, data_i4_2d, mask_2d)
194 data_i4_2d = merge(data_i4_2d,
nodata_i4, mask_2d)
195 call paste(datamatrix_i4, pack(data_i4_2d, level0_idomain%mask),
nodata_i4)
196 deallocate(data_i4_2d)
199 deallocate(datamatrix_i4)
Reads spatial data files of ASCII format.
Reads spatial data files of nc or ASCII format.
Provides constants commonly used by mHM, mRM and MPR.
real(dp), parameter, public nodata_dp
integer(i4), parameter, public nodata_i4
Provides file names and units for mRM.
integer, parameter ulcoverclass
Unit for LCover input data file.
character(len= *), parameter file_dem
DEM input data file.
integer, parameter udem
Unit for DEM input data file.
subroutine, public set_domain_indices(grids, indices)
TODO: add description.
subroutine, public read_lcover
TODO: add description.
subroutine, public read_dem
TODO: add description.
Provides common types needed by mHM, mRM and/or mpr.
Provides structures needed by mHM, mRM and/or mpr.
real(dp), dimension(:), allocatable, public resolutionhydrology
character(256), dimension(:), allocatable, public lcfilename
type(domain_meta), public domainmeta
integer(i4), public nlcoverscene
character(256), dimension(:), allocatable, public dirlcover
real(dp), dimension(:), allocatable, public l0_elev
character(256), dimension(:), allocatable, public dirmorpho
integer(i4), dimension(:, :), allocatable, public l0_lcover
type(grid), dimension(:), allocatable, target, public level0
Reads spatial input data.
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.