all/run_1-model.csh
author Forrest Hoffman <forrest@climatemodeling.org>
Mon, 26 Jan 2009 22:08:20 -0500
changeset 0 0c6405ab2ff4
child 1 4be95183fbcd
permissions -rwxr-xr-x
Initial commit of C-LAMP Diagnostics from Jeff Lee
     1 #!/bin/csh -f
     2 #-------------------------------------------------------------------
     3 # note: user modifies ONLY the "user modification" section 
     4 #
     5 #       MODEL : model name
     6 #       DIR_M  : directory of model data
     7 #       DIR_O  : directory of observed data
     8 #       DIR_S  : directory of model surface data
     9 #       DIR_SCRIPTS  : directory of run scripts
    10 #       FILE1 : time_mean  climatology from CLM diagnostic package
    11 #       FILE2 : 12-monthly climatology from CLM diagnostic package
    12 #       FILE3 : 12-monthly climatology from ATM diagnostic package
    13 #               leave it blank, if no ATM file:
    14 #               set FILE3 =
    15 #       FILE7 : timeseries file generated from .... 
    16 #       FILE8 : timeseries file generated from .... 
    17 #       GRID  : T31, T42, or 1.9
    18 #       BGC   : cn or casa 
    19 #       ENERGY: new or old (model data fields)
    20 #********************************************************************
    21 # user modification:
    22 
    23 # model data (no ATM file)
    24 set MODEL  = CN
    25 set DIR_M  = /fis/cgd/cseg/people/jeff/clamp_data/model/
    26 set FILE1  = i01.10cn_1948-2004_ANN_climo.nc
    27 set FILE2  = i01.10cn_1948-2004_MONS_climo.nc
    28 set FILE3  =
    29 set FILE4  = i01.06cn_1980-2004_ANN_climo.nc
    30 set FILE5  = i01.10cn_1990-2004_ANN_climo.nc
    31 set FILE6  = i01.07cn_1990-2004_ANN_climo.nc
    32 set FILE7  = i01.10cn_Fire_C_1979-2004_monthly.nc
    33 set FILE8  = i01.10cn_ameriflux_1990-2004_monthly.nc
    34 set GRID   = T42
    35 set BGC    = cn
    36 set ENERGY = new
    37 
    38 # in the "CLAMP metric processing" section:
    39 #  only 00.initial.ncl and 99.final.ncl are required,
    40 #  user can comment out any one or more of the other ncl scripts,
    41 #  e.g. 
    42 #  #ncl $INPUT_TEXT $DIR_SCRIPTS/10.fire.ncl
    43 
    44 # model surface data
    45 set DIR_S  = /fis/cgd/cseg/people/jeff/clamp_data/surface_model/
    46 
    47 # observed data
    48 set DIR_O  = /fis/cgd/cseg/people/jeff/clamp_data/observed/
    49 
    50 # directory for scripts, templates and ncl files
    51 set DIR_SCRIPTS = /fis/cgd/cseg/people/jeff/clamp/all/
    52 
    53 #********************************************************************
    54 
    55 # create a directory for the model by copying from a template
    56 if ($FILE3 != "") then
    57    set TEMPLATE = template_1-model
    58 else
    59    set TEMPLATE = template_1-model_noCO2
    60 endif
    61 cp -r $DIR_SCRIPTS/$TEMPLATE $MODEL
    62 
    63 # add quote, to be usesd in INPUT_TEXT
    64 set MODELQ = \"$MODEL\"
    65 set DIRMQ  = \"$DIR_M\"
    66 set F1  = \"$FILE1\"
    67 set F2  = \"$FILE2\"
    68 set F3  = \"$FILE3\"
    69 set F4  = \"$FILE4\"
    70 set F5  = \"$FILE5\"
    71 set F6  = \"$FILE6\"
    72 set F7  = \"$FILE7\"
    73 set F8  = \"$FILE8\"
    74 set GRIDQ   = \"$GRID\"
    75 set BGCQ    = \"$BGC\"
    76 set ENERGYQ = \"$ENERGY\"
    77 set DIRSQ   = \"$DIR_S\"
    78 set DIROQ   = \"$DIR_O\"
    79 
    80 set INPUT_TEXT = "model_name=$MODELQ model_grid=$GRIDQ dirm=$DIRMQ film1=$F1 film2=$F2 film3=$F3 film4=$F4 film5=$F5 film6=$F6 film7=$F7 film8=$F8 BGC=$BGCQ ENERGY=$ENERGYQ dirs=$DIRSQ diro=$DIROQ"
    81  
    82 # CLAMP metric processing
    83 ncl $INPUT_TEXT $DIR_SCRIPTS/00.initial.ncl
    84 ncl $INPUT_TEXT $DIR_SCRIPTS/01.npp.ncl
    85 ncl $INPUT_TEXT $DIR_SCRIPTS/02.lai.ncl
    86 
    87 if ($FILE3 != "") then
    88 ncl $INPUT_TEXT $DIR_SCRIPTS/03.co2.ncl
    89 endif
    90 
    91 ncl $INPUT_TEXT $DIR_SCRIPTS/04.biomass.ncl
    92 ncl $INPUT_TEXT $DIR_SCRIPTS/06.fluxnet.ncl
    93 ncl $INPUT_TEXT $DIR_SCRIPTS/07.beta.ncl
    94 ncl $INPUT_TEXT $DIR_SCRIPTS/08.turnover.ncl
    95 
    96 if ($BGC != "casa") then
    97 ncl $INPUT_TEXT $DIR_SCRIPTS/09.carbon_sink.ncl
    98 else
    99 ncl $INPUT_TEXT $DIR_SCRIPTS/09x.carbon_sink.ncl
   100 endif
   101 
   102 if ($BGC != "casa") then
   103 ncl $INPUT_TEXT $DIR_SCRIPTS/10.fire.ncl
   104 endif
   105 
   106 ncl $INPUT_TEXT $DIR_SCRIPTS/11.ameriflux.ncl
   107 ncl $INPUT_TEXT $DIR_SCRIPTS/99.final.ncl
   108 
   109 # create a tar file from the final output 
   110 tar cf $MODEL.tar $MODEL
   111 
   112