
Equal-weighted monthly climatology from CMIP6 / CCAM point files
Source:R/extract_climate_point.R
climate_point_monthly_climatology.RdCompanion to extract_climate_point(), for building the monthly
delta-change factors of scenario_workflow. extract_climate_point()
merges variables onto a shared Date and, to do that safely, averages
together any model-days a fixed-length calendar's month-end clamp maps
onto the same real date (see its documentation) - which very slightly
down-weights those clamped days in a monthly mean taken from its output,
since they then count as a single row instead of several. This function
instead reads each variable's own per-file series independently and
averages straight by calendar month, before any Date-based merge or
clamp-collapse happens, so every model day counts equally regardless of
how many (or how few) real dates it lands on.
Usage
climate_point_monthly_climatology(
path,
lon,
lat,
vars = c("MET_tmpair", "MET_pprain", "MET_wndspd", "MET_radswd", "MET_humrel",
"MET_radlwd", "MET_prsttn"),
experiments = NULL,
method = c("bilinear", "nearest"),
calendar = c("auto", "365_day", "360_day", "366_day", "standard"),
years = NULL,
fun = mean,
verbose = TRUE
)Arguments
- path
directory holding the
.ncfiles, or a character vector of file paths.- lon, lat
point of interest, decimal degrees (WGS84).
- vars
variables to return, as AEME
MET_*names or CMIP short names (do not mix the two). Default is the seven mapped variables; only those present on disk are returned.- experiments
optional character vector to keep (e.g.
c("historical", "ssp245"));NULL(default) returns every experiment found.- method
"bilinear"(default) interpolation between the four surrounding grid nodes, or"nearest"grid node.- calendar
"auto"(default, read from thetimevariable'scalendarattribute), or force one of"365_day","360_day","366_day","standard". A365_day/360_dayseries is mapped onto real dates, so it has no 29 February (and, for360_day, no 31st).- years
optional integer vector of calendar years (as decoded onto real dates) to include, e.g. a historical or future reference window.
NULL(default) uses every year found.- fun
the averaging function applied per experiment/variable/month. Default
mean.- verbose
print each file as it is read.