net.simplace.client.simulation.lap.transformer.DiurnalSineWeatherTransformer
Transforms daily radiation and temperature to diurnal values using
sine curves.
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).
- The field names (column names) of date, radiation, min and max temperature in the resource
- The number of steps the diurnal values are calculated (default is 24, i.e. hourly values)
- Latitude of the location
- The offset from noon of max temp (default 1.5, i.e. max temperature occurs at 1:30 pm)
- The nocturnal time coefficient for temperature (default is 4 hours)
- The radiation curve that should be used - either Sine or SinBeta
Output variables
Output variables in the following order
- Date
- Time - Array of time for each step (h)
- Temperature - Array of Temperature for each step (°C)
- Radiation intensity - Array of radiation intensity for each time step (J m^-2 h^-1, kJ m^-2 h^-1 or MJ m^-2 h^-1)
- Radiation - Array of radiation accumulated between two time steps
- DOY - day of year (d)
- Daylength - (h)
- Daily total radiation - (J m^-2, kJ m^-2 or MJ m^-2)
Temperature
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.
Radiation
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
\]
References
(G) Goudriaan, Modeling Potential Crop Growth Processes, 1994, (revised version Nov. 2004)
public class DiurnalSineWeatherTransformer extends
net.simplace.simulation.io.resources.FWSimResourceTransformer {
// Public Constructors
public DiurnalSineWeatherTransformer(FWSimSession aSession, Element
aResourceElement, Integer aOrderNumber);
public DiurnalSineWeatherTransformer(FWSimSession aSession, Integer
aOrderNumber);
// Public Instance Methods public HashMap createVariables(); // Defines
net.simplace.simulation.io.FWSimIOAdapter
public FWSimResourceCache getData(FWSimVarMap aVarMap)
throws MissingSimResourceException; // Defines
net.simplace.simulation.io.resources.FWSimInputAdapter
standard method from outside
public FWSimResourceCache
getData(FWSimVarMap aVarMap, FWSimResourceCache
aResourceCache) throws MissingSimResourceException;
used by test cases
- aVarMap
variable map
- aResourceCache
Cached resources (soil data)
returns delivered new data from transformer
public void fillVarMap(FWSimVarMap aVarMap);
// Defines
net.simplace.simulation.io.resources.FWSimResourceTransformer
public FWSimResourceCache
calculateDiurnalValues(int steps, double latitude,
double timeOffset, double timeCoefficient, String radiationCurve, String
DateField, String MinTempField, String MaxTempField, String
RadiationField, String aProjectID, FWSimResourceCache aCache)
throws MissingSimResourceException;
Calculates Daylengths
- steps
- latitude
- timeOffset
- timeCoefficient
- radiationCurve
- DateField
- MinTempField
- MaxTempField
- RadiationField
- aProjectID id of the project
- aCache original weather
returns the new created {@link FWSimResourceCache}
public void updateFields(FWObservable aObservable);
// Defines
net.simplace.simulation.io.resources.FWSimResourceTransformer
}
Hierarchy: java.lang.Object - net.simplace.simulation.io.FWSimIOAdapter (net.simplace.simulation.util.FWSimFieldContainer) - net.simplace.simulation.io.resources.FWSimInputAdapter - net.simplace.simulation.io.resources.FWSimResourceTransformer - DiurnalSineWeatherTransformer