forked from ARCCSS-extremes/climpact2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclimpact2.ncdf.thresholds.wrapper.r
35 lines (23 loc) · 1.11 KB
/
climpact2.ncdf.thresholds.wrapper.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# ------------------------------------------------
# This wrapper script calls the 'create.thresholds.from.file' function from the modified climdex.pcic.ncdf package
# to create thresholds, using data and parameters provided by the user.
# ------------------------------------------------
library(climdex.pcic.ncdf)
# list of one to three input files. e.g. c("a.nc","b.nc","c.nc")
input.files = c("./sample_data/climpact2.sampledata.gridded.1991-2010.nc")
# list of variable names according to above file(s)
vars=c(tmax="tmax", tmin="tmin", prec="precip")
# output file name
output.file = "./output/thresholds.1991-1997.nc"
# author data
author.data=list(institution="My University", institution_id="MU")
# reference period
base.range=c(1991,1997)
# number of cores to use (or FALSE)
parallel = FALSE
# print messages?
verbose=TRUE
######################################
# Do not modify without a good reason.
fclimdex.compatible=FALSE
create.thresholds.from.file(input.files,output.file,author.data,variable.name.map=vars,base.range=base.range,parallel=parallel,verbose=verbose,fclimdex.compatible=fclimdex.compatible)