Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_g95
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_g95	(revision 324)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_g95	(revision 330)
@@ -152,5 +152,5 @@
 #setenv localdir "LOCAL_DIR=`pwd`"
 #setenv localdir "`pwd`"
-cd $model
+d $model
 if $CRAY then
    set optim90="-Wp'-P' -DCRAY "'-p$(LIBO) -eiv '
@@ -180,7 +180,10 @@
 else if $LINUX then
 # Ehouarn 'g95' compiler
-# Aymeric : added option for NETCDF libraries
-   set optim90=" -DMESOSCALE -O2 -fno-second-underscore -fstatic -fzero -Wall "
-   set optimtru90=" -DMESOSCALE -O2 -fno-second-underscore -fstatic -fzero -Wall "
+   set optim="-O3 -fstatic -funroll-loops -fno-second-underscore -DMESOSCALE"
+   set optim90=" -O3 -fstatic -funroll-loops -fno-second-underscore -DMESOSCALE"
+   set optimtru90=" -O3 -fstatic -funroll-loops -fno-second-underscore -DMESOSCALE"
+## Aymeric : added option for NETCDF libraries
+#   set optim90=" -DMESOSCALE -O2 -fno-second-underscore -fstatic -fzero -Wall
+#   set optimtru90=" -DMESOSCALE -O2 -fno-second-underscore -fstatic -fzero -Wall
 #   set opt_link=" -Mfree -L/usr/local/pgi/linux86/lib -lpgf90 -lpgftnrtl -lpghpf -lpghpf2 -L$NCDFLIB -lnetcdf -Wl,-Bstatic "
 # Ehouarn: there is no /usr/local/pgi/linux86/lib, but it doesn't matter
@@ -339,5 +342,6 @@
                         
     case -O:
-        set optim90="$2" ; shift ; shift ; goto top
+#        set optim90="$2" ; shift ; shift ; goto top
+        set optim="$2" ; set optim90="$2" ; set optimtru90="$2" ; shift ; shift ; goto top
 
      case -p
@@ -375,10 +379,14 @@
            set optim90="$optim90"" -G1 "
         else if $LINUX then
-#           set optim90="-g -Mbounds "
-#           set optim90="-mcmodel=medium"
-#         Aymeric : thought I'd complete the g95 debugging 
-          set optim="$optim"" -g -fbounds-check -DMESOSCALE "
-          set optim90="$optim90"" -g -fbounds-check -DMESOSCALE "
-          set optimtru90="$optimtru90"" -g -fbounds-check -DMESOSCALE "
+##           set optim90="-g -Mbounds "
+##           set optim90="-mcmodel=medium"
+##         Aymeric : thought I'd complete the g95 debugging 
+#          set optim="$optim"" -g -fbounds-check -DMESOSCALE "
+#          set optim90="$optim90"" -g -fbounds-check -DMESOSCALE "
+#          set optimtru90="$optimtru90"" -g -fbounds-check -DMESOSCALE "
+           ## for g95
+           set optim="-g -Wall -ftrace=full -fbounds-check -DMESOSCALE"
+           set optim90="-g -Wall -ftrace=full -fbounds-check -DMESOSCALE"
+           set optimtru90="-g -Wall -ftrace=full -fbounds-check -DMESOSCALE"
         else 
            echo "pas d option debug predefinie pour cette machine"
@@ -523,5 +531,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
@@ -751,4 +759,5 @@
 else if $LINUX then
 # Ehouarn : adapt to g95
+ set optim="$optim -fmod=$libo"
  set optim90="$optim90 -fmod=$libo"
  set optimtru90="$optimtru90 -fmod=$libo"
@@ -772,4 +781,5 @@
 echo $make -f $LMDGCM/makefile \
 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
+OPTIM="$optim" \
 OPTIM90="$optim90" \
 OPTIMTRU90="$optimtru90" \
@@ -796,4 +806,5 @@
 $make -f $LMDGCM/makefile \
 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
+OPTIM="$optim" \
 OPTIM90="$optim90" \
 OPTIMTRU90="$optimtru90" \
@@ -817,3 +828,4 @@
 PROG=$code
 
+# cleanup, remove dimensions.h
 \rm $libf/grid/dimensions.h
