Source code for src.functions.SOLWEIGpython.TsWaveDelay_2015a
importnumpyasnp
[docs]defTsWaveDelay_2015a(gvfLup,firstdaytime,timeadd,timestepdec,Tgmap1):"Unchanged function for Tgmap updates"Tgmap0=gvfLup# current timestepiffirstdaytime==1:# "first in morning"Tgmap1=Tgmap0iftimeadd>=(59/1440):# more or equal to 59 minweight1=np.exp(-33.27*timeadd)# surface temperature delay function - 1 stepTgmap1=Tgmap0*(1-weight1)+Tgmap1*weight1Lup=Tgmap1iftimestepdec>(59/1440):timeadd=timestepdecelse:timeadd=0else:timeadd=timeadd+timestepdecweight1=np.exp(-33.27*timeadd)# surface temperature delay function - 1 stepLup=(Tgmap0*(1-weight1)+Tgmap1*weight1)returnLup,timeadd,Tgmap1