Index: wflow-py/wflow/sphy/hargreaves.py =================================================================== diff -u -re59169d4b535e077a267eba3d2ba75f73803fbc8 -r36b469410a4a5af24c3902cbebb595e9da83c7bb --- wflow-py/wflow/sphy/hargreaves.py (.../hargreaves.py) (revision e59169d4b535e077a267eba3d2ba75f73803fbc8) +++ wflow-py/wflow/sphy/hargreaves.py (.../hargreaves.py) (revision 36b469410a4a5af24c3902cbebb595e9da83c7bb) @@ -1,15 +1,25 @@ -#-Extraterrestrial radiation +# -Extraterrestrial radiation def extrarad(self, pcr): - DayNo = self.wf_supplyJulianDOY() # timecalc.julian(self)[0] + DayNo = self.wf_supplyJulianDOY() # timecalc.julian(self)[0] LatRad = self.Lat * (self.pi / 180) - dr = 1 + 0.033 * pcr.cos((2 * self.pi * DayNo) / 365) + dr = 1 + 0.033 * pcr.cos((2 * self.pi * DayNo) / 365) delta = 0.409 * pcr.sin(((2 * self.pi * DayNo) / 365) - 1.39) omegas = pcr.acos(-1 * pcr.tan(LatRad) * pcr.tan(delta)) - Ra = ((24 * 60) / self.pi) * self.Gsc * dr * (pcr.scalar(omegas) * pcr.sin(LatRad) * pcr.sin(delta) +\ - pcr.cos(LatRad) * pcr.cos(delta) * pcr.sin(omegas)) - return Ra + Ra = ( + ((24 * 60) / self.pi) + * self.Gsc + * dr + * ( + pcr.scalar(omegas) * pcr.sin(LatRad) * pcr.sin(delta) + + pcr.cos(LatRad) * pcr.cos(delta) * pcr.sin(omegas) + ) + ) + return Ra -#-Modified Hargreaves for calculation of ETref + +# -Modified Hargreaves for calculation of ETref def Hargreaves(pcr, ra, temp, tempmax, tempmin): - ETref = pcr.max(0.0023 * 0.408 * ra * (temp + 17.8) * (pcr.max(tempmax - tempmin, 0))**0.5, 0) - return ETref \ No newline at end of file + ETref = pcr.max( + 0.0023 * 0.408 * ra * (temp + 17.8) * (pcr.max(tempmax - tempmin, 0)) ** 0.5, 0 + ) + return ETref