Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ncclimo will reshape input files that are a series of snapshots of all model variables into outputs that are continuous timeseries of each individual variable taken from all input files. Timeseries to be reshaped (split) often come with hard-to-predict names, e.g., because the number of days or months in a file, or timesteps per day or month may all vary. Thus ncclimo in splitter mode requires the user to supply the input filenames. ncclimo will not construct input filenames itself in splitter mode (unlike monthly or annual climo generation mode). ncclimo will, as of version 5.0.4, employ timeseries reshaping mode if it receives the --split switch or the --ypf_max option described below. In addition, it must receive a list of files through a pipe to stdin, or, alternatively, placed as positional arguments (after the last command-line option), or if neither of these is done and no caseid is specified, in which case it assumes all *.nc files in drc_in constitute the input file list. These examples invoke reshaping mode in the four possible ways (choose your poison):

Code Block
# Sample Abbreviations
drc_in=~zender/data/ne30/raw
map_fl=${DATA}/maps/map_ne30/map_ne30pg2_to_cmip6_180x360_nco.20200901.nc
# Splitter Input Mode #1: Read input filename list from file
ls $drc_in/*eam.h0.201[34]*.nc > input_list
ncclimo --split --yr_srt=2013 --yr_end=2014 --var=FSNT,AODVIS --map=$map_fl --drc_out=$drc_out < input_list
# Splitter Input Mode #2: Pipe input filenames to stdin
cd $drc_in
ls $drc_in/*eam.h0.201[34]*.nc | ncclimo --split --yr_srt=2013 --yr_end=2014 --var=FSNT,AODVIS --map=$map_fl --drc_out=$drc_out
# Splitter Input Mode #3: Append filenames positional arguments
ncclimo --split --var=FSNT,AODVIS --yr_srt=2013 --yr_end=2014 --map=$map_fl --drc_out=$drc_out $drc_in/*cam.h0.0[012]??*.nc
# Splitter Input Mode #4: Ingest entire directory (be sure the directory contains only files to be climatologized!)
ncclimo --split --var=T,Q,RH --yr_srt=2013 --yr_end=2014 --drc_in=$drc_in --map=$map_fl --drc_out=$drc_out

...

A common task for ncclimo is to produce climatological monthly, seasonal, and annual-means from an interannual series of monthly-mean input files with commands like these:

Code Block
ncclimo         -s yr$yr_srt -e yr$yr_end -c run_id$caseid -i drc$drc_in -o drc$drc_out # EAM/CAM/CAM-SE
ncclimo -v FSNT -s yr$yr_srt -e yr$yr_end -c run_id$caseid -i drc$drc_in -o drc$drc_out # EAM subset
ncclimo -m clm2 -s yr$yr_srt -e yr$yr_end -c run_id$caseid -i drc$drc_in -o drc$drc_out # ELM/ALM/CLM

Each option can be accessed by a handful of long-option synonyms to suit users' tastes. With long options the first example above may be rewritten as

Code Block
ncclimo --start=yr$yr_srt --end=yr$yr_end --case=run_id$caseid --input=drc$drc_in --output=drc$drc_out

When invoked without options ncclimo outputs a handy table of all available options, their long-option synonyms, and some examples. NCO documentation here describes the full meaning of all options. The most common options are:

-a, --dec_md: The “December mode” option determines the start and end months of the climatology and the type of NH winter seasonal average. Valid arguments are sdd (default, or synonyms jfd and JFD) and scd (or synonyms djf and DJF). scd stands for seasonally continuous December. The first month used will be Dec of the year before the start year you specify with -s. The last month is November of the end year specified with -e.In SCD-mode the Northern Hemisphere winter seasonal climatology will be computed with sets of the three consecutive months December, January, and February (DJF) where the calendar year of the December months is always one less than the calendar year of January and February. sdd stands for seasonally discontinuous December. The first month used will be Jan of the specified start year. The last month is December of the specified end year. In SDD-mode the Northern Hemisphere winter seasonal climatology will be computed with sets of the three non-consecutive months January, February, and December (JFD) from each calendar year. (Prior to NCO 4.9.4, released in August 2020, the default was scd not sdd.)

-C, --clm_md: Climatology mode. Either mth (default, indicates monthly-mean input files), hfc for high-frequency-climo (i.e., diurnal cycles from sub-daily input files), hfs for high-frequency-splitter (i.e., concatenation of sub-daily input files), or ann (for annual-mean input files). 

-c, --caseid: The case ID or simulation name for automatically generating input filenames (in monthly climo mode). For input files like famipc5_ne30_v0.3_00001.cam.h0.1980-01.nc, specify -c famipc5_ne30_v0.3_00001. The .cam. and .h0. bits are added to the filenames internally by default, and can be modified via the -m mdl_nm and -h hst_nm switches if needed. In high-frequency mode the --caseidoption is optional (since the user provides all the input filenames). If provided, it is used to rename the output filenames (much the same as the --fml_nm option). 

-e, --yr_end: End year (example: 2000). Unless the optional flag -a scdis specified, the last month used will be Dec of the specified end year. If -a scd is specified, the last month will be Nov of the specified end year.

-h, --hst_nm: History file volume that separates the model name from the date in the input file name. Default is h0.  Other common values are h1 and h

-i, --drc_in: Directory containing all netCDF files to be used for input.

-m, --mdl_nm: Model name. Default is cam eam. This is similar to, though subtly different than, the -P option (which is preferred to -m). This is literally the string name used in the history tape output files. Other options are cam, clm2, cism, cice, mpasseaice mpasi, mpaso, pop.

-o, --drc_out: Directory where computed native grid climo files will be placed. Regridded climos will also be placed here unless a separate directory for them is specified with -O (NB: capital "O") 

-O, --drc_rgr: Directory where regridded climo files will be placed.

-P, --prc_typ: Processing type

-s, --yr_srt: Start year (example: 1980). By default, the first month used will be Jan of this start year. If -a scd is specified, the first month used will be Dec of the year before this specified start year (example Dec 1979 to allow for temporally contiguous DJF climos).

-v, --var: Variable list (comma-separated) to subset, e.g., FSNT,AODVIS,PREC.? (yes, regular expressions work so this expands to PRECC,PRECL,PRECSC,PRECSL)

...

MPAS ocean and ice models have their own (non-CESM'ish) naming convention that guarantees output files have the same names for all simulations. By default ncclimo analyzes the "timeSeriesStatsMonthly" analysis member (AM) output (tell CZ if you want options for other AM output). ncclimo ncclimo recognizes input files as being MPAS-style when invoked with -m mpaso or -m mpascicempasseaice (or synonyms) like this:

Code Block
ncclimo -m mpaso    P mpasocean  -s 1980 -e 1983 -i drc_in -o drc_out # MPAS-O
ncclimo -mP mpasseaice -s 1980 -e 1983 -i drc_in -o drc_out # MPAS-I

...