source: tags/ORCHIDEE_1_9_5/ORCHIDEE_OL/bench_ORCHIDEE @ 8

Last change on this file since 8 was 8, checked in by orchidee, 14 years ago

import first tag equivalent to CVS orchidee_1_9_5 + OOL_1_9_5

File size: 6.7 KB
Line 
1#!/bin/ksh
2#
3#
4#
5#
6# The model to be tested
7#
8model='../modipsl/bin/orchidee_ol'
9#
10# File with the forcing data
11#
12forcing='../ISLSCP/islscp_Euro_87.nc'
13#
14# Files of the various maps needed by the model
15#
16vegmap='../surfmap/carteveg5km.nc'
17irrigmap='../surfmap/irrigated.nc'
18routmap='../surfmap/routing.nc'
19soilmap='../surfmap/soils_param.nc'
20reftemp='../surfmap/reftemp.nc'
21#
22# Some tools we will need to process the data
23#
24ncks=$(which ncks)
25ncrcat=$(which ncrcat)
26ncdump=$(which ncdump)
27#
28rm="/bin/rm"
29mv="/bin/mv"
30diff="/usr/bin/diff"
31#
32#
33#  DO NOT CHANGE BELOW THIS LINE
34#------------------------------------------------------
35#------------------------------------------------------
36#
37######################################################
38#
39# Verifications
40#
41######################################################
42#
43if [ ! -x ${model} ]; then
44   echo "The model executable does not exist"
45   echo "Retry the compilation of ORCHIDEE in the modipsl strcture"
46   exit
47fi 
48#
49if [ ! -x ${ncks} ]; then
50   echo "The ncks tool of nco does not exist"
51   echo "Check it out at http://www.cgd.ucar.edu/cms/nco/nco.html"
52   exit
53fi
54#
55#
56if [ ! -x ${rm} ]; then
57   echo "How do I delete a file ?"
58   exit
59fi
60#
61if [ ! -f ${forcing} ]; then
62   echo "I could not find the forcing file"
63   exit
64fi
65#
66if [ ! -f ${vegmap} ]; then
67   echo "I could not find the file with the vegetation map"
68   exit
69fi
70#
71if [ ! -f ${irrigmap} ]; then
72   echo "I could not find the file with the irrigation map"
73   exit
74fi
75#
76if [ ! -f ${routmap} ]; then
77   echo "I could not find the file with the basin map for the routing"
78   exit
79fi
80#
81if [ ! -f ${soilmap} ]; then
82   echo "I could not find the file with the map with the soil types"
83   exit
84fi
85#
86if [ ! -f ${reftemp} ]; then
87   echo "I could not find the file with the map of reference temperatures"
88   exit
89fi
90#
91#
92######################################################
93#
94# generate the default run.def
95#
96######################################################
97#
98#
99${rm} -f run_default.def
100cat > run_default.def << %
101#
102# SECHIBA_2dim
103#
104DEBUG_INFO=n
105FORCING_FILE=${forcing}
106HEIGHT_LEV1=2.0
107SPLIT_DT=12
108RESTART_FILEIN=XXDR_RINXX
109RESTART_FILEOUT=XXDR_ROUTXX
110TIME_SKIP=0
111TIME_LENGTH=XXTLXX
112# IMPLICIT is not set
113NO_INTER=y
114SPRED_PREC=1
115NETRAD_CONS=n
116#
117LIMIT_WEST = XX_WEST_XX
118LIMIT_EAST = XX_EAST_XX
119LIMIT_NORTH = XX_NORTH_XX
120LIMIT_SOUTH = XX_SOUTH_XX
121#
122# IOIPSL
123#
124RIVER_ROUTING=y
125ROUTING_RIVERS = 2
126ROUTING_FILE=${routmap}
127IRRIGATION_FILE=${irrigmap}
128DO_IRRIGATION=y
129DO_FLOODPLAINS=y
130#
131# SECHIBA
132#
133CONDVEG_SNOWA=default
134# IMPOSE_AZE is not set
135SOILALB_FILE=${soilmap}
136SOILTYPE_FILE=${soilmap}
137DIFFUCO_LEAFCI=233.
138ENERBIL_TSURF=280.
139HYDROL_SNOW=0.0
140HYDROL_SNOWAGE=0.0
141HYDROL_SNOWICE=0.0
142HYDROL_SNOWICEAGE=0.0
143HYDROL_HDRY=0.0
144HYDROL_HUMR=1.0
145HYDROL_BQSB=default
146HYDROL_GQSB=0.0
147HYDROL_DSG=0.0
148HYDROL_DSP=default
149HYDROL_QSV=0.0
150# STOMATE_OK_CO2=y
151# STOMATE_OK_STOMATE is not set
152# STOMATE_OK_DGVM is not set
153# STOMATE_WATCHOUT is not set
154SECHIBA_restart_in=XXSE_RINXX
155SECHIBA_rest_out=XXSE_ROUTXX
156SECHIBA_reset_time=y
157STOMATE_RESTART_FILEIN=XXST_RINXX
158STOMATE_RESTART_FILEOUT=XXST_ROUTXX
159OUTPUT_FILE=XX_SEOUT_XX
160WRITE_STEP=86400
161SECHIBA_HISTLEVEL=5
162STOMATE_OUTPUT_FILE=XX_STOUT_XX
163STOMATE_HIST_DT=10.
164STOMATE_HISTLEVEL=10
165SECHIBA_DAY=0.0
166SECHIBA_ZCANOP=0.5
167DT_SLOW=86400.
168# IMPOSE_VEG is not set
169VEGETATION_FILE=${vegmap}
170THERMOSOIL_TPRO=280.
171%
172#
173######################################################
174#
175# Launch our first simulation. It will be called RLarge
176#
177######################################################
178#
179# Build the run.def file for 10 days on the large domaine.
180#
181exp_a='Rlarge'
182#
183${rm} -f wo
184cat << % > wo
185s/XXDR_RINXX/NONE/
186s/XXDR_ROUTXX/${exp_a}_drv_rest.nc/
187s/XXTLXX/10d/
188s/XX_WEST_XX/-20.0/
189s/XX_EAST_XX/10.0/
190s/XX_NORTH_XX/20.0/
191s/XX_SOUTH_XX/2.0/
192s/XXSE_RINXX/NONE/
193s/XXSE_ROUTXX/${exp_a}_sec_rest.nc/
194s/XXST_RINXX/NONE/
195s/XXST_ROUTXX/${exp_a}_sto_rest.nc/
196s/XX_SEOUT_XX/sec_${exp_a}.nc/
197s/XX_STOUT_XX/sto_${exp_a}.nc/
198%
199${rm} -f run.def
200sed -f wo run_default.def > run.def
201#
202# Run the model
203#
204#
205${rm} -f ${exp_a}.log ${exp_a}_*_rest.nc
206time ${model} > ${exp_a}.log
207${mv} used_run.def used_run_${exp_a}.def
208${rm} -f ${exp_a}_drv_rest.nc
209#
210#
211######################################################
212#
213# Launch our second simulation. It will test the restart of the model
214#
215######################################################
216#
217# Build the run.def file for the first 5 days on the large domaine.
218#
219exp_b='RlargeA'
220#
221${rm} -f wo
222cat << % > wo
223s/XXDR_RINXX/NONE/
224s/XXDR_ROUTXX/${exp_b}_drv_rest.nc/
225s/XXTLXX/5d/
226s/XX_WEST_XX/-20.0/
227s/XX_EAST_XX/10.0/
228s/XX_NORTH_XX/20.0/
229s/XX_SOUTH_XX/2.0/
230s/XXSE_RINXX/NONE/
231s/XXSE_ROUTXX/${exp_b}_sec_rest.nc/
232s/XXST_RINXX/NONE/
233s/XXST_ROUTXX/${exp_b}_sto_rest.nc/
234s/XX_SEOUT_XX/sec_${exp_b}.nc/
235s/XX_STOUT_XX/sto_${exp_b}.nc/
236%
237${rm} -f run.def
238sed -f wo run_default.def > run.def
239#
240# Run the model for the first 5 days
241#
242${rm} -f ${exp_b}.log ${exp_b}_*_rest.nc
243${model} > ${exp_b}.log
244${mv} used_run.def used_run_${exp_b}.def
245#
246# Build the run.def file for the second set of 5 days.
247#
248exp_c='RlargeB'
249#
250${rm} -f wo
251cat << % > wo
252s/XXDR_RINXX/${exp_b}_drv_rest.nc/
253s/XXDR_ROUTXX/${exp_c}_drv_rest.nc/
254s/XXTLXX/5d/
255s/XX_WEST_XX/-20.0/
256s/XX_EAST_XX/10.0/
257s/XX_NORTH_XX/20.0/
258s/XX_SOUTH_XX/2.0/
259s/XXSE_RINXX/${exp_b}_sec_rest.nc/
260s/XXSE_ROUTXX/${exp_c}_sec_rest.nc/
261s/XXST_RINXX/${exp_b}_sto_rest.nc/
262s/XXST_ROUTXX/${exp_c}_sto_rest.nc/
263s/XX_SEOUT_XX/sec_${exp_c}.nc/
264s/XX_STOUT_XX/sto_${exp_c}.nc/
265%
266${rm} -f run.def
267sed -f wo run_default.def > run.def
268#
269# Run the model for the first 5 days
270#
271${rm} -f ${exp_c}.log ${exp_c}_*_rest.nc
272${model} > ${exp_c}.log
273${mv} used_run.def used_run_${exp_c}.def
274${rm} -f ${exp_b}_drv_rest.nc ${exp_c}_drv_rest.nc
275#
276#################################################################
277#
278# Do the diagnostics
279#
280#################################################################
281#
282${rm} -f sec_${exp_a}_pt.nc sec_${exp_b}_pt.nc sec_${exp_c}_pt.nc sec_${exp_a}_combi_pt.nc
283${ncks} -d lon,5.25,5.75 -d lat,10.25,10.75 sec_${exp_a}.nc sec_${exp_a}_pt.nc
284${ncks} -d lon,5.25,5.75 -d lat,10.25,10.75 sec_${exp_b}.nc sec_${exp_b}_pt.nc
285${ncks} -d lon,5.25,5.75 -d lat,10.25,10.75 sec_${exp_c}.nc sec_${exp_c}_pt.nc
286#
287${ncrcat} sec_${exp_b}_pt.nc sec_${exp_c}_pt.nc sec_${exp_a}_combi_pt.nc
288#
289vars='evap gqsb bqsb temp_sol'
290for v in $vars ; do
291  ${rm} -f full combi
292  ${ncdump} -v $v -p 9,17 -f f sec_${exp_a}_pt.nc | tail -12 > full
293  ${ncdump} -v $v -p 9,17 -f f sec_${exp_a}_combi_pt.nc | tail -12 > combi
294  ${diff} full combi > /dev/null
295  if [ $? -eq 1 ]; then
296    echo 'The restart did not work and we have differences for variable ' $v
297    paste full combi
298  else
299    echo 'The restart worked for variable ' $v
300  fi
301done
302${rm} full combi sec_${exp_b}.nc sec_${exp_c}.nc
303#
304# Clean up !
305#
306#
307${rm} -f wo run.def run_default.def
308
Note: See TracBrowser for help on using the repository browser.