Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



...

What

nameofinstance.xml

Description

Configuration of the pcraster transformation module

schema location

http

https://

fews

fewsdocs.

wldelft

deltares.nl/schemas/version1.0/pcrTransformationSets.xsd

Entry in ModuleDescriptors

<moduleDescriptor id="PcrTransformation">
<description>PCr Transformation Component</description>
<className>nl.wldelft.fews.system.plugin.transformation.PcrTransformationController</className>
</moduleDescriptor>

Table of Contents
Children Display

...

  1. Grid Definition (number of rows, columns etc.) (do not use if any of the other methods can be used)
  2. Grid location Id (this will use a grid definition the the Grids.xml file in the RegionConfigFiles section).
  3. TimeSeriesSet which defines a Grid TimeSeries. (the grid definition is taken from the timeseries itself)

...



 

Examples

Here are few examples, which show the different methods available when defining an Area Map.
1.    The area map is defined as a (FEWS) grid location id which refers to the grid definition at the same location within Grids.xml configuration file

...

Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Solar radiation module demonstration configuration -->
<pcrTransformationSets xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews
http https://fewsfewsdocs.wldelftdeltares.nl/schemas/version1.0/pcrTransformationSets.xsd" version="1.1">
	<logLevel>WARN</logLevel>
	<pcrTransformationSet id="Potradiation">
		<areaMap>
			<locationId>Radiation</locationId>
		</areaMap>
		<definitions>
			<dataExchange>memory</dataExchange>
			<inputVariable variableId="Altitude" dataType="scalar" convertDatum="false" spatialType="spatial">
				<timeSeriesSet>
					<moduleInstanceId>Radiation</moduleInstanceId>
					<valueType>grid</valueType>
					<parameterId>Time.event</parameterId>
					<locationId>Radiation</locationId>
					<timeSeriesType>external historical</timeSeriesType>
					<timeStep unit="minute" multiplier="15"/>
					<relativeViewPeriod unit="hour" start="0" end="48"/>
					<readWriteMode>add originals</readWriteMode>
				</timeSeriesSet>
			</inputVariable>
			<inputVariable variableId="YearDay" dataType="scalar" convertDatum="false" scalarType="timeAsDayofYear">
				<timeSeriesSet>
					<moduleInstanceId>Radiation</moduleInstanceId>
					<valueType>scalar</valueType>
					<parameterId>Time.event</parameterId>
					<locationId>Radiation</locationId>
					<timeSeriesType>external historical</timeSeriesType>
					<timeStep unit="minute" multiplier="15"/>
					<relativeViewPeriod unit="hour" start="0" end="48"/>
					<readWriteMode>add originals</readWriteMode>
				</timeSeriesSet>
			</inputVariable>
			<inputVariable variableId="Hour" dataType="scalar" convertDatum="false" scalarType="timeAsHourofDay">
				<timeSeriesSet>
					<moduleInstanceId>Radiation</moduleInstanceId>
					<valueType>scalar</valueType>
					<parameterId>Time.event</parameterId>
					<locationId>Radiation</locationId>
					<timeSeriesType>external historical</timeSeriesType>
					<timeStep unit="minute" multiplier="15"/>
					<relativeViewPeriod unit="hour" start="0" end="48"/>
					<readWriteMode>add originals</readWriteMode>
				</timeSeriesSet>
			</inputVariable>
			<!-- Total potential Solar radiation -->
			<outputVariable variableId="SL" dataType="scalar" convertDatum="false">
				<timeSeriesSet>
					<moduleInstanceId>Radiation</moduleInstanceId>
					<valueType>grid</valueType>
					<parameterId>Sol.pot</parameterId>
					<locationId>Radiation</locationId>
					<timeSeriesType>external historical</timeSeriesType>
					<timeStep unit="minute" multiplier="15"/>
					<relativeViewPeriod unit="hour" start="0" end="48"/>
					<readWriteMode>add originals</readWriteMode>
				</timeSeriesSet>
			</outputVariable>
			<!-- Diffuse radiation -->
			<outputVariable variableId="SLDF" dataType="scalar" convertDatum="false">
				<timeSeriesSet>
					<moduleInstanceId>Radiation</moduleInstanceId>
					<valueType>grid</valueType>
					<parameterId>Sol.pot.diffuse</parameterId>
					<locationId>Radiation</locationId>
					<timeSeriesType>external historical</timeSeriesType>
					<timeStep unit="minute" multiplier="15"/>
					<relativeViewPeriod unit="hour" start="0" end="48"/>
					<readWriteMode>add originals</readWriteMode>
				</timeSeriesSet>
			</outputVariable>
			<!-- direct radiation -->
			<outputVariable variableId="SLDR" dataType="scalar" convertDatum="false">
				<timeSeriesSet>
					<moduleInstanceId>Radiation</moduleInstanceId>
					<valueType>grid</valueType>
					<parameterId>Sol.pot.direct</parameterId>
					<locationId>Radiation</locationId>
					<timeSeriesType>external historical</timeSeriesType>
					<timeStep unit="minute" multiplier="15"/>
					<relativeViewPeriod unit="hour" start="0" end="48"/>
					<readWriteMode>add originals</readWriteMode>
				</timeSeriesSet>
			</outputVariable>
		</definitions>
		<pcrModel id="String">
			<text><![CDATA[
#! --unittrue --degrees
# Test script to determine radiation over a grid.
#
# Inputs from Delft-Fews into this script
# - YearDay -> scalar with  day since beginning of year
# - Hour of day -> Fractional hour of day (e.g. 12.5 = 12:30)
# Ouputs to FEWS
# - SL -> Total Solar radiation
#
# This version determines Clear Sky radiation assuming a level surface using a uniform
# altitude. This level is configured in the script below.
Altitude=spatial(10);

Latitude = ycoordinate(boolean(Altitude));
Longitude = xcoordinate(boolean(Altitude));

Day =YearDay;
pi = 3.1416;
Sc       = 1367.0;          # Solar constant (Gates, 1980) [W/m2]
Trans    = 0.6;             # Transmissivity tau (Gates, 1980)

AtmPcor = ((288-0.0065*Altitude)/288)**5.256;            # atm pressure corr [-]

# Solar geometry
# ----------------------------
# SolDec  :declination sun per day  between +23 and -23 [deg]
# HourAng :hour angle [-] of sun during day
# SolAlt  :solar altitude [deg], height of sun above horizon
# SolDec  = -23.4*cos(360*(Day+10)/365);
# Now added a new function that should work on all latitudes!
theta    =(Day-1)*360/365;  # day expressed in degrees

# Time change equal to 4 min per degree longtitude
# Assume the time input to be GMT
HourS = Hour + (Longitude * 4/60);

SolDec =180/pi * (0.006918-0.399912 * cos(theta)+0.070257 * sin(theta) -   0.006758 * cos(2*theta)+0.000907 * sin(2*theta) -  0.002697 * cos(3*theta)+0.001480 * sin(3*theta));

HourAng = 15*(HourS-12.01);

SolAlt  = scalar(asin(scalar(sin(Latitude)*sin(SolDec)+cos(Latitude)*
           cos(SolDec)*cos(HourAng))));

# Solar azimuth
# ----------------------------
# SolAzi  :angle solar beams to N-S axes earth [deg]
 SolAzi = scalar(acos((sin(SolDec)*cos(Latitude)-cos(SolDec)*
          sin(Latitude)*cos(HourAng))/cos(SolAlt)));
 SolAzi = if(HourS le 12 then SolAzi else 360 - SolAzi);

 Slope = spatial(0.0001);
 Aspect = spatial(1);

# Surface azimuth
# ----------------------------
# cosIncident :cosine of angle of incident; angle solar beams to angle surface
 cosIncident = sin(SolAlt)*cos(Slope)+cos(SolAlt)*sin(Slope)
               *cos(SolAzi-Aspect);

# Radiation outer atmosphere
# ----------------------------
 OpCorr = Trans**((sqrt(1229+(614*sin(SolAlt))**2)
          -614*sin(SolAlt))*AtmPcor);    # correction for air masses [-]
 Sout   = Sc*(1+0.034*cos(360*Day/365)); # radiation outer atmosphere [W/m2]
 Snor   = Sout*OpCorr;                   # rad on surface normal to the beam [W/m2]

# Radiation at DEM
# ----------------------------
# Sdir   :direct sunlight on a horizontal surface [W/m2] if no shade
# Sdiff  :diffuse light [W/m2] for shade and no shade
# Stot   :total incomming light Sdir+Sdiff [W/m2] at Hour
# Radiation :avg of Stot(Hour) and Stot(Hour-HourStep)
# NOTE: PradM only valid for HourStep and DayStep = 1
 Sdir   = if(Snor*cosIncident<0,0.0,Snor*cosIncident);
 Sdiff  = if(Sout*(0.271-0.294*OpCorr)*sin(SolAlt)<0, 0.0,
          Sout*(0.271-0.294*OpCorr)*sin(SolAlt));

# Fill in missing values with areaaaverage
SLDR=cover((Sdir*1),(Altitude * 0) + areaaverage(Sdir*1,boolean(Altitude))); # hourly rad [W/m2]
SLDF=cover((Sdiff*1),(Altitude * 0) + areaaverage(Sdiff*1,boolean(Altitude))); # hourly rad [W/m2]

SL   = SLDR + SLDF;       # Total rad  in [W/m2]



			]]></text>
		</pcrModel>
	</pcrTransformationSet>
</pcrTransformationSets>

...

For 64 bit support PCRaster needs to be installed manually. See: PCRaster