-
Notifications
You must be signed in to change notification settings - Fork 3
/
HMC_Module_Namelist.f90
803 lines (686 loc) · 42.4 KB
/
HMC_Module_Namelist.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
!--------------------------------------------------------------------------------
! File: HMC_Module_Namelist.f90
! Author(s): Fabio Delogu, Francesco Silvestro, Simone Gabellani
! Created on May, 20 2014, 9:57 AM
!
! Module to allocate and read namelist
!--------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
! Module Header
module HMC_Module_Namelist
!--------------------------------------------------------------------------------
! External module(s) and implicit none
use HMC_Module_Tools_Debug ! to import global variable(s) declaration
implicit none
include "HMC_Type_Namelist.inc"
integer, parameter :: iMaxDomain = 1
type(HMC_Type_Namelist), dimension(iMaxDomain) :: oHMC_Namelist
save oHMC_Namelist
!--------------------------------------------------------------------------------
contains
!--------------------------------------------------------------------------------
! Subroutine to read namelist
subroutine HMC_Namelist_Read(dUc, dUh, dCt, dCf, dCPI, dWTableHbr, dKSatRatio, dSlopeMax, &
dCN, dFrac, dWS, dWDL, &
sDomainName, &
sFileInfo, iArgsType, &
oHMC_Namelist_Init)
!--------------------------------------------------------------------------------
! External module(s) and implicit none
implicit none
type(HMC_Type_Namelist) oHMC_Namelist_Init
!--------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
! Variable(s) declaration
integer(kind = 4) :: iErr
integer(kind = 4) :: iArgsType
character(len = 256) :: sFileInfo
logical :: bFileExist
integer(kind = 4) :: iFlagDebugSet, iFlagDebugLevel, iDebugUnitInit
integer(kind = 4) :: iFlagOs
integer(kind = 4) :: iFlagTypeData_Static
integer(kind = 4) :: iFlagTypeData_Forcing_Gridded, iFlagTypeData_Forcing_Point, iFlagTypeData_Forcing_TimeSeries
integer(kind = 4) :: iFlagTypeData_Updating_Gridded
integer(kind = 4) :: iFlagTypeData_Output_Gridded, iFlagTypeData_Output_Point, iFlagTypeData_Output_TimeSeries
integer(kind = 4) :: iFlagTypeData_State_Gridded, iFlagTypeData_State_Point
integer(kind = 4) :: iFlagTypeData_Restart_Gridded, iFlagTypeData_Restart_Point
integer(kind = 4) :: iFlagRestart, iFlagFlowDeep
integer(kind = 4) :: iFlagVarDtPhysConv
integer(kind = 4) :: iFlagReleaseMass
integer(kind = 4) :: iFlagLAI, iFlagAlbedo, iFlagCH
integer(kind = 4) :: iFlagSnow, iFlagSnowAssim, iFlagSMAssim
integer(kind = 4) :: iFlagGrid
integer(kind = 4) :: iFlagCoeffRes
integer(kind = 4) :: iFlagWS, iFlagWDL
integer(kind = 4) :: iFlagCType
integer(kind = 4) :: iFlagFrac
integer(kind = 4) :: iFlagDynVeg
integer(kind = 4) :: iFlagFlood
integer(kind = 4) :: iFlagEnergyBalance
logical :: bGridCheck
integer(kind = 4) :: iSimLength, iDtModel, iDtPhysConv
integer(kind = 4) :: iDtData_Forcing
integer(kind = 4) :: iDtData_Updating
integer(kind = 4) :: iDtData_Output_Gridded, iDtData_Output_Point
integer(kind = 4) :: iDtData_State_Gridded, iDtData_State_Point
integer(kind = 4) :: iActiveData_Output_Generic, iActiveData_Output_Flooding, iActiveData_Output_Snow
integer(kind = 4) :: iAccumData_Output_Hour
integer(kind = 4) :: iDtPhysPrev
integer(kind = 4) :: iDtPhysMethod
integer(kind = 4) :: iScaleFactor, iTcMax, iTc, iTVeg
integer(kind = 4) :: iRowsL, iColsL
real(kind = 4) :: dXLLCornerL, dYLLCornerL, dXCellSizeL, dYCellSizeL, dNoDataL
integer(kind = 4) :: iRowsF, iColsF
real(kind = 4) :: dXLLCornerF, dYLLCornerF, dXCellSizeF, dYCellSizeF, dNoDataF
integer(kind = 4) :: iNSection
integer(kind = 4) :: iNLake, iNDam, iNPlant, iNJoint, iNCatch, iNRelease
integer(kind = 4) :: iDaySteps, iTMarkedSteps
integer(kind = 4) :: iTdeepShift, iNTime, iETime
integer(kind = 4) :: iNData
real(kind = 4) :: dWTableHMin, dWTableHUSoil, dWTableHUChannel, dWTableSlopeBM, dWTableHOBedRock
real(kind = 4) :: dRateMin, dBc, dWTLossMax
real(kind = 4) :: dTRef, dEpsS, dSigma, dBFMin, dBFMax
real(kind = 4) :: dZRef, dG, dCp, dRd, dRhoS, dRhoW, dCpS, dCpW
real(kind = 4) :: dKq, dKw, dKo, dPorS, dFqS
real(kind = 4) :: dLSTDeltaMax
real(kind = 4) :: dTV, dDamSpillH
real(kind = 4) :: dSMGain
integer(kind = 4) :: iGlacierValue
real(kind = 4) :: dRhoSnowMax, dRhoSnowFresh, dSnowQualityThr
real(kind = 4) :: dMeltingTRef
integer(kind = 4), target, dimension(2) :: a1iDimsForcing
real(kind = 4), target, dimension(2) :: a1dGeoForcing
real(kind = 4), target, dimension(2) :: a1dResForcing
real(kind = 4), target, dimension(4) :: a1dArctUp
real(kind = 4), target, dimension(4) :: a1dExpRhoLow
real(kind = 4), target, dimension(4) :: a1dExpRhoHigh
real(kind = 4), target, dimension(4) :: a1dAltRange
real(kind = 4), target, dimension(12) :: a1dAlbedoMonthly
real(kind = 4), target, dimension(12) :: a1dLAIMonthly
real(kind = 4), target, dimension(12) :: a1dCHMonthly
real(kind = 4), target, dimension(4) :: a1dDemStep
real(kind = 4), target, dimension(4) :: a1dIntStep
real(kind = 4), target, dimension(4) :: a1dDtStep
real(kind = 4), target, dimension(4) :: a1dDtRatioStep
character(len = 12) :: sTimeStart
character(len = 12) :: sTimeRestart
character(len = 19) :: sTimeStartLong
character(len = 19) :: sTimeRestartLong
character(len = 256) :: sPathData_Static_Gridded
character(len = 256) :: sPathData_Static_Point
character(len = 256) :: sPathData_Forcing_Gridded
character(len = 256) :: sPathData_Forcing_Point
character(len = 256) :: sPathData_Forcing_TimeSeries
character(len = 256) :: sPathData_Updating_Gridded
character(len = 256) :: sPathData_Output_Gridded
character(len = 256) :: sPathData_Output_Point
character(len = 256) :: sPathData_Output_TimeSeries
character(len = 256) :: sPathData_State_Gridded
character(len = 256) :: sPathData_State_Point
character(len = 256) :: sPathData_Restart_Gridded
character(len = 256) :: sPathData_Restart_Point
character(len = 1) :: sPathBar
character(len = 700) :: sCommandUnzipFile
character(len = 700) :: sCommandZipFile
character(len = 700) :: sCommandRemoveFile
character(len = 700) :: sCommandCreateFolder
character(len = 10) :: sReleaseDate
character(len = 700) :: sAuthorNames
character(len = 5) :: sReleaseVersion
real(kind = 4) :: dUc, dUh, dCt, dCf, dCPI, dWTableHbr, dKSatRatio, dSlopeMax
real(kind = 4) :: dCN, dWS, dWDL, dFrac
character(len = 256) :: sDomainName
character(len = 256) :: sStrCf, sStrCt, sStrUh, sStrUc
!--------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
! Read namelist(s)
namelist /HMC_Parameters/ dUc, dUh, dCt, dCf, dCPI, dWTableHbr, dKSatRatio, dSlopeMax, &
dCN, dWS, dWDL, dFrac, &
sDomainName
namelist /HMC_Namelist/ iFlagTypeData_Static, &
iFlagTypeData_Forcing_Gridded, iFlagTypeData_Forcing_Point, &
iFlagTypeData_Forcing_TimeSeries, &
iFlagTypeData_Updating_Gridded, &
iFlagTypeData_Output_Gridded, iFlagTypeData_Output_Point, &
iFlagTypeData_Output_TimeSeries, &
iFlagTypeData_State_Gridded, iFlagTypeData_State_Point, &
iFlagTypeData_Restart_Gridded, iFlagTypeData_Restart_Point, &
iFlagDebugSet, iFlagDebugLevel, &
iFlagOs, iFlagFlowDeep, iFlagRestart, &
iFlagVarDtPhysConv, &
iFlagReleaseMass, &
iFlagLAI, iFlagAlbedo, iFlagCH, &
iFlagSnow, iFlagSnowAssim, iFlagSMAssim, &
iFlagCoeffRes, iFlagWS, iFlagWDL, &
iFlagCType, &
iFlagFrac, &
iFlagDynVeg, &
iFlagFlood, iFlagEnergyBalance, &
a1dGeoForcing, a1dResForcing, a1iDimsForcing, &
iScaleFactor, iTcMax, iTVeg, &
iSimLength, iDtModel, &
iDtPhysMethod, iDtPhysConv, &
a1dDemStep, a1dIntStep, a1dDtStep, a1dDtRatioStep, &
iDtData_Forcing, &
iDtData_Updating, &
iDtData_Output_Gridded, iDtData_Output_Point, &
iDtData_State_Gridded, iDtData_State_Point, &
iActiveData_Output_Generic, iActiveData_Output_Flooding, iActiveData_Output_Snow, &
iAccumData_Output_Hour, &
sTimeStart, sTimeRestart, &
sPathData_Static_Gridded, sPathData_Static_Point, &
sPathData_Forcing_Gridded, sPathData_Forcing_Point, sPathData_Forcing_TimeSeries, &
sPathData_Updating_Gridded, &
sPathData_Output_Gridded, sPathData_Output_Point, sPathData_Output_TimeSeries, &
sPathData_State_Gridded, sPathData_State_Point, &
sPathData_Restart_Gridded, sPathData_Restart_Point
namelist /HMC_Snow/ a1dArctUp, a1dExpRhoLow, a1dExpRhoHigh, a1dAltRange, &
iGlacierValue, dRhoSnowFresh, dRhoSnowMax, dSnowQualityThr, &
dMeltingTRef
namelist /HMC_Constants/ a1dAlbedoMonthly, a1dLAIMonthly, a1dCHMonthly, &
dWTableHMin, dWTableHUSoil, dWTableHUChannel, dWTableSlopeBM, dWTableHOBedRock, &
dRateMin, dBc, dWTLossMax, &
dTRef, iTdeepShift, dEpsS, dSigma, dBFMin, dBFMax, &
dZRef, dG, dCp, dRd, dRhoS, dRhoW, dCpS, dCpW, &
dKq, dKw, dKo, dPorS, dFqS, &
dLSTDeltaMax, &
dTV, dDamSpillH, &
dSMGain
namelist /HMC_Command/ sCommandZipFile, &
sCommandUnzipFile, &
sCommandRemoveFile, &
sCommandCreateFolder
namelist /HMC_Info/ sReleaseDate, &
sAuthorNames, &
sReleaseVersion
!--------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
! Set defaults for namelist variables
iFlagTypeData_Static = -9999;
iFlagTypeData_Forcing_Gridded = -9999; iFlagTypeData_Forcing_Point = -9999; iFlagTypeData_Forcing_TimeSeries = -9999;
iFlagTypeData_Updating_Gridded = -9999;
iFlagTypeData_Output_Gridded = -9999; iFlagTypeData_Output_Point = -9999; iFlagTypeData_Output_TimeSeries = -9999;
iFlagTypeData_State_Gridded = -9999; iFlagTypeData_State_Point = -9999;
iFlagTypeData_Restart_Gridded = -9999; iFlagTypeData_Restart_Point = -9999;
iFlagDebugSet = -9999; iFlagDebugLevel = -9999;
iFlagOs = -9999; iFlagFlowDeep = -9999; iFlagRestart = -9999;
iFlagVarDtPhysConv = -9999; iFlagReleaseMass = -9999;
iFlagLAI = -9999; iFlagAlbedo = -9999; iFlagCH = -9999;
iFlagSnow = -9999; iFlagSnowAssim = -9999; iFlagSMAssim = -9999;
iFlagCoeffRes = -9999; iFlagWS = -9999; iFlagWDL = -9999;
iFlagCType = -9999;
iFlagFrac = -9999;
iFlagDynVeg = -9999;
iFlagFlood = -9999; iFlagEnergyBalance = -9999;
a1dGeoForcing = -9999.0; a1dResForcing = -9999.0; a1iDimsForcing = -9999;
iScaleFactor = -9999; iTcMax = -9999; iTVeg = -9999; iTc = -9999;
iSimLength = -9999; iDtModel = -9999;
iDtPhysMethod = -9999; iDtPhysConv = -9999;
a1dDemStep = -9999.0; a1dIntStep = -9999.0; a1dDtStep = -9999.0; a1dDtRatioStep = -9999.0;
iDtData_Forcing = -9999;
iDtData_Updating = -9999;
iDtData_Output_Gridded = -9999; iDtData_Output_Point = -9999;
iDtData_State_Gridded = -9999; iDtData_State_Point = -9999;
iActiveData_Output_Generic = -1; iActiveData_Output_Flooding = -1; iActiveData_Output_Snow = -1;
iAccumData_Output_Hour = -1
sTimeStart = ""; sTimeRestart = "";
sPathData_Static_Gridded = ""; sPathData_Static_Point = "";
sPathData_Forcing_Gridded = ""; sPathData_Forcing_Point = ""; sPathData_Forcing_TimeSeries = "";
sPathData_Updating_Gridded = "";
sPathData_Output_Gridded = ""; sPathData_Output_Gridded = ""; sPathData_Output_TimeSeries = "";
sPathData_State_Gridded = ""; sPathData_State_Gridded = "";
sPathData_Restart_Gridded = ""; sPathData_Restart_Point = "";
iNTime = 0; iNData = 0; iETime = 0;
a1dArctUp = -9999.0; a1dExpRhoLow = -9999.0; a1dExpRhoHigh = -9999.0; a1dAltRange = -9999.0;
iGlacierValue = -9999; dRhoSnowFresh = -9999.0; dRhoSnowMax = -9999.0; dSnowQualityThr = -9999.0;
dMeltingTRef = -9999.0;
a1dAlbedoMonthly = -9999.0; a1dLAIMonthly = -9999.0; a1dCHMonthly = -9999.0
dWTableHMin = -9999.0; dWTableHUSoil = -9999.0; dWTableHUChannel = -9999.0;
dWTableSlopeBM = -9999.0; dWTableHOBedRock = -9999.0;
dRateMin = -9999.0; dBc = -9999.0; dWTLossMax = -9999.0;
dTRef = -9999.0; iTdeepShift = -9999; dEpsS = -9999.0;
dSigma = -9999.0; dBFMin = -9999.0; dBFMax = -9999.0
dZRef = -9999.0; dG = -9999.0; dCp = -9999.0; dRd = -9999.0; dRhoS = -9999.0;
dRhoW = -9999.0; dCpS = -9999.0; dCpW = -9999.0;
dKq = -9999.0; dKw = -9999.0; dKo = -9999.0; dPorS = -9999.0; dFqS = -9999.0;
dLSTDeltaMax = -9999.0
dTV = -9999.0; dDamSpillH = -9999.0
dSMGain = -9999.0;
sCommandZipFile = ""; sCommandUnzipFile = ""; sCommandRemoveFile = ""; sCommandCreateFolder = ""
sReleaseDate = ""; sAuthorNames = ""; sReleaseVersion = "";
!--------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
! Checking information file availability
!sFileName = trim(sDomainName)//'.info.txt'
inquire (file = trim(sFileInfo), exist = bFileExist)
if ( .not. bFileExist ) then
write(6, *) "No file info found ", trim(sFileInfo)
stop "Stopped"
else
! Read namelist section(s)
open(20,file = trim(sFileInfo))
read(20, HMC_Namelist, iostat=iErr); rewind(20)
read(20, HMC_Snow, iostat=iErr); rewind(20)
read(20, HMC_Constants, iostat=iErr); rewind(20)
read(20, HMC_Command, iostat=iErr); rewind(20)
read(20, HMC_Info, iostat=iErr); rewind(20)
! According to line argument(s) definition
if (iArgsType == 2) then
read(20, HMC_Parameters, iostat=iErr); rewind(20)
endif
close(20)
endif
!--------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
! Set debug level
call HMC_Tools_Debug_SetLevel(iFlagDebugSet, iFlagDebugLevel)
! Set file unit debug
call HMC_Tools_Debug_SetUnit(80, 100, iDebugUnitInit)
!--------------------------------------------------------------------------------
!-----------------------------------------------------------------------------------
! HMC Version
call mprintf(.true., iINFO_Basic, '************************************************************************')
call mprintf(.true., iINFO_Basic, ' Hydrological Model Continuum (Version: '//trim(sReleaseVersion)//')')
call mprintf(.true., iINFO_Basic, ' Author(s): '//trim(sAuthorNames))
call mprintf(.true., iINFO_Basic, ' Release Date: '//trim(sReleaseDate))
call mprintf(.true., iINFO_Basic, '************************************************************************')
!-----------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
! Time long definition
sTimeStartLong = sTimeStart(1:4)//"-"//sTimeStart(5:6)//"-"//sTimeStart(7:8)//"_" &
//sTimeStart(9:10)//":"//sTimeStart(11:12)//":"//"00"
sTimeRestartLong = sTimeRestart(1:4)//"-"//sTimeRestart(5:6)//"-"//sTimeRestart(7:8)//"_" &
//sTimeRestart(9:10)//":"//sTimeRestart(11:12)//":"//"00"
!--------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
! Define OS features
if (iFlagOS.eq.10) then
call mprintf(.true., iINFO_Main, ' Operative System: GNU/Linux')
sPathBar = '/'
elseif (iFlagOS.eq.0) then
call mprintf(.true., iINFO_Main, ' Operative System: WinOS')
sPathBar = '\'
else
call mprintf(.true., iERROR, ' Incorrect OS definition (Allowed values: GNU/Linux = 10, WinOS = 0)')
endif
!--------------------------------------------------------------------------------
!------------------------------------------------------------------------------------------
! Compute simulation time length
iNTime = (iSimLength)*3600./nint(real(iDtModel))
! Compute data time steps
iNData = int((iNTime*3600))/int(iDtData_Forcing)
!------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
! Check snow physics flag(s)
if (iFlagSnow.eq.0) iFlagSnowAssim = 0;
! Check slope value under a minimum value
if (dSlopeMax.lt.0.01) dSlopeMax = 0.01 ! Default value
!--------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
! Namelist definition
call mprintf(.true., iINFO_Main, ' Read Namelist ... ')
! Model dims (initialization)
oHMC_Namelist_Init%iRowsL = 0
oHMC_Namelist_Init%iColsL = 0
oHMC_Namelist_Init%iRowsF = 0
oHMC_Namelist_Init%iColsF = 0
oHMC_Namelist_Init%iNSection = 0
oHMC_Namelist_Init%iNLake = 0
oHMC_Namelist_Init%iNDam = 0
oHMC_Namelist_Init%iNPlant = 0
oHMC_Namelist_Init%iNJoint = 0
oHMC_Namelist_Init%iNCatch = 0
oHMC_Namelist_Init%iNRelease = 0
oHMC_Namelist_Init%iDaySteps = 0
oHMC_Namelist_Init%iTMarkedSteps = 0
! Flag(s) info
oHMC_Namelist_Init%iFlagTypeData_Static = iFlagTypeData_Static
oHMC_Namelist_Init%iFlagTypeData_Forcing_Gridded = iFlagTypeData_Forcing_Gridded
oHMC_Namelist_Init%iFlagTypeData_Forcing_Point = iFlagTypeData_Forcing_Point
if (iFlagTypeData_Forcing_TimeSeries .eq. -9999) then ! backward compatibility with older version of info file (without forcing time-series)
oHMC_Namelist_Init%iFlagTypeData_Forcing_TimeSeries = iFlagTypeData_Forcing_Point
else
oHMC_Namelist_Init%iFlagTypeData_Forcing_TimeSeries = iFlagTypeData_Forcing_TimeSeries
endif
if (iFlagTypeData_Updating_Gridded .eq. -9999) then ! backward compatibility with older version of info file (without updating gridded)
oHMC_Namelist_Init%iFlagTypeData_Updating_Gridded = iFlagTypeData_Forcing_Gridded
else
oHMC_Namelist_Init%iFlagTypeData_Updating_Gridded = iFlagTypeData_Updating_Gridded
endif
oHMC_Namelist_Init%iFlagTypeData_Output_Gridded = iFlagTypeData_Output_Gridded
oHMC_Namelist_Init%iFlagTypeData_Output_Point = iFlagTypeData_Output_Point
if (iFlagTypeData_Output_TimeSeries .eq. -9999) then ! backward compatibility with older version of info file (without output time-series)
oHMC_Namelist_Init%iFlagTypeData_Output_TimeSeries = iFlagTypeData_Output_Point
else
oHMC_Namelist_Init%iFlagTypeData_Output_TimeSeries = iFlagTypeData_Output_TimeSeries
endif
oHMC_Namelist_Init%iFlagTypeData_State_Gridded = iFlagTypeData_State_Gridded
oHMC_Namelist_Init%iFlagTypeData_State_Point = iFlagTypeData_State_Point
oHMC_Namelist_Init%iFlagTypeData_Restart_Gridded = iFlagTypeData_Restart_Gridded
oHMC_Namelist_Init%iFlagTypeData_Restart_Point = iFlagTypeData_Restart_Point
oHMC_Namelist_Init%iFlagDebugLevel = iFlagDebugLevel
oHMC_Namelist_Init%iFlagOs = iFlagOs
oHMC_Namelist_Init%iFlagFlowDeep = iFlagFlowDeep
oHMC_Namelist_Init%iFlagRestart = iFlagRestart
oHMC_Namelist_Init%iFlagVarDtPhysConv = iFlagVarDtPhysConv
if (iFlagReleaseMass .eq. -9999) then ! backward compatibility with older version of info file (without release mass flag)
oHMC_Namelist_Init%iFlagReleaseMass = 1 ! default mode with update release(s) mass balance
else
oHMC_Namelist_Init%iFlagReleaseMass = iFlagReleaseMass
endif
oHMC_Namelist_Init%iFlagLAI = iFlagLAI
oHMC_Namelist_Init%iFlagAlbedo = iFlagAlbedo
oHMC_Namelist_Init%iFlagCH = iFlagCH
oHMC_Namelist_Init%iFlagSnow = iFlagSnow
oHMC_Namelist_Init%iFlagSnowAssim = iFlagSnowAssim
if (iFlagSMAssim .eq. -9999) then ! backward compatibility with older version of info file (without sm assimilation flag)
oHMC_Namelist_Init%iFlagSMAssim = 0 ! default mode without soil moisture assimilation
else
oHMC_Namelist_Init%iFlagSMAssim = iFlagSMAssim
endif
oHMC_Namelist_Init%iFlagGrid = -9999
if (iFlagCoeffRes .eq. -9999) then ! backward compatibility with older version of info file (without coeff resolution flag)
oHMC_Namelist_Init%iFlagCoeffRes = 1 ! default mode with empiric relationship
else
oHMC_Namelist_Init%iFlagCoeffRes = iFlagCoeffRes ! to avoid coeff resolution map set flag to zero (vda old cases)
endif
if (iFlagWS .eq. -9999) then ! backward compatibility with older version of info file (without ws flag)
oHMC_Namelist_Init%iFlagWS = 0 ! default mode without watertable sources dynamic
else
oHMC_Namelist_Init%iFlagWS = iFlagWS
endif
if (iFlagWDL .eq. -9999) then ! backward compatibility with older version of info file (without wdl flag)
oHMC_Namelist_Init%iFlagWDL = 0 ! default mode without watertable deep losses dynamic
else
oHMC_Namelist_Init%iFlagWDL = iFlagWDL
endif
if (iFlagFrac .eq. -9999) then ! backward compatibility with older version of info file (without frac flag)
oHMC_Namelist_Init%iFlagFrac = 0 ! deactivate groundwater bedrock fracturation
else
oHMC_Namelist_Init%iFlagFrac = iFlagFrac ! activate/deactivate groundwater bedrock fracturation
endif
if (iFlagCType .eq. -9999) then ! backward compatibility with older version of info file (without ctype flag)
oHMC_Namelist_Init%iFlagCType = 1 ! channel network
else
oHMC_Namelist_Init%iFlagCType = iFlagCType ! channel network/fraction
endif
if (iFlagDynVeg .eq. -9999) then ! backward compatibility with older version of info file (without Vegtype flag)
oHMC_Namelist_Init%iFlagDynVeg = 0 ! dynamic vegetation module not activated
else
oHMC_Namelist_Init%iFlagDynVeg = iFlagDynVeg ! dynamic vegetation module
endif
if (iFlagFlood .eq. -9999) then ! backward compatibility with older version of info file (without Flooding flag)
oHMC_Namelist_Init%iFlagFlood = 0 ! flooding module not activated
else
oHMC_Namelist_Init%iFlagFlood = iFlagFlood ! flooding vegetation module
endif
if (iFlagEnergyBalance .eq. -9999) then ! backward compatibility with older version of info file (without EnergyBalance flag)
oHMC_Namelist_Init%iFlagEnergyBalance = 1 ! energy-balance module activated
else
oHMC_Namelist_Init%iFlagEnergyBalance = iFlagEnergyBalance
endif
! Geographical land and forcing info
oHMC_Namelist_Init%bGridCheck = .false.
oHMC_Namelist_Init%dXLLCornerL = 0.0
oHMC_Namelist_Init%dYLLCornerL = 0.0
oHMC_Namelist_Init%dXCellSizeL = 0.0
oHMC_Namelist_Init%dYCellSizeL = 0.0
oHMC_Namelist_Init%dNoDataL = 0.0
oHMC_Namelist_Init%dXLLCornerF = 0.0
oHMC_Namelist_Init%dYLLCornerF = 0.0
oHMC_Namelist_Init%dXCellSizeF = 0.0
oHMC_Namelist_Init%dYCellSizeF = 0.0
oHMC_Namelist_Init%dNoDataF = 0.0
oHMC_Namelist_Init%a1dGeoForcing = a1dGeoForcing
oHMC_Namelist_Init%a1dResForcing = a1dResForcing
oHMC_Namelist_Init%a1iDimsForcing = a1iDimsForcing
! S3M parameter(s) and constant(s)
oHMC_Namelist_Init%a1dArctUp = a1dArctUp
oHMC_Namelist_Init%a1dExpRhoLow = a1dExpRhoLow
oHMC_Namelist_Init%a1dExpRhoHigh = a1dExpRhoHigh
oHMC_Namelist_Init%a1dAltRange = a1dAltRange
oHMC_Namelist_Init%iGlacierValue = iGlacierValue
if (dRhoSnowFresh .eq. -9999) then ! backward compatibility with older version of info file (without fresh snow density reference)
oHMC_Namelist_Init%dRhoSnowFresh = 100
else
oHMC_Namelist_Init%dRhoSnowFresh = dRhoSnowFresh
endif
oHMC_Namelist_Init%dRhoSnowMax = dRhoSnowMax
oHMC_Namelist_Init%dSnowQualityThr = dSnowQualityThr
if (dMeltingTRef .eq. -9999) then ! backward compatibility with older version of info file (without melting t reference)
oHMC_Namelist_Init%dMeltingTRef = 1
else
oHMC_Namelist_Init%dMeltingTRef = dMeltingTRef
endif
! Time, dt and step(s) info
oHMC_Namelist_Init%iNTime = iNTime
oHMC_Namelist_Init%iETime = 0
oHMC_Namelist_Init%iTcMax = iTcMax
oHMC_Namelist_Init%iTc = 0
oHMC_Namelist_Init%iSimLength = iSimLength
if (iTVeg .le. 0) then
oHMC_Namelist_Init%iTVeg = 1 !minimum duration (in model time step) of observed LAI
else
oHMC_Namelist_Init%iTVeg = iTVeg
endif
oHMC_Namelist_Init%iDtModel = iDtModel
oHMC_Namelist_Init%iDtPhysConv = iDtPhysConv
oHMC_Namelist_Init%iDtPhysConvPrevious = iDtPhysConv
if (iDtPhysMethod .eq. -9999) then ! backward compatibility with older version of info file (without integration step scalar or linear)
oHMC_Namelist_Init%iDtPhysMethod = 1
else
oHMC_Namelist_Init%iDtPhysMethod = iDtPhysMethod
endif
if (all(a1dDemStep .eq. -9999.0)) then ! backward compatibility with older version of info file (without declaration of arrays to dynamically compute integration step)
oHMC_Namelist_Init%a1dDemStep = (/ 1, 10, 100, 1000 /)
else
oHMC_Namelist_Init%a1dDemStep = a1dDemStep
endif
if (all(a1dIntStep .eq. -9999.0)) then ! backward compatibility with older version of info file (without declaration of arrays to dynamically compute integration step)
oHMC_Namelist_Init%a1dIntStep = (/ 1, 5, 25, 600/)
else
oHMC_Namelist_Init%a1dIntStep = a1dIntStep
endif
if (all(a1dDtStep .eq. -9999.0)) then ! backward compatibility with older version of info file (without declaration of arrays to dynamically compute integration step)
oHMC_Namelist_Init%a1dDtStep = (/1, 6, 6, 60 /)
else
oHMC_Namelist_Init%a1dDtStep = a1dDtStep
endif
if (all(a1dDtRatioStep .eq. -9999.0)) then ! backward compatibility with older version of info file (without declaration of arrays to dynamically compute integration step)
oHMC_Namelist_Init%a1dDtRatioStep = (/3, 3, 3, 2/)
else
oHMC_Namelist_Init%a1dDtRatioStep = a1dDtRatioStep
endif
oHMC_Namelist_Init%iDtData_Forcing = iDtData_Forcing
if (iDtData_Updating .eq. -9999) then ! backward compatibility with older version of info file (without declaratiom of data updating dt)
oHMC_Namelist_Init%iDtData_Updating = iDtData_Forcing
else
oHMC_Namelist_Init%iDtData_Updating = iDtData_Updating
endif
oHMC_Namelist_Init%iDtData_Output_Gridded = iDtData_Output_Gridded
oHMC_Namelist_Init%iDtData_Output_Point = iDtData_Output_Point
oHMC_Namelist_Init%iDtData_State_Gridded = iDtData_State_Gridded
oHMC_Namelist_Init%iDtData_State_Point = iDtData_State_Point
if (iActiveData_Output_Generic .eq. -1) then
oHMC_Namelist_Init%iActiveData_Output_Generic = 2
else
oHMC_Namelist_Init%iActiveData_Output_Generic = iActiveData_Output_Generic
endif
if (iActiveData_Output_Flooding .eq. -1) then
oHMC_Namelist_Init%iActiveData_Output_Flooding = 0
else
oHMC_Namelist_Init%iActiveData_Output_Flooding = iActiveData_Output_Flooding
endif
if (iActiveData_Output_Snow .eq. -1) then
oHMC_Namelist_Init%iActiveData_Output_Snow = 0
else
oHMC_Namelist_Init%iActiveData_Output_Snow = iActiveData_Output_Snow
endif
if (iAccumData_Output_Hour .eq. -1) then
oHMC_Namelist_Init%iAccumData_Output_Hour = 23
else
oHMC_Namelist_Init%iAccumData_Output_Hour = iAccumData_Output_Hour
endif
! Time reference info
oHMC_Namelist_Init%sTimeStart = sTimeStartLong
oHMC_Namelist_Init%sTimeRestart = sTimeRestartLong
! Data info
oHMC_Namelist_Init%iNData = iNData
oHMC_Namelist_Init%iScaleFactor = iScaleFactor
! Path(s) info
oHMC_Namelist_Init%sPathData_Static_Gridded = sPathData_Static_Gridded
oHMC_Namelist_Init%sPathData_Static_Point = sPathData_Static_Point
oHMC_Namelist_Init%sPathData_Forcing_Gridded = sPathData_Forcing_Gridded
oHMC_Namelist_Init%sPathData_Forcing_Point = sPathData_Forcing_Point
if (sPathData_Forcing_TimeSeries == "") then ! backward compatibility with older version of info file (without forcing time-series)
oHMC_Namelist_Init%sPathData_Forcing_TimeSeries = sPathData_Forcing_Point
else
oHMC_Namelist_Init%sPathData_Forcing_TimeSeries = sPathData_Forcing_TimeSeries
endif
if (sPathData_Updating_Gridded == "") then ! backward compatibility with older version of info file (without updating gridded)
oHMC_Namelist_Init%sPathData_Updating_Gridded = sPathData_Forcing_Gridded
else
oHMC_Namelist_Init%sPathData_Updating_Gridded = sPathData_Updating_Gridded
endif
oHMC_Namelist_Init%sPathData_Output_Gridded = sPathData_Output_Gridded
oHMC_Namelist_Init%sPathData_Output_Point = sPathData_Output_Point
if (sPathData_Output_TimeSeries == "") then ! backward compatibility with older version of info file (without output time-series)
oHMC_Namelist_Init%sPathData_Output_TimeSeries = sPathData_State_Point
else
oHMC_Namelist_Init%sPathData_Output_TimeSeries = sPathData_Output_TimeSeries
endif
oHMC_Namelist_Init%sPathData_State_Gridded = sPathData_State_Gridded
oHMC_Namelist_Init%sPathData_State_Point = sPathData_State_Point
oHMC_Namelist_Init%sPathData_Restart_Gridded = sPathData_Restart_Gridded
oHMC_Namelist_Init%sPathData_Restart_Point = sPathData_Restart_Point
! Monthly value(s)
oHMC_Namelist_Init%a1dAlbedoMonthly = a1dAlbedoMonthly
oHMC_Namelist_Init%a1dLAIMonthly = a1dLAIMonthly
oHMC_Namelist_Init%a1dCHMonthly = a1dCHMonthly
! Command line
oHMC_Namelist_Init%sPathBar = sPathBar
oHMC_Namelist_Init%sCommandZipFile = sCommandZipFile
oHMC_Namelist_Init%sCommandUnzipFile = sCommandUnzipFile
oHMC_Namelist_Init%sCommandRemoveFile = sCommandRemoveFile
oHMC_Namelist_Init%sCommandCreateFolder = sCommandCreateFolder
! Command line argument(s) or namelist parameter(s)
oHMC_Namelist_Init%dUc = dUc
oHMC_Namelist_Init%dUh = dUh
oHMC_Namelist_Init%dCt = dCt
oHMC_Namelist_Init%dCf = dCf
oHMC_Namelist_Init%dCPI = dCPI
oHMC_Namelist_Init%dWTableHbr = dWTableHbr
oHMC_Namelist_Init%dKSatRatio = dKSatRatio
oHMC_Namelist_Init%dSlopeMax = dSlopeMax
oHMC_Namelist_Init%sDomainName = sDomainName
if (dCN .eq. -9999) then ! backward compatibility with older version of info file (without curve number value)
oHMC_Namelist_Init%dCN = -9999.0
else
oHMC_Namelist_Init%dCN = dCN
endif
if (dWS .eq. -9999) then ! backward compatibility with older version of info file (without water sources value)
oHMC_Namelist_Init%dWS = -9999.0
else
oHMC_Namelist_Init%dWS = dWS
endif
if (dWDL .eq. -9999) then ! backward compatibility with older version of info file (without water sources value)
oHMC_Namelist_Init%dWDL = -9999.0
else
oHMC_Namelist_Init%dWDL = dWDL
endif
if (dFrac .eq. -9999) then ! backward compatibility with older version of info file (without fracturation value)
oHMC_Namelist_Init%dFrac = -9999.0
else
oHMC_Namelist_Init%dFrac = dFrac
endif
! Water-table constant(s)
oHMC_Namelist_Init%dWTableHMin = dWTableHMin
oHMC_Namelist_Init%dWTableHUSoil = dWTableHUSoil
oHMC_Namelist_Init%dWTableHUChannel = dWTableHUChannel
oHMC_Namelist_Init%dWTableSlopeBM = dWTableSlopeBM
oHMC_Namelist_Init%dWTableHOBedRock = dWTableHOBedRock
! Convolution constant(s)
oHMC_Namelist_Init%dRateMin = dRateMin
oHMC_Namelist_Init%dBc = dBc
if (dWTLossMax .eq. -9999) then ! backward compatibility with older version of info file (without watertable deep losses value)
oHMC_Namelist_Init%dWTLossMax = -9999.0
else
oHMC_Namelist_Init%dWTLossMax = dWTLossMax
endif
! LSM constant(s)
oHMC_Namelist_Init%dTRef = dTRef
oHMC_Namelist_Init%iTdeepShift = iTdeepShift
oHMC_Namelist_Init%dEpsS = dEpsS
oHMC_Namelist_Init%dSigma = dSigma
oHMC_Namelist_Init%dBFMin = dBFMin
oHMC_Namelist_Init%dBFMax = dBFMax
oHMC_Namelist_Init%dZRef = dZRef
oHMC_Namelist_Init%dG = dG
oHMC_Namelist_Init%dCp = dCp
oHMC_Namelist_Init%dRd = dRd
oHMC_Namelist_Init%dRhoS = dRhoS
oHMC_Namelist_Init%dRhoW = dRhoW
oHMC_Namelist_Init%dCpS = dCpS
oHMC_Namelist_Init%dCpW = dCpW
oHMC_Namelist_Init%dKq = dKq
oHMC_Namelist_Init%dKw = dKw
oHMC_Namelist_Init%dKo = dKo
oHMC_Namelist_Init%dPorS = dPorS
oHMC_Namelist_Init%dFqS = dFqS
if (dLSTDeltaMax .eq. -9999) then ! backward compatibility with older version of info file (without lst delta max value)
oHMC_Namelist_Init%dLSTDeltaMax = 20 ! default mode without lst delta max value definition
else
oHMC_Namelist_Init%dLSTDeltaMax = dLSTDeltaMax
endif
oHMC_Namelist_Init%dTV = dTV
oHMC_Namelist_Init%dDamSpillH = dDamSpillH
if (dSMGain .eq. -9999) then ! backward compatibility with older version of info file (without sm gain value)
oHMC_Namelist_Init%dSMGain = 0 ! default mode without soil moisture gain definition
else
oHMC_Namelist_Init%dSMGain = dSMGain
endif
! Model info
oHMC_Namelist_Init%sReleaseDate = sReleaseDate
oHMC_Namelist_Init%sAuthorNames = sAuthorNames
oHMC_Namelist_Init%sReleaseVersion = sReleaseVersion
! Check of dumping flags for generic and flooding variable(s))
if ( oHMC_Namelist_Init%iActiveData_Output_Generic .eq. 1 ) then
call mprintf(.true., iINFO_Main, ' Activation of generic outcome dumping: BASIC DATASETS ')
else if ( oHMC_Namelist_Init%iActiveData_Output_Generic .eq. 2 ) then
call mprintf(.true., iINFO_Main, ' Activation of generic outcome dumping: EXTENDED DATASETS')
else
call mprintf(.true., iERROR, ' Activation of generic outcome dumping: NULL (1 = BASIN, 2 = EXTENDED)')
endif
if ( oHMC_Namelist_Init%iActiveData_Output_Flooding .eq. 0 ) then
call mprintf(.true., iINFO_Main, ' Activation of flooding outcome dumping: NOT ACTIVE ')
else if ( oHMC_Namelist_Init%iActiveData_Output_Flooding .eq. 1 ) then
call mprintf(.true., iINFO_Main, ' Activation of flooding outcome dumping: ACTIVE')
else
call mprintf(.true., iERROR, ' Activation of flooding outcome dumping: NULL (0 = NOT ACTIVE, 1 = ACTIVE)')
endif
if ( oHMC_Namelist_Init%iActiveData_Output_Snow .eq. 0 ) then
call mprintf(.true., iINFO_Main, ' Activation of snow outcome dumping: NOT ACTIVE ')
else if ( oHMC_Namelist_Init%iActiveData_Output_Snow .eq. 1 ) then
call mprintf(.true., iINFO_Main, ' Activation of snow outcome dumping: ACTIVE')
else
call mprintf(.true., iERROR, ' Activation of flooding outcome dumping: NULL (0 = NOT ACTIVE, 1 = ACTIVE)')
endif
if (( oHMC_Namelist_Init%iFlagFlood .eq. 0 ) .and. ( oHMC_Namelist_Init%iActiveData_Output_Flooding .eq. 1 )) then
call mprintf(.true., iWARN, ' Flooding is not activated; deactivate the dumping of flooding output ')
oHMC_Namelist_Init%iActiveData_Output_Flooding = 0
endif
if (( oHMC_Namelist_Init%iFlagSnow .eq. 0 ) .and. ( oHMC_Namelist_Init%iActiveData_Output_Snow .eq. 1 )) then
call mprintf(.true., iWARN, ' Snow is not activated; deactivate the dumping of snow output ')
oHMC_Namelist_Init%iActiveData_Output_Snow = 0
endif
! Info model
write(sStrUc, *) dUc; write(sStrUh, *) dUh; write(sStrCt, *) dCt; write(sStrCf, *) dCf;
call mprintf(.true., iINFO_Basic, ' PARAMETER(S) DEFAULT INFO --- dUc: '//trim(sStrUc)//' - dUh: '//trim(sStrUh)// &
' dCt: '//trim(sStrCt)//' dCf: '//trim(sStrCf) )
! Info
call mprintf(.true., iINFO_Main, ' Read Namelist ... OK')
!--------------------------------------------------------------------------------
end subroutine HMC_Namelist_Read
!--------------------------------------------------------------------------------
end module HMC_Module_Namelist
!--------------------------------------------------------------------------------