Modifications to scoring and graphics production for the final version of code for the C-LAMP paper in GCB.
2 #-------------------------------------------------------------------
3 # note: user modifies ONLY the "user modification" section
5 # COMPARE: model1 vs model2
7 # DIR_M : directory of model data
8 # DIR_O : directory of observed data
9 # DIR_S : directory of model surface data
10 # DIR_SCRIPTS : directory of run scripts
11 # FILE1 : time_mean climatology from CLM diagnostic package
12 # FILE2 : 12-monthly climatology from CLM diagnostic package
13 # FILE3 : 12-monthly climatology from ATM diagnostic package
14 # leave it blank, if no ATM file:
16 # FILE7 : timeseries file generated from ....
17 # FILE8 : timeseries file generated from ....
18 # GRID : T31, T42, or 1.9
20 # ENERGY : new or old (fields in model data)
21 #-------------------------------------------------------------------
23 #*******************************************************
24 # user modification-(1)
26 # directory name of model comparison
27 #et COMPARE = b30.061n_vs_b30.061m
28 set COMPARE = i01.38cn_vs_i01.39cn
30 #*******************************************************
31 # user modification-(2)
35 set DIR_M = /lustre/wolf-ddn/scratch/hof/cases1/i01.38cn_out/
36 set FILE1 = i01.38cn_out_ANN_climo.nc
37 set FILE2 = i01.38cn_out_MONS_climo.nc
42 set FILE7 = i01.38cn_Fire_C_2151-2175_monthly.nc
43 set FILE8 = i01.38cn_ameriflux_2151-2175_monthly.nc
50 # in the "CLAMP metric processing" section:
51 # only 00.initial.ncl and 99.final.ncl are required,
52 # user can comment out any one or more of the other ncl scripts,
54 # #ncl $INPUT_TEXT $DIR_SCRIPTS/10.fire.ncl
57 set DIR_S = /lustre/wolf-ddn/scratch/hof/clamp_data/surface_model/
60 set DIR_O = /lustre/wolf-ddn/scratch/hof/clamp_data/observed/
62 # directory for scripts, templates and ncl files
63 set DIR_SCRIPTS = /lustre/wolf-ddn/scratch/hof/clamp/all/
65 #********************************************************
67 # create model1 and model1_vs_model2 directory by copying templates
68 if ($FILE3 != "") then
69 set TEMPLATE1 = template_1-model
70 set TEMPLATE2 = template_2-model
72 set TEMPLATE1 = template_1-model_noCO2
73 set TEMPLATE2 = template_2-model_noCO2
75 #cp -r $DIR_SCRIPTS/$TEMPLATE1 $MODEL1
76 #cp -r $DIR_SCRIPTS/$TEMPLATE2 $COMPARE
79 tar xvpf $DIR_SCRIPTS/$TEMPLATE1.tar
81 tar xvpf $DIR_SCRIPTS/$TEMPLATE2.tar
82 mv $TEMPLATE2 $COMPARE
84 # add quote, to be usesd in INPUT_TEXT
85 set MODELQ = \"$MODEL1\"
86 set DIRMQ = \"$DIR_M\"
99 set ENERGYQ = \"$ENERGY\"
100 set DIRSQ = \"$DIR_S\"
101 set DIROQ = \"$DIR_O\"
102 set DIRCQ = \"$DIR_SCRIPTS\"
104 set COMPAREQ = \"$COMPARE\"
105 set MODELN = \"model1\"
107 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 BGC=$BGCQ ENERGY=$ENERGYQ dirs=$DIRSQ diro=$DIROQ dirscript=$DIRCQ modeln=$MODELN compare=$COMPAREQ"
109 echo "`date` - Running diagnostics for model ${MODELQ}"
110 # CLAMP metric processing of model1
111 echo "`date` - Running 00.initial.ncl"
112 ncl $INPUT_TEXT $DIR_SCRIPTS/00.initial.ncl
113 echo "`date` - Running 01.npp.ncl"
114 ncl $INPUT_TEXT $DIR_SCRIPTS/01.npp.ncl
115 echo "`date` - Running 01.lai.ncl"
116 ncl $INPUT_TEXT $DIR_SCRIPTS/02.lai.ncl
118 if ($FILE3 != "") then
119 echo "`date` - Running 03.co2.ncl"
120 ncl $INPUT_TEXT $DIR_SCRIPTS/03.co2.ncl
123 echo "`date` - Running 04.biomass.ncl"
124 ncl $INPUT_TEXT $DIR_SCRIPTS/04.biomass.ncl
125 echo "`date` - Running 06.fluxnet.ncl"
126 ncl $INPUT_TEXT $DIR_SCRIPTS/06.fluxnet.ncl
127 echo "`date` - Running 07.beta.ncl"
128 ncl $INPUT_TEXT $DIR_SCRIPTS/07.beta.ncl
129 echo "`date` - Running 08.turnover.ncl"
130 ncl $INPUT_TEXT $DIR_SCRIPTS/08.turnover.ncl
132 if ($BGC != "casa") then
133 echo "`date` - Running 09.carbon_sink.ncl"
134 ncl $INPUT_TEXT $DIR_SCRIPTS/09.carbon_sink.ncl
136 echo "`date` - Running 09x.carbon_sink.ncl"
137 ncl $INPUT_TEXT $DIR_SCRIPTS/09x.carbon_sink.ncl
140 if ($BGC != "casa") then
141 echo "`date` - Running 10.fire.ncl"
142 ncl $INPUT_TEXT $DIR_SCRIPTS/10.fire.ncl
145 echo "`date` - Running 11.ameriflux.ncl"
146 ncl $INPUT_TEXT $DIR_SCRIPTS/11.ameriflux.ncl
147 echo "`date` - Running 99.final.ncl"
148 ncl $INPUT_TEXT $DIR_SCRIPTS/99.final.ncl
150 #*******************************************************
151 # user modification-(3)
154 set MODEL2 = i01.39cn
155 set DIR_M = /lustre/wolf-ddn/scratch/hof/cases1/i01.39cn_out/
156 set FILE1 = i01.39cn_out_ANN_climo.nc
157 set FILE2 = i01.39cn_out_MONS_climo.nc
162 set FILE7 = i01.39cn_Fire_C_2101-2125_monthly.nc
163 set FILE8 = i01.39cn_ameriflux_2101-2125_monthly.nc
169 #*******************************************************
170 # create model2 directory by copying templates
171 if ($FILE3 != "") then
172 set TEMPLATE1 = template_1-model
174 set TEMPLATE1 = template_1-model_noCO2
176 #cp -r $DIR_SCRIPTS/$TEMPLATE1 $MODEL2
178 tar xvpf $DIR_SCRIPTS/$TEMPLATE1.tar
179 mv $TEMPLATE1 $MODEL2
181 # add quote, to be usesd in INPUT_TEXT
182 set MODELQ = \"$MODEL2\"
183 set DIRMQ = \"$DIR_M\"
193 set F10 = \"$FILE10\"
194 set GRIDQ = \"$GRID\"
196 set ENERGYQ = \"$ENERGY\"
198 set COMPAREQ = \"$COMPARE\"
199 set MODELN = \"model2\"
201 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 BGC=$BGCQ ENERGY=$ENERGYQ dirs=$DIRSQ diro=$DIROQ dirscript=$DIRCQ modeln=$MODELN compare=$COMPAREQ"
203 echo "`date` - Running diagnostics for model ${MODELQ}"
204 # CLAMP metric processing of model2
205 echo "`date` - Running 00.inital.ncl"
206 ncl $INPUT_TEXT $DIR_SCRIPTS/00.initial.ncl
207 echo "`date` - Running 01.npp.ncl"
208 ncl $INPUT_TEXT $DIR_SCRIPTS/01.npp.ncl
209 echo "`date` - Running 02.lai.ncl"
210 ncl $INPUT_TEXT $DIR_SCRIPTS/02.lai.ncl
212 if ($FILE3 != "") then
213 echo "`date` - Running 03.co2.ncl"
214 ncl $INPUT_TEXT $DIR_SCRIPTS/03.co2.ncl
217 echo "`date` - Running 04.biomass.ncl"
218 ncl $INPUT_TEXT $DIR_SCRIPTS/04.biomass.ncl
219 echo "`date` - Running 06.fluxnet.ncl"
220 ncl $INPUT_TEXT $DIR_SCRIPTS/06.fluxnet.ncl
221 echo "`date` - Running 07.beta.ncl"
222 ncl $INPUT_TEXT $DIR_SCRIPTS/07.beta.ncl
223 echo "`date` - Running 08.turnover.ncl"
224 ncl $INPUT_TEXT $DIR_SCRIPTS/08.turnover.ncl
226 if ($BGC != "casa") then
227 echo "`date` - Running 09.carbon_sink.ncl"
228 ncl $INPUT_TEXT $DIR_SCRIPTS/09.carbon_sink.ncl
230 echo "`date` - Running 09x.carbon_sink.ncl"
231 ncl $INPUT_TEXT $DIR_SCRIPTS/09x.carbon_sink.ncl
234 if ($BGC != "casa") then
235 echo "`date` - Running 10.fire.ncl"
236 ncl $INPUT_TEXT $DIR_SCRIPTS/10.fire.ncl
239 echo "`date` - Running 11.ameriflux.ncl"
240 ncl $INPUT_TEXT $DIR_SCRIPTS/11.ameriflux.ncl
241 echo "`date` - Running 99.final.ncl"
242 ncl $INPUT_TEXT $DIR_SCRIPTS/99.final.ncl
244 # create a tar file from the final output
245 echo "`date` - tarring up final output into all.tar"
246 tar cf - $MODEL1 $MODEL2 $COMPARE > all.tar