15 USE mo_kind,
ONLY : i4, dp
68 use mo_kind,
only : i4
74 integer(i4) :: idomain
85 if (idomain .eq. 1)
then
90 else if (
domainmeta%L0DataFrom(idomain) == idomain)
then
130 use mo_message,
only : error_message
133 use mo_string_utils,
only : num2str
134 use mo_utils,
only : eq
139 integer(i4),
intent(in) :: iDomain
141 integer(i4) :: k, n, nH
143 CHARACTER(len=1024) :: message_text =
''
150 message_text = trim(num2str(k,
'(I5)')) //
',' // trim(num2str(idomain,
'(I5)'))
151 call error_message(
' Error: elevation has missing value within the valid masked area at cell in domain ', &
157 message_text = trim(num2str(k,
'(I5)')) //
',' // trim(num2str(idomain,
'(I5)'))
158 call error_message(
' Error: slope has missing value within the valid masked area at cell in domain ', &
164 message_text = trim(num2str(k,
'(I5)')) //
',' // trim(num2str(idomain,
'(I5)'))
165 call error_message(
' Error: aspect has missing values within the valid masked area at cell in domain ', &
175 message_text = trim(num2str(k,
'(I5)')) //
',' // trim(num2str(idomain,
'(I5)')) //
',' // trim(num2str(n,
'(I5)'))
176 call error_message(
' Error: soil id has missing values within the valid masked area at cell in domain and horizon ', &
183 message_text = trim(num2str(k,
'(I5)')) //
',' // trim(num2str(idomain,
'(I5)'))
184 call error_message(
' Error: geological formation id has missing values within the valid masked area at cell in domain ', &
191 message_text = trim(num2str(k,
'(I5)')) //
',' // trim(num2str(idomain,
'(I5)')) //
',' // trim(num2str(n,
'(I5)'))
192 call error_message(
' Error: land cover id has missing values within the valid masked area at cell in domain and scene ', &
200 message_text = trim(num2str(k,
'(G5.3)')) //
',' // trim(num2str(idomain,
'(I5)'))
201 call error_message(
' Error: gridded LAI has missing values within the valid masked area at cell in domain ', &
239 use mo_append,
only : append
244 use mo_orderpack,
only : sort_index
245 use mo_utils,
only : eq
250 integer(i4),
intent(in) :: iDomain
252 real(dp),
dimension(:),
allocatable :: slope_emp
254 integer(i4),
dimension(:),
allocatable :: slope_sorted_index
256 integer(i4) :: i, j, k, nH, i_sort, i_sortpost
268 if (idomain .eq. 1)
then
270 soildb%is_present(:) = 0_i4
278 allocate(slope_emp(
level0(idomain)%nCells), slope_sorted_index(
level0(idomain)%nCells))
296 slope_emp(slope_sorted_index(
level0(idomain)%nCells)) = real(
level0(idomain)%nCells, dp) / &
297 real(level0(iDomain)%nCells + 1_i4, dp)
300 do i = level0(idomain)%nCells - 1, 1, -1
301 i_sort=slope_sorted_index(i)
302 i_sortpost=slope_sorted_index(i+1)
303 if (eq(
l0_slope(level0(idomain)%iStart-1_i4+i_sort),
l0_slope(level0(idomain)%iStart-1_i4+i_sortpost)))
then
305 slope_emp(i_sort) = slope_emp(i_sortpost)
308 slope_emp(i_sort) = real(i, dp) / real(level0(idomain)%nCells + 1_i4, dp)
327 do k = level0(idomain)%iStart, level0(idomain)%iEnd
329 soildb%is_present(j) = 1_i4
334 deallocate(slope_emp, slope_sorted_index)
365 use mo_append,
only : append
366 use mo_constants,
only : yearmonths
380 integer(i4),
intent(in) :: ncells1
382 real(dp),
dimension(:, :, :),
allocatable :: dummy_3d
384 integer(i4) :: max_extent
412 call append(
l1_fasp, dummy_3d(:, 1 : 1, 1 : 1))
458 if (
allocated(dummy_3d))
deallocate(dummy_3d)
Provides constants commonly used by mHM, mRM and MPR.
real(dp), parameter, public p1_initstatefluxes
real(dp), parameter, public eps_dp
epsilon(1.0) in double precision
real(dp), parameter, public nodata_dp
integer(i4), parameter, public nodata_i4
Provides structures needed by mHM, mRM and/or mpr.
real(dp), dimension(:), allocatable, public resolutionhydrology
type(domain_meta), public domainmeta
integer(i4), public nlcoverscene
real(dp), dimension(:), allocatable, public l0_elev
integer(i4), dimension(:, :), allocatable, public l0_lcover
type(grid), dimension(:), allocatable, target, public level1
type(grid), dimension(:), allocatable, target, public level0
type(gridremapper), dimension(:), allocatable, public l0_l1_remap
subroutine, public set_domain_indices(grids, indices)
TODO: add description.
subroutine, public init_lowres_level(highres, target_resolution, lowres, highres_lowres_remap)
Level-1 variable initialization.
subroutine, public l0_grid_setup(new_grid)
level 0 variable initialization
Global variables for mpr only.
real(dp), dimension(:, :, :), allocatable, public l1_degday
real(dp), dimension(:, :, :), allocatable, public l1_degdaymax
real(dp), dimension(:, :, :), allocatable, public l1_soilmoistexp
real(dp), dimension(:, :, :), allocatable, public l1_harsamcoeff
real(dp), dimension(:, :, :), allocatable, public l1_karstloss
real(dp), dimension(:, :, :), allocatable, public l1_unsatthresh
real(dp), dimension(:, :, :), allocatable, public l1_kperco
real(dp), dimension(:), allocatable, public l0_slope_emp
real(dp), dimension(:, :, :), allocatable, public l1_alpha
real(dp), dimension(:, :, :), allocatable, public l1_surfresist
integer(i4), dimension(:), allocatable, public l0_geounit
real(dp), dimension(:,:,:), allocatable, public l1_cosmicl3
real(dp), dimension(:), allocatable, public l0_asp
real(dp), dimension(:, :, :), allocatable, public l1_degdayinc
integer(i4), public nsoiltypes
real(dp), dimension(:, :, :), allocatable, public l1_petlaicorfactor
real(dp), dimension(:, :, :), allocatable, public l1_fasp
real(dp), dimension(:, :, :), allocatable, public l1_kbaseflow
real(dp), dimension(:, :, :), allocatable, public l1_soilmoistfc
integer(i4), public nsoilhorizons_mhm
type(soiltype), public soildb
real(dp), dimension(:, :, :), allocatable, public l1_maxinter
real(dp), dimension(:,:,:), allocatable, public l1_bulkdens
real(dp), dimension(:, :, :), allocatable, public l1_degdaynopre
real(dp), dimension(:, :, :), allocatable, public l1_wiltingpoint
integer(i4), dimension(:, :), allocatable, public l0_soilid
real(dp), dimension(:, :), allocatable, public l0_gridded_lai
real(dp), dimension(:, :, :), allocatable, public l1_prietayalpha
real(dp), dimension(:, :, :), allocatable, public l1_fsealed
real(dp), dimension(:, :, :), allocatable, public l1_froots
integer(i4), public iflag_soildb
real(dp), dimension(:, :, :), allocatable, public l1_jarvis_thresh_c1
real(dp), dimension(:, :, :), allocatable, public l1_tempthresh
real(dp), dimension(:,:,:), allocatable, public l1_no_count
real(dp), dimension(:, :, :), allocatable, public l1_kfastflow
real(dp), dimension(:, :, :), allocatable, public l1_kslowflow
real(dp), dimension(:, :, :), allocatable, public l1_aeroresist
real(dp), dimension(:, :, :), allocatable, public l1_sealedthresh
integer(i4), public timestep_lai_input
real(dp), dimension(:, :, :), allocatable, public l1_soilmoistsat
real(dp), dimension(:), allocatable, public l0_slope
real(dp), dimension(:,:,:), allocatable, public l1_latticewater
Startup procedures for mHM.
subroutine, public init_eff_params(ncells1)
Allocation of space for mHM related L1 and L11 variables.
subroutine l0_check_input(idomain)
Check for errors in L0 input data.
subroutine l0_variable_init(idomain)
level 0 variable initialization
subroutine, public mpr_initialize
Initialize main mHM variables.
reading latitude and longitude coordinates for each domain
subroutine, public read_latlon(ii, lon_var_name, lat_var_name, level_name, level)
reads latitude and longitude coordinates
Generating soil database from input file.
subroutine, public generate_soil_database
Generates soil database.