@@ -109,19 +109,20 @@ def initial(self):
109
109
# upstream of gauge locations
110
110
# Calculate inverse, so we can multiply in dynamic (faster than divide)
111
111
112
- self .var .IsChannelPcr = boolean (loadmap ('Channels' , pcr = True )) #pcr
112
+ self .var .IsChannelPcr = boolean (loadmap ('Channels' , pcr = True )) #pcr map
113
113
self .var .IsChannel = np .bool8 (compressArray (self .var .IsChannelPcr )) #bool
114
114
self .var .IsChannelPcr = boolean (decompress (self .var .IsChannel )) #pcr
115
-
116
115
# Identify grid cells containing a river channel
116
+
117
+ self .var .IsChannelKinematic = self .var .IsChannel .copy () #bool
118
+ # Identify channel pixels using kinematic or split routing
119
+ # (identical to IsChannel, unless MCT wave is used, see below)
120
+
117
121
self .var .IsStructureChan = np .bool8 (maskinfo .in_zero ()) #bool
118
122
# Initialise map that identifies special inflow/outflow structures (reservoirs, lakes) within the
119
123
# channel routing. Set to (dummy) value of zero modified in reservoir and lake
120
124
# routines (if those are used)
121
125
122
- self .var .IsChannelKinematic = self .var .IsChannel .copy () #bool
123
- # Identify kinematic wave channel pixels
124
- # (identical to IsChannel, unless MCT wave is used, see below)
125
126
self .var .IsStructureKinematic = np .bool8 (maskinfo .in_zero ()) #bool
126
127
# Initialise map that identifies special inflow/outflow structures (reservoirs, lakes) within the
127
128
# kinematic wave channel routing. Set to (dummy) value of zero modified in reservoir and lake
@@ -231,7 +232,7 @@ def initial(self):
231
232
# Area (sq m) of bank full discharge cross section [m2]
232
233
# (trapezoid area equation)
233
234
234
- #cmcheck
235
+ #cmcheck - TotalCrossSectionAreaHalfBankFull is not 1/2 TotalCrossSectionAreaBankFull it's trapezoid
235
236
# ChanUpperWidthHalfBankFull = self.var.ChanBottomWidth + 2 * self.var.ChanSdXdY * 0.5 * ChanDepthThreshold
236
237
# TotalCrossSectionAreaHalfBankFull = 0.5 * \
237
238
# 0.5 * ChanDepthThreshold * (ChanUpperWidthHalfBankFull + self.var.ChanBottomWidth)
@@ -394,7 +395,7 @@ def initial(self):
394
395
# Cumulative inflow volume from inflow hydrographs [m3]
395
396
self .var .sumDis = maskinfo .in_zero ()
396
397
self .var .sumIn = maskinfo .in_zero ()
397
- # cmcheck non so se sostituita da self.var.sumInWB
398
+ # cmcheck - non so se sostituita da self.var.sumInWB
398
399
self .var .sumInWB = maskinfo .in_zero ()
399
400
400
401
@@ -470,7 +471,6 @@ def initialSecond(self):
470
471
self .var .Beta , self .var .ChanLength , self .var .DtRouting ,
471
472
alpha_floodplains = self .var .ChannelAlpha2 , flagnancheck = flags ['nancheck' ])
472
473
473
- # cmcheck
474
474
# ************************************************************
475
475
# ***** WATER BALANCE ************
476
476
# ************************************************************
@@ -488,15 +488,15 @@ def initialSecond(self):
488
488
489
489
if not option ['InitLisflood' ] and option ['repMBTs' ]:
490
490
self .var .StorageStepINIT = self .var .ChanM3
491
- DisStructure = np .where (self .var .IsUpsOfStructureKinematicC , self .var .ChanQ * self .var .DtRouting , 0 )
492
- # cmchek to fix IsUpsOfStructureKinematicC for MCT
491
+ # DisStructure = np.where(self.var.IsUpsOfStructureKinematicC, self.var.ChanQ * self.var.DtRouting, 0)
492
+ DisStructure = np . where ( self . var . IsUpsOfStructureChanC , self . var . ChanQ * self . var . DtRouting , 0 )
493
493
if not (option ['SplitRouting' ]):
494
494
# self.var.StorageStepINIT = self.var.ChanM3Kin
495
495
# self.var.StorageStepINIT = self.var.ChanM3
496
496
if option ['simulateReservoirs' ]:
497
497
self .var .StorageStepINIT += self .var .ReservoirStorageIniM3
498
- DisStructure = np .where (self .var .IsUpsOfStructureKinematicC , self .var .ChanQ * self .var .DtRouting , 0 )
499
- # cmchek to fix IsUpsOfStructureKinematicC for MCT
498
+ # DisStructure = np.where(self.var.IsUpsOfStructureKinematicC, self.var.ChanQ * self.var.DtRouting, 0)
499
+ DisStructure = np . where ( self . var . IsUpsOfStructureChanC , self . var . ChanQ * self . var . DtRouting , 0 )
500
500
if option ['simulateLakes' ]:
501
501
self .var .StorageStepINIT += self .var .LakeStorageIniM3
502
502
DisStructure += np .where (compressArray (self .var .IsUpsOfStructureLake ), 0.5 * self .var .ChanQ * self .var .DtRouting , 0 )
@@ -815,18 +815,17 @@ def dynamic(self, NoRoutingExecuted):
815
815
if option ['simulateReservoirs' ]:
816
816
sum1 = self .var .ChanQ .copy ()
817
817
StorageStep = StorageStep + self .var .ReservoirStorageM3 .copy ()
818
- # cmcheck IsUpsOfStructureKinematicC
819
- DisStructureR = np .where (self .var .IsUpsOfStructureKinematicC , sum1 * self .var .DtRouting , 0 )
820
- # cmchek to fix IsUpsOfStructureKinematicC for MCT
818
+ # DisStructureR = np.where(self.var.IsUpsOfStructureKinematicC, sum1 * self.var.DtRouting, 0)
819
+ DisStructureR = np .where (self .var .IsUpsOfStructureChanC , sum1 * self .var .DtRouting , 0 )
821
820
DischargeM3StructuresR = np .take (np .bincount (self .var .Catchments , weights = DisStructureR ), self .var .Catchments )
822
821
DischargeM3StructuresR -= self .var .DischargeM3StructuresIni
823
822
824
823
if not option ['InitLisflood' ]:
825
824
if option ['simulateLakes' ]:
826
825
sum1 = self .var .ChanQ .copy ()
827
826
StorageStep = StorageStep + self .var .LakeStorageM3Balance .copy ()
828
- DisStructureR = np .where (self .var .IsUpsOfStructureKinematicC , sum1 * self .var .DtRouting , 0 )
829
- # cmchek to fix IsUpsOfStructureKinematicC for MCT
827
+ # DisStructureR = np.where(self.var.IsUpsOfStructureKinematicC, sum1 * self.var.DtRouting, 0)
828
+ DisStructureR = np . where ( self . var . IsUpsOfStructureChanC , sum1 * self . var . DtRouting , 0 )
830
829
DischargeM3StructuresR = np .take (np .bincount (self .var .Catchments , weights = DisStructureR ), self .var .Catchments )
831
830
maskinfo = MaskInfo .instance ()
832
831
DisLake = maskinfo .in_zero ()
@@ -864,16 +863,16 @@ def dynamic(self, NoRoutingExecuted):
864
863
sum1 = []
865
864
sum1 = self .var .ChanQ .copy ()
866
865
StorageStep = StorageStep + self .var .ReservoirStorageM3 .copy ()
867
- DisStructureSR = np .where (self .var .IsUpsOfStructureKinematicC , sum1 * self .var .DtRouting , 0 )
868
- # cmchek to fix IsUpsOfStructureKinematicC for MCT
866
+ # DisStructureSR = np.where(self.var.IsUpsOfStructureKinematicC, sum1 * self.var.DtRouting, 0)
867
+ DisStructureSR = np . where ( self . var . IsUpsOfStructureChanC , sum1 * self . var . DtRouting , 0 )
869
868
DischargeM3StructuresR = np .take (np .bincount (self .var .Catchments , weights = DisStructureSR ), self .var .Catchments )
870
869
DischargeM3StructuresR -= self .var .DischargeM3StructuresIni
871
870
872
871
if option ['simulateLakes' ]:
873
872
sum1 = self .var .ChanQ .copy ()
874
873
StorageStep = StorageStep + self .var .LakeStorageM3Balance .copy ()
875
- DisStructureSR = np .where (self .var .IsUpsOfStructureKinematicC , sum1 * self .var .DtRouting , 0 )
876
- # cmchek to fix IsUpsOfStructureKinematicC for MCT
874
+ # DisStructureSR = np.where(self.var.IsUpsOfStructureKinematicC, sum1 * self.var.DtRouting, 0)
875
+ DisStructureSR = np . where ( self . var . IsUpsOfStructureChanC , sum1 * self . var . DtRouting , 0 )
877
876
DischargeM3StructuresR = np .take (np .bincount (self .var .Catchments , weights = DisStructureSR ), self .var .Catchments )
878
877
DisLake = maskinfo .in_zero ()
879
878
np .put (DisLake , self .var .LakeIndex , 0.5 * self .var .LakeInflowCC * self .var .DtRouting )
0 commit comments