Skip to content

Instantly share code, notes, and snippets.

@sunt05
Last active August 10, 2017 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunt05/6d5cc5556e6c2799c99d32a2065cf450 to your computer and use it in GitHub Desktop.
Save sunt05/6d5cc5556e6c2799c99d32a2065cf450 to your computer and use it in GitHub Desktop.
SUEWS interface improvement
calPotEvap(& ! compared with the above subroutine, you may find we put all input and output variables explicitly here
TSurf, Qair, SoilMoist, Res, PET)
! below are pseudo-code and comments:
implict none
real, intent(in):: TSurf, Qair, SoilMoist, Res
real, intent(out):: PET
real:: Rho,Lv ! these are constant values: Rho (air density), Lv (latent heat of vaporization)
PET= soilMoist*Rho*Lv/Res*(qsat(Tsurf)-Qair) ! this is the final result we want
endsubroutine calPotEvap
calPotEvap(day) ! this subroutine calculates potential evaporation of a given day
! below are pseudo-code and comments:
use someModule
implict none
! load met forcing and soil states of the given day:
call loadMet(day) ! by doing this, we can get: TSurf (surface temperature), Qair (air humidity),
call loadSfc(day) ! by doing this, we can get: SoilMoist (soil moisture), Res (aerodynamic resistance)
PET= soilMoist*Rho*Lv/Res*(qsat(Tsurf)-Qair) ! this is the final result we want
endsubroutine calPotEvap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment