CanRCM4AdjustedCreateHourlyObs: Extracts all CRHM obs variables for a specified location and...

View source: R/CanRCMadjustedCreateHourlyObsFile.R

CanRCM4AdjustedCreateHourlyObsR Documentation

Extracts all CRHM obs variables for a specified location and duration and constructs an obs file of hourly values.

Description

This function extracts the time series of 3-hourly values from a set of NetCDF files of CanRCM4 data, which has been bias-corrected using the WFDEI 3-hour reanalysis values. The values are stored at a spatial resolution of 0.125 degees, so the closest point to the specified location will be used. Note that because the reanalysis data omit February 29, the values returned by this function will hbe interplolate from February 28 and March 1 for leap days, except for precipitation values, which are set to zero. The variables are converted to values, and variable names, appropriate for CRHM when they are extracted. The three-hourly values of temeperature, wind speed

Usage

CanRCM4AdjustedCreateHourlyObs(
  startDate = "1979-01-01",
  endDate = "2100-12-01",
  longitude = 0,
  latitude = 0,
  sunTimeOffset = 2,
  locationName = "",
  fileStr = "_CanRCM4_hist+fut_1979_2100",
  inDir = "./",
  outDir = "./",
  timezone = "etc/GMT+7",
  write3hour = FALSE,
  quiet = FALSE
)

Arguments

startDate

Optional. Beginning date of data to be extracted. A string formatted as "yyyy-mm-dd". The default value of 1979-01-01 is the beginning of the data.

endDate

Optional. Beginning date of data to be extracted. A string formatted as "yyyy-mm-dd". The default value of 2100-12-01 is the end of the data.

longitude

Required. The longitude of the point being sought. Valid values appear to be between -90 and -142, but the input value is not checked for validity, in case the model extent changes.

latitude

Required. The latitude of the point being sought. Valid values appear to be between 45 and 75, but the input value is not checked for validity, in case the model extent changes.

sunTimeOffset

Optional. The offset (in hours) is added to the solar time to convert it to local time. The default value 2 shifts the daily peak to occur at 2pm. This is required to downscale the Qsi values.

locationName

Optional. Name for the location. This value is used to construct the name of the output file.

fileStr

Optional. The name for the NetCDF .nc files containing the data, exclusive of their path and variable name.

inDir

Optional. The path to the NetCDF .nc files. Default is the current directory.

outDir

Optional. The path output file(s). Default is the current directory.

timezone

Required. The name of the timezone of the data as a character string. This should be the timezone of your data, but omitting daylight savings time. Note that the timezone code is specific to your OS. To avoid problems, you should use a timezone without daylight savings time. Under Linux, you can use CST and MST for Central Standard or Mountain Standard time, respectively. Under Windows or OSX, you can use etc/GMT+6 or etc/GMT+7 for Central Standard and Mountain Standard time. DO NOT use America/Regina as the time zone, as it includes historical changes between standard and daylight savings time.

write3hour

Optional. Should the three-hour values be written to a .obs file? Default is FALSE.

quiet

Optional. If TRUE then comments will be written to the screen as the input data is processed. Note that this function may take a long time to execute, so the default is the opposite value used by most functions.

Value

If successful, writes CRHMr obs file(s) and returns TRUE. If unsuccessful, returns FALSE.

See Also

CanRCM4adjustedGetNearestTimeseries

Examples

## Not run: CanRCM4AdjustedCreateHourlyObs(startDate = "1980-01-01", 
endDate = "1980-12-31", longitude = -101.704683, latitude = 50.845585, 
locationName = "SmithCreek")

## End(Not run)

CentreForHydrology/Reanalysis documentation built on Nov. 23, 2022, 2:57 a.m.