diff --git a/HSP2/PLANK_Class.py b/HSP2/PLANK_Class.py index 3eed8694..e7164516 100644 --- a/HSP2/PLANK_Class.py +++ b/HSP2/PLANK_Class.py @@ -652,6 +652,9 @@ def simulate(self, tw, phval, co2, tss, OXRX, NUTRX, iphyto, izoo, iorn, iorp, i else: # use full depth and velocity self.balvel = avvele self.baldep = avdepe + else: + self.balvel = 0.0 + self.baldep = 0.0 # calculate solar radiation absorbed; solrad is the solar radiation at gage, # corrected for location of reach; 0.97 accounts for surface reflection @@ -1253,6 +1256,11 @@ def litrch(inlit, extb, extcla, extsed, avdepe, baldep, PHYFG, BALFG): ''' calculate light correction factor to algal growth (cflit); determine amount of light available to phytoplankton and benthic algae''' ln01 = 4.60517 # minus natural log 0.01 + + cflit = 0.0 + phylit = 0.0 + ballit = 0.0 + if inlit > 0.0: # calculate extinction of light based on the base extinction # coefficient of the water incremented by self-shading effects @@ -1290,10 +1298,10 @@ def litrch(inlit, extb, extcla, extsed, avdepe, baldep, PHYFG, BALFG): ballit = inlit * exp(-extco * baldep) if ballit < 0.0001: ballit = 0.0 + else: # there is no incident solar radiation; algal growth cannot occur - cflit = 0.0 - phylit = 0.0 - ballit = 0.0 + pass + return phylit, ballit, cflit @staticmethod diff --git a/HSP2/RQUAL_Class.py b/HSP2/RQUAL_Class.py index 04fbfdb6..02f677a4 100644 --- a/HSP2/RQUAL_Class.py +++ b/HSP2/RQUAL_Class.py @@ -750,9 +750,10 @@ def simulate(self, ts): self.PHYTO[loop] = self.PLANK.phyto self.ZOO[loop] = self.PLANK.zoo - self.BENAL1[loop] = self.PLANK.benal[0] - self.TBENAL1[loop] = self.PLANK.tbenal[1] - self.TBENAL2[loop] = self.PLANK.tbenal[2] + if self.PLANK.BALFG: + self.BENAL1[loop] = self.PLANK.benal[0] + self.TBENAL1[loop] = self.PLANK.tbenal[1] + self.TBENAL2[loop] = self.PLANK.tbenal[2] self.PHYCLA[loop] = self.PLANK.phycla self.ORN[loop] = self.PLANK.orn