def SurfFlux(self,forc,parameter,simTime,humRef,tempRef,windRef,boundCond,intFlux):
<EOL>dens = forc.pres/(<NUM_LIT:1000>*<NUM_LIT>*tempRef*(<NUM_LIT:1.>+<NUM_LIT>*humRef)) <EOL>self.aeroCond = <NUM_LIT> + <NUM_LIT> * windRef         <EOL>if (self.horizontal):     <EOL><INDENT>if not self.is_near_zero(self.waterStorage) and self.waterStorage > <NUM_LIT:0.0>:<EOL><INDENT>qtsat = self.qsat([self.layerTemp[<NUM_LIT:0>]],[forc.pres],parameter)[<NUM_LIT:0>]<EOL>eg = self.aeroCond*parameter.colburn*dens*(qtsat-humRef)/parameter.waterDens/parameter.cp<EOL>self.waterStorage = min(self.waterStorage + simTime.dt*(forc.prec-eg),parameter.wgmax)<EOL>self.waterStorage = max(self.waterStorage,<NUM_LIT:0.>) <EOL><DEDENT>else:<EOL><INDENT>eg = <NUM_LIT:0.><EOL><DEDENT>soilLat = eg*parameter.waterDens*parameter.lv<EOL>if simTime.month < parameter.vegStart and simTime.month > parameter.vegEnd:<EOL><INDENT>self.solAbs = (<NUM_LIT:1.>-self.albedo)*self.solRec <EOL>vegLat = <NUM_LIT:0.><EOL>vegSens = <NUM_LIT:0.><EOL><DEDENT>else:    <EOL><INDENT>self.solAbs = ((<NUM_LIT:1.>-self.vegCoverage)*(<NUM_LIT:1.>-self.albedo)+self.vegCoverage*(<NUM_LIT:1.>-parameter.vegAlbedo))*self.solRec<EOL>vegLat = self.vegCoverage*parameter.grassFLat*(<NUM_LIT:1.>-parameter.vegAlbedo)*self.solRec<EOL>vegSens = self.vegCoverage*(<NUM_LIT:1.>-parameter.grassFLat)*(<NUM_LIT:1.>-parameter.vegAlbedo)*self.solRec<EOL><DEDENT>self.lat = soilLat + vegLat<EOL>self.sens = vegSens + self.aeroCond*(self.layerTemp[<NUM_LIT:0>]-tempRef)<EOL>self.flux = -self.sens + self.solAbs + self.infra - self.lat <EOL><DEDENT>else:               <EOL><INDENT>self.solAbs = (<NUM_LIT:1.>-self.albedo)*self.solRec<EOL>self.lat = <NUM_LIT:0.><EOL>self.sens = self.aeroCond*(self.layerTemp[<NUM_LIT:0>]-tempRef)<EOL>self.flux = -self.sens + self.solAbs + self.infra - self.lat <EOL><DEDENT>self.layerTemp = self.Conduction(simTime.dt, self.flux, boundCond, forc.deepTemp, intFlux)<EOL>self.T_ext = self.layerTemp[<NUM_LIT:0>]<EOL>self.T_int = self.layerTemp[-<NUM_LIT:1>]<EOL>
Calculate net heat flux, and update element layer temperatures