source: trunk/MESOSCALE/LMD_MM_MARS/makemeso @ 2276

Last change on this file since 2276 was 2268, checked in by aslmd, 5 years ago

MESOSCALE. option -d of makemeso was incomplete. now working to simply create the compilation folder without compiling anything

  • Property svn:executable set to *
File size: 41.1 KB
RevLine 
[11]1#! /bin/bash
2
3
4##################################
5# makemeso allows you to compile #
6# WRF with modified LMD physics  #
7##################################
8
9##############################
10# Author: A. Spiga           #
11# New version : October 2008 #
12# Last update : January 2009 #
13#               November  09 #
[29]14#               January   11 #
[11]15##############################
16
[68]17###############################
18#### Type makemeso -h for help
19###############################
[11]20
[2058]21###path to compiled version of ioipsl on your system for generic physics
22pathioipsl='/home/leconte/script/ioipsl/modipsl/lib'
[11]23
24##############################################################################################
25##############################################################################################
26##############################################################################################
27##############################################################################################
28
29donotcompile=0
30donotallow=0
[1588]31config='real'
[11]32donotcompilephys=0
33justphys=0
34debug=0
[54]35fresh_start=0
[1588]36phys="mars_lmd"
[118]37scenario=""
[1038]38from_scratch=0
[1440]39
[1588]40while getopts "drc:njhgp:fs:xe" options; do
[11]41  case $options in
[2268]42   d ) donotcompile=1;donotcompilephys=1;justphys=1;;       ## just to check the compile folder
[118]43   r ) donotallow=1;;         ## allow only known config (useful with 'makemeso < last')
44   c ) config="${OPTARG}";;   ## idealized cases
45   n ) donotcompilephys=1;;   ## do not recompile physics
46   j ) justphys=1;;           ## just compile LMD physics
47   g ) debug=1;;              ## debug mode
[1588]48   p ) phys="${OPTARG}";;     ## choose physics
[118]49   f ) fresh_start=1;;        ## a fresh start
[1038]50   e ) from_scratch=1;;       ## a fresh start with a completely new folder
[1411]51   s ) scenario="${OPTARG}";; ## a specific scenario (with precompiling flags)
[1590]52   x ) donotcompile=1;phys="void_lmd_new";donotcompilephys=1;; ## a case with no LMD physics included
[11]53   h ) echo "
54# Use:   
55#
[142]56# makemeso                   ## basic use (real-case configuration)
[11]57#
58# makemeso -d                ## no compilation, just check the name of the compile folder
59#
[68]60# makemeso -c ideal          ## idealized mode (convective cell, mountain wave, etc...)
[142]61# makemeso -c les            ## large-eddy simulations mode based on WRFV3
[11]62#
[70]63# makemeso -n                ## do not recompile LMD physics (must have been compiled before)
[68]64#
[11]65# makemeso < last            ## basic use + skip questions [! script must have been executed at least once]
66# makemeso -r < last         ## basic use + skip questions + only known config
67# makemeso -nr < last        ## basic use + skip questions + only known config + no LMD phys recompile
68#
69# makemeso -j                ## just compile the LMD physics
70#
71# makemeso -g                ## debug mode
72#
73# makemeso -h                ## display options
[29]74#
[1588]75# makemeso -p mars_lmd_new   ## choose physics
[1597]76#             venus_lmd_new
[2014]77#             generic_lmd_new             
[54]78#
79# makemeso -f                ## fresh start [clean -a]
[118]80#
[1578]81# makemeso -e                ## a completely new recompile with erasing the WHOLE compiling folder
[1038]82#
[1411]83# makemeso -s DUSTSTORM      ## a specific scenario (with precompiling flags)
[156]84#
85# makemeso -x                ## a case with no LMD physics included
[11]86" ; exit ;;
87  esac
88done   
89
90#--------------
91# talk w/ user
92#--------------
93  echo '****************************************'
94  echo ' LMD Mesoscale Model Compiler. Welcome.'
95  echo '****************************************'
[1588]96  if [[ "${phys}" == *"new"* ]]
[29]97  then
[1588]98    echo '*********** PHYSICS: ' ${phys}
[29]99    echo '****************************************'
100  fi
[11]101  # computer
102  uname -a | grep x86_64 > /dev/null
103  if [[ "$?" == 0 ]]
104  then
105    machine='64'
106  else
107    machine='32'
108  fi
109  # compiler
110  echo "Supported compiler options are "
111  echo "       <1> pgf90"
112  echo "       <2> g95"
113  echo "       <3> pgf90 + mpi"
114  echo "       <4> ifort"
115  echo "       <5> ifort + mpi"
116  echo "       <7> xlf + mpi (IBM AIX)"
[1853]117  echo "       <8> gfortran"
[2115]118  echo "       <9> gfortran + openmpi"
[11]119  echo "Your choice ?" ; read reply
120  case ${reply} in
121    1) compilo='pgf' ; numproc=1 ;;
122    2) compilo='g95' ; numproc=1 ;;
123    3) compilo='mpi'
[1236]124       if [[ "${WHERE_MPI}" = "" ]]
[11]125       then
126         echo Please initialize the variable WHERE_MPI in your environnement
127         exit
[1236]128       fi ;;
[11]129    4) compilo='ifort' ; numproc=1 ;;
[1236]130    5) compilo='mpifort' ;;
131    7) compilo='mpixlf' ;;
[1853]132    8) compilo='gnu' ; numproc=1 ;;
[2115]133    9) compilo='openmpi';;
[11]134    *) echo not supported by this script ; exit ;;
135  esac
[1236]136  # number of processors
[1597]137  if [[ "${phys}" == *"new"* ]]
[1236]138  then
139   numproc=999
140  else
141   case ${reply} in
142    3) echo How many processors ? e.g. 1, 2, 4, 6, 8, 12, 16, 20, 24, 32, 64, 128 ; read numproc ;;
143    5) echo How many processors ? e.g. 1, 2, 4, 6, 8, 12, 16, 20, 24, 32, 64, 128 ; read numproc ;;
144    7) echo How many processors ? e.g. 1, 2, 4, 6, 8, 12, 16, 20, 24, 32, 64, 128 ; read numproc ;;
145   esac
146  fi
147
[11]148  # dimensions
149  if [ ${donotcompile} -eq 0 ]
150  then   
[1212]151  # ngrid: now dynamically set in newphys 03/2014
[1597]152   if [[ "${phys}" == *"new"* ]]
[1212]153   then
154      lon=999
155      lat=999
[1272]156      level=999
[1236]157   else
158      echo Grid points in longitude ? ; read lon
159      echo Grid points in latitude ? ; read lat
[1272]160      echo Number of vertical levels ? ; read level
[1212]161   fi
[11]162  fi
163  echo Number of domains ? ; read dom
164
165###PB lecture dom si < last
166
167    case ${dom} in
168       1) single='_single' ;;
169       *) single='_nest' ;;
170    esac
171      if [ "${compilo}" = "mpi" -o "${compilo}" = "mpifort" -o "${compilo}" = "mpixlf" ]
172      then
173           single=''
174      fi
175
176testflag=''
177####
178#testflag='_test'
179####
180
[1588]181    conf_wrf="${phys}_${config}${scenario}_${compilo}_${machine}${single}${testflag}"
[1234]182
183    if [ ${debug} -eq 1 ]
184    then
185     conf_wrf="debug_${conf_wrf}"
186    fi
187
[11]188    \rm what_folder 2> /dev/null
189    echo ${conf_wrf} > what_folder
[1590]190         if [ ${donotcompile} -eq 0 ]
[11]191         then
[1590]192            ##\rm what_folder 2> /dev/null
193            ##echo '**********************'
194            ##echo '*** Your folder is ...'
195            ##echo '**********************'
196            ##echo ${conf_wrf} | tee what_folder
197            ##cat what_folder
198            ##echo ${conf_wrf} > what_folder
199            ##echo ${reply} > what_compilo
200            ##echo ${numproc} > what_numproc
201            #if [[ "${phys}" != "nophys_" ]]
202            #then
203            #  exit
204            #fi
205         #else
[1212]206            # tracers: now dynamically set in newphys 09/2013
[1597]207            if [[ "${phys}" == *"new"* ]]
[1038]208            then
209              tra=999
210            else
[1236]211              echo Number of tracers ? ; read tra
[1038]212              if [ ${tra} -eq 0 ]
213              then
214                tra=1   
215              fi
[157]216            fi
[11]217         fi
[1038]218  # 'from scratch' case
219  if [ ${from_scratch} -eq 1 ]
220  then
221      echo "***** I ERASE THE FOLDER "${conf_wrf}
222      \rm -rf ${conf_wrf}
223  fi
[11]224  # folder
[1588]225
[11]226  mkdir ${conf_wrf} 2> /dev/null
227  if [[ "$?" == 0 ]]
228  then
229    echo new folder ... link sources
[1588]230    ###############################################
[1597]231     echo ${phys}
[1588]232     ./SRC/SCRIPTS/copy_model -p ${phys} -c ${config}
[215]233     mv zeWRFV2 ${conf_wrf}/WRFV2
[1588]234    ###############################################
235     if [[ "${phys}" == *"new"* ]]
[1411]236     then
[1588]237      cd ${conf_wrf}/WRFV2
[1411]238        if [[ "${config}" != "les" ]]
[118]239        then
[1411]240           cp ../../SRC/WRFV2/Registry/Registry.EM.newphys Registry/Registry.EM
[118]241        else
[1411]242           cp -L ../../SRC/LES/WRFV2/Registry/Registry.EM.newphys Registry/Registry.EM
243        fi
[1588]244      cd phys
245      ln -sf module_lmd_driver.F.new module_lmd_driver.F
246      cd ..
[1212]247
[1746]248     else
249      cd ${conf_wrf}/WRFV2
250      cd Registry ; ./Registry.bash ; cd ..
[54]251     fi
[142]252          #### sparadrap consequent a l'utilisation de copy_model pour les liens
253          #### -- car alors il manque fftpack
254          if [[ "${config}" == "les" ]]
[158]255          then
[1389]256            cp ../../SRC/LES/correcfft ./
[142]257            ./correcfft
258            \rm correcfft
259          fi
[1588]260  else
[11]261    cd ${conf_wrf}/WRFV2
[54]262    if [ ${fresh_start} -eq 1 ]
263    then
264      echo '*** FRESH START, I clean everything'
[318]265      ### clean the whole place 
[54]266      clean -a > /dev/null 2> /dev/null
[318]267      ### get a possibly modified registry !
[1588]268      if [[ "${phys}" == *"new"* ]]
[333]269      then
[1411]270          cp ../../SRC/WRFV2/Registry/Registry.EM.newphys Registry/Registry.EM
271      else
272          cp ../../SRC/WRFV2/Registry/Registry.EM Registry/
[333]273      fi
[341]274      if [[ "${config}" == "les" ]]
275      then
276        cp ../../SRC/LES/WRFV2/Registry/Registry.EM Registry/
277      fi
[318]278      ### ensure the model will be recompiled from scratch with correct registry
[54]279      cd Registry ; mv Registry Registry.bak ; Registry.bash ; cd ..
[262]280#     answer='y' ## a voir... pas si sur
281#    else
282#            if [[ "${phys}" != "nophys_" ]]
283#            then
284#      echo Did you modify anything in the Registry or clean ? y for yes, any key for no ; read answer
285#      case ${answer} in
286#        y) cd Registry ; mv Registry Registry.bak ; Registry.bash ; cd .. ;;
287#        *) answer='no' ;;
288#      esac
289#            fi
[54]290    fi
[11]291  fi
[153]292
[11]293  # summary
294  echo '**********************'
295  echo '*** Your folder is ...'
296  echo '**********************'
297  echo ${conf_wrf}
298  echo '**********************'
299  echo '****************************************'
300  echo so ...
301  echo your computer is ${machine} bits
302  echo ${compilo} is your compiler
303       if [[ "${compilo}" = "mpi" ]]
304       then
305         echo MPICH is in ${WHERE_MPI}
306       fi
[1272]307  echo you have ${dom} domains
[1588]308  if [[ "${phys}" == *"new"* ]]
[153]309  then
[1236]310   echo number of processors can be changed without recompiling
311   echo x points can be changed without recompiling
312   echo y points can be changed without recompiling
[1272]313   echo z points can be changed without recompiling
[1236]314   echo number of tracers can be changed without recompiling
315  else
316   echo you will use ${numproc} processors
317   echo you have ${lon} x points
318   echo '         '${lat} y points
[1272]319   echo '         '${level} z points
[1236]320   echo '         '${tra} tracers
[153]321  fi
[11]322  echo '****************************************'
323  # save answer
324  \rm last 2> /dev/null
325  touch last
326  echo ${reply} >> last
[1588]327  if [[ "${phys}" != *"new"* ]]
[1236]328  then
329    if [ "${compilo}" = "mpi" -o "${compilo}" = "mpifort" -o "${compilo}" = "mpixlf" ]
330    then
[11]331     echo ${numproc} >> last
[1236]332    fi
333    echo ${lon} >> last
334    echo ${lat} >> last
[1272]335    echo ${level} >> last
[1236]336  fi
[11]337  echo ${dom} >> last
[1588]338  if [[ "${phys}" != **"new"* ]]
[1236]339  then
340   echo ${tra} >> last
341  fi
[11]342
343#------------
344# log files
345#------------
346  \rm log_compile 2> /dev/null
347  \rm log_error 2> /dev/null
348
349#-----------------
350# configure WRF
351#-----------------
352  mv configure.wrf configure.wrf.bak 2> /dev/null
353  ########################
[30]354  conf_wrf_forall="${compilo}_${machine}${single}${testflag}"
[142]355
356         #### in this case options are different because for LES, WRFV3 is used
357         if [[ "${config}" == "les" ]]
358         then
359         conf_wrf_forall="${config}${compilo}_${machine}${single}${testflag}"
360         fi
361
[30]362  case ${conf_wrf_forall} in
[142]363
364     #######LES-specific (WRFV3-based) -- previously in 'makeles'
365     #######
366
367     lesmpi_64)        ## MPI (dm) 64 bits [PS: remplacer 3 par 4 pour openMP]
368                       \rm conf > /dev/null 2> /dev/null ; touch conf ; echo 3 >> conf ; echo 1 >> conf
369                       \rm configure.wrf > /dev/null 2> /dev/null ; ./configure < conf > /dev/null 2> /dev/null
[1588]370                       sed s+"-lnetcdf"+"-lnetcdf -L../$phys/libo -llmd"+g   configure.wrf > yeah ; mv -f yeah configure.wrf
[142]371                       if [[ "$(hostname)" == "ciclad1.ipsl.jussieu.fr" ]]
372                       then
373            echo "SPECIFIC CHANGES FOR CICLAD CLUSTER. EDIT makemeso IF YOU ENCOUNTER PROBLEMS."
374            #sed s+"mpif90 -f90=$(SFC)"+"/usr/lib64/openmpi/1.4.2-pgf/bin/mpif90"+g                      configure.wrf > yeah ; mv -f yeah configure.wrf
375            #sed s+"mpicc -cc=$(SCC)"+"/usr/lib64/openmpi/1.4.2-gfortran/bin/mpicc -DMPI2_SUPPORT"+g     configure.wrf > yeah ; mv -f yeah configure.wrf
[158]376            sed s+"mpif90 -f90=\$(SFC)"+"/usr/lib64/openmpi/1.4.3-pgfgcc/bin/mpif90"+g                   configure.wrf > yeah ; mv -f yeah configure.wrf
377            sed s+"mpicc -cc=\$(SCC)"+"/usr/lib64/openmpi/1.4.3-pgfgcc/bin/mpicc -DMPI2_SUPPORT"+g       configure.wrf > yeah ; mv -f yeah configure.wrf
[142]378                       else
[390]379            #sed s+"mpif90"+"$WHERE_MPI/mpif90"+g                 configure.wrf > yeah ; mv -f yeah configure.wrf
380            #sed s+"mpicc"+"$WHERE_MPI/mpicc -DMPI2_SUPPORT"+g    configure.wrf > yeah ; mv -f yeah configure.wrf
381            #### OPENMPI
382            sed s+"mpif90 -f90=\$(SFC)"+"$WHERE_MPI/mpif90"+g                 configure.wrf > yeah ; mv -f yeah configure.wrf
383            sed s+"mpicc -cc=\$(SCC)"+"$WHERE_MPI/mpicc -DMPI2_SUPPORT"+g    configure.wrf > yeah ; mv -f yeah configure.wrf
[142]384                       fi
385                       sed s+"-fastsse"+" "+g                               configure.wrf > yeah ; mv -f yeah configure.wrf
386                          ### pas forcement necessaire ici mais OK
387                          sed s+"-llmd"+"-llmd $NETCDF/lib/libnetcdf.a"+g     configure.wrf > yeah ; mv -f yeah configure.wrf
388                       \rm conf > /dev/null ;;
389
390     lesmpifort_64)    ## MPI (dm) 64 bits IFORT
391                       \rm conf > /dev/null 2> /dev/null ; touch conf ; echo 7 >> conf ; echo 1 >> conf
392                       \rm configure.wrf > /dev/null 2> /dev/null ; ./configure < conf > /dev/null 2> /dev/null
[1597]393                       if [[ "${phys}" != *"void"* ]]
394                       then
[1937]395                         sed s+"-lnetcdff"+"TOZTOZ"+g configure.wrf > yeah ; mv -f yeah configure.wrf
396                         # ... in case there is netcdff save it in TOZTOZ so that it is not impacted in the following sed
[1597]397                         sed s+"-lnetcdf"+"-lnetcdf -L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g   configure.wrf > yeah ; mv -f yeah configure.wrf
[1937]398                         sed s+"TOZTOZ"+"-lnetcdff"+g configure.wrf > yeah ; mv -f yeah configure.wrf
[1597]399                       else
400                         sed s+"-lnetcdf"+"-lnetcdf $NETCDF/lib/libnetcdf.a"+g   configure.wrf > yeah ; mv -f yeah configure.wrf
401                       fi
[142]402                       sed s+"mpif90"+"$WHERE_MPI/mpif90"+g                 configure.wrf > yeah ; mv -f yeah configure.wrf
403                       sed s+"mpicc"+"$WHERE_MPI/mpicc -DMPI2_SUPPORT"+g    configure.wrf > yeah ; mv -f yeah configure.wrf
404                       sed s+"-fastsse"+" "+g                               configure.wrf > yeah ; mv -f yeah configure.wrf
[1597]405                       sed s+"O3"+"O3 -mcmodel=large -shared-intel"+g configure.wrf > yeah ; mv -f yeah configure.wrf
[1587]406                       #sed s+"-lnetcdf -lnetcdff"+"-lnetcdf -lnetcdff -L../mars_lmd/libo -llmd"+g     configure.wrf > yeah ; mv -f yeah configure.wrf
[674]407                       if [ ${debug} -ne 0 ]   # not working for xlf!
408                             then
409                             echo 'DEBUG DEBUG DEBUG DEBUG'
[790]410                             sed s+"# -g"+" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"+g configure.wrf > yeah
[674]411                             mv -f yeah configure.wrf
412                       fi
[142]413                       \rm conf > /dev/null ;;
414
[2115]415     lesopenmpi_64_single) echo Special option...
416                       \rm conf > /dev/null 2> /dev/null ; touch conf ; echo 13 >> conf ; echo 0 >> conf
417                       configure  < conf > log_compile 2> log_error
418                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf 
419                       sed s+"-lnetcdff"+'-lnetcdff -I$(WRF_SRC_ROOT_DIR)/inc'+g configure.wrf > yeah ; mv -f yeah configure.wrf ;;
420
[2094]421     lesgnu_64_single) echo Special option...
422                       \rm conf > /dev/null 2> /dev/null ; touch conf ; echo 11 >> conf ; echo 0 >> conf
423                       configure  < conf > log_compile 2> log_error
424                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf 
425                       sed s+"-lnetcdff"+'-lnetcdff -I$(WRF_SRC_ROOT_DIR)/inc'+g configure.wrf > yeah ; mv -f yeah configure.wrf ;;
[142]426     #######
427     #######LES-specific (WRFV3-based) -- previously in 'makeles'   
428
[11]429                     # GFORTRAN, 64 bits, no nesting     
430     gnu_64_single)    cd arch ; ln -sf ../configure.defaults.gfortran64 configure.defaults ; cd ..
431                       echo 15 | configure > log_compile 2> log_error
[1588]432                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf 
[2094]433                       sed s+"-L../$phys/libo -llmd"+"-lnetcdf -lnetcdff -L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf ;;
[11]434                     # PGF90, 32 bits, no nesting
435     pgf_32_single)    echo 1 | configure > log_compile 2> log_error
[1588]436                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;
[11]437                     # PGF90, 32 bits, nesting
438     pgf_32_nest)      echo 2 | configure > log_compile 2> log_error
[1588]439                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;
[11]440                     # PGF90, 64 bits, no nesting
441     pgf_64_single)    echo 1 | configure > log_compile 2> log_error
[330]442                       #### the following line is necessary because readtesassim has a line "use netcdf" in it!
[1588]443                       #sed s+"-L../$phys/libo -llmd"+"-L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf
444                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;
[11]445                     # PGF90, 64 bits, nesting
446     pgf_64_nest)      cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
447                       echo 4 | configure > log_compile 2> log_error
[1588]448                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;
[11]449                     # G95, 32 bits, no nesting
450     g95_32_single)    echo 13 | configure > log_compile 2> log_error
[1588]451                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;
[24]452                     # G95, 64 bits, no nesting  ### we modify configure.defaults to add x86_64 next to g95 in the header comment
453     g95_64_single)    cd arch ; sed s/"PC Linux i486 i586 i686, g95 compiler"/"PC Linux i486 i586 i686 x86_64, g95 compiler"/g configure.defaults > yeahyeahyeah ; rm configure.defaults ; mv yeahyeahyeah configure.defaults ; cd ..
454                       echo 14 | configure > log_compile 2> log_error
[330]455                         ##### marche pas ....
456                         #sed s+"-fno-second-underscore"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf
[1588]457                         #sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf
458                         #sed s+"-L../$phys/libo -llmd"+"-L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf ;;
459                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;
[24]460                       #sed s+"=       g95"+"=       /home/physastro/aspiga/mysoft/g95/g95-install/bin/x86_64-unknown-linux-gnu-g95"+g configure.wrf > yeah ; mv -f yeah configure.wrf;;
[11]461                     # IFORT, 64 bits, no nesting
462     ifort_64_single)  echo 5 | configure > log_compile 2> log_error
463                       sed s+"-DIFORT_KLUDGE"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
[674]464                       if [ ${debug} -ne 0 ]   # not working for xlf!
465                             then
466                             echo 'DEBUG DEBUG DEBUG DEBUG'
[790]467                             sed s+"# -g"+" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"+g configure.wrf > yeah
[674]468                             mv -f yeah configure.wrf
469                       fi
[11]470                         ## !!! NETCDF must be defined
[1588]471                         sed s+"lio_grib_share"+"lio_grib_share -L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah
[11]472                         mv -f yeah configure.wrf ;;
473     mpifort_64)     # MPI+IFORT, 64 bits, no nesting / nesting
[1752]474                       echo 9 | ./configure > log_compile 2> log_error
[1588]475                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf
[11]476                       sed s+"-f90=ifort"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
477                       sed s+"-cc=icc"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
478                       sed s+"-DIFORT_KLUDGE"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
[1440]479                       sed s+"-O1"+"-O1 -mcmodel=medium -shared-intel"+g configure.wrf > yeah ; mv -f yeah configure.wrf
480                       sed s+"-O2"+"-O2 -mcmodel=medium -shared-intel"+g configure.wrf > yeah ; mv -f yeah configure.wrf
481                       sed s+"-O3"+"-O3 -mcmodel=medium -shared-intel"+g configure.wrf > yeah ; mv -f yeah configure.wrf
[674]482                       if [ ${debug} -ne 0 ]   # not working for xlf!
483                             then
484                             echo 'DEBUG DEBUG DEBUG DEBUG'
[1752]485                             sed s+"#-g"+" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"+g configure.wrf > yeah
[674]486                             mv -f yeah configure.wrf
487                       fi
[11]488                       sed s+"O3"+"O2"+g configure.wrf > yeah ; mv -f yeah configure.wrf
489                                        #sed s+"O3"+"O0"+g configure.wrf > yeah ; mv -f yeah configure.wrf  ### pour compilation rapide
490                                        #-w -ftz -align all -fno-alias -fp-model precise >>> options indiquees dans WRF3
491                                        #http://software.intel.com/en-us/articles/performance-tools-for-software-developers-building-wrf-with-the-intel-compilers/
492                            #### NB: RSL is replaced by RSL_LITE, better memory capacity, less seg fault
493                            sed s+"../external/RSL/RSL"+"../external/RSL_LITE"+g configure.wrf > yeah ; mv -f yeah configure.wrf
494                            sed s+"-DWRF_RSL_IO"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
495                            sed s+"-DRSL"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
496                            sed s+"librsl.a"+"librsl_lite.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf
497                            sed s+"../external/RSL/gen"+"../external/RSL_LITE/gen"+g configure.wrf > yeah ; mv -f yeah configure.wrf
498                            sed s+"../external/RSL/module"+"../external/RSL_LITE/module"+g configure.wrf > yeah ; mv -f yeah configure.wrf
499                            sed s+"-lrsl"+"-lrsl_lite"+g configure.wrf > yeah ; mv -f yeah configure.wrf
500                            sed s+"linux"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
501                         ### necessary even if mpi-selector is used (no need in makegcm though)
502                         sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g > yeah ; mv -f yeah configure.wrf
503                         sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g configure.wrf > yeah ; mv -f yeah configure.wrf
504                         ## !!! NETCDF must be defined
[1752]505                         if [[ "${phys}" != *"void"* ]]
506                         then
507                           sed s+"-L../$phys/libo -llmd"+"-L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah
508                         else
509                           sed s+"-lesmf_time"+"-lesmf_time $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah
510                         fi
[70]511                         mv -f yeah configure.wrf
512                         #### POUR LE TRAITEMENT PARTICULIERS des NESTS sur iDATAPLEX [cf. module_lmd_driver]
[71]513                         sed s+"ARCHFLAGS       =       "+"ARCHFLAGS       =       -DSPECIAL_NEST_SAVE "+g configure.wrf > yeah
[11]514                         mv -f yeah configure.wrf ;;
515                     # MPICH, 64 bits, no nesting / nesting
516     mpi_64)           cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
517                       echo 3 | configure > log_compile 2> log_error
[1588]518                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf
[227]519                       ### the following line is necessary because readtesassim has a line "use netcdf" in it!
[1588]520                       sed s+"-L../$phys/libo -llmd"+"-L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf
[11]521                       sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah
[341]522                       #sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT -w -O3"+g > yeah
[11]523                                #| sed s+"fastsse"+"fast"+g > yeah
[341]524                       mv -f yeah configure.wrf ;;
[335]525                       #    #sed s+"-fastsse"+"-O2 -Munroll -Mcache_align"+g configure.wrf > yeah
526                       #    ##sed s+"-fastsse"+"-O2 -fpic"+g configure.wrf > yeah ## marche pas, ILM problem
527                       #    ##sed s+"-fastsse"+"-mcmodel=medium -Mlarge_arrays"+g configure.wrf > yeah ## marche pas, ILM problem
528                       #sed s+"-fastsse"+"-O3 -tp=nehalem-64 -fastsse -Mscalarsse -Mvect=sse -Mipa=fast"+g configure.wrf > yeah
529                       #sed s+"-fastsse"+"-O2 -Munroll -Mcache_align"+g configure.wrf > yeah
[341]530                       #sed s+"-fastsse"+""+g configure.wrf > yeah
531                       #sed s+"-fastsse"+"-fast"+g configure.wrf > yeah
532                       #sed s+"-fastsse"+"-Mvect=noaltcode -Msmartalloc -Mprefetch=distance:8 -Mfprelaxed"+g configure.wrf > yeah
533                       #mv -f yeah configure.wrf ;;
[11]534                     # MPICH, 64 bits, OK with periodic BC but no positive definite
535     mpi_64_test)      cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
536                       echo 2 | configure > log_compile 2> log_error
[1588]537                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf
[11]538                       sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah
539                       mv -f yeah configure.wrf ;;
540                     # XLF+MPICH on AIX machine (64 bits) with nesting, NB: the 32bits notice is not to be considered
541     mpixlf_32)        cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
542                       echo 3 | configure > log_compile 2> log_error
[1588]543                       sed -f physics.sed configure.wrf > yeah
[11]544                       mv -f yeah configure.wrf ;;
545                     # ANYTHING ELSE
546     *)                echo NO PRESETS ...
547                       if [ ${donotallow} -eq 0 ] 
548                       then
549                         configure
550                       else
551                         # problem when an input file is used
552                         echo 'please cd to '$PWD' and type ./configure' 
553                         exit   
554                       fi ;;
555  esac
556  ########################
557
[142]558
[156]559  ### here a case structure would be great
560
[1588]561  if [[ "${phys}" == *"new"* ]]
[29]562  then
[142]563     if [[ "${config}" == "les" ]]  ### LES is different because of WRFV3
564     then
565       sed s+"ARCH_LOCAL      =       "+"ARCH_LOCAL      =       -DNEWPHYS "+g configure.wrf > yeah
566     else
567       sed s+"ARCHFLAGS       =       "+"ARCHFLAGS       =       -DNEWPHYS "+g configure.wrf > yeah
568     fi
[29]569     mv -f yeah configure.wrf
570  fi
[11]571
[1411]572        ### SCENARIO SCENARIO SCENARIO
573        if [[ ! ("${scenario}" == "") ]]   ### not supported with LES for the moment?
[118]574        then
[1411]575          # precompiling flag in WRF part
[2115]576          sed s+"ARCHFLAGS       =   "+"ARCHFLAGS       =   -D${scenario} "+g configure.wrf > yeah
[118]577          mv -f yeah configure.wrf
[1411]578          # precompiling flag in LMD part
[1588]579          cd $phys
[1411]580          cp -Lrf makegcm_${compilo} yeah
581          \rm makegcm_${compilo}
582          sed s+"-DMESOSCALE"+"-D${scenario} -DMESOSCALE"+ yeah > makegcm_${compilo}
583          chmod 755 makegcm_${compilo}
584          \rm yeah
585          cd ..
[118]586        fi
587
[156]588  ################
[1590]589  #if [[ "${phys}" == "nophys_" ]]
590  #then
591  #   if [[ "${config}" == "les" ]]  ### LES is different because of WRFV3
592  #   then
593  #     sed s+"ARCH_LOCAL      =       "+"ARCH_LOCAL      =       -DNOPHYS "+g configure.wrf > yeah ; mv -f yeah configure.wrf
594  #     sed s+"-L../$phys/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf
595  #   else
596  #     ### not tested yet but should be working 
597  #     echo CAUTION CAUTION CAUTION NOT FULLY TESTED
598  #     sed s+"ARCHFLAGS       =       "+"ARCHFLAGS       =       -DNOPHYS "+g configure.wrf > yeah ; mv -f yeah configure.wrf
599  #     sed s+"-L../$phys/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf
600  #   fi
601  #fi
[156]602  ################
603
[1597]604  if [[ "${phys}" == *"venus"* ]]
605  then
606    sed s+"LIB_BUNDLED     = "+"LIB_BUNDLED     =    /usr/lib64/liblapack.so  \ "+g configure.wrf > yeah ; mv -f yeah configure.wrf
607  fi
608
[11]609  if [ ${debug} -ne 0 ]   # not working for xlf!
610  then
611    echo 'DEBUG DEBUG DEBUG DEBUG'
[790]612    sed s+"# -g"+" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"+g configure.wrf > yeah
613    #sed s+"# -g"+"-g -Ktrap=fp -Mbounds"+g configure.wrf > yeah
614    #sed s+"# -g"+"-g"+g configure.wrf > yeah
[11]615    mv -f yeah configure.wrf
616  fi
617
[1605]618  if [[ "${phys}" == *"prescribed"* ]]
619  then
620     donotcompilephys=1
[1846]621  fi
[1597]622
[1846]623  # some compiler and environment mess things up when using -C
624  sed s+"-C"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf   
625
[1588]626#exit
[11]627##################################################
628# compile physics
629##################################################
[1597]630if [ ${donotcompilephys} -eq 0 ] #|| [[ "${phys}" != *"prescribed"* ]]
[11]631then
632
[1588]633 cd $phys/
[11]634
[1588]635 if [[ "${phys}" == *"new"* ]]
[1212]636 then
637  divx=1
638  divy=1
639 else
[11]640  # required size
641  #----------------
642  case ${numproc} in
[239]643      1) divx=1 ; divy=1  ;;
644      2) divx=1 ; divy=2  ;;
645      4) divx=2 ; divy=2  ;;
646      6) divx=2 ; divy=3  ;;
647      8) divx=2 ; divy=4  ;;
648     12) divx=3 ; divy=4  ;;
649     16) divx=4 ; divy=4  ;;
650     20) divx=4 ; divy=5  ;;
651     24) divx=4 ; divy=6  ;;
652     32) divx=4 ; divy=8  ;;
653     64) divx=8 ; divy=8  ;;
654    128) divx=8 ; divy=16 ;;
655      *) echo not yet supported ; exit ;;
[11]656  esac
[1212]657 fi
[240]658  physx=$(expr ${lon} - 1)
659  restex=$(expr ${physx} \% ${divx})   
660  physy=$(expr ${lat} - 1)
661  restey=$(expr ${physy} \% ${divy})
[239]662  if [[ ${restex} != 0 || ${restey} != 0 ]]
663  then
664     echo nx-1 shall be divided by ${divx}
665     echo ny-1 shall be divided by ${divy}
666     exit
667  fi
[240]668  physx=$(expr ${physx} \/ ${divx})
669  physy=$(expr ${physy} \/ ${divy})
[239]670  physz=$(expr ${level} - 1)
[11]671
672  # change this if you change num_soil_layers in WRF
673  # -- default is 10
[1588]674  if [[ "${phys}" == *"new"* ]]
[30]675  then
[1212]676     soilsize=18 ## nouvelle physique. ne sert a rien ici. voir comsoil.
[30]677  else
678     soilsize=10
679  fi
[11]680
681  # GCM environment variables
682  #--------------------------
683  export LMDGCM=$PWD
684  export LIBOGCM=$PWD/libo
685
686  # generate the appropriate dimphys
687  #---------------------------------
[1597]688  if [[ "${phys}" == *"mars"* ]]
689  then
690    cd libf/phymars
691  elif [[ "${phys}" == *"venus"* ]]
692  then
693    cd libf/phyvenus
[2015]694  elif [[ "${phys}" == *"generic"* ]]
[2014]695  then
696    cd libf/phystd
[1597]697  fi
[11]698  \rm dimphys.h 2> /dev/null
[1746]699#  if [[ "${phys}" == "newphys_" ]]
700#  then
701#    ln -sf ../../meso_dimphys.h_ref . ## ne sert plus !!
702#  else
703  if [[ "${phys}" == "mars_lmd" ]]
[235]704  then
[1272]705    physize=$(expr ${physx} \* ${physy})
706    sed s/--xsize--/${physx}/g meso_dimphys.h_ref | sed s/--ysize--/${physy}/g | sed s/--physize--/${physize}/g | sed s/--zsize--/${physz}/g | sed s/--soilsize--/${soilsize}/g > dimphys.h
707    head -15 dimphys.h
[235]708  fi
[1746]709     #### TEST new new phys
[1578]710     #if [[ "${phys}" == "newphys_" ]]
711     #then
712     #  touch gr_fi_dyn.F.lien
713     #    ln -sf ../dyn3d/gr_fi_dyn.F .  ## dommage, a corriger
[1746]714     ################################
715     ################################
716     ################################
[1578]717     #fi
[1746]718     ####
719     ####
[11]720  cd ../..
721
722  # prepare for nesting
723  #---------------------
724  cd libf
725  duplicate${dom} 2> /dev/null
726  cd ..
727
728  # compile physics
729  #--------------------------
730  \rm libf/grid/dimensions.h 2> /dev/null
731  \rm -rf libo/* 2> /dev/null
732  echo 1. compiling LMD physics ...
733  echo compilation info in:
734  echo $PWD/libo/log_compile_phys
[1746]735
[1597]736  if [ ${debug} -ne 0 ] 
[11]737  then
[1597]738    if [[ "${phys}" == *"mars"* ]]
739    then
740      echo 'DEBUG DEBUG DEBUG DEBUG'
[1746]741      nohup makegcm_${compilo} -debug -full -t ${tra} -p mars -d ${physz} testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
[1597]742    elif [[ "${phys}" == *"venus"* ]]
[1752]743    then
[1597]744      echo 'DEBUG DEBUG DEBUG DEBUG'
[1752]745      nohup ./makelmdz -debug -full -p venus -d 51 rcm1d -arch linux-ifort -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys # on /u/ and /planeto/
746      nohup ./makelmdz --debug p venus -d 51 rcm1d -arch linux-ifort -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
[2014]747    elif [[ "${phys}" == *"generic"* ]]
748    then
749      echo 'DEBUG DEBUG DEBUG DEBUG'
750      nohup ./makelmdz -debug -t ${tra} -p std -b 36x32 -s 1 -d 25 rcm1d -arch X64_MESU -cpp MESOSCALE | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys #Proxb
[1597]751    fi
[11]752  else
[2037]753    if [[ "${phys}" == *"mars"* ]]
[1597]754    then
755      nohup makegcm_${compilo} -t ${tra} -p mars -d ${physz} testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
756    elif [[ "${phys}" == *"venus"* ]]
757    then
[1752]758      nohup ./makelmdz -full -p venus -d 51 rcm1d -arch linux-ifort_meso -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys # on /u/ and /planeto/
759      nohup ./makelmdz -p venus -d 51 rcm1d -arch linux-ifort_meso -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
760      #nohup ./makelmdz -full -p venus -d 51 rcm1d -arch CICLADifort -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys # on CICLAD
761      #nohup ./makelmdz -p venus -d 51 rcm1d -arch CICLADifort -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
762      #nohup ./makelmdz -full -p venus -d 51 rcm1d -arch X64_MESU -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys #on MESU
763      #nohup ./makelmdz -p venus -d 51 rcm1d -arch X64_MESU -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
764      #nohup makelmdz -full -p venus -d 51 rcm1d -arch X64_OCCIGEN -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys #on OCCIGEN
765      #nohup makelmdz -p venus -d 51 rcm1d -arch X64_OCCIGEN -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
[2014]766    elif [[ "${phys}" == *"generic"* ]]
767    then
[2210]768      echo $PWD/libo/log_compile_phys2
[2058]769      nohup ./makelmdz -t 1 -p std -b 38x36 -full -s 1 -d 25 rcm1d -arch mascaret_gfortran_para -cpp MESOSCALE | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys #Proxb
[2094]770      nohup ./makelmdz -t 1 -p std -b 38x36 -s 1 -d 25 rcm1d -arch mascaret_gfortran_para -cpp MESOSCALE | tee libo/log_compile_phys2 | grep 'warnings' >> libo/log_compile_phys2 #Proxb
[2037]771    fi
[11]772  fi
773  echo ... done
774        # clean the duplicate routines
775        cd libf
776        duplicate1 2> /dev/null
777        cd ..
778
779  # merge LMD executables in one lib
780  #--------------------------------------
781  cd libo
782  mkdir temp
[1752]783  if [[ "${phys}" == *"mars"* ]]
[1601]784  then
[1752]785    cp -f LINUX*/*.a temp
[2014]786  else #VENUS and GENERIC
[2058]787#    cp -f linux*/*.a temp/ # on /u/ and /planeto/
788    cp -f */*.a temp/ # on /u/ and /planeto/
[1752]789    #cp -f /home/mlefevre/modipsl/lib/libioipsl.a temp/ #on CICLAD
790    #cp -f X64*/*.a temp #on MESU and OCCIGEN
[2058]791    cp -f $pathioipsl/libioipsl.a temp/
[1597]792  fi
[11]793  cd temp
[1597]794  if [[ "${phys}" == *"mars"* ]]
795   then   
796   ar x libbibio.a
797   ar x libphymars.a
798   ar x libaeronomars.a
[2014]799  elif [[ "${phys}" == *"venus"* ]]
800   then
[1597]801   ar x libphyvenus.a
802   ar x libmisc.a
803   ar x libphy_common.a
[1601]804   ar x libioipsl.a
[2014]805  elif [[ "${phys}" == *"generic"* ]]
806   then
807   ar x libphystd.a
808   ar x libmisc.a
809   ar x libphy_common.a
810   ar x libioipsl.a
[1597]811  fi
[11]812  \rm *.a
813  ar r liblmd.a *
814  cp -f liblmd.a ..
815  cd ..
816  \rm -r temp
817  nm liblmd.a > liblmd_content
818  # finish merge
819  cd ..
[1588]820  if [[ "${phys}" == *"new"* ]]
[1234]821  then
[1597]822    if [[ "${phys}" == *"mars"* ]]
823    then
824      # include modules for interfacing
825      mv  *.mod ../inc/
[2014]826    else
[2058]827#      mv  ./libo/linux*/*.mod ../inc/ # on /u/ and /planeto/
828      mv  ./libo/*/*.mod ../inc/ # on /u/ and /planeto/
[1752]829      #mv  ./libo/CICLAD*/*.mod ../inc/ # on CICLAD
830      #mv  ./libo/X64*/*.mod ../inc/ # on MESU and OCCIGEN
[2058]831      cp -f $pathioipsl/*.mod ../inc/
[1597]832    fi
[1234]833  fi
834
[1597]835
[11]836  # save a copy
837  #--------------
[1247]838  cp -f libo/liblmd.a libo/liblmd.a_${lon}_${lat}_${level}_${dom}_${tra}
[11]839  echo '****************************************'
840
841  # ok
842  #----
843  cd ..
844
845  # manage nest includes in module_lmd_driver.F
846  #----
847  cp call_meso_inifis$dom.inc call_meso_inifis.inc
848  cp call_meso_physiq$dom.inc call_meso_physiq.inc
849
850
851fi
852##################################################
853# END compile physics
854##################################################
855
856#------------------
857# compile WRF
858#------------------
859if [ ${justphys} -eq 0 ]
860then
861
862  echo 2. compiling WRF dynamical core ...
863
[1590]864  #if [[ "${phys}" == "nophys_" ]]
865  #then
866  # echo 'NO LMD PHYSICS included'
867  #else
868  # if [[ ! ( -f "call_meso_physiq.inc" ) ]]
869  # then
870  #  echo 'did you compile the physics ? no call_meso_physiq.inc !'
871  #  exit
872  # fi
873  #fi
[11]874
875  # be sure to compile with the most recent physics
876  touch phys/module_lmd_driver.F
877
878  # talk to user
879  echo '>>> compiling ... this may be long ... <<<'
880  echo check progress in:
881  echo $PWD/log_compile
882  echo check possible errors in:
883  echo $PWD/log_error
884 
885  # compile ...
[1588]886  echo '>>> YOUR CONFIG IS : '${config}
[11]887  case ${config} in
[1588]888    'real')         ./compile em_real > log_compile 2> log_error
[11]889                    # save executables 
890                    cd main
[68]891                      if [[ -f real.exe ]]
892                      then
893                        echo 'Looks good ! real.exe is here...'
894                      fi
[11]895                      if [[ -f wrf.exe ]]
896                      then
897                        echo 'Looks good ! wrf.exe is here...'
898                      fi
[1247]899                    cp -f real.exe ../../real_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
900                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
[11]901                    cd ..  ;;
[68]902    'ideal')        #mkdir 'test/em_quarter_ss' 2> /dev/null
[1588]903                    #echo '>>> YOUR CONFIG IS : '${config}
[421]904                    ./compile em_quarter_ss > log_compile 2> log_error
[11]905                    # save executables 
906                    cd main
[68]907                      if [[ -f ideal.exe ]]
908                      then
909                        echo 'Looks good ! ideal.exe is here...'
910                      fi
[11]911                      if [[ -f wrf.exe ]]
912                      then
913                        echo 'Looks good ! wrf.exe is here...'
914                      fi
[1247]915                    cp -f ideal.exe ../../ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
916                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
[11]917                    cd ..  ;;
[1588]918    'les')          #echo '>>> YOUR CONFIG IS : '${config}
[142]919                    mkdir 'test/em_les' 2> /dev/null                   
[2094]920                    ./compile em_les ###> log_compile 2> log_error
[142]921                    # save executables 
922                    cd main
923                      if [[ -f ideal.exe ]]
924                      then
925                        echo 'Looks good ! ideal.exe is here...'
926                      fi
927                      if [[ -f wrf.exe ]]
928                      then
929                        echo 'Looks good ! wrf.exe is here...'
930                      fi
[1247]931                    cp -f ideal.exe ../../ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
932                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
[142]933                    cd ..  ;;
934    *)              echo not supported... please use ; echo ideal les ; exit ;;
[11]935  esac
936  echo '*******last lines from log_error*********'
937  tail -n 20 log_error
938fi
939
940  # the end
941  echo '****************************************'
942  echo 'done.'
943  echo '****************************************'
[1247]944  cp last ../makemeso_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}
[11]945  mv last ../../
[1247]946  svn info ../../ > ../makemeso_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.svn.info
[11]947
[1445]948  # link latest compiled folder as LATEST
949  cd ../../
[1448]950  rm -rf LATEST
[1445]951  ln -sf ${conf_wrf} LATEST
952
[1855]953  # link latest compiled exec
954  cd LATEST
955  case ${config} in
956    'real')         ln -sf real_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe real.exe ;;
957    'ideal')        ln -sf ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe ideal.exe ;;
958    'les')          ln -sf ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe ideal.exe ;;
959  esac
960  ln -sf wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe wrf.exe
961  cd ..
962
[11]963  # add here specific messages
964  if [[ "${dom}" != "1" ]]
965  then
966  nest=$(expr ${lon} + 4)
967  echo NB: in namelist.input, please set:
968  echo '
969  max_dom = '$dom'
970  s_we    = 1,1,
971  e_we    = '$lon','$nest',
972  s_sn    = 1,1,
973  e_sn    = '$lat','$nest',
974  s_vert  = 1,1,
975  e_vert  = '$level','$level','
976  fi
977
[1588]978
Note: See TracBrowser for help on using the repository browser.