82 use mo_append,
only : append
86 use mo_message,
only : message, error_message
87 use mo_message,
only : message, error_message
93 use mo_string_utils,
only : num2str
94 use mo_utils,
only : eq
98 character(*),
intent(in) :: file_namelist
100 character(*),
intent(in) :: file_namelist_param
105 real(dp),
dimension(maxNoSoilHorizons) :: soil_depth
109 character(256),
dimension(maxNoDomains) :: dir_gridded_lai
111 character(256) :: dummy
114 real(dp),
dimension(5, nColPars) :: dummy_2d_dp
117 real(dp),
dimension(1, nColPars) :: dummy_2d_dp_2
119 real(dp),
dimension(nColPars) :: canopyinterceptionfactor
121 real(dp),
dimension(nColPars) :: snowtreshholdtemperature
122 real(dp),
dimension(nColPars) :: degreedayfactor_forest
123 real(dp),
dimension(nColPars) :: degreedayfactor_impervious
124 real(dp),
dimension(nColPars) :: degreedayfactor_pervious
125 real(dp),
dimension(nColPars) :: increasedegreedayfactorbyprecip
126 real(dp),
dimension(nColPars) :: maxdegreedayfactor_forest
127 real(dp),
dimension(nColPars) :: maxdegreedayfactor_impervious
128 real(dp),
dimension(nColPars) :: maxdegreedayfactor_pervious
130 real(dp),
dimension(nColPars) :: orgmattercontent_forest
131 real(dp),
dimension(nColPars) :: orgmattercontent_impervious
132 real(dp),
dimension(nColPars) :: orgmattercontent_pervious
133 real(dp),
dimension(nColPars) :: ptf_lower66_5_constant
134 real(dp),
dimension(nColPars) :: ptf_lower66_5_clay
135 real(dp),
dimension(nColPars) :: ptf_lower66_5_db
136 real(dp),
dimension(nColPars) :: ptf_higher66_5_constant
137 real(dp),
dimension(nColPars) :: ptf_higher66_5_clay
138 real(dp),
dimension(nColPars) :: ptf_higher66_5_db
139 real(dp),
dimension(nColPars) :: ptf_ks_constant
140 real(dp),
dimension(nColPars) :: ptf_ks_sand
141 real(dp),
dimension(nColPars) :: ptf_ks_clay
142 real(dp),
dimension(nColPars) :: ptf_ks_curveslope
143 real(dp),
dimension(nColPars) :: rootfractioncoefficient_forest
144 real(dp),
dimension(nColPars) :: rootfractioncoefficient_impervious
145 real(dp),
dimension(nColPars) :: rootfractioncoefficient_pervious
146 real(dp),
dimension(nColPars) :: infiltrationshapefactor
147 real(dp),
dimension(nColPars) :: jarvis_sm_threshold_c1
149 real(dp),
dimension(nColPars) :: fcmin_glob
150 real(dp),
dimension(nColPars) :: fcdelta_glob
151 real(dp),
dimension(nColPars) :: rootfractioncoefficient_sand
152 real(dp),
dimension(nColPars) :: rootfractioncoefficient_clay
154 real(dp),
dimension(nColPars) :: imperviousstoragecapacity
156 real(dp),
dimension(nColPars) :: pet_a_forest
157 real(dp),
dimension(nColPars) :: pet_a_impervious
158 real(dp),
dimension(nColPars) :: pet_a_pervious
159 real(dp),
dimension(nColPars) :: pet_b
160 real(dp),
dimension(nColPars) :: pet_c
162 real(dp),
dimension(nColPars) :: mincorrectionfactorpet
163 real(dp),
dimension(nColPars) :: maxcorrectionfactorpet
164 real(dp),
dimension(nColPars) :: aspecttresholdpet
165 real(dp),
dimension(nColPars) :: hargreavessamanicoeff
167 real(dp),
dimension(nColPars) :: priestleytaylorcoeff
168 real(dp),
dimension(nColPars) :: priestleytaylorlaicorr
170 real(dp),
dimension(nColPars) :: canopyheigth_forest
171 real(dp),
dimension(nColPars) :: canopyheigth_impervious
172 real(dp),
dimension(nColPars) :: canopyheigth_pervious
173 real(dp),
dimension(nColPars) :: displacementheight_coeff
174 real(dp),
dimension(nColPars) :: roughnesslength_momentum_coeff
175 real(dp),
dimension(nColPars) :: roughnesslength_heat_coeff
176 real(dp),
dimension(nColPars) :: stomatal_resistance
178 real(dp),
dimension(nColPars) :: interflowstoragecapacityfactor
179 real(dp),
dimension(nColPars) :: interflowrecession_slope
180 real(dp),
dimension(nColPars) :: fastinterflowrecession_forest
181 real(dp),
dimension(nColPars) :: slowinterflowrecession_ks
182 real(dp),
dimension(nColPars) :: exponentslowinterflow
184 real(dp),
dimension(nColPars) :: rechargecoefficient
185 real(dp),
dimension(nColPars) :: rechargefactor_karstic
186 real(dp),
dimension(nColPars) :: gain_loss_gwreservoir_karstic
188 real(dp),
dimension(maxGeoUnit, nColPars) :: geoparam
190 real(dp),
dimension(nColPars) :: desilets_n0
191 real(dp),
dimension(nColPars) :: desilets_lw0
192 real(dp),
dimension(nColPars) :: desilets_lw1
195 real(dp),
dimension(nColPars) :: cosmic_n0
196 real(dp),
dimension(nColPars) :: cosmic_n1
197 real(dp),
dimension(nColPars) :: cosmic_n2
198 real(dp),
dimension(nColPars) :: cosmic_alpha0
199 real(dp),
dimension(nColPars) :: cosmic_alpha1
200 real(dp),
dimension(nColPars) :: cosmic_l30
201 real(dp),
dimension(nColPars) :: cosmic_l31
202 real(dp),
dimension(nColPars) :: cosmic_lw0
203 real(dp),
dimension(nColPars) :: cosmic_lw1
205 integer(i4) :: idomain, domainid
235 call error_message(
'***ERROR: Number of soil horizons is resticted to ', trim(num2str(
maxnosoilhorizons)),
'!')
243 call error_message(
'***ERROR: iFlag_soilDB option given does not exist. Only 0 and 1 is taken at the moment.')
244 call error_message(
'***ERROR: iFlag_soilDB option given does not exist. Only 0 and 1 is taken at the moment.')
250 call error_message(
'***ERROR: Soil tillage depth must conform with one of the specified horizon (lower) depth.')
274 call error_message(
'***ERROR: option for selected timeStep_LAI_input not coded yet')
294 'canopyInterceptionFactor'/))
298 call error_message(
'***ERROR: parameter in namelist "interception1" out of bound in ', trim(adjustl(file_namelist_param)))
301 call error_message(
'***ERROR: Process description for process "interception" does not exist!')
310 snowtreshholdtemperature =
nml_snow1%snowTreshholdTemperature
311 degreedayfactor_forest =
nml_snow1%degreeDayFactor_forest
312 degreedayfactor_impervious =
nml_snow1%degreeDayFactor_impervious
313 degreedayfactor_pervious =
nml_snow1%degreeDayFactor_pervious
314 increasedegreedayfactorbyprecip =
nml_snow1%increaseDegreeDayFactorByPrecip
315 maxdegreedayfactor_forest =
nml_snow1%maxDegreeDayFactor_forest
316 maxdegreedayfactor_impervious =
nml_snow1%maxDegreeDayFactor_impervious
317 maxdegreedayfactor_pervious =
nml_snow1%maxDegreeDayFactor_pervious
331 'snowTreshholdTemperature ', &
332 'degreeDayFactor_forest ', &
333 'degreeDayFactor_impervious ', &
334 'degreeDayFactor_pervious ', &
335 'increaseDegreeDayFactorByPrecip', &
336 'maxDegreeDayFactor_forest ', &
337 'maxDegreeDayFactor_impervious ', &
338 'maxDegreeDayFactor_pervious '/))
342 call error_message(
'***ERROR: parameter in namelist "snow1" out of bound in ', trim(adjustl(file_namelist_param)))
345 call error_message(
'***ERROR: Process description for process "snow" does not exist!')
367 rootfractioncoefficient_forest =
nml_soilmoisture1%rootFractionCoefficient_forest
368 rootfractioncoefficient_impervious =
nml_soilmoisture1%rootFractionCoefficient_impervious
369 rootfractioncoefficient_pervious =
nml_soilmoisture1%rootFractionCoefficient_pervious
393 'orgMatterContent_forest ', &
394 'orgMatterContent_impervious ', &
395 'orgMatterContent_pervious ', &
396 'PTF_lower66_5_constant ', &
397 'PTF_lower66_5_clay ', &
398 'PTF_lower66_5_Db ', &
399 'PTF_higher66_5_constant ', &
400 'PTF_higher66_5_clay ', &
401 'PTF_higher66_5_Db ', &
402 'PTF_Ks_constant ', &
405 'PTF_Ks_curveSlope ', &
406 'rootFractionCoefficient_forest ', &
407 'rootFractionCoefficient_impervious', &
408 'rootFractionCoefficient_pervious ', &
409 'infiltrationShapeFactor '/))
413 call error_message(
'***ERROR: parameter in namelist "soilmoisture1" out of bound in ', trim(adjustl(file_namelist_param)))
431 rootfractioncoefficient_forest =
nml_soilmoisture2%rootFractionCoefficient_forest
432 rootfractioncoefficient_impervious =
nml_soilmoisture2%rootFractionCoefficient_impervious
433 rootfractioncoefficient_pervious =
nml_soilmoisture2%rootFractionCoefficient_pervious
459 'orgMatterContent_forest ', &
460 'orgMatterContent_impervious ', &
461 'orgMatterContent_pervious ', &
462 'PTF_lower66_5_constant ', &
463 'PTF_lower66_5_clay ', &
464 'PTF_lower66_5_Db ', &
465 'PTF_higher66_5_constant ', &
466 'PTF_higher66_5_clay ', &
467 'PTF_higher66_5_Db ', &
468 'PTF_Ks_constant ', &
471 'PTF_Ks_curveSlope ', &
472 'rootFractionCoefficient_forest ', &
473 'rootFractionCoefficient_impervious', &
474 'rootFractionCoefficient_pervious ', &
475 'infiltrationShapeFactor ', &
476 'jarvis_sm_threshold_c1 '/))
480 call error_message(
'***ERROR: parameter in namelist "soilmoisture2" out of bound in ', trim(adjustl(file_namelist_param)))
498 rootfractioncoefficient_forest =
nml_soilmoisture3%rootFractionCoefficient_forest
499 rootfractioncoefficient_impervious =
nml_soilmoisture3%rootFractionCoefficient_impervious
500 rootfractioncoefficient_pervious =
nml_soilmoisture3%rootFractionCoefficient_pervious
534 'orgMatterContent_forest ', &
535 'orgMatterContent_impervious ', &
536 'orgMatterContent_pervious ', &
537 'PTF_lower66_5_constant ', &
538 'PTF_lower66_5_clay ', &
539 'PTF_lower66_5_Db ', &
540 'PTF_higher66_5_constant ', &
541 'PTF_higher66_5_clay ', &
542 'PTF_higher66_5_Db ', &
543 'PTF_Ks_constant ', &
546 'PTF_Ks_curveSlope ', &
547 'rootFractionCoefficient_forest ', &
548 'rootFractionCoefficient_impervious', &
549 'rootFractionCoefficient_pervious ', &
550 'infiltrationShapeFactor ', &
551 'rootFractionCoefficient_sand ', &
552 'rootFractionCoefficient_clay ', &
555 'jarvis_sm_threshold_c1 '/))
559 call error_message(
'***ERROR: parameter in namelist "soilmoisture3" out of bound in ', trim(adjustl(file_namelist_param)))
577 rootfractioncoefficient_forest =
nml_soilmoisture4%rootFractionCoefficient_forest
578 rootfractioncoefficient_impervious =
nml_soilmoisture4%rootFractionCoefficient_impervious
579 rootfractioncoefficient_pervious =
nml_soilmoisture4%rootFractionCoefficient_pervious
611 'orgMatterContent_forest ', &
612 'orgMatterContent_impervious ', &
613 'orgMatterContent_pervious ', &
614 'PTF_lower66_5_constant ', &
615 'PTF_lower66_5_clay ', &
616 'PTF_lower66_5_Db ', &
617 'PTF_higher66_5_constant ', &
618 'PTF_higher66_5_clay ', &
619 'PTF_higher66_5_Db ', &
620 'PTF_Ks_constant ', &
623 'PTF_Ks_curveSlope ', &
624 'rootFractionCoefficient_forest ', &
625 'rootFractionCoefficient_impervious', &
626 'rootFractionCoefficient_pervious ', &
627 'infiltrationShapeFactor ', &
628 'rootFractionCoefficient_sand ', &
629 'rootFractionCoefficient_clay ', &
635 call error_message(
'***ERROR: parameter in namelist "soilmoisture4" out of bound in ', trim(adjustl(file_namelist_param)))
638 call error_message(
'***ERROR: Process description for process "soilmoisture" does not exist!')
639 call error_message(
'***ERROR: Process description for process "soilmoisture" does not exist!')
657 call error_message(
'***ERROR: parameter in namelist "directRunoff1" out of bound in ', trim(adjustl(file_namelist_param)))
660 call error_message(
'***ERROR: Process description for process "directRunoff" does not exist!')
661 call error_message(
'***ERROR: Process description for process "directRunoff" does not exist!')
684 'PET_a_impervious ', &
691 call error_message(
'***ERROR: parameter in namelist "PETminus1" out of bound n ', trim(adjustl(file_namelist_param)))
694 call nml_pet0%read(file_namelist_param)
695 mincorrectionfactorpet =
nml_pet0%minCorrectionFactorPET
696 maxcorrectionfactorpet =
nml_pet0%maxCorrectionFactorPET
697 aspecttresholdpet =
nml_pet0%aspectTresholdPET
706 'minCorrectionFactorPET ', &
707 'maxCorrectionFactorPET ', &
708 'aspectTresholdPET '/))
712 call error_message(
'***ERROR: parameter in namelist "PET0" out of bound in ', trim(adjustl(file_namelist_param)))
715 call nml_pet1%read(file_namelist_param)
716 mincorrectionfactorpet =
nml_pet1%minCorrectionFactorPET
717 maxcorrectionfactorpet =
nml_pet1%maxCorrectionFactorPET
718 aspecttresholdpet =
nml_pet1%aspectTresholdPET
719 hargreavessamanicoeff =
nml_pet1%HargreavesSamaniCoeff
728 'minCorrectionFactorPET', &
729 'maxCorrectionFactorPET', &
730 'aspectTresholdPET ', &
731 'HargreavesSamaniCoeff '/))
735 call error_message(
'***ERROR: parameter in namelist "PET1" out of bound in ', trim(adjustl(file_namelist_param)))
738 call nml_pet2%read(file_namelist_param)
739 priestleytaylorcoeff =
nml_pet2%PriestleyTaylorCoeff
740 priestleytaylorlaicorr =
nml_pet2%PriestleyTaylorLAIcorr
747 'PriestleyTaylorCoeff ', &
748 'PriestleyTaylorLAIcorr'/))
752 call error_message(
'***ERROR: parameter in namelist "PET2" out of bound in ', trim(adjustl(file_namelist_param)))
755 call nml_pet3%read(file_namelist_param)
756 canopyheigth_forest =
nml_pet3%canopyheigth_forest
757 canopyheigth_impervious =
nml_pet3%canopyheigth_impervious
758 canopyheigth_pervious =
nml_pet3%canopyheigth_pervious
759 displacementheight_coeff =
nml_pet3%displacementheight_coeff
760 roughnesslength_momentum_coeff =
nml_pet3%roughnesslength_momentum_coeff
761 roughnesslength_heat_coeff =
nml_pet3%roughnesslength_heat_coeff
762 stomatal_resistance =
nml_pet3%stomatal_resistance
776 'canopyheigth_forest ', &
777 'canopyheigth_impervious ', &
778 'canopyheigth_pervious ', &
779 'displacementheight_coeff ', &
780 'roughnesslength_momentum_coeff', &
781 'roughnesslength_heat_coeff ', &
782 'stomatal_resistance '/))
786 call error_message(
'***ERROR: parameter in namelist "PET3" out of bound in ', trim(adjustl(file_namelist_param)))
789 call error_message(
'***ERROR: Process description for process "actualET" does not exist!')
790 call error_message(
'***ERROR: Process description for process "actualET" does not exist!')
799 interflowstoragecapacityfactor =
nml_interflow1%interflowStorageCapacityFactor
800 interflowrecession_slope =
nml_interflow1%interflowRecession_slope
801 fastinterflowrecession_forest =
nml_interflow1%fastInterflowRecession_forest
802 slowinterflowrecession_ks =
nml_interflow1%slowInterflowRecession_Ks
814 'interflowStorageCapacityFactor', &
815 'interflowRecession_slope ', &
816 'fastInterflowRecession_forest ', &
817 'slowInterflowRecession_Ks ', &
818 'exponentSlowInterflow '/))
822 call error_message(
'***ERROR: parameter in namelist "interflow1" out of bound in ', trim(adjustl(file_namelist_param)))
825 call error_message(
'***ERROR: Process description for process "interflow" does not exist!')
826 call error_message(
'***ERROR: Process description for process "interflow" does not exist!')
836 gain_loss_gwreservoir_karstic =
nml_percolation1%gain_loss_GWreservoir_karstic
845 'rechargeCoefficient ', &
846 'rechargeFactor_karstic ', &
847 'gain_loss_GWreservoir_karstic'/))
851 call error_message(
'***ERROR: parameter in namelist "percolation1" out of bound in ', trim(adjustl(file_namelist_param)))
854 call error_message(
'***ERROR: Process description for process "percolation" does not exist!')
855 call error_message(
'***ERROR: Process description for process "percolation" does not exist!')
863 call message(
'***CAUTION: Routing is deativated! ')
885 call error_message(
'***ERROR: Process description for process "routing" does not exist!')
901 do ii = 1,
size(geoparam, 1)
916 dummy =
'GeoParam(' // trim(adjustl(num2str(ii))) //
',:)'
922 call error_message(
'***ERROR: parameter in namelist "geoparameter" out of bound in ', trim(adjustl(file_namelist_param)))
925 call error_message(
'***ERROR: Process description for process "geoparameter" does not exist!')
939 call message(
'***SELECTION: Neutron count routine is deativated! ')
962 call error_message(
'***ERROR: parameter in namelist "neutrons1" out of bound in ', trim(adjustl(file_namelist_param)))
1001 call error_message(
'***ERROR: parameter in namelist "neutrons2" out of bound in ', trim(adjustl(file_namelist_param)))
1004 call error_message(
'***ERROR: Process description for process "NEUTRON count" does not exist!')