def budgetCheck(self, sample, timestep):
     # NOTE this is only valid if addition,subtraction and lateral flow are invoked EACH TIME STEP
     # NOTE this does not include amountOfMoistureThickNetAdded in case of regolith thickness change
     self.actualAdditionCum = self.actualAdditionCum + self.actualAdditionFlux * self.timeStepDuration
     self.actualAbstractionCum = self.actualAbstractionCum + self.actualAbstractionFlux * self.timeStepDuration
     self.upwardSeepageCum = self.upwardSeepageCum + self.upwardSeepageFlux * self.timeStepDuration
     self.lateralFlowFluxAmountCum = self.lateralFlowFluxAmountCum + self.lateralFlowFluxAmount
     self.increaseInSubsurfaceStorage = self.soilMoistureThick - self.initialSoilMoistureThick
     budget = pcr.catchmenttotal(self.actualAdditionCum - self.increaseInSubsurfaceStorage - self.actualAbstractionCum
            - self.upwardSeepageCum, self.ldd) \
            - self.lateralFlowFluxAmountCum
     pcr.report(budget, pcrfw.generateNameST('B-sub', sample, timestep))
     pcr.report(budget / self.lateralFlowFluxAmountCum,
                pcrfw.generateNameST('BR-sub', sample, timestep))
     return self.increaseInSubsurfaceStorage, self.lateralFlowFluxAmountCum, self.actualAbstractionCum
Ejemplo n.º 2
0
 def budgetCheck(self, sample, timestep):
     # NOTE this is only valid if addition,subtraction are invoked ONCE EACH TIME STEP
     # NOTE use of maptotal, in case of ldd not covering whole area, absolute values may not be
     # comparable with other budgets.
     self.actualAdditionCum = pcr.scalar(self.actualAdditionCum +
                                         self.actualInfiltrationFlux *
                                         self.timeStepDuration)
     self.increaseInStore = self.store - self.initialStore
     budget = pcr.maptotal(self.actualAdditionCum - self.increaseInStore)
     pcr.report(budget, pcrfw.generateNameST('B-inf', sample, timestep))
     return self.increaseInStore
Ejemplo n.º 3
0
 def budgetCheck(self, sample, timestep):
     # NOTE this is only valid if addition,subtraction and lateral flow are invoked ONCE EACH TIME STEP
     # NOTE use of maptotal, in case of ldd not covering whole area, absolute values may not be
     # comparable with other budgets.
     # note self.changeAmount can be positive or negative and thus self.actualAdditionCum, too
     self.actualAdditionCum = self.actualAdditionCum + self.changeAmount
     self.increaseInStore = self.store - self.initialStore
     # budget=catchmenttotal(self.actualAdditionCum-self.actualAbstractionCum-self.increaseInStore)
     budget = pcr.maptotal(self.actualAdditionCum - self.increaseInStore)
     pcr.report(budget, pcrfw.generateNameST('B-sur', sample, timestep))
     return self.increaseInStore
 def budgetCheck(self, sample, timestep):
     # this should include setMaximumStore as this may result in throwing away of water
     # NOTE this is only valid if addition,subtraction and lateral flow are invoked ONCE EACH TIME STEP
     # NOTE use of maptotal, in case of ldd not covering whole area, absolute values may not be
     # comparable with other budgets.
     self.actualAdditionCum = self.actualAdditionCum + self.actualAdditionFlux * self.timeStepDuration
     self.actualAbstractionCum = self.actualAbstractionCum + self.actualAbstractionFlux * self.timeStepDuration
     self.increaseInStore = self.store - self.initialStore
     # budget=catchmenttotal(self.actualAdditionCum-self.actualAbstractionCum-self.increaseInStore)
     budget = pcr.maptotal(self.actualAdditionCum -
                           self.actualAbstractionCum - self.increaseInStore)
     pcr.report(budget, pcrfw.generateNameST('B-int', sample, timestep))
     return self.increaseInStore
Ejemplo n.º 5
0
    def reportAsMaps(self, sample, timestep):
        self.variablesToReport = {}
        if self.setOfVariablesToReport == 'full':
            self.variablesToReport = {
                'RPic': self.maximumInterceptionCapacityPerLAI,
                'RPks': self.ksat,
                'RPrt': self.regolithThicknessHomogeneous,
                'RPsc': self.saturatedConductivityMetrePerDay,
                'RPmm': self.multiplierMaxStomatalConductance
            }
        if self.setOfVariablesToReport == 'filtering':
            self.variablesToReport = {
                'RPic': self.maximumInterceptionCapacityPerLAI,
                'RPks': self.ksat,
                'RPrt': self.regolithThicknessHomogeneous,
                'RPsc': self.saturatedConductivityMetrePerDay,
                'RPmm': self.multiplierMaxStomatalConductance
            }

        if timestep in self.timeStepsToReport:
            for variable in self.variablesToReport:
                pcr.report(self.variablesToReport[variable],
                           pcrfw.generateNameST(variable, sample, timestep))
Ejemplo n.º 6
0
    def checkBudgets(self, currentSampleNumber, currentTimeStep):

        increaseInPrecipitationStore = 0.0 - self.d_exchangevariables.cumulativePrecipitation
        pcr.report(
            increaseInPrecipitationStore,
            pcrfw.generateNameST('incP', currentSampleNumber, currentTimeStep))

        increaseInInterceptionStore = self.d_interceptionuptomaxstore.budgetCheck(
            currentSampleNumber, currentTimeStep)
        pcr.report(
            increaseInInterceptionStore,
            pcrfw.generateNameST('incI', currentSampleNumber, currentTimeStep))

        increaseInSurfaceStore = self.d_surfaceStore.budgetCheck(
            currentSampleNumber, currentTimeStep)
        pcr.report(
            increaseInSurfaceStore,
            pcrfw.generateNameST('incS', currentSampleNumber, currentTimeStep))
        increaseInSurfaceStoreQM = pcr.catchmenttotal(
            increaseInSurfaceStore, self.ldd) * pcr.cellarea()
        pcr.report(
            increaseInSurfaceStoreQM,
            pcrfw.generateNameST('testb', currentSampleNumber,
                                 currentTimeStep))

        # let op: infiltration store is directly passed to subsurface store, thus is not a real store
        increaseInInfiltrationStore = self.d_infiltrationgreenandampt.budgetCheck(
            currentSampleNumber, currentTimeStep)

        increaseInSubSurfaceWaterStore, lateralFlowInSubsurfaceStore, abstractionFromSubSurfaceWaterStore = \
                                 self.d_subsurfaceWaterOneLayer.budgetCheck(currentSampleNumber, currentTimeStep)
        increaseInSubSurfaceStoreQM = pcr.catchmenttotal(
            increaseInSubSurfaceWaterStore, self.ldd) * pcr.cellarea()

        increaseInRunoffStoreCubicMetresInUpstreamArea = self.d_runoffAccuthreshold.budgetCheck(
        )

        totalIncreaseInStoresCubicMetresInUpstreamArea = 0.0
        stores = [
            increaseInPrecipitationStore, increaseInInterceptionStore,
            increaseInSurfaceStore, increaseInSubSurfaceWaterStore
        ]
        for store in stores:
            increaseInStoreCubicMetresInUpstreamArea = pcr.catchmenttotal(
                store, self.ldd) * pcr.cellarea()
            totalIncreaseInStoresCubicMetresInUpstreamArea = totalIncreaseInStoresCubicMetresInUpstreamArea + \
                                                           increaseInStoreCubicMetresInUpstreamArea

        pcr.report(
            totalIncreaseInStoresCubicMetresInUpstreamArea,
            pcrfw.generateNameST('inSt', currentSampleNumber, currentTimeStep))
        pcr.report(
            increaseInRunoffStoreCubicMetresInUpstreamArea,
            pcrfw.generateNameST('inRu', currentSampleNumber, currentTimeStep))
        pcr.report(
            pcr.catchmenttotal(self.d_exchangevariables.upwardSeepageFlux,
                               self.ldd) * pcr.cellarea(),
            pcrfw.generateNameST('inSe', currentSampleNumber, currentTimeStep))
        # total budget is total increase in stores plus the upward seepage flux for each ts that is passed to the next
        # timestep and thus not taken into account in the current timestep budgets
        budget = totalIncreaseInStoresCubicMetresInUpstreamArea + increaseInRunoffStoreCubicMetresInUpstreamArea + \
               lateralFlowInSubsurfaceStore * pcr.cellarea() + pcr.catchmenttotal(abstractionFromSubSurfaceWaterStore, self.ldd) * pcr.cellarea() + \
               pcr.catchmenttotal(self.d_exchangevariables.upwardSeepageFlux, self.ldd) * pcr.cellarea()
        pcr.report(
            budget,
            pcrfw.generateNameST('B-tot', currentSampleNumber,
                                 currentTimeStep))
        budgetRel = budget / increaseInRunoffStoreCubicMetresInUpstreamArea
        pcr.report(
            budgetRel,
            pcrfw.generateNameST('B-rel', currentSampleNumber,
                                 currentTimeStep))
Ejemplo n.º 7
0
 def reportMaps(self, sample, timestep):
     if timestep in self.timeStepsToReport:
         for variable in self.variablesToReport:
             pcr.report(self.variablesToReport[variable],
                        pcrfw.generateNameST(variable, sample, timestep))