Organization: | Natural Resource Ecology Laboratory |
Project: | IRC |
Category: | Whitepaper |
Title: | Description and Use of the Weather Data Framework |
Draft
Introduction | ||||||
Framework Architecture | ||||||
|
||||||
Using the Framework | ||||||
|
||||||
Weather Sources | ||||||
|
||||||
Additional Information | ||||||
Glossary | ||||||
Bibliography | ||||||
About This Document | ||||||
|
The Weather Data Framework is a collection of C++ class hierarchies for accessing weather data. Major components of the framework include a data server which has a collection of data sources associated with interfaces to the data. The interfaces are used by a model or other software needing access to the data. Each assocation of data source-interface is scheduled in simulation time, that is, the data source-interface pair is made available when the scheduled simulation time is reached. This allows the data sources to vary throughout the course of a simulation.
The framework is designed to be extensible and flexible. It can be extended with new data sources and new model interfaces.
The following diagram shows a functional view of the framework's subsystems. A weather server has a container of linked data source-interface pairs. The data sources store actual data in data containers. The weather server is configured by a weather INI file, or from the object which owns it. A Century monthly or daily weather source schedule can be imported from a Century management schedule file, and the new schedule stored in a weather INI file.
goals of the design
Grid-Cohort Framework Issues
Century5 and DayCent5 Issues
IRC Issues
restrictions: compatibility
|
describe; class UML diagram
describe component diagram
Kinds of weather data derive from class WeatherDataBase (e.g., precip., temp.)
class WeatherDataBase, PrecipitationData, TemperatureData
Kinds of data sources derive from class WeatherSourceBase (e.g., NetCDF)
Derived classes provide functions for reading and accessing the data. Is paired with a weather interface object in the weather server object. Is publicly accessed through weather server.
Behaviors: Data can be copied? Data can be reused? (rewind in Century) Data has look-ahead (retrieve future data)? Data is static (constant)?
Characteristics: Time period resolution (monthly/daily/etc) Kind of data (actual, modelled, stochastic, means, etc.)
Kinds of data interfaces derive from class WeatherInterfaceBase (e.g., daily, monthly)
Knows its associated weather source object. Derived classes provide functions for accessing the data. Is publicly accessed through weather server.
Kinds of weather data servers derive from class WeatherServerBase (each server is specific to an application)
Classes that extract weather schedule from Century4 and Century5 management schedules.
Compilers, libraries
Weather data is scheduled to be used in a simulation beginning at the start of a specified simulation year. This schedule can be kept in a weather INI file, according to the following format:
<simulation year>=<short description>,<time period of data>,<spatial domain>,<type>,<type-specific data>
The key name is the simulation year in which the weather source will begin to be used. The fields assigned to the key are comma-delimited strings. An example specifying daily Century weather files, would look like this:
1900=COARDS Daily Weather,day,file,coards-weather.nc
Types of data are:
Type name string Type-specific datafile File name, with path if needed. If the file name has the extension "nc", it is assumed to be a NetCDF file. Otherwise, it is assumed to be a text-format file, whose format is determined by the time period field. site mean Mean values from the site parameters. site stochastic Stochastic values calculated using values from the site parameters. model INI section name with the model-specific configuration information.
Time periods of data are:
Time period string Descriptionhour Each data value represents one hour. This option currently is not used. day Each data value represents one day. This is available in Century text-format daily weather files, and in NetCDF COARDS-format binary files. month Each data value represents one month. This is available in Century text-format monthly weather files.
Spatial domain types are:
Spatial Domain string Descriptionsite Data applies to one site or point within a map or grid. grid Data is gridded; separate values are specified for each grid cell.
You can use comments to provide further description. Comment lines begin with one of the following characters: # ! ;
The file name has the extension "ini" if it is in text format; for example, "sim-weather.ini".
An example INI file is shown below:
[Description] Description1=Weather for Colorado forest 6000-8500 elevation Description2=Historical, Estes Park DataSetName= DataSetSource= [EditorInfo] EditorName= EditorEmail= EditorOrganization= EditDate= EditComment= [Schedule] 1900=COARDS Daily Weather - Simulated,day,site,file,weather-estespark-historical.nc 1980=COARDS Daily Weather - Actual,day,site,file,weather-estespark-actual.nc
Weather can be scheduled either through a Century5 management schedule, a Century4 schedule file, or a weather INI file.
Text and tables here.
The Century model, version 5, with a monthly time step, has the following weather data sources:
The daily version, DayCent5, also uses daily precipitation and temperature, and optional data for solar radiation, relative humidity, and mean windspeed. These are described further in the section Weather Data Sources and below under "DayCent4 and 5 Daily Weather Text File".
The model interfaces for the monthly Century are monthly precipitation and temperature; annual precipitation and temperature. DayCent has daily precipitation, temperature, solar radiation, relative humidity, and mean windspeed.
The weather data file is an ASCII (text) file containing rows of precipitation and 2-meter temperature data. In the Century version 4, the columns must be in a fixed format. In Century 5, this fixed column format is not required. However, Century 5 does require the row/record organization described below. Comment lines begin with one of the following characters: # ! ; (Century5 only).
Missing values are represented in the weather data file by entering -99.99
into
the field where the missing data occurs.
If the weather data file contains weather data for a minimum of a ten year period it can be used to generate precipitation means, standard deviations, and skewness values, minimum temperature means and maximum temperature means. These statistical values can be used to drive the stochastic weather generator. You specify the statistical values in the site parameter set.
The weather data file name must be no more than 8 characters in length and
end with a .wth
extension. The format of the weather
file is:
prec
(precipitation)
tmin
(2-meter minimum temperature)
tmax
(2-meter maximum temperature)
The following is an example of two weather entries from a weather data file formatted to be compatible for Century 4 as well as version 5:
prec 1915 0.31 2.55 5.07 7.01 8.87 5.13 1.61 8.83 3.55 3.53 0.99 0.92
tmin 1915 -13.50 -8.33 -8.17 0.78 1.67 7.00 9.72 8.33 5.39 -0.28 -6.06 -8.78
tmax 1915 4.44 8.56 4.33 16.33 17.50 21.06 26.83 26.06 22.89 18.89 10.78 8.50
prec 1916 1.57 0.31 0.37 1.68 8.07 2.90 4.27 2.84 1.06 2.64 2.06 3.06
tmin 1916 -16.50 -9.50 -4.89 -2.28 1.56 6.28 10.56 9.89 3.33 -2.44 -9.28 -14.78
tmax 1916 -0.61 8.67 14.22 14.33 20.28 25.44 32.39 27.28 24.56 14.78 8.78 1.56
The daily weather file in text format is arranged in columns, with each row containing the data for one day. It is customary (but not required) for the weather file name to have the extension "wth", as in mysite.wth for instance. The columns for preciptation and temperature are required, but the columns for solar radiation, relative humidity, and mean wind speed are optional.
The following is an example of the daily weather file.
# day mon year doy temp max temp min precip solar rad rel humid wind spd
# --- --- ---- ---- -------- --------- --------- --------- --------- ---------
1 1 1910 1 1.1979 -19.8167 0.0000
2 1 1910 2 -6.6101 -17.1811 0.0000
3 1 1910 3 1.0010 -6.6729 0.0000
<snip>
30 1 1910 30 5.4748 -7.9216 0.0000
31 1 1910 31 10.3707 -5.3493 0.0000
1 2 1910 32 7.6402 -16.4190 0.0000
2 2 1910 33 5.9807 -9.5389 0.0000
<snip>
30 12 1910 364 10.2789 -11.9567 0.0000
31 12 1910 365 13.0964 -4.5152 0.0000
1 1 1911 1 11.9193 -7.3365 0.0000
2 1 1911 2 11.1026 -6.1654 0.0000
<snip>
The columns are: day of month, month number, year, day number in year, temperature mininum and maximum, precipitation, solar radiation, relative humdity, and wind speed. Comment lines begin with one of the following characters: # ! ;
<to do>
This document: www.nrel.colostate.edu/projects/irc/public/Documents/Software/WhitePapers/Weather-Framework/WeatherDataFramework.htm
Project web page: www.nrel.colostate.edu/projects/irc/
E-mail contact: irc@nrel.colostate.edu