Skip to contents

Reads weather data from CF-formatted NetCDFs and writes it in the .clim format expected by SIPNET: a 12-column tab-separated table with no headers.

Usage

met2model.SIPNET(
  in.path,
  in.prefix,
  outfolder,
  start_date,
  end_date,
  var.names = NULL,
  overwrite = FALSE,
  verbose = FALSE,
  year.fragment = FALSE,
  clim_format_version = c("v2", "v1"),
  ...
)

Arguments

in.path

location on disk where inputs are stored

in.prefix

prefix of input and output files,

outfolder

location on disk where outputs will be stored

start_date

the start date of the data to be downloaded (will only use the year part of the date)

end_date

the end date of the data to be downloaded (will only use the year part of the date)

var.names

character: list of variable names to be extracted. Default NULL uses all variables from input file

overwrite

should existing files be overwritten

verbose

should the function be very verbose

year.fragment

the function should ignore whether or not the data is stored as a set of complete years (such as for forecasts).

clim_format_version

SIPNET clim file format to generate. Default "v2" writes 12 columns, "v1" writes the legacy 14-column format.

...

Additional arguments, currently ignored

Value

a dataframe containing information about the files created

Details

The columns of the output file are:

  • 4-digit year

  • Day of year

  • Hour of day

  • Timestep size (days)

  • Air temperature (degrees C)

  • Soil temperature (degrees C)

  • PAR (mol/m2/hr)

  • Precip (mm)

  • VPD (Pa)

  • VPD of soil (Pa)

  • Canopy vapor pressure (Pa)

  • Wind speed (m/s)

When clim_format_version is "v1", the table has 14 columns:

  • column 1 is a spatial grid index, always set to 0

  • columns 2-13 are the 12 described above

  • column 14 is soil wetness as a fraction of saturation, always set to 0.6

These were needed by older versions of Sipnet, but never had any effect on PEcAn runs: PEcAn never used gridded runs and always configured Sipnet to calculate soil moisture internally. Model support for both the spatial index and soil moisture columns was removed from Sipnet >= v2.0. Newer versions now accept 14-column files, but ignore the first and last columns with a warning.

SIPNET does not allow missing values in its inputs. If the result contains NAs after conversion, no file is written and the process returns an error. To fix this, consider using a formal gap-filling method such as PEcAn.data.atmosphere::metgapfill() before calling met2model.

Author

Luke Dramko, Michael Dietze, Alexey Shiklomanov, Rob Kooper