Index: /LMDZ.3.3/branches/rel-LF/create_make_gcm
===================================================================
--- /LMDZ.3.3/branches/rel-LF/create_make_gcm	(revision 486)
+++ /LMDZ.3.3/branches/rel-LF/create_make_gcm	(revision 487)
@@ -14,4 +14,8 @@
   XNEC=1
 fi
+X6NEC=0
+if [ "$machine" = "mercure" ] ; then
+  X6NEC=1
+fi
 VPP=0
 if [ "$machine" = "nymphea0" ] ; then
@@ -51,5 +55,5 @@
 echo '# Les differentes librairies pour l"edition des liens:'
 echo
-if [ "$XNEC" = '1' ] ; then
+if ( [ "$XNEC" = '1' ] || [ "$X6NEC" = '1' ] ) ; then
   echo 'dyn3d      = $(LIBO)/libsxdyn3d.a $(LIBO)/libsx$(FILTRE).a'
   echo 'dyn2d      = $(LIBO)/libsxdyn2d.a'
@@ -170,4 +174,5 @@
          F90=0 ; egrep -i '^ *use ' $trufile > /dev/null 2>&1 && F90=1
                  egrep -i '^ *module ' $trufile > /dev/null 2>&1 && F90=1
+                 egrep -i '#include*.inc ' $trufile > /dev/null 2>&1 && F90=1
          str1='$(LIBO)/lib'$diri'.a('$fili'.o) : $(LIBF)/'$diri/$trufile
          [ "$fili" = "chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F
@@ -213,5 +218,5 @@
             fi
 	 fi
-         if [ "$XNEC" -eq '1' ] ; then
+	 if ( [ "$XNEC" -eq '1' ] || [ "$X6NEC" = '1' ] ) ; then
            echo '	sxar r $(LIBO)/libsx'$diri'.a '$fili'.o ; \'
          fi
Index: /LMDZ.3.3/branches/rel-LF/makegcm
===================================================================
--- /LMDZ.3.3/branches/rel-LF/makegcm	(revision 486)
+++ /LMDZ.3.3/branches/rel-LF/makegcm	(revision 487)
@@ -23,9 +23,8 @@
 
 ###### VERSION LMDZ.3.3
-set LMDGCM="`pwd`"
+##set LMDGCM="`pwd`"
 #
 
 setenv localdir "`pwd`"
-  setenv LIBOGCM "`pwd`/lib"
 set MODIPSL=0
 echo $localdir | grep modipsl >& /dev/null
@@ -47,4 +46,7 @@
       set NCDFINC=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"`
       set NCDFLIB=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'`
+    else if ( `hostname` == mercure ) then
+      set NCDFINC=`grep sx6nec ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"`
+      set NCDFLIB=`grep sx6nec ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'`
     else
       echo 'Probleme de definition des variables NCDFINC et NCDFLIB'
@@ -94,4 +96,5 @@
 set NEC=0
 set XNEC=0
+set X6NEC=0
 if ( `uname` == HP-UX ) then
    set machine=HP
@@ -109,5 +112,5 @@
    set machine=ALPHA
    set DEC=1
-else if ( `uname` == Linux ) then
+else if ( `uname` == Linux && `hostname` != mercure ) then
    set machine=LINUX
    set LINUX=1
@@ -121,4 +124,7 @@
    set machine=XNEC
    set XNEC=1
+else if ( `hostname` == mercure) then
+   set machine=X6NEC
+   set X6NEC=1
 else
    echo Vous travaillez sur une machine non prevue par le reglement
@@ -213,4 +219,11 @@
    set optimbis=" "
    set mod_suffix="mod"
+else if $X6NEC then
+   set optdbl='-dw -Wf\"-A dbl4\"'  
+   set optim90=' -clear -float0 -size_t64 -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume "'
+   set optimtru90=' -clear -f4 -float0 -size_t64 -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R2 -R3 -R4 -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume"'
+   set optim="$optim90"
+   set optimbis=" "
+   set mod_suffix="mod"
 else
    set optim=""
@@ -464,5 +477,5 @@
     set nomlib=F90_${dim_}_t${ntrac}
 endif
-if ( $NEC || $XNEC ) then
+if ( $NEC || $XNEC || $X6NEC) then
     set nomlib=F90_${dim_}_t${ntrac}
 endif
@@ -684,4 +697,21 @@
    endif
    set mod_loc_dir="./"
+else if $X6NEC then
+   set f77=sxmpif90
+   set f90=sxmpif90
+   if $MODIPSL then
+     set opt_link="-L$MODIPSLDIR"
+     if ($veget == true) then
+       set opt_link="$opt_link -lsxsechiba -lsxparameters -lsxstomate"
+     endif
+     if ($couple == true) then
+       set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 -size_t64 $optdbl -P static $NCDFLIB "
+     else
+       set opt_link="$opt_link -lsxioipsl -float0 -size_t64 $optdbl -P static $NCDFLIB "
+     endif
+   else
+     set opt_link=" -float0 -size_t64 $optdbl -P static -L$MODIPSLDIR -lsxsechiba -lsxparameters -lsxstomate -lsxioipsl $NCDFLIB "
+   endif
+   set mod_loc_dir="./"
 else
    set f77=f77
@@ -700,4 +730,6 @@
 set make="make -k RANLIB=ranlib"
 else if $XNEC then
+set make="gmake RANLIB=ls"
+else if $X6NEC then
 set make="gmake RANLIB=ls"
 else
@@ -758,4 +790,7 @@
  set optim90=" $optim90 -I$libo "
  set optimtru90=" $optimtru90 -I$libo "
+else if $X6NEC then
+ set optim90=" $optim90 -I$libo "
+ set optimtru90=" $optimtru90 -I$libo "
 else if $LINUX then
  set optim90=" $optim90 -module $libo "
@@ -774,4 +809,7 @@
   set link="$f90 "
 #  set ar=sxar
+else if $X6NEC then
+  set link="sxld $opt_link"
+  set link="$f90 "
 endif
 
