I was facing problem with computation of bulk fluxes over land masked region. They were generating NaNs as RH was masked out to be 0. The code
Code: Select all
IF (RH.lt.2.0_r8) THEN !RH fraction
cff=cff*RH !Vapor pres (mb)
Q(i)=0.62197_r8*(cff/(PairM-0.378_r8*cff)) !Spec hum (kg/kg)
ELSE !RH input was actually specific humidity in g/kg
Q(i)=RH/1000.0_r8 !Spec Hum (kg/kg)
END IF
Code: Select all
IF (RH.lt.2.0_r8) THEN !RH fraction
# ifdef MASKING
if (rmask(i,j).NE.0) then
# endif
cff=cff*RH !Vapor pres (mb)
Q(i)=0.62197_r8*(cff/(PairM-0.378_r8*cff)) !Spec hum (kg/kg)
# ifdef MASKING
else
Q(i)=rmask(i,j)
endif
# endif
ELSE !RH input was actually specific humidity in g/kg
Q(i)=RH/1000.0_r8 !Spec Hum (kg/kg)
END IF