13 USE mo_kind,
ONLY : i4, dp
14 use mo_message,
only: message, error_message
43 use mo_append,
only : append
51 use mo_string_utils,
only : num2str
56 integer(i4) :: domainid, idomain
59 character(256) :: fname
61 real(dp),
dimension(:, :),
allocatable :: data_dp_2d
63 type(
grid),
pointer :: level0_idomain
78 if (idomain .gt. 1)
then
79 if (
domainmeta%L0DataFrom(idomain) < idomain)
then
81 call message(
' Using dem of domain ', &
83 trim(adjustl(num2str(idomain))),
'...')
91 call message(
' Reading dem for domain: ', trim(adjustl(num2str(domainid))),
' ...')
96 level0_idomain%nrows, level0_idomain%ncols, level0_idomain%xllcorner, &
97 level0_idomain%yllcorner, level0_idomain%cellsize, level0_idomain%nodata_value)
101 call error_message(
'***ERROR: resolutionHydrology (L1) should be smaller than the input data resolution (L0)', raise=.false.)
102 call error_message(
' check set-up (in mhm.nml) for domain: ', trim(adjustl(num2str(domainid))),
' ...')
108 level0_idomain%nrows, level0_idomain%ncols, level0_idomain%xllcorner, &
109 level0_idomain%yllcorner, level0_idomain%cellsize, data_dp_2d, level0_idomain%mask)
112 data_dp_2d = merge(data_dp_2d,
nodata_dp, level0_idomain%mask)
114 call append(
l0_elev, pack(data_dp_2d, level0_idomain%mask))
116 deallocate(data_dp_2d)
118 level0_idomain%nCells = count(level0_idomain%mask)
143 use mo_append,
only : append, paste
149 use mo_string_utils,
only : num2str
154 integer(i4) :: domainid, idomain, ivar
157 character(256) :: fname
159 integer(i4),
dimension(:, :),
allocatable :: data_i4_2d
161 integer(i4),
dimension(:, :),
allocatable :: datamatrix_i4
163 logical,
dimension(:, :),
allocatable :: mask_2d
165 type(
grid),
pointer :: level0_idomain
175 if (
domainmeta%L0DataFrom(idomain) < idomain)
then
176 call message(
' Using lcover of domain ', &
177 trim(adjustl(num2str(
domainmeta%L0DataFrom(idomain)))),
' for domain: ',&
178 trim(adjustl(num2str(domainid))),
'...')
184 call message(
' Reading lcover for domain: ', trim(adjustl(num2str(domainid))),
' ...')
190 level0_idomain%nrows, level0_idomain%ncols, level0_idomain%xllcorner, &
191 level0_idomain%yllcorner, level0_idomain%cellsize, data_i4_2d, mask_2d)
193 data_i4_2d = merge(data_i4_2d,
nodata_i4, mask_2d)
194 call paste(datamatrix_i4, pack(data_i4_2d, level0_idomain%mask),
nodata_i4)
195 deallocate(data_i4_2d)
198 deallocate(datamatrix_i4)
Reads spatial data files of 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 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
subroutine, public set_domain_indices(grids, indices)
TODO: add description.
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.