Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_ifort
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_ifort	(revision 77)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_ifort	(revision 78)
@@ -179,8 +179,12 @@
 else if $DEC then
 else if $LINUX then
-## Ehouarn & Aymeric: ifort options 
-   set optim90=" -O2 -static -zero -align commons" #-ffree-line-length-huge"
-   set optimtru90=" -O2 -static -zero -align commons" #-ffree-line-length-huge"
-   set opt_link=" -L$NCDFLIB -lnetcdf"
+# Ehouarn 'ifort' compiler
+   #NB: on gnome -O3 ==> NaNs ...
+   set optim=" -O2 -ip -mkl=sequential -align common "
+   set optim90=" -O2 -ip -mkl=sequential -align common "
+   set optimtru90=" -O2 -ip -mkl=sequential -align common "
+#   set opt_link=" -Mfree -lpgf90 -lpgftnrtl -lpghpf -lpghpf2 -L$NCDFLIB -lnetcdf -Bstatic "
+   set mod_loc_dir=$LIBOGCM
+   set mod_suffix=mod
 else if $NEC then
    set optim90=' -clear -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "'
@@ -209,5 +213,6 @@
 endif
 
-set nomlib=$machine
+# Ehouarn: add 'g9fortran' string to pathname
+set nomlib=${machine}
 
 # Impose distinct name for 64 bit Linux machines (to avoid mixing 32 and 64)
@@ -332,5 +337,5 @@
                         
     case -O:
-        set optim90="$2" ; shift ; shift ; goto top
+        set optim="$2" ; set optim90="$2" ; set optimtru90="$2" ; shift ; shift ; goto top
 
      case -p
@@ -368,5 +373,8 @@
            set optim90="$optim90"" -G1 "
         else if $LINUX then
-           set optim90="-g -Mbounds "
+           ## for ifort
+             set optim=" -g -no-ftz -traceback -ftrapuv -fp-stack-check "
+             set optim90=" -g -no-ftz -traceback -ftrapuv -fp-stack-check "
+             set optimtru90=" -g -no-ftz -traceback -ftrapuv -fp-stack-check "
         else 
            echo "pas d option debug predefinie pour cette machine"
@@ -502,5 +510,5 @@
 #  if ( $< == "oui" ) then
 #    #remove old dimensions.h file
-#    \rm $libf/grid/dimensions.h
+#    \rm -f $libf/grid/dimensions.h
 #  else
 #    exit
@@ -511,5 +519,5 @@
 # Build the appropriate 'dimensions.h' file
 cd dimension
-makdim $ntrac $dim
+./makdim $ntrac $dim
 # echo contents of dimensions.h to standard output
 cat $libf/grid/dimensions.h
@@ -641,6 +649,7 @@
    set f90=f90
 else if $LINUX then
-   set f77=pgf90
-   set f90=pgf90
+   set f77=ifort
+   set f90=ifort
+   set opt_link=" -L$LIBOGCM -L$NCDFLIB -lnetcdf "
 else if $SUN then
    set f77=f90
@@ -702,15 +711,15 @@
 # l'optimisation de startvar se passe mal
 #
-if ($code == 'create_etat0' && $VPP) then
-   if ( ! -f $libo/libdyn3d.a ) then
-     echo "Priere de compiler gcm en premier pour des raisons d'optimisation"
-     \rm $libf/grid/dimensions.h                                             
-     exit                       
-   endif
-   set optim90="$optim90"" -X9 -w"
-   set opt_link="-L$NCDFLIB -lnetcdf"
-   touch $LMDGCM/libf/dyn3d/startvar.F
-   touch $LMDGCM/libf/dyn3d/etat0_netcdf.F
-endif
+#if ($code == 'create_etat0' && $VPP) then
+#   if ( ! -f $libo/libdyn3d.a ) then
+#     echo "Priere de compiler gcm en premier pour des raisons d'optimisation"
+#     \rm $libf/grid/dimensions.h                                             
+#     exit                       
+#   endif
+#   set optim90="$optim90"" -X9 -w"
+#   set opt_link="-L$NCDFLIB -lnetcdf"
+#   touch $LMDGCM/libf/dyn3d/startvar.F
+#   touch $LMDGCM/libf/dyn3d/etat0_netcdf.F
+#endif
 
 #
@@ -736,6 +745,8 @@
  set optimtru90=" $optimtru90 -I$libo "
 else if $LINUX then
- set optim90="$optim90 -module $libo"
- set optimtru90="$optimtru90 -module $libo"
+# Ehouarn : adapt to gfortran
+ set optim="$optim -I${libo}"
+ set optim90="$optim90 -I${libo}"
+ set optimtru90="$optimtru90 -ffree-form -I${libo}"
 # Ehouarn: remove set mod_loc_dir def below; mod_loc_dir=$localdir (set above)
 # set mod_loc_dir=$libo
@@ -757,4 +768,5 @@
 echo $make -f $LMDGCM/makefile \
 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
+OPTIM="$optim" \
 OPTIM90="$optim90" \
 OPTIMTRU90="$optimtru90" \
@@ -781,4 +793,5 @@
 $make -f $LMDGCM/makefile \
 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
+OPTIM="$optim" \
 OPTIM90="$optim90" \
 OPTIMTRU90="$optimtru90" \
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_mpifort
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_mpifort	(revision 77)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_mpifort	(revision 78)
@@ -73,11 +73,4 @@
     exit
   endif
- ### Aymeric: that could be useless, but user might 
- ### want to test various mpi at various locations on the disk
- if ( ! $?WHERE_MPI ) then
-   echo You must initialize the variable WHERE_MPI in your environnement
-   echo for instance: "setenv WHERE_MPI /home/install_mpi/bin" in .cshrc
-   exit
- endif
 endif
 set model=$LMDGCM
@@ -186,8 +179,12 @@
 else if $DEC then
 else if $LINUX then
-## Ehouarn & Aymeric: ifort options 
-   set optim90=" -O2 -static -zero -align commons" #-ffree-line-length-huge"
-   set optimtru90=" -O2 -static -zero -align commons" #-ffree-line-length-huge"
-   set opt_link=" -L$NCDFLIB -lnetcdf"
+# Ehouarn 'ifort' compiler
+   #NB: on gnome -O3 ==> NaNs ...
+   set optim=" -O2 -ip -mkl=sequential -align common "
+   set optim90=" -O2 -ip -mkl=sequential -align common "
+   set optimtru90=" -O2 -ip -mkl=sequential -align common "
+#   set opt_link=" -Mfree -lpgf90 -lpgftnrtl -lpghpf -lpghpf2 -L$NCDFLIB -lnetcdf -Bstatic "
+   set mod_loc_dir=$LIBOGCM
+   set mod_suffix=mod
 else if $NEC then
    set optim90=' -clear -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "'
@@ -216,5 +213,6 @@
 endif
 
-set nomlib=$machine
+# Ehouarn: add 'g9fortran' string to pathname
+set nomlib=${machine}
 
 # Impose distinct name for 64 bit Linux machines (to avoid mixing 32 and 64)
@@ -339,5 +337,5 @@
                         
     case -O:
-        set optim90="$2" ; shift ; shift ; goto top
+        set optim="$2" ; set optim90="$2" ; set optimtru90="$2" ; shift ; shift ; goto top
 
      case -p
@@ -375,5 +373,8 @@
            set optim90="$optim90"" -G1 "
         else if $LINUX then
-           set optim90="-g -Mbounds "
+           ## for ifort
+             set optim=" -g -no-ftz -traceback -ftrapuv -fp-stack-check "
+             set optim90=" -g -no-ftz -traceback -ftrapuv -fp-stack-check "
+             set optimtru90=" -g -no-ftz -traceback -ftrapuv -fp-stack-check "
         else 
            echo "pas d option debug predefinie pour cette machine"
@@ -509,5 +510,5 @@
 #  if ( $< == "oui" ) then
 #    #remove old dimensions.h file
-#    \rm $libf/grid/dimensions.h
+#    \rm -f $libf/grid/dimensions.h
 #  else
 #    exit
@@ -518,5 +519,5 @@
 # Build the appropriate 'dimensions.h' file
 cd dimension
-makdim $ntrac $dim
+./makdim $ntrac $dim
 # echo contents of dimensions.h to standard output
 cat $libf/grid/dimensions.h
@@ -648,8 +649,7 @@
    set f90=f90
 else if $LINUX then
-   #set f77=pgf90
-   #set f90=pgf90 Aymeric
-   set f77=$WHERE_MPI/mpif90
-   set f90=$WHERE_MPI/mpif90
+   set f77=$WHERE_MPI/mpif90  #ifort
+   set f90=$WHERE_MPI/mpif90  #ifort
+   set opt_link=" -L$LIBOGCM -L$NCDFLIB -lnetcdf "
 else if $SUN then
    set f77=f90
@@ -711,15 +711,15 @@
 # l'optimisation de startvar se passe mal
 #
-if ($code == 'create_etat0' && $VPP) then
-   if ( ! -f $libo/libdyn3d.a ) then
-     echo "Priere de compiler gcm en premier pour des raisons d'optimisation"
-     \rm $libf/grid/dimensions.h                                             
-     exit                       
-   endif
-   set optim90="$optim90"" -X9 -w"
-   set opt_link="-L$NCDFLIB -lnetcdf"
-   touch $LMDGCM/libf/dyn3d/startvar.F
-   touch $LMDGCM/libf/dyn3d/etat0_netcdf.F
-endif
+#if ($code == 'create_etat0' && $VPP) then
+#   if ( ! -f $libo/libdyn3d.a ) then
+#     echo "Priere de compiler gcm en premier pour des raisons d'optimisation"
+#     \rm $libf/grid/dimensions.h                                             
+#     exit                       
+#   endif
+#   set optim90="$optim90"" -X9 -w"
+#   set opt_link="-L$NCDFLIB -lnetcdf"
+#   touch $LMDGCM/libf/dyn3d/startvar.F
+#   touch $LMDGCM/libf/dyn3d/etat0_netcdf.F
+#endif
 
 #
@@ -745,6 +745,8 @@
  set optimtru90=" $optimtru90 -I$libo "
 else if $LINUX then
- set optim90="$optim90 -module $libo"
- set optimtru90="$optimtru90 -module $libo"
+# Ehouarn : adapt to gfortran
+ set optim="$optim -I${libo}"
+ set optim90="$optim90 -I${libo}"
+ set optimtru90="$optimtru90 -ffree-form -I${libo}"
 # Ehouarn: remove set mod_loc_dir def below; mod_loc_dir=$localdir (set above)
 # set mod_loc_dir=$libo
@@ -766,4 +768,5 @@
 echo $make -f $LMDGCM/makefile \
 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
+OPTIM="$optim" \
 OPTIM90="$optim90" \
 OPTIMTRU90="$optimtru90" \
@@ -790,4 +793,5 @@
 $make -f $LMDGCM/makefile \
 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
+OPTIM="$optim" \
 OPTIM90="$optim90" \
 OPTIMTRU90="$optimtru90" \
