source: CONFIG_DEVT/ORCHIDEE_OL_TP/ENSEMBLE/Job_Post_FLUXNET @ 5587

Last change on this file since 5587 was 5570, checked in by aclsce, 3 years ago

Created ORCHIDEE_OL_TP configuration : temporary configuration to be used during prectical session.

  • Property svn:executable set to *
File size: 21.9 KB
Line 
1#!/bin/ksh
2
3# $Date: 2010/06/25 18:48:26 $
4# $Author: ssipsl $
5# $Revision: 1.5 $
6# IPSL (2006)
7#  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC
8
9#D--------------------------------------------------------------------==
10#D--------------------------------------------------------------------==
11#D-
12#D-                      Job to launch FLUXNET spinup simulations
13#D-
14#D--------------------------------------------------------------------==
15#D--------------------------------------------------------------------==
16#D-
17#                       Job inspired from Sönke Zaehle "site_new.def" job
18#                       #################################################
19
20if [ $# -lt 1 ] ; then
21   echo ""
22   echo "ERROR: Bad usage. You must give the name of the card as argument."
23   echo "Note that this script is only supposed to be used with fluxnet simulation."
24   echo "Do as follow for fluxnet simulation with fluxnet.card:"
25   echo "   ./Job_Post_FLUXNET fluxnet  > out_Job_Post_FLUXNET 2>&1" 
26   echo ""
27   exit
28fi
29
30
31
32SUBMIT_DIR=$( pwd )
33MODIPSL=$(cd ${SUBMIT_DIR}'/../../..';pwd;)
34libIGCM=${MODIPSL}/libIGCM
35
36
37
38# CleanSmallFiles : option to remove small output files before saving
39CleanSmallFiles=yes
40export CleanSmallFiles
41
42# All SubJobs in SPINUP in ONE OR MORE YEARS run (must be used with libIGCM branches/AllPostFred).
43
44
45
46#D--------------------------------------------------------------------==
47#D-                   -1. User modification place
48#D--------------------------------------------------------------------==
49
50#D- Increased verbosity (1, 2, 3)
51#Verbosity=3
52
53#D-
54# --------------------------------------------------------------------
55#D- ! Optionnal features /!\ Use with care !
56# --------------------------------------------------------------------
57
58#D- Low level debug : to bypass lib test checks and stack construction
59#D- Default=true
60DEBUG_debug=false
61
62#D- Set DEBUG_sys to false to disable output calls of function
63#D- Default=true
64#DEBUG_sys=false
65
66#D- Turn in dry run mode ? (0,1,2,3)
67#D- Default=0
68#DRYRUN=3
69# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
70# -------------------------------------------------------------------------------------
71# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
72# |          |  Cp/Exe param files |            |  Chmod  |                           |
73# |          |      Qsub           |            |         |                           |
74# -------------------------------------------------------------------------------------
75# |    0     |       yes           |    yes     |  yes    |      yes                  |
76# -------------------------------------------------------------------------------------
77# |    1     |       yes           |    yes     |  yes    |      no                   |
78# -------------------------------------------------------------------------------------
79# |    2     |       yes           |    yes     |  no     |      no                   |
80# -------------------------------------------------------------------------------------
81# |    3     |       yes           |    no      |  no     |      no                   |
82# -------------------------------------------------------------------------------------
83
84
85#D-
86#D--------------------------------------------------------------------==
87#D-                   0. System Environment
88#D-                      - Define variables for Number of processors
89#D-                      - Define MPI variables
90#D-                      - Define batch scheduler variables
91#D-                      - Source IGCM Library
92#D-                      - Get RESOLution in .resol file (temporary)
93#D--------------------------------------------------------------------==
94
95#D--------------------------------------------------------------------==
96. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
97. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
98. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
99#-------
100. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
101. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
102. ${libIGCM}/libIGCM_comp/libIGCM_comp.ksh
103. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
104#-------
105( ${DEBUG_debug} ) && IGCM_debug_Check
106( ${DEBUG_debug} ) && IGCM_card_Check
107( ${DEBUG_debug} ) && IGCM_date_Check
108
109#D--------------------------------------------------------------------==
110#D- 0.1 COMMON ENVIRONMENT
111#D-     - Read libIGCM compatibility version in config.card
112#D-     - Read UserChoices section
113#D-     - Read Ensemble section
114#D-     - Read Post section
115#D-     - Define all netcdf output directories
116#D--------------------------------------------------------------------==
117IGCM_config_CommonConfiguration ${SUBMIT_DIR}/config.card
118
119#D--------------------------------------------------------------------==
120#D- 1. INITIALIZE CONFIGURATION
121#D-    - Simulation configuration
122#D-    - Simulation parameters
123#D-    - Execution parameter
124#D-    - Define input files directory
125#D-    - Read or initialize CumulPeriod
126#D-    - run.card
127#D---------------------------------------------------------------------==
128IGCM_config_Initialize
129
130
131IGCM_sys_Cp -p ensemble.card ref.card
132IGCM_sys_Cp -p $1.card ensemble.card
133
134IGCM_sys_Rm -f ${SUBMIT_DIR}/liste_glost.list
135IGCM_sys_Rm -f ${SUBMIT_DIR}/job_output_
136
137
138#set -vx
139
140. ${SUBMIT_DIR}/ensemble.ksh
141
142ENSEMBLE_initialize
143
144# Launch ATLAS syncho : we have to wait for the last job !
145
146# ATLAS fix parameters :
147# Atlas Name :
148AtlasCfg=${ensemble_SPINUP_AtlasCfg}
149#atlas_FLUXNET.cfg
150
151# observation_file
152observation_file_path=${ensemble_SPINUP_observation_base_path}/'${Site}_${FYEAR}-${LYEAR}.nc'
153
154
155# old history file
156
157reference_base_path=${ensemble_SPINUP_reference_base_path}
158if [ X${reference_base_path} == X"" ] || [ X${reference_base_path} == XNONE ] ; then
159    flag_reference=0
160    reference_config="_"
161    reference_file_path=NONE
162else
163    flag_reference=1
164    reference_config=${ensemble_SPINUP_reference_config}
165    reference_file_path=${reference_base_path}/${reference_config}/'${Site}${reference_config}HIST/SRF/Output/MO/${Site}${reference_config}HIST_${FYEAR}0101_${LYEAR}1231_1M_sechiba_history.nc'
166
167fi
168export reference_config
169
170
171
172# Modulo for SpinUp years
173Modulo=${ensemble_SPINUP_Modulo}
174
175
176
177# Create RUN_DIR
178echo RUN_DIR_PATH=${RUN_DIR_PATH}
179IGCM_sys_MkdirWork ${RUN_DIR_PATH}
180cp *jnl ${RUN_DIR_PATH}/.
181cp *cfg ${RUN_DIR_PATH}/. 
182cd ${RUN_DIR_PATH}
183
184
185echo  ${ensemble_CONFIG_Groups[*]}
186for group in  ${ensemble_CONFIG_Groups[*]} ; do
187   isite=1
188   index=0
189
190   eval temp=\${ensemble_CONFIG_${group}[*]}
191   set -A group_site -- $temp
192
193   # Number of sites :
194   NumSites=$(( ${#group_site[*]} / NumInfosBySite ))
195
196   R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_UserChoices_JobName}
197
198   IGCM_sys_Rm -Rf ${R_SAVE}/fluxnet_taylor_diff_${config_UserChoices_JobName}_${reference_config}_${group}
199   IGCM_sys_Mkdir ${R_SAVE}/fluxnet_taylor_diff_${config_UserChoices_JobName}_${reference_config}_${group}
200
201   while [ ${isite} -le ${NumSites} ] ; do
202   
203       site=${group_site[$index]}
204       echo $site
205   
206       TIME_YEAR=${group_site[ $(( index + ColumnLength )) ]}
207       YEAR=${group_site[ $(( index + ColumnYear )) ]}
208   
209       Site=$site
210       echo $YEAR
211       DUREE=${TIME_YEAR}
212       FYEAR=${YEAR}
213       (( LYEAR=FYEAR+DUREE-1 ))
214       echo $site
215       SpinUpJob=${site}${config_UserChoices_JobName}
216       TIME_YEAR=${group_site[ $(( index + ColumnLength )) ]}
217       YEAR=${group_site[ $(( index + ColumnYear )) ]}
218       Stand_Age=${group_site[ $(( index + ColumnAge )) ]}
219     
220    if [ ${Stand_Age} -gt 150 ] ; then
221        DATE_END_SECTOF=150
222    else
223        DATE_END_SECTOF=$((Stand_Age - TIME_YEAR))
224    fi
225
226 
227       fichier_with_path=$( \ls -rt ${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_UserChoices_JobName}/${SpinUpJob}HIST/SRF/Output/MO/*_sechiba_history.nc )
228
229       fichier_with_path_SBG=$( \ls -rt ${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_UserChoices_JobName}/${SpinUpJob}HIST/SBG/Output/MO/*_stomate_history.nc )
230
231        itis=0
232        for j in {5..32} ; do
233                itis=${group_site[ $(( index + j )) ]}
234                if [ ${itis} == 1 ] ; then
235                        esp=$(( j - 4 ))
236                fi
237        done
238
239        echo "PFT=" ${esp}
240
241       eval observation_file=${observation_file_path}
242       eval reference_file=${reference_file_path}
243
244       echo "reference_config=" ${reference_config}
245
246        ferret -script simple_info.jnl ${fichier_with_path_SBG} ${esp} ${site}
247
248        cp simple_info.csv ${SUBMIT_DIR}/simple_info.csv
249
250        ferret -script taylor_arrow_fluxnet_final_1.jnl GPP GPP/1800 hour ${flag_reference} GPP ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
251       ferret -script taylor_arrow_fluxnet_final_1.jnl GPP GPP/1800 day ${flag_reference} GPP ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
252       ferret -script taylor_arrow_fluxnet_final_1.jnl GPP GPP/1800 month ${flag_reference} GPP ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
253       ferret -script taylor_arrow_fluxnet_final_1.jnl GPP GPP/1800 year ${flag_reference} GPP ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
254
255       ferret -script taylor_arrow_fluxnet_final_1.jnl \(maint_resp+hetero_resp+growth_resp\) Reco/1800 hour ${flag_reference} TER ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
256       ferret -script taylor_arrow_fluxnet_final_1.jnl \(maint_resp+hetero_resp+growth_resp\) Reco/1800 day ${flag_reference} TER ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
257       ferret -script taylor_arrow_fluxnet_final_1.jnl \(maint_resp+hetero_resp+growth_resp\) Reco/1800 month ${flag_reference} TER ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
258       ferret -script taylor_arrow_fluxnet_final_1.jnl \(maint_resp+hetero_resp+growth_resp\) Reco/1800 year ${flag_reference} TER ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
259
260       ferret -script taylor_arrow_fluxnet_final_1.jnl NEE NEE/1800 hour ${flag_reference} NEE ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
261       ferret -script taylor_arrow_fluxnet_final_1.jnl NEE NEE/1800 day ${flag_reference} NEE ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
262       ferret -script taylor_arrow_fluxnet_final_1.jnl NEE NEE/1800 month ${flag_reference} NEE ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
263       ferret -script taylor_arrow_fluxnet_final_1.jnl NEE NEE/1800 year ${flag_reference} NEE ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
264
265       ferret -script taylor_arrow_fluxnet_final_1.jnl Qh H_F hour ${flag_reference} SH ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
266       ferret -script taylor_arrow_fluxnet_final_1.jnl Qh H_F day ${flag_reference} SH ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
267       ferret -script taylor_arrow_fluxnet_final_1.jnl Qh H_F month ${flag_reference} SH ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
268       ferret -script taylor_arrow_fluxnet_final_1.jnl Qh H_F year ${flag_reference} SH ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
269
270       ferret -script taylor_arrow_fluxnet_final_1.jnl Qle LE_F hour ${flag_reference} LH ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
271       ferret -script taylor_arrow_fluxnet_final_1.jnl Qle LE_F day ${flag_reference} LH ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
272       ferret -script taylor_arrow_fluxnet_final_1.jnl Qle LE_F month ${flag_reference} LH ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
273       ferret -script taylor_arrow_fluxnet_final_1.jnl Qle LE_F year ${flag_reference} LH ${config_UserChoices_JobName} ${reference_config} ${group} ${site} ${fichier_with_path} ${observation_file} ${reference_file}
274
275
276       # We test if the END step was moved in SpinUp/SPIN/Output directory.
277       # Then we are sure the last historical SpinUp step has finished (HIST)...
278   
279       # Define name of the END SubJob (FIN) in SpinUp
280       if [ ${DATE_END_SECTOF} -gt 0 ] ; then
281        BeforeLastJob=${site}${config_UserChoices_JobName}FIN
282       else
283        echo "We must have an \"duree_final\" non zero to get historical run and post-treatment"
284        exit 1
285       fi
286   
287       TIME_YEAR=${group_site[ $(( index + ColumnLength )) ]}
288       YEAR=${group_site[ $(( index + ColumnYear )) ]}
289
290       ATLAS_ARGS=${AtlasCfg}\ ${observation_file}\ ${reference_file}\ ${reference_config}\ ${Modulo}
291       
292       echo "ATLAS_ARGS:" ${ATLAS_ARGS}
293
294   
295       # Launch post-treatment for SPINUP !
296       echo "****"
297       echo "Launch post-treatment for SPINUP for site ${site} !"
298       echo  "call to post_FLUXNET:" ${MODIPSL} ${group} ${site} ${TIME_YEAR} ${YEAR} ${ATLAS_ARGS}
299#       nohup ${SUBMIT_DIR}/post_FLUXNET ${MODIPSL} ${group} ${site} ${TIME_YEAR} ${YEAR} ${ATLAS_ARGS} > ${SUBMIT_DIR}/out_post_${site} 2>&1 &
300       echo ${SUBMIT_DIR}/post_FLUXNET ${MODIPSL} ${group} ${site} ${ATLAS_ARGS} \> ${SUBMIT_DIR}/out_post_${site} >> ${SUBMIT_DIR}/liste_glost.list
301       echo "****"
302   
303      (( isite=isite+1 ))
304      (( index=index+NumInfosBySite ))
305  done
306 
307       
308
309  if [ ${#ensemble_CONFIG_Groups[*]} -ne 1 ] ; then
310     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_GPP_hour.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_GPP_hour.csv
311     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_GPP_day.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_GPP_day.csv
312     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_GPP_month.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_GPP_month.csv
313     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_GPP_year.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_GPP_year.csv
314   
315     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_TER_hour.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_TER_hour.csv
316     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_TER_day.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_TER_day.csv
317     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_TER_month.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_TER_month.csv
318     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_TER_year.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_TER_year.csv
319   
320     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_NEE_hour.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_NEE_hour.csv
321     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_NEE_day.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_NEE_day.csv
322     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_NEE_month.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_NEE_month.csv
323     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_NEE_year.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_NEE_year.csv
324   
325     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_SH_hour.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_SH_hour.csv
326     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_SH_day.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_SH_day.csv
327     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_SH_month.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_SH_month.csv
328     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_SH_year.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_SH_year.csv
329   
330     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_LH_hour.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_LH_hour.csv
331     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_LH_day.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_LH_day.csv
332     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_LH_month.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_LH_month.csv
333     cat stat_${config_UserChoices_JobName}_${reference_config}_${group}_LH_year.csv >> stat_${config_UserChoices_JobName}_${reference_config}_ALL_LH_year.csv
334   
335  fi
336
337
338  sed -e "s,\(flag_reference_file=\)\(.*\),\1${flag_reference},g" -e "s,\(group=\)\(.*\),\1\"${group}\",g" -e "s,\(config_eval=\)\(.*\),\1\"${config_UserChoices_JobName}\",g" -e "s,\(config_ref=\)\(.*\),\1\"${reference_config}\",g" atlas_FLUXNET_taylor.cfg > atlas_FLUXNET_taylor_${group}.cfg
339   
340   atlas -o fluxnet_taylor_diff_${config_UserChoices_JobName}_${reference_config}_${group} atlas_FLUXNET_taylor_${group}.cfg toto
341
342   # Remove small files before saving
343   if [ X$CleanSmallFiles = Xyes ] ; then
344     tmpdir=fluxnet_taylor_diff_${config_UserChoices_JobName}_${reference_config}_${group}
345     # Remove .info .tex .jnl .stdout .jpg .pdf
346     echo "Remove small files before saving : "
347     sumfilestoremove=$(( $( find $tmpdir -name "*.info" | wc -l ) +  $( find $tmpdir -name "*.jnl" | wc -l ) +  $( find $tmpdir -name "*.stdout" | wc -l ) + $( find $tmpdir -name "*.tex" | wc -l ) + $( ls $tmpdir/*.pdf | wc -l ) ))
348     echo "Following $sumfilestoremove files listed below will be removed:"
349     find ${tmpdir} -name "*.info"
350     find ${tmpdir} -name "*.jnl"
351     find ${tmpdir} -name "*.stdout"
352     find ${tmpdir} -name "*.tex"
353     ls ${tmpdir}/*pdf ${tmpdir}/*/*pdf
354
355     # Now remove them
356     find ${tmpdir} -name "*.info" -print -exec rm -f '{}' \;
357     find ${tmpdir} -name "*.jnl" -print -exec rm -f '{}' \;
358     find ${tmpdir} -name "*.stdout" -print -exec rm -f '{}' \;
359     find ${tmpdir} -name "*.tex" -print -exec rm -f '{}' \;
360#     rm -f ${tmpdir}/*/*pdf
361   else
362     echo "No clean of small files will be done"
363   fi
364
365   # Save files
366   R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_UserChoices_JobName}
367   echo "Before IGCM_sys_Put_Dir : destination= ${R_SAVE}"
368
369   IGCM_sys_Put_Dir fluxnet_taylor_diff_${config_UserChoices_JobName}_${reference_config}_${group} ${R_SAVE}
370   IGCM_sys_Rm -Rf fluxnet_taylor_diff_${config_UserChoices_JobName}_${reference_config}_${group}
371
372
373done
374
375nlignes=`less ${SUBMIT_DIR}/liste_glost.list | wc -l `
376nproc=`echo "$nlignes/4+1" | bc`
377sed -e "s/#MSUB\ \-n.*/#MSUB\ \-n\ ${nproc}/" ${SUBMIT_DIR}/job_output > ${SUBMIT_DIR}/job_output_
378echo ccc_mprun ./glost_launch ${SUBMIT_DIR}/liste_glost.list >> ${SUBMIT_DIR}/job_output_
379ccc_msub ${SUBMIT_DIR}/job_output_
380
381
382
383if [ ${#ensemble_CONFIG_Groups[*]} -ne 1 ] ; then
384   group="ALL"
385   IGCM_sys_Rm -Rf ${R_SAVE}/fluxnet_taylor_diff_${config_UserChoices_JobName}_${reference_config}_${group}
386   
387   sed -e "s,\(flag_reference_file=\)\(.*\),\1${flag_reference},g" -e "s,\(group=\)\(.*\),\1\"${group}\",g" -e "s,\(config_eval=\)\(.*\),\1\"${config_UserChoices_JobName}\",g" -e "s,\(config_ref=\)\(.*\),\1\"${reference_config}\",g" atlas_FLUXNET_taylor.cfg > atlas_FLUXNET_taylor_${group}.cfg
388   
389   atlas -o fluxnet_taylor_diff_${config_UserChoices_JobName}_${reference_config}_${group} atlas_FLUXNET_taylor_${group}.cfg toto
390 
391
392   # Remove small files before saving
393   if [ X$CleanSmallFiles = Xyes ] ; then
394     tmpdir=fluxnet_taylor_diff_${config_UserChoices_JobName}_${reference_config}_${group}
395     # Remove .info .tex .jnl .stdout .jpg .pdf
396     echo "Remove small files before saving : "
397     sumfilestoremove=$(( $( find $tmpdir -name "*.info" | wc -l ) +  $( find $tmpdir -name "*.jnl" | wc -l ) +  $( find $tmpdir -name "*.stdout" | wc -l ) + $( find $tmpdir -name "*.tex" | wc -l ) + $( ls $tmpdir/*.pdf | wc -l ) ))
398     echo "Following $sumfilestoremove files listed below will be removed:"
399     find ${tmpdir} -name "*.info"
400     find ${tmpdir} -name "*.jnl"
401     find ${tmpdir} -name "*.stdout"
402#     find ${tmpdir} -name "*.jpg"
403     find ${tmpdir} -name "*.tex"
404     ls ${tmpdir}/*pdf
405
406     # Now remove them
407#     find ${tmpdir} -name "*.info" -print -exec rm -f '{}' \;
408#     find ${tmpdir} -name "*.jnl" -print -exec rm -f '{}' \;
409#     find ${tmpdir} -name "*.stdout" -print -exec rm -f '{}' \;
410##     find ${tmpdir} -name "*.jpg" -print -exec rm -f '{}' \;
411#     find ${tmpdir} -name "*.tex" -print -exec rm -f '{}' \;
412#     rm -f ${tmpdir}/*/*pdf
413   else
414     echo "No clean of small files will be done"
415   fi
416
417   # Save files
418   R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_UserChoices_JobName}
419   IGCM_sys_Put_Dir fluxnet_taylor_diff_${config_UserChoices_JobName}_${reference_config}_${group} ${R_SAVE}
420   IGCM_sys_Rm -Rf fluxnet_taylor_diff_${config_UserChoices_JobName}_${reference_config}_${group}
421fi
422
423cd ${SUBMIT_DIR}
424IGCM_sys_Mv ref.card ensemble.card
425IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
Note: See TracBrowser for help on using the repository browser.