Index: trunk/libIGCM/AA_create_se
===================================================================
--- trunk/libIGCM/AA_create_se	(revision 59)
+++ trunk/libIGCM/AA_create_se	(revision 66)
@@ -15,5 +15,5 @@
 #-Q- sx8brodie # @ wall_clock_limit = 10:00:00
 #-Q- sx8brodie # Nom du travail LoadLeveler
-#-Q- sx8brodie # @ job_name   = Sortie   
+#-Q- sx8brodie # @ job_name   = SE
 #-Q- sx8brodie # Fichier de sortie standard du travail       
 #-Q- sx8brodie # @ output     = $(job_name).$(jobid)
@@ -22,5 +22,5 @@
 #-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
 #-Q- sx8brodie # @ notification = error
-#-Q- sx8brodie # @ environment  = COPY_ALL
+#-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_SRF
 #-Q- sx8brodie # @ queue
 #-Q- sx8mercure #!/bin/ksh
@@ -187,5 +187,5 @@
 		# Initialize ${flag_post}_${compname}_${post_freq}
 		#
-		eval ${flag_post}_${compname}_SeasonalFrequency=true
+		eval export ${flag_post}_${compname}_SeasonalFrequency=true
 	    fi
 	    let $(( i=i+3 ))
@@ -193,5 +193,5 @@
     fi
 
-    for element in $( set | grep Post_ | grep ${compname}_SeasonalFrequency | grep -i "=true" ) ; do
+    for element in $( env | grep Post_ | grep ${compname}_SeasonalFrequency | grep -i "=true" ) ; do
         #
 	FILE=$( echo ${element} | awk -F "_${compname}" '{print $1}' | awk "-FPost_" '{print $2}' )
@@ -205,5 +205,6 @@
 	TestedFile=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${FILE}.nc
 	#
-	if [ ! -f ${DIRECTORY}/${TestedFile} ] ; then
+	IGCM_sys_TestFileArchive ${DIRECTORY}/${TestedFile}
+	if [ ! $? = 0 ] ; then
 	    eval set +A LISTE_FILE_${comp} \$\{LISTE_FILE_${comp}[*]} ${FILE}
 	    eval set +A LISTE_PATCHES_${FILE} \$\{${compname}_Post_${FILE}_Patches[*]}
@@ -242,5 +243,6 @@
 	RESULT_SE=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${file}.nc
 	# Do not redoo an existing SE
-	if [ -f ${R_SAVE}/${comp}/Analyse/SE/${RESULT_SE} ] ; then
+	IGCM_sys_TestFileArchive ${R_SAVE}/${comp}/Analyse/SE/${RESULT_SE}
+	if [ $? = 0 ] ; then
 	    continue
 	fi
@@ -253,6 +255,8 @@
 	  (( an = an_deb ))
           # Initialize array
-	  set -A liste_file_se
-	  set -A liste_file_se_tmp
+	  #set -A liste_file_se
+	  #set -A liste_file_se_tmp
+	  unset liste_file_se
+	  unset liste_file_se_tmp
 	  while [ ${an} -le ${an_fin} ] ; do
 	      moisL=$( IGCM_date_DaysInMonth ${an} ${mois} )
@@ -263,6 +267,8 @@
 	      afin=$( IGCM_date_AddDaysToGregorianDate ${an4}0101 $(( diy - 1 )) )
 	      date=${an4}0101_${afin}
-	      set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
-	      set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc
+	      #set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
+	      #set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc
+	      liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
+	      liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_${date}_${file}.nc
 	      (( an = an + 1 ))
 	  done
@@ -302,6 +308,8 @@
 	      (( an = an_deb ))
 	      # Initialize array
-	      set -A liste_file_se
-	      set -A liste_file_se_tmp
+	      #set -A liste_file_se
+	      #set -A liste_file_se_tmp
+	      unset liste_file_se
+	      unset liste_file_se_tmp
 	      while [ ${an} -le ${an_fin} ] ; do
 		  moisL=$( IGCM_date_DaysInMonth ${an} ${mois} )
@@ -310,6 +318,9 @@
 	          #
 		  date=${an4}${mois}01_${an4}${mois}${moisL}
-		  set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
-		  set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc
+		  #set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
+		  #set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc
+		  liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
+		  liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_${date}_${file}.nc
+
 		  (( an = an + 1 ))
 	      done
@@ -343,6 +354,8 @@
 	      (( an = an_deb ))
 	      # Initialize array
-	      set -A liste_file_se
-	      set -A liste_file_se_tmp
+	      #set -A liste_file_se
+	      #set -A liste_file_se_tmp
+	      unset liste_file_se
+	      unset liste_file_se_tmp
 	      while [ ${an} -le ${an_fin} ] ; do
 		  moisL=$( IGCM_date_DaysInMonth ${an} ${mois} )
@@ -361,6 +374,8 @@
 		      day_end=$( IGCM_date_AddDaysToGregorianDate ${day_beg} ${length_d} )
 		      date=${an4}${mois}${day_beg}_${an4}${mois}${day_end}
-		      set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
-		      set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc
+		      #set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
+		      #set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc
+		      liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_${date}_${file}.nc
+		      liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_${date}_${file}.nc
 		      (( day = day + 1 ))
 		  done
