-
Notifications
You must be signed in to change notification settings - Fork 5
Drivers
The header file for the meteorological files are specified by the ED_MET_DRIVER_DB setting in the ED2IN file. The header file, which is in ASCII, then summarizes the content and frequency of various HDF5 met files. The component met files are set up so that different variables can be stored at different frequencies.
The organization of the meteorological data header file
<number of file formats>
{<path and prefix of files> } Repeat n blocks
{<nlon>, <nlat>, <dx>, <dy>, <xmin>, <ymin> }
{<number of variables> }
{<list of variable names> }
{<list of update frequencies (seconds) or scalar values if flag=4> }
{<list of variable flags> }
- nlon — Number of longitude grid cells
- nlat — Number of latitude grid cells
- dx — Size of longitude grid cell (degrees)
- dy — Size of latitude grid cell (degrees)
- xmin — Minimum longitude (ignored if gridded longitude is provided)
- ymin — Minimum latitude (ignored if gridded longitude is provided)
- 0 — read gridded data - no time interpolation
- 1 — read gridded data - with time interpolatation
- 2 — read gridded data - constant in time, not changing (if this is lat/lon, will overwrite line 3 information)
- 3 — read one value representing the whole grid - no time interpolation
- 4 — specify a constant for all polygons, constant in time (most likely reference height)
- 5 — specify a space-independent variable with time interpolation (most likely CO2)
Names are similar to NCEP reanalyses:
- lat — grid of latitude coordinates, if this variable is present line 3 is ignored
- lon — grid of longitude coordinates, if this variable is present line 3 is ignored
- land (optional) — land/sea mask. Values are 0 (water) and 1 (land). Values over water are ignored by ED-2. When not provided, ED-2 assumes all land.
- co2 (optional) — surface CO2 mixing ratio (μmolCO2 molAir-1). When not provided, ED-2 uses the value set in ED2IN (variable NL%INITIAL_CO2)
- dlwrf — downward long wave radiation (W m-2)
- nbdsf — near infrared beam downward solar radiation (W m-2)
- nddsf — near IR diffuse downward solar radiation (W m-2)
- vbdsf — visible beam downward solar radiation (W m-2)
- vddsf — visible diffuse downward solar radiation (W m-2)
- prate — precipitation rate (kgH2O m-2 s-1)
- pres — atmospheric pressure (Pa)
- hgt — geopotential height (m)
- ugrd — zonal wind (m s-1)
- vgrd — meridional wind (m s-1)
- sh — specific humidity (kgH2O kgAir-1)
- tmp — air temperature (K)
1
/home/mdietze/inputs/fluxnet/blodgett/met/ED_OL_
1 1 1. 1. -121.0 38.0
13
'vbdsf' 'vddsf' 'prate' 'dlwrf' 'pres' 'ugrd' 'vgrd' 'sh' 't
mp' 'hgt' 'co2' 'nbdsf' 'nddsf'
1800.0 1800.0 1800.0 1800.0 1800.0 1800.0 1800.0 1800.0 1800.0 5
0.0 1800.0 1800.0 1800.0
1 1 1 1 1 0 0 1 1
4 3 1 1
Some general R
scripts that convert meteorological measurements to HDF5 are available here. You must download the three R scripts and place them in the same directory:
-
radutils.r
— Script with functions to decompose shortwave radiation. -
timeutils.r
— Script with functions to help with time calculation. -
make_ed_driver.r
— The main script to generate drivers. This is the only script that needs to be edited.
chron
and rhdf5
. To install chron
, simply use the regular command in R
:
install.packages("chron")
rhdf5
, follow instructions from the Bioconductor website.
The meteorological data must be a CSV file, and must be placed in the same directory as the R
scripts. The CSV file must contain the following variables, in these units.
The variable names (case sensitive) must be provided in the first line of the CSV. The order does not matter, but you must provide all of them, in the units shown below:
- year — Year
- month — Month
- day — Day
- hour — Hour
- min — Minute
- sec — Second
- atm.tmp — Air temperature (K)
- atm.prss — Atmospheric pressure (Pa)
- atm.shv — Specific humidity (kgH2O kgAir-1
- atm.vels — Wind speed (m s-1)
- atm.vdir — Wind direction (°). This is not needed by ED-2. In case you do not have wind direction, add a dummy column with zeroes.
- rain — Precipitation rate (kg m-2 s-1)
- rlong.in — Incoming longwave radiation (W m-2)
- rshort.in — Incoming shortwave radiation (W m-2)
- File name must follow the convention filled_name.txt, where name can be any simple name (no spaces or non-standard characters, underscores can be used).
- The data must contain full calendar years of meteorological measurements.
- The time series of all variables must be complete, i.e. no measurement gaps. In case your data set has gaps, use must fill the gaps before running these
R
scripts. - Time stamps must be in UTC, no daylight saving time. You must also know whether the time stamp corresponds to the beginning, middle, or end of the averaging period.
- ED-2 needs subdaily data. Ideally use hourly data or more frequent.
make_ed_driver.r
) before running:
- Line 15. This is the directory where files will be written.
-
Lines 23-30. These are the settings for each site:
- name — Site name. This is the name wildcard mentioned above.
- longname — Long name for site. Used only for standard output on screen.
- lon — Longitude in decimal scale (range from -180 to 180). Make sure this variable is correctly set for your site. This is used for radiation calculation.
- lat — Latitude in decimal scale. Make sure this variable is correctly set for your site. This is used for radiation calculation.
- h5pref — Prefix of the hdf5 files.
- height — Height of the measurements (metres). Make sure this value is at least 10 m higher than the maximum possible height of the tallest PFT you are going to simulate.
- dtdat — Time resolution (seconds)
-
imetavg — Flag to describe the averaging window:
- 1 — Averages ending at the time stamp (e.g. hourly data from 19 Jan 2019 2000 UTC are averages between 1900 and 2000 UTC).
- 2 — Averages starting at the time stamp (e.g. hourly data from 19 Jan 2019 2000 UTC are averages between 2000 and 2100 UTC).
- 3 — Averages starting at the time stamp (e.g. hourly data from 19 Jan 2019 2000 UTC are averages between 1930 and 2030 UTC).
Below is a list of reanalysis and gridded data sets for which we have R preprocessors (check with @mpaiao for scripts) :
Also, the ED-2 distribution comes with RAPP, which pre-processes and converts NCEP reanalyses to ED-2 format; however we no longer update or maintain this feature.The NACP model-data intercomparison met files can be converted to the old ASCII format using the Media:NACP2DRIVER.txt script
The old ascii files can be converted to HDF5 using:
> cd EDBRAMS/ED/src/preproc/ascii2hdf
> make
> ./convert_ascii <first_year> <last_year> <findir> <foutdir> <frqin> <frqin_rad>
Variables:
- first_year. First year to process
- last_year. Last year to process
- findir. Directory of the input data
- foutdir. Directory of the output data
- frqin. Frequency at which input (non-radiation) data was written out [seconds].
- frqin_rad. Frequency at which the input radiation data was written out [seconds].
Mike also has code to convert the AMERIFLUX level 3 post-processed flux files to ASCII met drivers, that can then be converted to HDF5
There are three options to prescribe the phenology in ED:
- 0 – Calculate based on meteorology
- 1 – User prescribed
- 2 – MODIS derived
To impose anthropogenic land use change in ED-2, you must provide ASCII files with instructions on the transition rates. The format and rationale follow Hurtt et al. (2006). All land use drivers must be placed in the same path, and the path must be provided in ED2IN (variable NL%LU_DATABASE
). Disturbances are applied on yearly basis.
The land use transition file should look like the following:
WEST.LONGITUDE = -52.500
EAST.LONGITUDE = -52.000
SOUTH.LATITUDE = -1.000
NORTH.LATITUDE = -0.500
BLOCK.AREA = 3090800389.4662
FIRST.LUYEAR = 1500
LAST.LUYEAR = 2099
N.PFT.HARVEST = 13
HARVEST.PFT = 2 3 4 6 7 8 9 10 11 12 13 14 15
MINDBH.SLOG = 50 50 50 0 0 0 0 0 0 50 50 50 50
HARVPROB.SLOG = 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25
MINDBH.FPLT = 50 50 50 0 0 0 0 0 0 50 50 50 50
HARVPROB.FPLT = 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25
year cp pc pv vp vc cv sc cs sp ps vs sbh f_sbh vbh f_vbh sbh2 f_sbh2 vbh2 f_vbh2
2019 0.000411 0.000000 0 0.009455 0.000030 0 0 0.000030 0 0.004355 0.000000 1.787300e+07 0.000794 0.0 0.000000 0 0 0 0
2020 0.000000 0.001769 0 0.004306 0.000030 0 0 0.000030 0 0.008779 0.000000 1.811700e+07 0.000804 0.0 0.000000 0 0 0 0
2021 0.000000 0.001769 0 0.003890 0.000148 0 0 0.000148 0 0.008363 0.000000 1.818400e+07 0.000807 0.0 0.000000 0 0 0 0
2022 0.000000 0.001769 0 0.003474 0.000266 0 0 0.000266 0 0.007947 0.000000 1.825100e+07 0.000824 0.0 0.000000 0 0 0 0
Header:
- WEST.LONGITUDE – Western edge of the area.
- EAST.LONGITUDE – Eastern edge of the area.
- SOUTH.LATITUDE – Southern edge of the area.
- NORTH.LATITUDE – Northern edge of the area.
- BLOCK.AREA – Total area of the grid cell (m2). This should be found using solid angle (see below).
- FIRST.LUYEAR – First year in the land use data set.
- LAST.LUYEAR – Last year in the land use data set.
- N.PFT.HARVEST – Number of PFTs that may be harvested.
- HARVEST.PFT – List of PFTs that may be harvested in selective logging.
- MINDBH.SLOG – Minimum DBH that can be harvested in selective logging. For clear-cut logging, set the DBH to zero.
- HARVPROB.SLOG – Probability of tree of being selectively logged when no biomass demand is provided. For clear-cut logging, set it to 1.0.
- MINDBH.FPLT – Minimum DBH that can be harvested in forest plantation. For clear-cut logging, set the DBH to zero.
- HARVPROB.FPLT – Probability of tree of being harvested in forest plantation when no biomass demand is provided. For clear-cut logging, set it to 1.0.
- year – Simulation year to apply the disturbances.
- cp – Transition rate: cropland to pasture (yr-1).
- pc – Transition rate: pasture to cropland (yr-1).
- pv – Pasture to primary forest (in ED-2 this goes to abandonment) (yr-1).
- vp – Primary forest to pasture (yr-1).
- vc – Primary forest to cropland (yr-1).
- cv – Cropland to primary forest (in ED-2 this goes to abandonment) (yr-1).
- sc – Secondary forest to cropland (yr-1).
- cs – Cropland to secondary forest (in ED-2 this goes to abandonment) (yr-1).
- sp – Secondary forest to pasture (yr-1).
- ps – Pasture to secondary forest (in ED-2 this goes to abandonment) (yr-1).
- ps – Primary forest to secondary forest (assumed logging in ED-2) (yr-1).
- sbh – Timber demand on mature secondary forest (kgC).
- f_sbh – Timber demand on mature secondary forest (grid fraction). This is currently ignored in ED-2.
- vbh – Timber demand on mature primary forest (kgC). This is combined with vbh2 (see below).
- f_vbh – Timber demand on mature primary forest (grid fraction). This is currently ignored in ED-2.
- sbh – Timber demand on young secondary forest (kgC).
- f_sbh2 – Timber demand on young secondary forest (grid fraction). This is currently ignored in ED-2.
- vbh2 – Timber demand on primary vegetation other than forest (kgC). This is combined with vbh (see above).
- f_vbh2 – Timber demand on primary vegetation other than forest (grid fraction). This is currently ignored in ED-2.
The definition of primary and secondary forests can be quite confusing. For ED-2 purposes, we assume that patches previously disturbed by tree fall are primary, whereas patches previously generated by fire, abandonment, and logging are considered secondary. This may be revisited in the future because fires may be ambiguous: in tropical forests fires are almost exclusively anthropogenic, but they can be mostly natural in boreal forests, for example.
Scripts to convert the Land Use Harmonisation data set (LUH-1.1, for CMIP5) to ED-2 format are available here:
-
solid_angle.r
– Support script that computes the solid angle given the longitude and latitude edges. -
make_lu_files_ed22.r
– The main script to convert the files. Follow instructions in the first few lines of the script.
Forestry is driven by 1x1 degree *.fhr files in the “forestrybyage” directory and covers 1700-2050 at a 10 year time step. File format is tab-delimited ASCII:
year harvest_rate secondary_base_f
In addition, state variables are read from the reference.biomass and fraction.plantation files in the “forestry” folder. Files are 1x1 degree ASCII tab-delimeted formats:
reference.biomass: lat lon tagb
fraction.plantation: lat lon fracplant