Index: trunk/MESOSCALE/LMD_MM_MARS/makemeso
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/makemeso	(revision 1590)
+++ trunk/MESOSCALE/LMD_MM_MARS/makemeso	(revision 1597)
@@ -73,4 +73,5 @@
 #
 # makemeso -p mars_lmd_new   ## choose physics
+#             venus_lmd_new
 #
 # makemeso -f                ## fresh start [clean -a]
@@ -130,5 +131,5 @@
   esac
   # number of processors
-  if [[ "${phys}" == *"new"* ]] #|| [[ "${phys}" == "nophys_" ]]
+  if [[ "${phys}" == *"new"* ]]
   then
    numproc=999
@@ -145,5 +146,5 @@
   then	  
   # ngrid: now dynamically set in newphys 03/2014
-   if [[ "${phys}" == *"new"* ]]
+   if [[ "${phys}" == *"new"* ]] 
    then
       lon=999
@@ -200,5 +201,5 @@
          #else
             # tracers: now dynamically set in newphys 09/2013
-            if [[ "${phys}" == *"new"* ]]
+            if [[ "${phys}" == *"new"* ]] 
             then
               tra=999
@@ -223,17 +224,6 @@
   then
     echo new folder ... link sources
-    #if [[ "${phys}" == *"new"*  ]]
-    #then
-    # \rm copy_model_tmp > /dev/null 2> /dev/null
-    #    sed s+"mars_lmd"+"mars_lmd_new"+g             SRC/SCRIPTS/copy_model > copy_model_tmp
-    #    if [[ "${config}" == "les" ]] 
-    #    then
-    #     sed s+"PWD/SRC/"+"PWD/SRC/LES/"+g copy_model_tmp > yeah
-    #     mv yeah copy_model_tmp
-    #    fi
-    #chmod 755 copy_model_tmp
-    #./copy_model_tmp
-    #\rm copy_model_tmp
     ###############################################
+     echo ${phys}
      ./SRC/SCRIPTS/copy_model -p ${phys} -c ${config}
      mv zeWRFV2 ${conf_wrf}/WRFV2
@@ -242,5 +232,4 @@
      then
       cd ${conf_wrf}/WRFV2
-      #ln -sf mars_lmd_new mars_lmd 
         if [[ "${config}" != "les" ]]
         then
@@ -253,27 +242,5 @@
       cd ..
 
-     ## remove files adapted to parallel GCM and useless for mesoscale
-     #cd mars_lmd
-     #cd libf/phymars
-     #\rm tabfi* soil_settings* phyetat0* phyredem* iostart* writediagfi* mkstat* writediagsoil* eofdump* wstats* inistats* mod_*
-     #\rm iniphysiq* init_phys_lmdz* comgeomphy* planetwide_mod*
-     #mv ../dyn3d/control_mod.F90 .
-     #cd ../..
-     #cd ..
-
      else
-    #    if [[ "${config}" == "les" ]] 
-    #    then
-    #      #### NB: With physics: LES folder // Without physics : LESnophys_ folder
-    #      #### ---- because differences in 'modif' folder ----
-    #      #sed s+"PWD/SRC/"+"PWD/SRC/LES$phys/"+g SRC/SCRIPTS/copy_model > copy_model_tmp
-    #      sed s+"PWD/SRC/"+"PWD/SRC/LES/"+g SRC/SCRIPTS/copy_model > copy_model_tmp
-    #    else
-    #      cp SRC/SCRIPTS/copy_model copy_model_tmp
-    #    fi   
-    #chmod 755 copy_model_tmp
-    #./copy_model_tmp
-    #\rm copy_model_tmp
-    #mv zeWRFV2 ${conf_wrf}/WRFV2
       cd ${conf_wrf}/WRFV2
       cd Registry ; ./Registry.bash ; cd .. 
@@ -283,11 +250,4 @@
           if [[ "${config}" == "les" ]]
           then 
-            #if [[ "${phys}" == "nophys_" ]]
-            #then
-            #  ## voir ci-dessus pour le folder
-            #  cp ../../SRC/LES$phys/correcfft ./
-            #else
-            #  cp ../../SRC/LES/correcfft ./
-            #fi  
             cp ../../SRC/LES/correcfft ./
             ./correcfft
@@ -427,10 +387,14 @@
                        \rm conf > /dev/null 2> /dev/null ; touch conf ; echo 7 >> conf ; echo 1 >> conf
                        \rm configure.wrf > /dev/null 2> /dev/null ; ./configure < conf > /dev/null 2> /dev/null
-                       sed s+"-lnetcdf"+"-lnetcdf -L../$phys/libo -llmd"+g   configure.wrf > yeah ; mv -f yeah configure.wrf
+                       if [[ "${phys}" != *"void"* ]]
+                       then
+                         sed s+"-lnetcdf"+"-lnetcdf -L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g   configure.wrf > yeah ; mv -f yeah configure.wrf
+                       else
+                         sed s+"-lnetcdf"+"-lnetcdf $NETCDF/lib/libnetcdf.a"+g   configure.wrf > yeah ; mv -f yeah configure.wrf
+                       fi
                        sed s+"mpif90"+"$WHERE_MPI/mpif90"+g                 configure.wrf > yeah ; mv -f yeah configure.wrf
                        sed s+"mpicc"+"$WHERE_MPI/mpicc -DMPI2_SUPPORT"+g    configure.wrf > yeah ; mv -f yeah configure.wrf
                        sed s+"-fastsse"+" "+g                               configure.wrf > yeah ; mv -f yeah configure.wrf
-                       sed s+"O3"+"O3 -mcmodel=large -shared-intel"+g configure.wrf > yeah ; mv -f yeah configure.wrf 
-                       sed s+"-llmd"+"-llmd $NETCDF/lib/libnetcdf.a"+g     configure.wrf > yeah ; mv -f yeah configure.wrf
+                       sed s+"O3"+"O3 -mcmodel=large -shared-intel"+g configure.wrf > yeah ; mv -f yeah configure.wrf
                        #sed s+"-lnetcdf -lnetcdff"+"-lnetcdf -lnetcdff -L../mars_lmd/libo -llmd"+g     configure.wrf > yeah ; mv -f yeah configure.wrf
                        if [ ${debug} -ne 0 ]   # not working for xlf!
@@ -617,4 +581,14 @@
   ################
 
+  if [[ "${phys}" == *"venus"* ]]
+  then
+    sed s+"LIB_BUNDLED     = "+"LIB_BUNDLED     =    /usr/lib64/liblapack.so  \ "+g configure.wrf > yeah ; mv -f yeah configure.wrf
+    #sed s+"RWORDSIZE       =       "+"RWORDSIZE       =       8 # "+g configure.wrf > yeah ; mv -f yeah configure.wrf
+    #sed s+"-DLWORDSIZE=4 "+"-DLWORDSIZE=8 "+g configure.wrf > yeah ; mv -f yeah configure.wrf
+    #sed s+"-DIWORDSIZE=4 "+"-DIWORDSIZE=8 "+g configure.wrf > yeah ; mv -f yeah configure.wrf
+    #sed s+"FCBASEOPTS      ="+"FCBASEOPTS      = -r8 "+g configure.wrf > yeah ; mv -f yeah configure.wrf
+    #sed s+"-fp-model precise "+"-fpconstant -fp-model precise "+g configure.wrf > yeah ; mv -f yeah configure.wrf
+  fi
+
   if [ ${debug} -ne 0 ]   # not working for xlf!
   then
@@ -626,9 +600,14 @@
   fi
 
+  #if [[ "${phys}" == *"prescribed"* ]]
+  #then
+  #   donotcompilephys=1
+  #fi   
+
 #exit
 ##################################################
 # compile physics
 ##################################################
-if [ ${donotcompilephys} -eq 0 ]
+if [ ${donotcompilephys} -eq 0 ] #|| [[ "${phys}" != *"prescribed"* ]]
 then
 
@@ -688,5 +667,11 @@
   # generate the appropriate dimphys
   #---------------------------------
-  cd libf/phymars
+  if [[ "${phys}" == *"mars"* ]]
+  then
+    cd libf/phymars
+  elif [[ "${phys}" == *"venus"* ]]
+  then 
+    cd libf/phyvenus
+  fi
   \rm dimphys.h 2> /dev/null
 #  if [[ "${phys}" == "newphys_" ]]
@@ -727,10 +712,23 @@
   echo $PWD/libo/log_compile_phys
 
-  if [ ${debug} -ne 0 ]
-  then
-    echo 'DEBUG DEBUG DEBUG DEBUG'
-    nohup makegcm_${compilo} -debug -t ${tra} -p mars -d ${physz} testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys 
+  if [ ${debug} -ne 0 ]  
+  then
+    if [[ "${phys}" == *"mars"* ]]
+    then
+      echo 'DEBUG DEBUG DEBUG DEBUG'
+      nohup makegcm_${compilo} debug -t ${tra} -p mars -d ${physz} testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
+    elif [[ "${phys}" == *"venus"* ]]
+    then 
+      echo 'DEBUG DEBUG DEBUG DEBUG'
+      nohup makelmdz -debug -full -p venus -d 181 rcm1d -arch linux-ifort -cpp MESOSCALE | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
+    fi
   else
-    nohup makegcm_${compilo} -t ${tra} -p mars -d ${physz} testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
+  if [[ "${phys}" == *"mars"* ]]
+    then
+      nohup makegcm_${compilo} -t ${tra} -p mars -d ${physz} testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
+    elif [[ "${phys}" == *"venus"* ]]
+    then
+      nohup makelmdz -full -p venus -d 51 rcm1d -arch linux-ifort -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
+    fi
   fi
   echo ... done
@@ -744,10 +742,21 @@
   cd libo
   mkdir temp
-  #cp -f LINUXfastI._${physz}_t${tra}_reg/*.a temp
-  cp -f LINUX*/*.a temp/
+    if [[ "${phys}" == *"venus"* ]]
+  then 
+    cp -f linux*/*.a temp/
+  else 
+    cp -f LINUX*/*.a temp/
+  fi
   cd temp
-  ar x libbibio.a
-  ar x libphymars.a
-  ar x libaeronomars.a
+  if [[ "${phys}" == *"mars"* ]]
+   then   
+   ar x libbibio.a
+   ar x libphymars.a
+   ar x libaeronomars.a
+  else 
+   ar x libphyvenus.a
+   ar x libmisc.a
+   ar x libphy_common.a
+  fi
   \rm *.a
   ar r liblmd.a *
@@ -760,7 +769,14 @@
   if [[ "${phys}" == *"new"* ]]
   then
-    # include modules for interfacing
-    mv *.mod ../inc/
-  fi
+    if [[ "${phys}" == *"mars"* ]]
+    then
+      # include modules for interfacing
+      mv  *.mod ../inc/
+    else # [[ "${phys}" == *"venus"* ]]
+      mv  ./libo/linux*/*.mod ../inc/
+      
+    fi
+  fi
+
 
   # save a copy 
