net.simplace.client.simulation.lap.transformer.AstronomicParametersTransformer
Calculated daylength, photoperiodic daylength, solar constant and
daily total effictive solar height for each DOY at a given latitude.
For each row in the ressource it creates 366 rows containing values for
each day of year (DOY)
The transformer needs the fieldnames of a ressource, that contain
- location id
- latitude in degrees
- inclination of sun angle in degrees
It outputs a resource with following fields
- DOY (serves as a key)
- location id (serves as a key)
- daylength
- photoperiodic daylength
- solar constant
- seasonal offset of sine of solar height (SINLD)
- amplitude of sine of solar height (COSLD)
- effective solar height (DSINB)
- daily total of effective solar height (DSINBE)
References
The calculation method follows mainly the routine from the Gecros model ref?.
Differences between this routine and Gecros
- Gecros limits the latitude between -67 and 67 degrees. This routine extends
the range from -90 to 90 degrees as in Lintul5 ref?
- Sine and Cosine of declination are calculated directly (in a mathematical
equivalent way)
- Values are calculated with double precision, which might result in slightly different
values than from the FORTRAN code.
Usage
Transformer is used in the FST based models:
Conversion factor from degrees to radians. The original Fortran/FST-Modules use a less
precise approximation of \(\pi \approx 3.141592654\), whereas here \(\pi \approx 3.141592653589793\).
\[
\begin{eqnarray}
rad &=& \frac{\pi}{180}\\
\end{eqnarray}
\]
Sine and cosine of latitude, maximal declination. Values calculated only once per location.
\[
\begin{eqnarray}
sinlat &=& \sin(rad \cdot latitutde)\\
coslat &=& \cos(rad \cdot latitutde)\\
sindcm &=& \sin(rad \cdot 23.45)\\
\end{eqnarray}
\]
Sine and cosine of declination of the sun as function of day of year.
Calculation is taken from Goudriaan, van Laar 1994.
Some models first calculate \(dec\) as the arcsine of \(sindec\) and
then take the sine and cosine. The methods are mathematically equivalent
due to \(sin^2+cos^2=1\)
\[
\begin{eqnarray}
sindec &=& -sindcm \cos(2 \pi \frac{doy+10}{365})\\
cosdec &=& \sqrt{1-sindec^2}\\
sinld &=& sinlat \cdot sindec\\
cosld &=& coslat \cdot cosdec
\end{eqnarray}
\]
Daylength calculation.
\[
\begin{eqnarray}
arg &=& \min(1,\max(-1,\frac{sinld}{cosld}))\\
daylength &=& 12 (1 + \frac{2}{\pi} \arcsin(arg))\\
\end{eqnarray}
\]
Photoperiodic daylength
\[
\begin{eqnarray}
arg2 &=& \min(1,\max(-1,\frac{-\sin(rad \cdot inclination)+sinld}{cosld}))\\
ddlp &=& 12(1+\frac{2}{\pi}\arcsin(arg2))\\
\end{eqnarray}
\]
Solar constant
\[
\begin{eqnarray}
sc &=& 1367(1 + 0.033 \cos(2 \pi\frac{doy-10}{365}))\\
\end{eqnarray}
\]
Daily total of effective solar height
\[
\begin{eqnarray}
dsinb &=& 3600(dayl \cdot sinld+24 cosld \frac{\sqrt{1-arg^2}}{\pi})\\
dsinbe &=& 3600(dayl(sinld+0.4(sinld^2+\frac{cosld^2}{2})) + 12 cosld(2+3\cdot 0.4 sinld)\frac{\sqrt{1-arg^2}}{\pi})
\end{eqnarray}
\]
public class AstronomicParametersTransformer extends
net.simplace.simulation.io.resources.FWSimResourceTransformer {
// Public Constructors
public AstronomicParametersTransformer(FWSimSession aSession, Element
aResourceElement, Integer aOrderNumber);
public AstronomicParametersTransformer(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
calculateDaylength(FWSimVariable idname,
FWSimVariable latitudename, FWSimVariable inclinationname, String
aProjectID, FWSimResourceCache aCache)
throws MissingSimResourceException;
Calculates Daylengths
- idname
- latitudename
- inclinationname
- aProjectID
id of the project
- aCache
original soil info stored
returns the new created {@link FWSimResourceCache}
public Element toXML(); // Defines
net.simplace.simulation.io.resources.FWSimResourceTransformer
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 - AstronomicParametersTransformer