scam2web
Latest updates
Latest downloads
Latest documentation
Previous versions
Introduction
This software documents the scam2web set of scripts that are intended to
- Compile and build the CAM in single-column (SCAM) mode
- Run the model for pre-determined intensive observation period (IOP) for which data is available in the correct format.
- Create a number of postscript plots using NCL.
- Convert those plots and put them on a clickable webpage (see example).
The software runs in a specific mode such that it is comparing two different SCAM integrations. The scripts may be set up to run SCAM for both cases and process the output, or just process pre-existing output or a combination of both. So there has to be two runs to diagnose for the script to work.
Additional Requirements
- CAM code distribution (development version only)
- CAM datasets (for the Eulerian T42 resolution)
- NCAR Command Language binaries (NCL) (download and install help here)
- NetCDF libraries
- NetCDF Operators (NCO) utilities
- gmake
Current Version Enhancements (v1.0)
- More sensible build options based on presence of code modifications
- Calculates mean fields
- Can properly diagnose radiation fields
- More concise web-page functionality
- Builds and runs under pgf90 on x86-64bit machines (NCAR/CGD:hurricane,mineral,salina)
- Displays cam-tag on web page
Next Version Additions/Error Corrections (v1.1)
- Allow year 2000 and beyond IOPs (CAM code IOP info. read hardwiring change)
- NCL array redefinitions and smoothing to speed-up plot production
- Build IOP specific run requirements for individual IOPs
- Allow build on MAC under xlf compiler
- Allow plotting of IOP data when it is not provided every model timestep
- Provide more observational data to IOP files
- Consolidate NCL code so there is only one read of netcdf file for each variable and not for each plot type for each variable
- Provide functionality for 31-level devleopment version of CAM
Downloads
Code and SCAM specific downloads
scam2web (v1.0)
Documentation
scam2web.csh (v1.0) (15 October 2007)
This script controls the overall running of the model compile, build, namelist options, diagnostic output and web-page creation. The key variables that are required to be set are described below.
Environment variables
- SCAM_TEST - The case name of the 'test' experiment to be run and/or diagnosed.
- SCAM_CTRL - The case name of the 'control' experiment to be run and/or diagnosed.
- IOP_NAME - The name of the IOP case to be run (e.g., 'arm95').
- SCAM_IOP - Description metadata for the IOP case (e.g., 'ARM 1995 (18 Jul 1995 - 4 Aug 1995)').
- SCAM_LEVS - Number of model levels in the vertical.
- TEST_NLIST - Namelist options for the 'test' case that are not part of the default options in a 'vanilla' simulation ( e.g. shallow_scheme = 'UW', eddy_scheme = 'diag TKE').
- CTRL_NLIST - Namelist options for the 'control' case that are not part of the default options in a 'vanilla' simulation.
- SCAM_DIAGS - Additional diagnostic output added to the namelist required for the runs that are not included in scam_namelist.csh (see below).
- CAM_TAG - Cam code tag to be used for the model runs (e.g., cam3_5_03)
Options (0=yes; 1=no)
- RUN_TEST - Run SCAM for the 'test' case?
- RUN_CTRL - Run SCAM for the 'control' case?
- SCAM_RECON - Reconfigure model and completely rebuild?
- NCL_PLOT - Run ncl routines to produce diagnostics plots?
- CONV_PLOT - Convert plots to png ready for web page creation?
- KEEP_BEG - Keep existing plot and web files from previous run?
- KEEP_END - Keep final plot and web files?
- WEB_TAR - Create and tar-up web directory and delete directories? (will only untar to a specific location if $WEB_DIR is set).
- SCAM_DEF_DIAGS - Select a default group of SCAM output diagnsotics listed in scam_namelist.csh?
Directories
- SCAM_SCR - Location of the 'bld' directory for the cam_tag $CAM_TAG.
- WEB_DIR - Location of directory for untarring of web-page tar file $web/runs/scam.
- SCAM_ROOT - Root directory for building and running SCAM, producing output and creating the web-page tar file.
- IOP_ROOT - Location of the IOP forcing dataset file.
- TEST_CODE - Location of code modifications for the 'test' case SCAM run.
- CTRL_CODE - Location of code modifications for the 'control' case SCAM run.
- NCL_ROOT - Location of all the scam2web scripts and NCL code.
Other options
- DBUG - For debug on the compile set to "-debug" (makes it much slower though)
- PNGD - Conversion ps->png density (85 is usually good for the web page).
A note on directory structures below $SCAM_ROOT.
To facilitate a number of experiments with different IOP datasets at the running and diagnosing stages the directory structures
are the following:
| | | run_ctrl1 | toga | bld |
|
| | runs--> | run_test1--> | arm95--> | mods |
|
| | | ... | ... | run |
|
| $SCAM_ROOT--> | | | | |
|
| | | run_test1-run_ctrl1 | toga | html |
|
| | plots--> | run_test2-run_ctrl2--> | arm95--> | |
|
| | | ... | ... | plots |
|
So that SCAM run builds in 'bld' with the mods copied to 'mods' and it runs in 'run. Diagnostics for
the comparison of two runs are put in 'plots' and the web-pages created in 'html'.
scam_namelist.csh
The ultimate intention is that nothing will need to be changed in this file.
However, it contains some default diagnostic output options as well as land initial condition
options. The 'finidat' option contains the location of the land intiial conditions and there
is an option for the first of every month in a particular year of a T42 global run with the
'vanilla' climate from a cam3_5_03 tag run. If finidat is not specified then SCAM will start
with arbitrary initial conditions for the land.
The following land initial condition files are available from
/project/cms/rneale/cam/cam_mydata/inic/lnd
cam3_5_eul_ic4scam.clm2.r.0010-01-01-00000.nc
cam3_5_eul_ic4scam.clm2.r.0010-02-01-00000.nc
cam3_5_eul_ic4scam.clm2.r.0010-03-01-00000.nc
cam3_5_eul_ic4scam.clm2.r.0010-04-01-00000.nc
cam3_5_eul_ic4scam.clm2.r.0010-05-01-00000.nc
cam3_5_eul_ic4scam.clm2.r.0010-06-01-00000.nc
cam3_5_eul_ic4scam.clm2.r.0010-07-01-00000.nc
cam3_5_eul_ic4scam.clm2.r.0010-08-01-00000.nc
cam3_5_eul_ic4scam.clm2.r.0010-09-01-00000.nc
cam3_5_eul_ic4scam.clm2.r.0010-10-01-00000.nc
cam3_5_eul_ic4scam.clm2.r.0010-11-01-00000.nc
cam3_5_eul_ic4scam.clm2.r.0010-12-01-00000.nc
*** 17JUL07 *** As of cam3_5_03 SCAM is not able to read in a CAM land initial conditions ****
scam_plots.ncl
This ncl script lists the fields to be plotted, currently for 4 categories:
- Single-level timeseries
- Multi-level timeserieslibfj9i6.so.1
- Single-level mean diurnal cycle
- Multi-level mean diurnal cycle
plot_vars.ncl
Producing diagnostics has been condensed and simplified significantly such there is now a single routine (plot_vars.ncl) that contains all the plot output information. It is now assumed that for each variable selected
the mean, timeseries and diurnal-cycle plots will automatically be produced.
The structure of the 1-D variable selection is as follows.
var1d = (/ \
\; Format
\; CAM (name -- units -- scale) -- Rad var? - Obs (name - scale) ** av (low,hi) -- ts (low,hi) -- dc (low,hi)
\
(/"PRECC", "mm/day", m2mm, "n", "x", "1.0", "0.","20.", "0.","80.", "0.","20."/),\
(/"PRECT", "mm/day", m2mm, "n", "Prec", m2mm, "0.","20.", "0.","80.", "0.","20."/),\
(/"TS", "K", "1.0", "n", "Tsair", "1.0", "290","320", "290","320", "290","320"/),\
Focusing on 'PRECT' the user defined values are
- PRECT - 1-D variable name on the SCAM history tape.
- mm/day - Units of variable name (Leave blank to use units on the SCAM history tape).
- m2mm (= 86400*1000. defined in plot_vars.ncl) - Scale factor for variable (Set=1. to use existing scaling).
- n - Is this a variable that is output on radiation timsteps? (n=no, y=yes).
- Prec - Name of variable on IOP dataset for comparison ("x" if no observations exist)
- m2mm (= 86400*1000. defined in plot_vars.ncl) - Scale factor for observed variable (Set=1. to use existing scaling).
- 0,20 - Min and max for MEAN plot (set both="0" if you want NCL to guess the range)
- 0,80 - Min and max for TIME-SERIES plot (set both="0" if you want NCL to guess the range)
- 0,20 - Min and max for DIURNAL CYCLE plot (set both=0 if you want NCL to guess the range)
The structure of the 2-D variable selection is as follows.
To include the 2-D variable 'Q' the user would add the following line into the single-level multiple array in plot_vars.ncl.
var2d = (/ \
\; Format
\; CAM (name -- units -- scale) --Rad var?-- Obs (name -- scale) ** av (low,hi) -- ts/dts (low,hi,int) -- dc/adc (low,hi,int)
\
(/"CLDLIQ", "g/kg", "1000.", "n", "x", "1", "0.","0.2", "0.","0.5","0.05", "0.","0.5","0.05", \
"-0.5","0.5","0.1", "-0.2","0.2","0.05"/),\
\
(/"Q", "g/kg", "1000.", "n", "q", "1000.", "0.","25", "0.","25","2", "0.","25","2", \
"-10.","10","1", "-1","1","0.1"/),\
\
(/"CLDICE", "g/kg", "1000.", "n", "x", "1", "0.","0.1", "0.","0.5","0.05", "0.","0.1","0.01", \
"-0.5","0.5","0.1", "-0.1","0.1","0.01"/),\
Focusing on 'Q' the user defined values are
- Q - 2-D variable name on the SCAM history tape.
- g/kg - Units of variable name (Leave blank to use units on the SCAM history tape).
- 1000. - Scale factor for variable (Set=1. to use existing scaling).
- 0,20,1 - Minimum,maximum,contour interval for the contour plot of the full fields.
- n - Is this a variable that is output on radiation timsteps? (n=no, y=yes)
- q - Name of variable on IOP dataset for comparison (leave blank if no observations exist)
- 1000. - Scale factor for observed variable (Set=1. to use existing scaling).
- 0,25 - Min and max for MEAN plot (set both="0" if you want NCL to guess the range)
- 0,25,2 - Min,max,contour interval for TIME-SERIES plot (set all="0" if you want NCL to guess the range and interval)
- 0,25,2 - Min,max,contour interval for DIURNAL CYCLE plot (set all="0" if you want NCL to guess the range and interval)
- -10,10,1 - Min,max,contour interval for TIME-SERIES DIFFERENCE plot (set all="0" if you want NCL to guess the range and interval)
- -1,1,0.1 - Min,max,contour interval for DIURNAL CYCLE ANOMALY plot (set all="0" if you want NCL to guess the range and interval)
Only variables listed in the routine scam_plots.ncl will be produced and added to the webpage.
plot2web.csh
This script uses c-script logic to create a webpage set based on the postscript files
present from the ncl output. The web page looks like the screen-shot below:
- The web-page location will be ($WEB_DIR/$SCAM_TEST-$SCAM_CTRL-$IOP_NAME).
- All the available variables are listed on the right hand side at the bottom. Click to view.
- Rollover mouse to see the variable's long name.
- Click the plot type for a particular variable (AVAREG,TS,DC) to view.
- Click 'root page' to go to $WEB_DIR (index.html).
Currently tested machines
NCAR-CGD
lf95/32-bit
bangkok
pgf90/64-bit
mineral
hurricane
salina
Previous Versions
scam2web (v0.1)
Initial 'gamma' version of scam2web.
Not recommended for use as it does not produce variable means or
radiation fields. Also the web-page is much more clunky that the current versions.
Documentation
Download