source: trunk/MESOSCALE/LMD_MM_MARS/makemeso @ 4006

Last change on this file since 4006 was 4006, checked in by aslmd, 8 days ago

MESOSCALE: add the second log compile to makemeso prints

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