Temperature follows a sine curve during daylight and an exponential decay curve during night between minimum and maximum temperature.
Radiation follows either a simple sine curve, or a shifted sine curve (SinBeta) as defined by (G).
Output variables in the following order
First we need a resource with daily weather, including min and max temp and radiation.
| <resource id="weather" interface="weatherfile" frequence="DAILY"> | <header> | <res id="KeyValue" datatype="CHAR" key="vWeatherKey"/> | <res id="PolygonCode" datatype="CHAR" /> | <res id="CURRENTDATE" datatype="DATE" key="CURRENT.DATE" /> | <res id="Rain" unit="mm" datatype="DOUBLE" /> | <res id="AirTemperatureMax" unit="°C" datatype="DOUBLE" /> | <res id="AirTemperatureMin" unit="°C" datatype="DOUBLE" /> | <res id="GlobalSolarRadiation" unit="MJ*m**-2" datatype="DOUBLE" /> | <res id="WindSpeed" unit="m*s**-1" datatype="DOUBLE" /> | <res id="ReferenceEvapotranspiration" unit="mm" datatype="DOUBLE" /> | </header> | </resource>
The transformer needs the resource id in it's resource attribute. Output variables in the header section start with the resources key variables, followed by calculated variables. The inputs for DateField, !MinTempField, MaxTempField and RadiationField contain the names of the columns as defined in the resource above.
| <transform id="diurnal" frequence="DAILY" resource="weather" class="net.simplace.client.simulation.lap.transformer.DiurnalSineWeatherTransformer"> | <header> | <res id="KeyValue" datatype="CHAR" key="vWeatherKey"/> | <res id="CURRENTDATE" datatype="DATE" key="CURRENT.DATE" /> | <res id="Hours" datatype="DOUBLEARRAY" /> | <res id="Temperature" datatype="DOUBLEARRAY" /> | <res id="RadiationIntensity" datatype="DOUBLEARRAY" /> | <res id="Radiation" datatype="DOUBLEARRAY" /> | <res id="Doy" datatype="INT" /> | <res id="Daylength" datatype="DOUBLE" /> | <res id="GlobalRadiation" datatype="DOUBLE" /> | </header> | <input id="DateField">CURRENTDATE</input> | <input id="MinTempField">AirTemperatureMin</input> | <input id="MaxTempField">AirTemperatureMax</input> | <input id="RadiationField">GlobalSolarRadiation</input> | <input id="Steps">48</input> | <input id="Latitude" source="vLatitude" /> | <input id="RadiationCurve">Sine</input> | </transform>
Temperature is calculated according to (G) eq. 3.9 for daytime
\(12-d/2 < t_h < 12+d/2\): \[ T_a(t_h) =T_{min} + (T_{max} + T_{min})\sin(\pi \frac{t_h - 12 + \frac{d}{2}}{d + 2p}) \]and (G) eq. 3.10 for nighttime
\(t_h \leq 12-d/2 \quad\text{or}\quad 12+d/2 \leq t_h\): \[ T_a(t_h) = \frac{T_{min}-T_{sset} e^{-\frac{n}{TC}} + (T_{sset}-T_{min})e^{-\frac{t_h - t_{sset}}{TC}}}{1-e^{-\frac{n}{TC}}} \] where \(T_a\) is the air temperature at hour \(t_h\), \(d, n\) are day- and nightlength, \(p\) is the offset from noon of max temperature and \(TC\) the nocturnal time coefficient. \(T_{sset}, t_{sset}\) are temperature and time at sunsset.If RadiationCurve has the value 'Sine', then the radiation intensitiy follows the curve
\[ I(t) \propto s(t) = \sin(\frac{\pi}{d} (t - (12-\frac{d}{2}))) \]If it has the value SinBeta the curve (G), eq. 3.2 is used:
\[ I(t) \propto sin\beta(t) = a + b\cos(2\pi \frac{t - 12}{24}) \] where parameters \(a,b\) depend on latitude and daylength. Diurnal Radiation at a timestep \(t_i\) is the radiation accumulated between the previous and actual timestep. \[ R(t_i) = \int_{t_{i-1}}^{t_i}I(t)dt \](G) Goudriaan, Modeling Potential Crop Growth Processes, 1994, (revised version Nov. 2004)