Child pages
  • CCR diagnostics
Skip to end of metadata
Go to start of metadata

Setting up CCR diagnostics for CCSM4

Contacts:  Adrianne Middleton, Nan Rosenbloom

The CCR diagnostics create an updated version of the AMWG timerseries diagnostics e.g., plots. They are created by a series of rather complicated steps.

All environmental variables below can be set by going to the directory where you run your case from ($CASEROOT) and executing Tools/ccsm_getenv

  • See Options below for pre-preprocessing data: extract monthly data from the atm history files (see Option 1 and Option 2 below).
Step 1: Automatically run the diagnostics as data is produced: 

edit $CASEROOT/$CASE.l_archive script to add lines in Option 1 box below.

Step 2: Make sure to generate the output fields necessary for the diagnostics:

edit  cam.buildnml.csh to include the following output fields. You may add your own as well.

fincl1 = 'cb_ozone_c', 'cb_sulf_c', 'MSKtem', 'VTH2d', 'UV2d', 'UW2d', 'U2d', 'V2d', 'TH2d', 'W2d', 'UTGWORO'

Step 3: Create the local timeseries files:

If you did step 1, the timeseries files will be created and updated every time you run the archiver. If you did not do step 1, then
% ~adrianne/diag4/sdiag $CASE
This will create timeseries plots in $DIAGDIR/monthly, where $DIAGDIR is defined below
















sdiag can take a very long time to run, especially if you have more than 100 years of data. You can improve speed significantly by downloading all $CASE.cam2.h0.* files to $DIAGDIR/hist before launching sdiag.

Step 4: Compare your run against a control:

On copper, create a new data directory for your case

% mkdir /datalocal/ccpa/adrianne/diag/$CASE /datalocal/ccpa/adrianne/diag/$CASE/timeseries /datalocal/ccpa/adrianne/diag/$CASE/plot

Step 5: Tranfer all files in $DIAGROOT/monthly to copper:/datalocal/ccpa/adrianne/diag/$CASE/timeseries

% cd $DIAGDIR/$CASE/monthly
% tar -cvf $CASE.diag.tar $CASE
% scp $CASE.diag.tar$CASE/timeseries

NB: These files are not backed up. I highly recommend that you copy all files in $DIAGDIR/annual and $CASE.diag.tar to $CASE/diag on the hpss.

Step 6: Move the files into place on copper

setenv CASE to your case name
% cd /datalocal/ccpa/adrianne/diag/$CASE/timeseries
% tar -xvf $CASE.diag.tar

Step 7: Create new run comparison script from a recent script.

The scripts are labeled by case name, so if there is a case similar to the case you have run, copy that script. DO NOT modify any scripts already there, unless you created them. In the example below, I have used b40.lm850-1850.1deg.001 as our initial comparison script.
% cd /datalocal/ccpa/adrianne/diag/scripts
% cp b40.lm850-1850.1deg.001.csh $CASE.csh

    • edit new run script ($CASE.csh)
      • casename
      • years (year1, year2) - Need 4 digits:  850 => 0850
      • ncase
      • figpath
Step 8: Run comparison script

% $CASE.csh
NOTE:png files should write to $webdir, which is defined in $CASE.csh. When updating an existing case, the files will automatically overwrite the existing png files. However, if you have placed them into a subdirectory, you need to point to the new directory, either in the script, or by moving them manually after running. (e.g., amwg/$CASE/CCR/*.png)

Step 9: Create new html page

% cd $webdir
% cp b40.lm850-1850.1deg.001_series.html $CASE.html
edit $CASE.html for your case.

Option 1: Archive script should have these lines in it.  Data will automatically be extracted as the archiver is working.

# Determine necessary environment variables

cd /fs/cgd/csm/runs/ccsm4_0/b40.lm850-1850.1deg.001

source ./Tools/ccsm_getenv || exit -1

# copy files to diagnostic directories

cd $DOUT_S_ROOT/atm/hist
source ~adrianne/diag4/setdir
cp *.h0*.nc $HISTDIR
if (! -e $DIAGDIR/startyear) then
  set year = `ls -1 *h0* | head -1 | sed -e 's/^.h0\.//g' | sed -e 's/-.//g'`
  echo $year >& startyear

# run the long term archiver


cd ~adrianne/diag4
sdiag $CASE

Option 2: Run offline for previously completed experiments (Bluefire)

  1. Pre-stage atm history files on /ptmp/LOGNAME/diag4_ccr/$CASE/hist
  2. copy -R ~adrianne/diag4/setdir ~
  3. edit sdiag (if required - e.g., if USER is not the owner of the RESTDIR)
  4. Usage: ./sdiag $CASE
  5. tar file will be written to MSS: /CCSM/csm/$CASE/diagnostics/$CASE.diag.tar
  • No labels