Index: /trunk/libIGCM/ins_job
===================================================================
--- /trunk/libIGCM/ins_job	(revision 1599)
+++ /trunk/libIGCM/ins_job	(revision 1600)
@@ -463,6 +463,8 @@
     echo "No config.card available in current directory"
     echo ""
+    conf_card=no
     continue 
   fi 
+  conf_card=yes
 
 
@@ -702,48 +704,58 @@
   
 fi
+
 #
 # Install a light copy of C-ESM-EP in SUBMIT_DIR/Cesmep and create a
 # C-ESM-EP launch script there.
 #
-[ ${new_struct?} == yes ] && prefix="$JobName/"  
-IGCM_card_DefineVariableFromOption ${prefix}config.card Post Cesmep
-if ( [ X${config_Post_Cesmep} = X${NULL_STR} ] || [ X${config_Post_Cesmep} = XNONE ] || \
-	 [ X${config_Post_Cesmep} = X ] ) ; then
-    config_Post_Cesmep=FALSE
+# Only do this if we are in a folder containing a config.card (conf_card=yes)
+if [ ${conf_card} == yes ] ; then
+
+    [[ ${new_struct} == yes ]] && prefix="$JobName/"  
+
+    IGCM_card_DefineVariableFromOption ${prefix}config.card Post Cesmep
+    
+    if ( [ X${config_Post_Cesmep} = X${NULL_STR} ] || [ X${config_Post_Cesmep} = XNONE ] || \
+	[ X${config_Post_Cesmep} = X ] ) ; then
+	config_Post_Cesmep=FALSE
+    fi
+    if [ ${config_Post_Cesmep} != FALSE ]; then
+	IGCM_config_CommonConfiguration ${prefix}config.card
+	if [ x"${config_Post_CesmepMail}" == x"TRUE" ] || [ x"${config_Post_CesmepMail}" == x"True" ] ; then
+	    # Compute mail adress - inspired by libIGCM_post.ksh - should be turned in a function 
+	    if [ ! -z ${config_UserChoices_MailName} ] ; then
+		MailAdress=${config_UserChoices_MailName}
+	    elif [ -f ~/.forward ] ; then
+		MailAdress=$( cat ~/.forward )
+	    else
+		MailAdress=${USER}
+	    fi
+	else
+	    MailAdress=None
+	fi
+	#
+	components=","
+	for comp in ${config_ListOfComponents[*]} ; do
+	    components=${components}${comp}, ;
+	done
+	if ( [ X"${SYSTEM}" == X"irene" ]    || [ X"${SYSTEM}" == X"irene-amd" ] || \
+	    [ X"${SYSTEM}" == X"mesoipsl" ] || [ X"${SYSTEM}" == X"jeanzay" ] ) ; then
+	    IGCM_card_DefineVariableFromOption ${prefix}config.card UserChoices DateBegin
+	    ${config_Post_CesmepCode}/libIGCM_install.sh $(pwd)/${prefix} \
+		${config_Post_CesmepComparison} $JobName ${R_SAVE} "${ProjectID}" \
+		${MailAdress} ${config_UserChoices_DateBegin//-/} \
+		${config_Post_Cesmep} ${CesmepPeriod} ${config_Post_CesmepSlices} \
+		$components $CENTER
+	    [ $? -ne 0 ] && echo -e "\nERROR : cannot configure C-ESM-EP run" && exit 5
+	else
+	    echo -e "\nERROR Cannot (yet) handle CESMEP atlas on this computer system (${SYSTEM})"
+	    echo "=> Variable Cesmep in config.card's section Post must be set to FALSE (rather than $config_Post_Cesmep)"
+	    exit 6
+	fi
+    fi
+    
 fi
-if [ ${config_Post_Cesmep} != FALSE ]; then
-    IGCM_config_CommonConfiguration ${prefix}config.card
-    if [ x"${config_Post_CesmepMail}" == x"TRUE" ] || [ x"${config_Post_CesmepMail}" == x"True" ] ; then
-	# Compute mail adress - inspired by libIGCM_post.ksh - should be turned in a function 
-	if [ ! -z ${config_UserChoices_MailName} ] ; then
-	    MailAdress=${config_UserChoices_MailName}
-	elif [ -f ~/.forward ] ; then
-	    MailAdress=$( cat ~/.forward )
-	else
-	    MailAdress=${USER}
-	fi
-    else
-	MailAdress=None
-    fi
-    #
-    components=","
-    for comp in ${config_ListOfComponents[*]} ; do
-	components=${components}${comp}, ;
-    done
-    if ( [ X"${SYSTEM}" == X"irene" ]    || [ X"${SYSTEM}" == X"irene-amd" ] || \
-	 [ X"${SYSTEM}" == X"mesoipsl" ] || [ X"${SYSTEM}" == X"jeanzay" ] ) ; then
-	IGCM_card_DefineVariableFromOption ${prefix}config.card UserChoices DateBegin
-	${config_Post_CesmepCode}/libIGCM_install.sh $(pwd)/${prefix} \
-		   ${config_Post_CesmepComparison} $JobName ${R_SAVE} "${ProjectID}" \
-		   ${MailAdress} ${config_UserChoices_DateBegin//-/} \
-		   ${config_Post_Cesmep} ${CesmepPeriod} ${config_Post_CesmepSlices} \
-		   $components $CENTER
-	[ $? -ne 0 ] && echo -e "\nERROR : cannot configure C-ESM-EP run" && exit 5
-    else
-	echo -e "\nERROR Cannot (yet) handle CESMEP atlas on this computer system (${SYSTEM})"
-	echo "=> Variable Cesmep in config.card's section Post must be set to FALSE (rather than $config_Post_Cesmep)"
-	exit 6
-    fi
-fi
+
+#
 #-
 [[ ${x_v} = 'verbose' ]] && print - "";
