all/run_2-model_FMH.csh
author Forrest Hoffman <forrest@climatemodeling.org>
Thu, 26 Mar 2009 14:02:21 -0400
changeset 1 4be95183fbcd
permissions -rwxr-xr-x
Modifications to scoring and graphics production for the final version of code for the C-LAMP paper in GCB.
forrest@1
     1
#!/bin/csh -f
forrest@1
     2
#-------------------------------------------------------------------
forrest@1
     3
# note: user modifies ONLY the "user modification" section 
forrest@1
     4
#
forrest@1
     5
#       COMPARE: model1 vs model2
forrest@1
     6
#       MODELn : model name
forrest@1
     7
#       DIR_M  : directory of model data
forrest@1
     8
#       DIR_O  : directory of observed data
forrest@1
     9
#       DIR_S  : directory of model surface data
forrest@1
    10
#       DIR_SCRIPTS  : directory of run scripts
forrest@1
    11
#       FILE1  : time_mean  climatology from CLM diagnostic package
forrest@1
    12
#       FILE2  : 12-monthly climatology from CLM diagnostic package
forrest@1
    13
#       FILE3  : 12-monthly climatology from ATM diagnostic package
forrest@1
    14
#                leave it blank, if no ATM file:
forrest@1
    15
#                set FILE3 =
forrest@1
    16
#       FILE7 : timeseries file generated from .... 
forrest@1
    17
#       FILE8 : timeseries file generated from .... 
forrest@1
    18
#       GRID   : T31, T42, or 1.9
forrest@1
    19
#       BGC    : cn or casa 
forrest@1
    20
#       ENERGY : new or old (fields in model data)
forrest@1
    21
#-------------------------------------------------------------------
forrest@1
    22
forrest@1
    23
#*******************************************************
forrest@1
    24
# user modification-(1)
forrest@1
    25
forrest@1
    26
# directory name of model comparison
forrest@1
    27
#et COMPARE = b30.061n_vs_b30.061m
forrest@1
    28
set COMPARE = CN_vs_CASA 
forrest@1
    29
forrest@1
    30
#*******************************************************
forrest@1
    31
# user modification-(2)
forrest@1
    32
forrest@1
    33
# model1 
forrest@1
    34
set MODEL1 = CASA
forrest@1
    35
set DIR_M  = /lustre/wolf-ddn/scratch/hof/clamp_data/model/
forrest@1
    36
#set FILE1  = i01.10casa_1948-2004_ANN_climo.nc
forrest@1
    37
set FILE1  = i01.10casa_1975-2000_ANN_climo.nc
forrest@1
    38
set FILE2  = i01.10casa_1948-2004_MONS_climo.nc
forrest@1
    39
set FILE3  = f02.03casa_1876-1900_MONS_climo_atm.nc
forrest@1
    40
set FILE4  = i01.06casa_1980-2004_ANN_climo.nc
forrest@1
    41
set FILE5  = i01.10casa_1990-2004_ANN_climo.nc
forrest@1
    42
set FILE6  = i01.07casa_1990-2004_ANN_climo.nc
forrest@1
    43
set FILE7  = i01.10casa_Fire_C_1979-2004_monthly.nc
forrest@1
    44
set FILE8  = i01.10casa_ameriflux_1990-2004_monthly.nc
forrest@1
    45
set FILE9  = i01.10casa_2000-2004_ANN_climo.nc
forrest@1
    46
set FILE10 = i01.10casa_2000-2004_MONS_climo.nc
forrest@1
    47
set FILE11 = i01.10casa_2000_ANN_climo.nc
forrest@1
    48
set GRID   = T42
forrest@1
    49
set BGC    = casa
forrest@1
    50
set ENERGY = new
forrest@1
    51
forrest@1
    52
# in the "CLAMP metric processing" section:
forrest@1
    53
#  only 00.initial.ncl and 99.final.ncl are required,
forrest@1
    54
#  user can comment out any one or more of the other ncl scripts,
forrest@1
    55
#  e.g. 
forrest@1
    56
#  #ncl $INPUT_TEXT $DIR_SCRIPTS/10.fire.ncl
forrest@1
    57
forrest@1
    58
# model surface data
forrest@1
    59
set DIR_S  = /lustre/wolf-ddn/scratch/hof/clamp_data/surface_model/
forrest@1
    60
forrest@1
    61
# observed data
forrest@1
    62
set DIR_O  = /lustre/wolf-ddn/scratch/hof/clamp_data/observed/
forrest@1
    63
forrest@1
    64
# directory for scripts, templates and ncl files
forrest@1
    65
set DIR_SCRIPTS = /lustre/wolf-ddn/scratch/hof/clamp/all/
forrest@1
    66
forrest@1
    67
#********************************************************
forrest@1
    68
forrest@1
    69
# create model1 and model1_vs_model2 directory by copying templates
forrest@1
    70
if ($FILE3 != "") then
forrest@1
    71
   set TEMPLATE1 = template_1-model
forrest@1
    72
   set TEMPLATE2 = template_2-model
forrest@1
    73
else
forrest@1
    74
   set TEMPLATE1 = template_1-model_noCO2
forrest@1
    75
   set TEMPLATE2 = template_2-model_noCO2
forrest@1
    76
endif
forrest@1
    77
#cp -r $DIR_SCRIPTS/$TEMPLATE1 $MODEL1
forrest@1
    78
#cp -r $DIR_SCRIPTS/$TEMPLATE2 $COMPARE
forrest@1
    79
rm -rf $MODEL1
forrest@1
    80
rm -rf $COMPARE
forrest@1
    81
tar xvpf $DIR_SCRIPTS/$TEMPLATE1.tar
forrest@1
    82
mv $TEMPLATE1 $MODEL1
forrest@1
    83
tar xvpf $DIR_SCRIPTS/$TEMPLATE2.tar
forrest@1
    84
mv $TEMPLATE2 $COMPARE
forrest@1
    85
forrest@1
    86
# add quote, to be usesd in INPUT_TEXT
forrest@1
    87
set MODELQ = \"$MODEL1\"
forrest@1
    88
set DIRMQ  = \"$DIR_M\"
forrest@1
    89
set F1  = \"$FILE1\"
forrest@1
    90
set F2  = \"$FILE2\"
forrest@1
    91
set F3  = \"$FILE3\"
forrest@1
    92
set F4  = \"$FILE4\"
forrest@1
    93
set F5  = \"$FILE5\"
forrest@1
    94
set F6  = \"$FILE6\"
forrest@1
    95
set F7  = \"$FILE7\"
forrest@1
    96
set F8  = \"$FILE8\"
forrest@1
    97
set F9  = \"$FILE9\"
forrest@1
    98
set F10 = \"$FILE10\"
forrest@1
    99
set F11 = \"$FILE11\"
forrest@1
   100
set GRIDQ   = \"$GRID\"
forrest@1
   101
set BGCQ    = \"$BGC\"
forrest@1
   102
set ENERGYQ = \"$ENERGY\"
forrest@1
   103
set DIRSQ   = \"$DIR_S\"
forrest@1
   104
set DIROQ   = \"$DIR_O\"
forrest@1
   105
set DIRCQ   = \"$DIR_SCRIPTS\"
forrest@1
   106
forrest@1
   107
set COMPAREQ = \"$COMPARE\"
forrest@1
   108
set MODELN   = \"model1\"
forrest@1
   109
forrest@1
   110
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 film9=$F9 film10=$F10 film11=$F11 BGC=$BGCQ ENERGY=$ENERGYQ dirs=$DIRSQ diro=$DIROQ dirscript=$DIRCQ modeln=$MODELN compare=$COMPAREQ"
forrest@1
   111
 
forrest@1
   112
echo "`date` - Running diagnostics for model ${MODELQ}"
forrest@1
   113
# CLAMP metric processing of model1
forrest@1
   114
echo "`date` - Running 00.initial.ncl"
forrest@1
   115
ncl $INPUT_TEXT $DIR_SCRIPTS/00.initial.ncl
forrest@1
   116
echo "`date` - Running 01.npp.ncl"
forrest@1
   117
ncl $INPUT_TEXT $DIR_SCRIPTS/01.npp.ncl
forrest@1
   118
echo "`date` - Running 01.lai.ncl"
forrest@1
   119
ncl $INPUT_TEXT $DIR_SCRIPTS/02.lai.ncl
forrest@1
   120
forrest@1
   121
if ($FILE3 != "") then
forrest@1
   122
echo "`date` - Running 03.co2.ncl"
forrest@1
   123
ncl $INPUT_TEXT $DIR_SCRIPTS/03.co2.ncl
forrest@1
   124
endif
forrest@1
   125
forrest@1
   126
echo "`date` - Running 04.biomass.ncl"
forrest@1
   127
ncl $INPUT_TEXT $DIR_SCRIPTS/04.biomass.ncl
forrest@1
   128
echo "`date` - Running 06.fluxnet.ncl"
forrest@1
   129
ncl $INPUT_TEXT $DIR_SCRIPTS/06.fluxnet.ncl
forrest@1
   130
echo "`date` - Running 07.beta.ncl"
forrest@1
   131
ncl $INPUT_TEXT $DIR_SCRIPTS/07.beta.ncl
forrest@1
   132
echo "`date` - Running 08.turnover.ncl"
forrest@1
   133
ncl $INPUT_TEXT $DIR_SCRIPTS/08.turnover.ncl
forrest@1
   134
forrest@1
   135
if ($BGC != "casa") then
forrest@1
   136
echo "`date` - Running 09.carbon_sink.ncl"
forrest@1
   137
ncl $INPUT_TEXT $DIR_SCRIPTS/09.carbon_sink.ncl
forrest@1
   138
else
forrest@1
   139
echo "`date` - Running 09x.carbon_sink.ncl"
forrest@1
   140
ncl $INPUT_TEXT $DIR_SCRIPTS/09x.carbon_sink.ncl
forrest@1
   141
endif
forrest@1
   142
forrest@1
   143
if ($BGC != "casa") then
forrest@1
   144
echo "`date` - Running 10.fire.ncl"
forrest@1
   145
ncl $INPUT_TEXT $DIR_SCRIPTS/10.fire.ncl
forrest@1
   146
endif
forrest@1
   147
forrest@1
   148
echo "`date` - Running 11.ameriflux.ncl"
forrest@1
   149
ncl $INPUT_TEXT $DIR_SCRIPTS/11.ameriflux.ncl
forrest@1
   150
echo "`date` - Running 99.final.ncl"
forrest@1
   151
ncl $INPUT_TEXT $DIR_SCRIPTS/99.final.ncl
forrest@1
   152
forrest@1
   153
#*******************************************************
forrest@1
   154
# user modification-(3)
forrest@1
   155
forrest@1
   156
# model2
forrest@1
   157
set MODEL2 = CN
forrest@1
   158
set DIR_M  = /lustre/wolf-ddn/scratch/hof/clamp_data/model/
forrest@1
   159
#set FILE1  = i01.10cn_1948-2004_ANN_climo.nc
forrest@1
   160
set FILE1  = i01.10cn_1975-2000_ANN_climo.nc
forrest@1
   161
set FILE2  = i01.10cn_1948-2004_MONS_climo.nc
forrest@1
   162
set FILE3  = f02.03cn_1901-1925_MONS_climo_atm.nc
forrest@1
   163
set FILE4  = i01.06cn_1980-2004_ANN_climo.nc
forrest@1
   164
set FILE5  = i01.10cn_1990-2004_ANN_climo.nc
forrest@1
   165
set FILE6  = i01.07cn_1990-2004_ANN_climo.nc
forrest@1
   166
set FILE7  = i01.10cn_Fire_C_1979-2004_monthly.nc
forrest@1
   167
set FILE8  = i01.10cn_ameriflux_1990-2004_monthly.nc
forrest@1
   168
set FILE9  = i01.10cn_2000-2004_ANN_climo.nc
forrest@1
   169
set FILE10 = i01.10cn_2000-2004_MONS_climo.nc
forrest@1
   170
set FILE11 = i01.10cn_2000_ANN_climo.nc
forrest@1
   171
set GRID   = T42
forrest@1
   172
set BGC    = cn
forrest@1
   173
set ENERGY = new
forrest@1
   174
forrest@1
   175
#*******************************************************
forrest@1
   176
# create model2 directory by copying templates
forrest@1
   177
if ($FILE3 != "") then
forrest@1
   178
   set TEMPLATE1 = template_1-model
forrest@1
   179
else
forrest@1
   180
   set TEMPLATE1 = template_1-model_noCO2
forrest@1
   181
endif
forrest@1
   182
#cp -r $DIR_SCRIPTS/$TEMPLATE1 $MODEL2
forrest@1
   183
rm -rf $MODEL2
forrest@1
   184
tar xvpf $DIR_SCRIPTS/$TEMPLATE1.tar
forrest@1
   185
mv $TEMPLATE1 $MODEL2
forrest@1
   186
forrest@1
   187
# add quote, to be usesd in INPUT_TEXT
forrest@1
   188
set MODELQ  = \"$MODEL2\"
forrest@1
   189
set DIRMQ   = \"$DIR_M\"
forrest@1
   190
set F1  = \"$FILE1\"
forrest@1
   191
set F2  = \"$FILE2\"
forrest@1
   192
set F3  = \"$FILE3\"
forrest@1
   193
set F4  = \"$FILE4\"
forrest@1
   194
set F5  = \"$FILE5\"
forrest@1
   195
set F6  = \"$FILE6\"
forrest@1
   196
set F7  = \"$FILE7\"
forrest@1
   197
set F8  = \"$FILE8\"
forrest@1
   198
set F9  = \"$FILE9\"
forrest@1
   199
set F10 = \"$FILE10\"
forrest@1
   200
set F11 = \"$FILE11\"
forrest@1
   201
set GRIDQ   = \"$GRID\"
forrest@1
   202
set BGCQ    = \"$BGC\"
forrest@1
   203
set ENERGYQ = \"$ENERGY\"
forrest@1
   204
forrest@1
   205
set COMPAREQ = \"$COMPARE\"
forrest@1
   206
set MODELN   = \"model2\"
forrest@1
   207
forrest@1
   208
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 film9=$F9 film10=$F10 film11=$F11 BGC=$BGCQ ENERGY=$ENERGYQ dirs=$DIRSQ diro=$DIROQ dirscript=$DIRCQ modeln=$MODELN compare=$COMPAREQ"
forrest@1
   209
 
forrest@1
   210
echo "`date` - Running diagnostics for model ${MODELQ}"
forrest@1
   211
# CLAMP metric processing of model2
forrest@1
   212
echo "`date` - Running 00.inital.ncl"
forrest@1
   213
ncl $INPUT_TEXT $DIR_SCRIPTS/00.initial.ncl
forrest@1
   214
echo "`date` - Running 01.npp.ncl"
forrest@1
   215
ncl $INPUT_TEXT $DIR_SCRIPTS/01.npp.ncl
forrest@1
   216
echo "`date` - Running 02.lai.ncl"
forrest@1
   217
ncl $INPUT_TEXT $DIR_SCRIPTS/02.lai.ncl
forrest@1
   218
forrest@1
   219
if ($FILE3 != "") then
forrest@1
   220
echo "`date` - Running 03.co2.ncl"
forrest@1
   221
ncl $INPUT_TEXT $DIR_SCRIPTS/03.co2.ncl
forrest@1
   222
endif
forrest@1
   223
forrest@1
   224
echo "`date` - Running 04.biomass.ncl"
forrest@1
   225
ncl $INPUT_TEXT $DIR_SCRIPTS/04.biomass.ncl
forrest@1
   226
echo "`date` - Running 06.fluxnet.ncl"
forrest@1
   227
ncl $INPUT_TEXT $DIR_SCRIPTS/06.fluxnet.ncl
forrest@1
   228
echo "`date` - Running 07.beta.ncl"
forrest@1
   229
ncl $INPUT_TEXT $DIR_SCRIPTS/07.beta.ncl
forrest@1
   230
echo "`date` - Running 08.turnover.ncl"
forrest@1
   231
ncl $INPUT_TEXT $DIR_SCRIPTS/08.turnover.ncl
forrest@1
   232
forrest@1
   233
if ($BGC != "casa") then
forrest@1
   234
echo "`date` - Running 09.carbon_sink.ncl"
forrest@1
   235
ncl $INPUT_TEXT $DIR_SCRIPTS/09.carbon_sink.ncl
forrest@1
   236
else
forrest@1
   237
echo "`date` - Running 09x.carbon_sink.ncl"
forrest@1
   238
ncl $INPUT_TEXT $DIR_SCRIPTS/09x.carbon_sink.ncl
forrest@1
   239
endif
forrest@1
   240
forrest@1
   241
if ($BGC != "casa") then
forrest@1
   242
echo "`date` - Running 10.fire.ncl"
forrest@1
   243
ncl $INPUT_TEXT $DIR_SCRIPTS/10.fire.ncl
forrest@1
   244
endif
forrest@1
   245
forrest@1
   246
echo "`date` - Running 11.ameriflux.ncl"
forrest@1
   247
ncl $INPUT_TEXT $DIR_SCRIPTS/11.ameriflux.ncl
forrest@1
   248
echo "`date` - Running 99.final.ncl"
forrest@1
   249
ncl $INPUT_TEXT $DIR_SCRIPTS/99.final.ncl
forrest@1
   250
forrest@1
   251
# create a tar file from the final output
forrest@1
   252
echo "`date` - tarring up final output into all.tar"
forrest@1
   253
tar cf - $MODEL1 $MODEL2 $COMPARE > all.tar
forrest@1
   254