Organization: Natural Resource Ecology Laboratory
Project: IRC
Category: Whitepaper
Title: Description and Use of the Weather Data Framework

Draft

Contents

Introduction
Framework Architecture
    Design Requirements
  Class Hierarchy
  Implementation Requirements
Using the Framework
  The Weather INI File
  Specifying Weather in the Century5 and DayCent5 Models
    Specifying Weather in the IRC Model
Weather Sources
  Century Model Weather Sources
    NetCDF COARDS-Format Weather Sources
Additional Information
Glossary
Bibliography
About This Document
    Revision History
  Document Source
  Copyright and Distribution Information

Introduction

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.


Framework Architecture

Design Requirements

goals of the design

Major Design Issues

Grid-Cohort Framework Issues

Century5 and DayCent5 Issues

IRC Issues

restrictions: compatibility

Weather Data Sources

Current Weather Data Sources
     Kind of Data    Time Period Units
Century4 Site Parameters    Precipitation: mean, std. dev., skewness
Temperature: minimum, maximum
   monthly
Century 5 Site Parameters   Precipitation: mean, std. dev., skewness
Temperature: minimum, maximum
  monthly
DayCent5 Site Parameters   Precipitation: mean, std. dev., skewness
Temperature: minimum, maximum
  monthly
Century4.5 Site Parameters        
DayCent4.5 Site Parameters        
Century4/5 Weather File   Precipitation: mean
Temperature: minimum, maximum
  monthly
DayCent4/5 Weather File   Precipitation: mean
Temperature: minimum, maximum
Solar radiation (optional)
Relative humidity (optional)
Wind speed (optional)
  daily
NetCDF COARDS Daily File   Precipitation: mean
Temperature: minimum, maximum
Solar radiation (optional)
Relative humidity (optional)
Wind speed (optional)
  daily

Class Hierarchy

describe; class UML diagram

Weather Data Framework UML Class Diagram

describe component diagram

Weather Data Framework UML Component Diagram

Weather Data Classes

Kinds of weather data derive from class WeatherDataBase (e.g., precip., temp.)

class WeatherDataBase, PrecipitationData, TemperatureData

Weather Data Framework UML Class Diagram for Data Classes

Weather Source Classes

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.)

Weather Data Framework UML Class Diagram for Data Source Classes

Weather Interface Classes

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.

Weather Server Classes

Kinds of weather data servers derive from class WeatherServerBase (each server is specific to an application)

Extracting Weather from Century Management

Classes that extract weather schedule from Century4 and Century5 management schedules.

Implementation Requirements

Compilers, libraries

Using the Framework

The Weather INI File

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 data
file
  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    
Description
hour
  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    
Description
site
  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

Specifying Weather in the Century5 and DayCent5 Models

Weather can be scheduled either through a Century5 management schedule, a Century4 schedule file, or a weather INI file.

Specifying Weather in the IRC Model

Text and tables here.

Weather Sources

Century Model Weather Sources

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.

Century 4 and Century 5 Monthly Weather Data File

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:

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

DayCent4 and 5 Daily Weather Text File

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: # ! ;

NetCDF COARDS-Format Weather Sources

<to do>

Additional Information

Century4 Web Site
www.nrel.colostate.edu/projects/century/
Century5 Web Site
www.nrel.colostate.edu/projects/century5/
COARDS format description:
http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html
NetCDF library web site:
www.unidata.ucar.edu/content/software/netcdf/

Glossary

server
Definition
interface
Definition
data source
Definition
NetCDF
Binary file format that is portable to common computer types and operating systems.
COARDS
Standard format for NetCDF data.

Bibliography

First entry
Second entry

About This Document

Revision History

01/24/2005 - Draft 5
Author(s): Thomas E. Hilinski
10/23/2006 - Draft 6
Editor: Thomas E. Hilinski

Document Source

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

Copyright and Distribution Information

Copyright © 2005, Colorado State University. All rights reserved.

Developed with funding from the National Science Foundation grant NSF DEB-9977066.