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