34 USE mo_kind,
ONLY : i4, dp
35 use mo_message,
only: message, error_message
99 use mo_kind,
only : i4
100 use mo_string_utils,
only : num2str
101 use mo_os,
only : check_path_isdir
111 character(256),
dimension(:),
intent(in) :: dirprecipitation
112 character(256),
dimension(:),
intent(in) :: dirreferenceet
113 character(256),
dimension(:),
intent(in) :: dirtemperature
115 character(256) :: fname
117 integer(i4) :: i, j, idomain, domainid
124 call message(
' Log-file written to ', trim(fname))
126 call check_path_isdir(trim(adjustl(
dirconfigout)), raise=.true.)
127 open(
uconfig, file = fname, status =
'unknown', action =
'write', iostat = err)
129 call error_message(
' Problems while creating File. ',
'Error-Code ', num2str(err))
133 write(
uconfig, 100)
'L. Samaniego & R. Kumar, UFZ'
136 write(
uconfig, 201)
' M A I N mHM C O N F I G U R A T I O N I N F O R M A T I O N '
146 write(
uconfig, 103)
'Domain ', domainid,
'No. of cells L1 ',
level1(idomain)%nCells
148 write(
uconfig, 103)
'Total No. of nodes ',
level11(idomain)%nCells
149 write(
uconfig, 103)
'Total No. of reaches ',
level11(idomain)%nCells - 1
177 write(
uconfig, 115)
' Model Run Periods for Domain ', num2str(domainid)
180 ' Day Month Year Day Month Year'
182 'Warming Period (1) ', &
186 'Evaluation Period (2) ', &
190 'Simulation Period (1)+(2) ', &
200 write(
uconfig, 118)
' Land Cover Observations for Domain ', num2str(domainid)
201 write(
uconfig, 119)
' Start Year',
' End Year',
' Land cover scene',
'Land Cover File'
210 write(
uconfig, 121)
' Initial Transfer Function Parameter Ranges (gammas) '
214 ' i',
' min',
' max',
' current', &
223 write(
uconfig, 202)
' Domain Runoff Data '
224 write(
uconfig, 107)
' Gauge No.',
' Domain Id',
' Qmax[m3/s]',
' Qmin[m3/s]'
236 write(
uconfig, 202)
' Domain Inflow Data '
237 write(
uconfig, 107)
' Gauge No.',
' Domain Id',
' Qmax[m3/s]',
' Qmin[m3/s]'
249 write(
uconfig, 218)
'Domain-wise Configuration'
258 write(
uconfig, 222)
'Directory list'
263 write(
uconfig, 224)
'Directory to gauging station input ',
dirgauges(idomain)
265 write(
uconfig, 224)
'Directory to precipitation input ', dirprecipitation(idomain)
266 write(
uconfig, 224)
'Directory to temperature input ', dirtemperature(idomain)
267 write(
uconfig, 224)
'Directory to reference ET input ', dirreferenceet(idomain)
268 write(
uconfig, 224)
'Directory to write output by default ',
dirout(idomain)
272 write(
uconfig, 102)
'River Network (Routing level)'
273 write(
uconfig, 100)
'Label 0 = intermediate draining cell '
274 write(
uconfig, 100)
'Label 1 = headwater cell '
275 write(
uconfig, 100)
'Label 2 = sink cell '
278 write(
uconfig, 104)
' Overall', &
308 write(
uconfig, 134)
' Overall', &
331 write(
uconfig, 109)
' Overall',
' Domain', &
332 ' Cell',
' Routing', &
334 do i = 1,
level11(idomain)%nCells
339 write(
uconfig, 111)
' Modeling',
' Routing',
' Effective', &
340 ' Cell',
' Cell Id',
' Area', &
341 ' Id',
' [-]',
' [km2]'
343 do i = 1,
level1(idomain)%nCells
346 write(
uconfig, 114)
' Total[km2]', sum(
level1(idomain)%CellArea) * 1.0e-6_dp
356 102
format (/ 30(
'-') / a30 / 30(
'-'))
357 103
format (a20, 10x, i10)
358 104
format (/ 75(
'-') / 5a10, 5x, 2a10 / 5a10, 5x, 2a10)
359 105
format (5a10, 5x, 2a10 / 75(
'-'))
360 106
format (5i10, 5x, 2f10.3)
361 107
format (2a10, 2a15)
362 108
format (2i10, 2f15.3)
364 109
format (/ 20(
'-') / 2a10 / 2a10 / 2a10 / 20(
'-'))
367 111
format (/ 30(
'-') / 3a10 / 3a10 / 3a10 / 30(
'-'))
368 113
format (2i10, 1f10.3)
369 114
format (30(
'-') / a15, 5x, 1f10.3 /)
371 115
format (/61(
'-')/ a50, a10 /61(
'-'))
372 116
format (39x, a22 / 25x, a36)
373 117
format (3(a25, 6(i6)))
375 118
format (/50(
'-')/ a40, a10 /50(
'-'))
376 119
format (a10, a10, a20, a20/)
377 120
format (i10, i10, 10x, i10, a20)
379 121
format (/55(
'-')/ a55 /55(
'-'))
380 122
format (a10, 3a15, a35)
381 123
format (i10, 3f15.3, a35)
383 126
format (a30, 9x, l1)
385 134
format (/ 50(
'-') / 5a10 / 5a10)
386 135
format (5a10 / 50(
'-'))
391 202
format (/50(
'-')/ a50 /50(
'-'))
393 218
format (/ 80(
'-')/ 26x, a24, 26x, /80(
'-'))
394 222
format (/80(
'-')/ 26x, a21 /80(
'-'))
395 224
format (a40, 5x, a256)
397 301
format (a7, i2, a32, f15.0)
398 302
format (a7, i2, a32, es20.8)
435 use mo_string_utils,
only : num2str
436 use mo_os,
only : check_path_isdir
441 real(dp),
intent(in) :: best_of
444 real(dp),
dimension(:),
intent(in) :: best_paramset
446 character(len = *),
dimension(:),
intent(in) :: param_names
448 character(256) :: fname, formheader, formparams
450 integer(i4) :: ii, err, n_params
454 n_params =
size(best_paramset)
459 call check_path_isdir(trim(adjustl(
dirconfigout)), raise=.true.)
460 open(
uopti, file = fname, status =
'unknown', action =
'write', iostat = err, recl = (n_params + 1) * 40)
462 call error_message(
' IOError while openening "', trim(fname),
'". Error-Code ', num2str(err))
466 write(formheader, *)
'(a40,', n_params,
'a40)'
469 write(
uopti, formheader)
'OF', (trim(adjustl(param_names(ii)(1 : 39))), ii = 1, n_params)
472 write(formparams, *)
'( es40.14, ', n_params,
'(es40.14) )'
473 write(
uopti, formparams) best_of, (best_paramset(ii), ii = 1, n_params)
480 call message(
' Optimized parameters written to ', trim(fname))
519 use mo_string_utils,
only : num2str
520 use mo_os,
only : check_path_isdir
526 integer(i4),
dimension(nProcesses, 3),
intent(in) ::
processmatrix
529 real(dp),
dimension(:, :),
intent(in) :: parameters
532 logical,
dimension(size(parameters, 1)),
intent(in) :: maskpara
535 character(len = *),
dimension(size(parameters, 1)),
intent(in) :: parameters_name
537 character(256) :: fname
539 character(len = 28),
dimension(nProcesses) :: process_descr
541 integer(i4) :: err, flag
543 integer(i4) :: iproc, ipar, ipar_start
546 process_descr(1) =
'interception'
547 process_descr(2) =
'snow'
548 process_descr(3) =
'soilmoisture'
549 process_descr(4) =
'directSealedAreaRunoff'
550 process_descr(5) =
'potential evapotranspiration'
551 process_descr(6) =
'interflow'
552 process_descr(7) =
'percolation'
553 process_descr(8) =
'routing'
554 process_descr(9) =
'geology'
555 process_descr(10) =
'neutrons'
560 call check_path_isdir(trim(adjustl(
dirconfigout)), raise=.true.)
561 open(
uopti_nml, file = fname, status =
'unknown', action =
'write', iostat = err)
563 call error_message(
' IOError while openening "', trim(fname),
'". Error-Code ', num2str(err))
567 write(
uopti_nml,
'( A47,T50,3(A20,2x),2(A8,1x) )')
"!PARAMETER",
"lower_bound",
"upper_bound",
"value",
"FLAG",
"SCALING"
572 write(
uopti_nml, *)
'! ', trim(adjustl(process_descr(iproc)))
641 if (maskpara(ipar))
then
647 write(
uopti_nml,
'( A47," = ",T50,3(f20.12,", "),I8,", 1" )') &
648 trim(adjustl(parameters_name(ipar))), &
649 parameters(ipar, 1), &
650 parameters(ipar, 2), &
651 parameters(ipar, 3), &
667 call message(
' Optimized parameters written in namelist format to ', trim(fname))
Provides constants commonly used by mHM, mRM and MPR.
real(dp), parameter, public nodata_dp
Provides file names and units for mRM.
integer, parameter uconfig
Unit for file defining mHM's outputs.
character(len= *), parameter file_config
file defining mHM's outputs
Provides file names and units for mHM.
integer, parameter uopti
Unit for file optimization outputs (objective and parameter set)
character(len=*), parameter file_opti
file defining optimization outputs (objective and parameter set)
character(len=*), parameter file_opti_nml
file defining optimization outputs in a namelist format (parameter set)
integer, parameter uopti_nml
Unit for file optimization outputs in a namelist format (parameter set)
Provides structures needed by mHM, mRM and/or mpr.
type(period), dimension(:), allocatable, public warmper
real(dp), dimension(:), allocatable, public resolutionrouting
integer(i4), dimension(:, :), allocatable, public lcyearid
type(period), dimension(:), allocatable, public simper
integer(i4), public timestep
logical, public read_restart
type(period), dimension(:), allocatable, public evalper
Provides structures needed by mHM, mRM and/or mpr.
integer(i4), parameter, public nprocesses
character(256), dimension(:), allocatable, public mhmfilerestartout
real(dp), dimension(:), allocatable, public resolutionhydrology
logical, public write_restart
real(dp), dimension(:, :), allocatable, target, public global_parameters
character(256), dimension(:), allocatable, public lcfilename
character(256), dimension(:), allocatable, public global_parameters_name
type(domain_meta), public domainmeta
character(256), public dirconfigout
integer(i4), public nlcoverscene
character(256), dimension(:), allocatable, public dirlcover
integer(i4), dimension(:), allocatable, public lc_year_end
character(256), dimension(:), allocatable, public dirout
character(256), dimension(:), allocatable, public dirmorpho
integer(i4), public iflag_cordinate_sys
integer(i4), dimension(nprocesses, 3), public processmatrix
type(grid), dimension(:), allocatable, target, public level1
type(grid), dimension(:), allocatable, target, public level0
integer(i4), dimension(:), allocatable, public lc_year_start
Provides file names and units for mHM.
character(len=*), parameter version
Current mHM model version (will be set to )
Global variables for mRM only.
type(gaugingstation), public inflowgauge
integer(i4), dimension(:), allocatable, public l11_netperm
integer(i4), dimension(:), allocatable, public l1_l11_id
integer(i4), dimension(:), allocatable, public l11_label
character(256), dimension(:), allocatable, public dirgauges
type(gaugingstation), public gauge
integer(i4), dimension(:), allocatable, public l11_fromn
real(dp), dimension(:), allocatable, public l11_length
integer(i4), dimension(:), allocatable, public l11_ton
integer(i4), public ngaugeslocal
type(grid), dimension(:), allocatable, target, public level11
real(dp), dimension(:), allocatable, public l11_slope
integer(i4), dimension(:), allocatable, public l11_noutlets
integer(i4), public ninflowgaugestotal
integer(i4), dimension(:), allocatable, public l11_rorder
integer(i4), public ngaugestotal
Module to write ascii file output.
subroutine, public write_configfile(dirprecipitation, dirreferenceet, dirtemperature)
This modules writes the results of the configuration into an ASCII-file.
subroutine, public write_optinamelist(processmatrix, parameters, maskpara, parameters_name)
Write final, optimized parameter set in a namelist format.
subroutine, public write_optifile(best_of, best_paramset, param_names)
Write briefly final optimization results.