source: trunk/mesoscale/LMD_MM_MARS/makemeso @ 67

Last change on this file since 67 was 60, checked in by aslmd, 14 years ago

LMD_MM_MARS et LMD_LES_MARS: ajouts de scripts et modifications runmeso/makeles/makemeso pour faire tourner le modele sur iDataPlex. premiers tests en parallele fonctionnent tres bien. le run 16procs est bien 4fois rapide que le run 4procs sur la ferme planeto. resultats totalement similaires 4procs TESTCASE entre auric et gnome (a part amortissement vitesse verticale aux premiers pas de temps). le LES fonctionne bien lui aussi, cependant il y a un bug a corriger relatif a un flux de chaleur sensible nul aux points d'interfaces entre 4 tuiles. ------ petite remarque sur LMDZ5: un job 24proc est 10fois plus rapide qu'un job 8proc absolument equivalent sur ciclad.

  • Property svn:executable set to *
File size: 23.1 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# Use:   
19#
20# makemeso                   ## basic use (real configuration)
21#
22# makemeso -d                ## no compilation, just check the name of the compile folder
23#
24# makemeso -c real           ## real-case mode [default]
25# makemeso -c convection     ## idealized mode: convective cell
26#
27# makemeso < last            ## basic use + skip questions [! script must have been executed at least once]
28# makemeso -r < last         ## basic use + skip questions + only known config
29# makemeso -nr < last        ## basic use + skip questions + only known config + no LMD phys recompile
30#
31# makemeso -j                ## just compile the LMD physics
32#
33# makemeso -g                ## debug mode
34#
35# makemeso -h                ## display options
36#
37#############################
38
39
40# todo: netcdf support
41
42
43##############################################################################################
44##############################################################################################
45##############################################################################################
46##############################################################################################
47
48donotcompile=0
49donotallow=0
50config='real'
51donotcompilephys=0
52justphys=0
53debug=0
54fresh_start=0
55phys=""
56while getopts "drc:njhgpf" options; do
57  case $options in
58   d ) donotcompile=1;;     ## just to check the compile folder
59   r ) donotallow=1;;       ## allow only known config (useful with 'makemeso < last')
60   c ) config="${OPTARG}";; ## idealized cases
61   n ) donotcompilephys=1;; ## do not recompile physics
62   j ) justphys=1;;         ## just compile LMD physics
63   g ) debug=1;;            ## debug mode
64   p ) phys="newphys_";;    ## with new physics
65   f ) fresh_start=1;;      ## a fresh start
66   h ) echo "
67# Use:   
68#
69# makemeso                   ## basic use (real configuration)
70#
71# makemeso -d                ## no compilation, just check the name of the compile folder
72#
73# makemeso -c real           ## real-case mode [default]
74# makemeso -c convection     ## idealized mode: convective cell
75#
76# makemeso < last            ## basic use + skip questions [! script must have been executed at least once]
77# makemeso -r < last         ## basic use + skip questions + only known config
78# makemeso -nr < last        ## basic use + skip questions + only known config + no LMD phys recompile
79#
80# makemeso -j                ## just compile the LMD physics
81#
82# makemeso -g                ## debug mode
83#
84# makemeso -h                ## display options
85#
86# makemeso -p                ## with new LMD physics
87#
88# makemeso -f                ## fresh start [clean -a]
89" ; exit ;;
90  esac
91done   
92
93#--------------
94# talk w/ user
95#--------------
96  echo '****************************************'
97  echo ' LMD Mesoscale Model Compiler. Welcome.'
98  echo '****************************************'
99  if [[ "${phys}" == "newphys_" ]]
100  then
101    echo '***********with new physics*************'
102    echo '****************************************'
103  fi
104  # computer
105  uname -a | grep x86_64 > /dev/null
106  if [[ "$?" == 0 ]]
107  then
108    machine='64'
109  else
110    machine='32'
111  fi
112  # compiler
113  echo "Supported compiler options are "
114  echo "       <1> pgf90"
115  echo "       <2> g95"
116  echo "       <3> pgf90 + mpi"
117  echo "       <4> ifort"
118  echo "       <5> ifort + mpi"
119  echo "       <7> xlf + mpi (IBM AIX)"
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       echo How many processors ? 1, 2, 4, 6, 8, 12, 16, 20, 24 test 32 64 ; read numproc ;;
131    4) compilo='ifort' ; numproc=1 ;;
132    5) compilo='mpifort' ; echo How many processors ? 1, 2, 4, 6, 8, 12, 16, 20, 24 test 32 64 ; read numproc ;;
133    7) compilo='mpixlf' ; echo How many processors ? 1, 2, 4, 6, 8, 12, 16, 20, 24 test 32 64 ; read numproc ;;
134### for tests
13599) compilo='gnu' ; numproc=1 ;;
136    *) echo not supported by this script ; exit ;;
137  esac
138  # dimensions
139  if [ ${donotcompile} -eq 0 ]
140  then   
141  echo Grid points in longitude ? ; read lon
142  echo Grid points in latitude ? ; read lat
143  echo Number of vertical levels ? ; read level
144  fi
145  echo Number of domains ? ; read dom
146
147###PB lecture dom si < last
148
149    case ${dom} in
150       1) single='_single' ;;
151       *) single='_nest' ;;
152    esac
153      if [ "${compilo}" = "mpi" -o "${compilo}" = "mpifort" -o "${compilo}" = "mpixlf" ]
154      then
155           single=''
156      fi
157
158testflag=''
159####
160#testflag='_test'
161####
162
163    conf_wrf="${phys}${compilo}_${machine}${single}${testflag}"
164    \rm what_folder 2> /dev/null
165    echo ${conf_wrf} > what_folder
166         if [ ${donotcompile} -eq 1 ]
167         then
168            #\rm what_folder 2> /dev/null
169            #echo '**********************'
170            #echo '*** Your folder is ...'
171            #echo '**********************'
172            #echo ${conf_wrf} | tee what_folder
173            #cat what_folder
174            #echo ${conf_wrf} > what_folder
175            #echo ${reply} > what_compilo
176            #echo ${numproc} > what_numproc
177            exit
178         fi
179  echo Number of tracers ? ; read tra
180         if [ ${tra} -eq 0 ]
181         then
182            tra=1       
183         fi
184  # folder
185  mkdir ${conf_wrf} 2> /dev/null
186  if [[ "$?" == 0 ]]
187  then
188    echo new folder ... link sources
189    if [[ "${phys}" == "newphys_" ]]
190    then
191     sed s+"mars_lmd"+"mars_lmd_new"+g copy_model > copy_model_tmp
192     chmod 755 copy_model_tmp
193     ./copy_model_tmp
194     \rm copy_model_tmp
195     mv WRFV2 ${conf_wrf}/
196     cd ${conf_wrf}/WRFV2
197     ln -sf mars_lmd_new mars_lmd
198     ln -sf meso_callkeys_newphys.h meso_callkeys.h
199     cd Registry ; Registry.bash ; cd ..
200    else
201     ./copy_model
202     mv WRFV2 ${conf_wrf}/
203     cd ${conf_wrf}/WRFV2
204     cd Registry ; Registry.bash ; cd ..
205     fi
206  else
207    cd ${conf_wrf}/WRFV2
208    if [ ${fresh_start} -eq 1 ]
209    then
210      echo '*** FRESH START, I clean everything'
211      clean -a > /dev/null 2> /dev/null
212      cd Registry ; mv Registry Registry.bak ; Registry.bash ; cd ..
213      answer='y' ## a voir... pas si sur
214    else
215      echo Did you modify anything in the Registry or clean ? y for yes, any key for no ; read answer
216      case ${answer} in
217        y) cd Registry ; mv Registry Registry.bak ; Registry.bash ; cd .. ;;
218        *) answer='no' ;;
219      esac
220    fi
221  fi
222  # summary
223  echo '**********************'
224  echo '*** Your folder is ...'
225  echo '**********************'
226  echo ${conf_wrf}
227  echo '**********************'
228  echo '****************************************'
229  echo so ...
230  echo your computer is ${machine} bits
231  echo ${compilo} is your compiler
232       if [[ "${compilo}" = "mpi" ]]
233       then
234         echo MPICH is in ${WHERE_MPI}
235       fi
236  echo you will use ${numproc} processors
237  echo you have ${lon} x points
238  echo '         '${lat} y points
239  echo '         '${level} z points
240  echo '         '${dom} domains
241  echo '         '${tra} tracers
242  echo '****************************************'
243  # save answer
244  \rm last 2> /dev/null
245  touch last
246  echo ${reply} >> last
247     if [ "${compilo}" = "mpi" -o "${compilo}" = "mpifort" -o "${compilo}" = "mpixlf" ]
248     then
249     echo ${numproc} >> last
250     fi
251  echo ${lon} >> last
252  echo ${lat} >> last
253  echo ${level} >> last
254  echo ${dom} >> last
255  echo ${tra} >> last
256  echo ${answer} >> last
257
258
259#------------
260# log files
261#------------
262  \rm log_compile 2> /dev/null
263  \rm log_error 2> /dev/null
264
265#-----------------
266# configure WRF
267#-----------------
268  mv configure.wrf configure.wrf.bak 2> /dev/null
269  ########################
270  conf_wrf_forall="${compilo}_${machine}${single}${testflag}"
271  case ${conf_wrf_forall} in
272#######TEST TEST
273                     # GFORTRAN, 64 bits, no nesting     
274     gnu_64_single)    cd arch ; ln -sf ../configure.defaults.gfortran64 configure.defaults ; cd ..
275                       echo 15 | configure > log_compile 2> log_error
276                       sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf 
277                       sed s+"-L../mars_lmd/libo -llmd"+"-L../mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf ;;
278#######TEST TEST
279                     # PGF90, 32 bits, no nesting
280     pgf_32_single)    echo 1 | configure > log_compile 2> log_error
281                       sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;
282                     # PGF90, 32 bits, nesting
283     pgf_32_nest)      echo 2 | configure > log_compile 2> log_error
284                       sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;
285                     # PGF90, 64 bits, no nesting
286     pgf_64_single)    echo 1 | configure > log_compile 2> log_error
287                       sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;
288                     # PGF90, 64 bits, nesting
289     pgf_64_nest)      cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
290                       echo 4 | configure > log_compile 2> log_error
291                       sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;
292                     # G95, 32 bits, no nesting
293     g95_32_single)    echo 13 | configure > log_compile 2> log_error
294                       sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;
295                     # G95, 64 bits, no nesting  ### we modify configure.defaults to add x86_64 next to g95 in the header comment
296     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 ..
297                       echo 14 | configure > log_compile 2> log_error
298                       sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;
299                       #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;;
300                     # IFORT, 64 bits, no nesting
301     ifort_64_single)  echo 5 | configure > log_compile 2> log_error
302                       sed s+"-DIFORT_KLUDGE"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
303                         ## !!! NETCDF must be defined
304                         sed s+"lio_grib_share"+"lio_grib_share -L../mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah
305                         mv -f yeah configure.wrf ;;
306     mpifort_64)     # MPI+IFORT, 64 bits, no nesting / nesting
307                       echo 9 | configure > log_compile 2> log_error
308                       sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf
309                       sed s+"-f90=ifort"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
310                       sed s+"-cc=icc"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
311                       sed s+"-DIFORT_KLUDGE"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
312                       sed s+"O3"+"O2"+g configure.wrf > yeah ; mv -f yeah configure.wrf
313                                        #sed s+"O3"+"O0"+g configure.wrf > yeah ; mv -f yeah configure.wrf  ### pour compilation rapide
314                                        #-w -ftz -align all -fno-alias -fp-model precise >>> options indiquees dans WRF3
315                                        #http://software.intel.com/en-us/articles/performance-tools-for-software-developers-building-wrf-with-the-intel-compilers/
316                            #### NB: RSL is replaced by RSL_LITE, better memory capacity, less seg fault
317                            sed s+"../external/RSL/RSL"+"../external/RSL_LITE"+g configure.wrf > yeah ; mv -f yeah configure.wrf
318                            sed s+"-DWRF_RSL_IO"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
319                            sed s+"-DRSL"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
320                            sed s+"librsl.a"+"librsl_lite.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf
321                            sed s+"../external/RSL/gen"+"../external/RSL_LITE/gen"+g configure.wrf > yeah ; mv -f yeah configure.wrf
322                            sed s+"../external/RSL/module"+"../external/RSL_LITE/module"+g configure.wrf > yeah ; mv -f yeah configure.wrf
323                            sed s+"-lrsl"+"-lrsl_lite"+g configure.wrf > yeah ; mv -f yeah configure.wrf
324                            sed s+"linux"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
325                         ### necessary even if mpi-selector is used (no need in makegcm though)
326                         sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g > yeah ; mv -f yeah configure.wrf
327                         sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g configure.wrf > yeah ; mv -f yeah configure.wrf
328                         ## !!! NETCDF must be defined
329                         sed s+"-L../mars_lmd/libo -llmd"+"-L../mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah
330                         mv -f yeah configure.wrf ;;
331                     # MPICH, 64 bits, no nesting / nesting
332     mpi_64)           cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
333                       echo 3 | configure > log_compile 2> log_error
334                       sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf
335                       sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah
336                                #| sed s+"fastsse"+"fast"+g > yeah
337                       mv -f yeah configure.wrf ;;
338                       #sed s+"-fastsse"+"-O2 -Munroll -Mcache_align"+g configure.wrf > yeah
339                       ##sed s+"-fastsse"+"-O2 -fpic"+g configure.wrf > yeah ## marche pas, ILM problem
340                       ##sed s+"-fastsse"+"-mcmodel=medium -Mlarge_arrays"+g configure.wrf > yeah ## marche pas, ILM problem
341                       #mv -f yeah configure.wrf ;;
342                     # MPICH, 64 bits, OK with periodic BC but no positive definite
343     mpi_64_test)      cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
344                       echo 2 | configure > log_compile 2> log_error
345                       sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf
346                       sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah
347                       mv -f yeah configure.wrf ;;
348                     # XLF+MPICH on AIX machine (64 bits) with nesting, NB: the 32bits notice is not to be considered
349     mpixlf_32)        cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
350                       echo 3 | configure > log_compile 2> log_error
351                       sed -f mars.sed configure.wrf > yeah
352                       mv -f yeah configure.wrf ;;
353                     # ANYTHING ELSE
354     *)                echo NO PRESETS ...
355                       if [ ${donotallow} -eq 0 ] 
356                       then
357                         configure
358                       else
359                         # problem when an input file is used
360                         echo 'please cd to '$PWD' and type ./configure' 
361                         exit   
362                       fi ;;
363  esac
364  ########################
365
366  if [[ "${phys}" == "newphys_" ]]
367  then
368     sed s+"ARCHFLAGS       =       "+"ARCHFLAGS       =       -DNEWPHYS "+g configure.wrf > yeah
369     mv -f yeah configure.wrf
370  fi
371
372  if [ ${debug} -ne 0 ]   # not working for xlf!
373  then
374    echo 'DEBUG DEBUG DEBUG DEBUG'
375    sed s+"#-g"+"-g"+g configure.wrf > yeah
376    mv -f yeah configure.wrf
377  fi
378
379
380##################################################
381# compile physics
382##################################################
383if [ ${donotcompilephys} -eq 0 ]
384then
385
386  cd mars_lmd/
387
388  # required size
389  #----------------
390  case ${numproc} in
391    1) physx=$(expr ${lon} - 1)
392       physy=$(expr ${lat} - 1)
393       physz=$(expr ${level} - 1) ;;
394    2) physx=$(expr ${lon} - 1)
395       physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 2)
396       physz=$(expr ${level} - 1) ;;
397    4) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 2)
398       physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 2)
399       physz=$(expr ${level} - 1) ;;
400    6) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 2)
401       physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 3)
402       physz=$(expr ${level} - 1) ;;
403    8) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 2)
404       physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 4)
405       physz=$(expr ${level} - 1) ;;
406    12) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 3)
407        physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 4)
408        physz=$(expr ${level} - 1) ;;
409    16) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 4)
410        physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 4)
411        physz=$(expr ${level} - 1) ;;
412    20) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 4)
413        physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 5)
414        physz=$(expr ${level} - 1) ;;
415    24) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 4)
416        physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 6)
417        physz=$(expr ${level} - 1) ;;
418### TESTS
419    32) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 4)
420        physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 8)
421        physz=$(expr ${level} - 1) ;;
422    64) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 8)
423        physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 8)
424        physz=$(expr ${level} - 1) ;;
425    *) echo not supported ; exit
426  esac
427
428  # change this if you change num_soil_layers in WRF
429  # -- default is 10
430  if [[ "${phys}" == "newphys_" ]]
431  then
432     soilsize=18 ## nouvelle physique
433  else
434     soilsize=10
435  fi
436
437  # GCM environment variables
438  #--------------------------
439  export LMDGCM=$PWD
440  export LIBOGCM=$PWD/libo
441
442  # generate the appropriate dimphys
443  #---------------------------------
444  cd libf/phymars
445  \rm dimphys.h 2> /dev/null
446  physize=$(expr ${physx} \* ${physy})
447  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
448  head -15 dimphys.h
449     ###
450     ### TEST new new phys
451     if [[ "${phys}" == "newphys_" ]]
452     then
453       touch callkeys.h.meso 
454         ln -sf meso_callkeys.h callkeys.h
455       touch dustlift.F.meso
456         ln -sf meso_dustlift.F dustlift.F  ## attention avec "ancienne nouvelle physique"
457       touch readtesassim.F90.meso
458         ln -sf meso_readtesassim.F90 readtesassim.F90  ## attention idem
459       touch gr_fi_dyn.F.lien
460         ln -sf ../dyn3d/gr_fi_dyn.F .  ## dommage, a corriger ## attention idem
461     fi
462     ###
463     ###
464  cd ../..
465
466  # prepare for nesting
467  #---------------------
468  cd libf
469  duplicate${dom} 2> /dev/null
470  cd ..
471
472  # compile physics
473  #--------------------------
474  \rm libf/grid/dimensions.h 2> /dev/null
475  \rm -rf libo/* 2> /dev/null
476  echo 1. compiling LMD physics ...
477  echo compilation info in:
478  echo $PWD/libo/log_compile_phys
479
480  if [ ${debug} -ne 0 ]
481  then
482    echo 'DEBUG DEBUG DEBUG DEBUG'
483    nohup makegcm_${compilo} -debug -t ${tra} -p mars -d ${physz} meso_testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
484  else
485    nohup makegcm_${compilo} -t ${tra} -p mars -d ${physz} meso_testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
486  fi
487  echo ... done
488        # clean the duplicate routines
489        cd libf
490        duplicate1 2> /dev/null
491        cd ..
492
493  # merge LMD executables in one lib
494  #--------------------------------------
495  cd libo
496  mkdir temp
497  #cp -f LINUXfastI._${physz}_t${tra}_reg/*.a temp
498  cp -f LINUX*/*.a temp
499  cd temp
500  ar x libbibio.a
501  ar x libphymars.a
502  ar x libaeronomars.a
503  \rm *.a
504  ar r liblmd.a *
505  cp -f liblmd.a ..
506  cd ..
507  \rm -r temp
508  nm liblmd.a > liblmd_content
509  # finish merge
510  cd ..
511
512  # save a copy
513  #--------------
514  cp -f libo/liblmd.a libo/liblmd.a_${lon}_${lat}_${level}_${dom}_${tra}
515  echo '****************************************'
516
517  # ok
518  #----
519  cd ..
520
521  # manage nest includes in module_lmd_driver.F
522  #----
523  cp call_meso_inifis$dom.inc call_meso_inifis.inc
524  cp call_meso_physiq$dom.inc call_meso_physiq.inc
525
526
527fi
528##################################################
529# END compile physics
530##################################################
531
532#------------------
533# compile WRF
534#------------------
535if [ ${justphys} -eq 0 ]
536then
537
538  echo 2. compiling WRF dynamical core ...
539
540  if [[ ! ( -f "call_meso_physiq.inc" ) ]]
541  then
542   echo 'did you compile the physics ? no call_meso_physiq.inc !'
543   exit
544  fi
545
546  # be sure to compile with the most recent physics
547  touch phys/module_lmd_driver.F
548
549  # talk to user
550  echo '>>> YOUR CONFIG IS : '${config}
551  echo '>>> compiling ... this may be long ... <<<'
552  echo check progress in:
553  echo $PWD/log_compile
554  echo check possible errors in:
555  echo $PWD/log_error
556 
557  # compile ...
558  case ${config} in
559    'real')         compile em_real > log_compile 2> log_error
560                    # save executables 
561                    cd main
562                      if [[ -f wrf.exe ]]
563                      then
564                        echo 'Looks good ! wrf.exe is here...'
565                      fi
566                    cp -f real.exe ../../real_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
567                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
568                    cd ..  ;;
569    'convection')   #mkdir 'test/em_quarter_ss' 2> /dev/null
570                    compile em_quarter_ss > log_compile 2> log_error
571                    # save executables 
572                    cd main
573                      if [[ -f wrf.exe ]]
574                      then
575                        echo 'Looks good ! wrf.exe is here...'
576                      fi
577                    cp -f ideal.exe ../../ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
578                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
579                    cd ..  ;;
580    *)              echo not supported please use ; echo real convection ; exit ;;
581  esac
582  echo '*******last lines from log_error*********'
583  tail -n 20 log_error
584fi
585
586  # the end
587  echo '****************************************'
588  echo 'done.'
589  echo '****************************************'
590  cp last ../makemeso_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}
591  mv last ../../
592
593  # add here specific messages
594  if [[ "${dom}" != "1" ]]
595  then
596  nest=$(expr ${lon} + 4)
597  echo NB: in namelist.input, please set:
598  echo '
599  max_dom = '$dom'
600  s_we    = 1,1,
601  e_we    = '$lon','$nest',
602  s_sn    = 1,1,
603  e_sn    = '$lat','$nest',
604  s_vert  = 1,1,
605  e_vert  = '$level','$level','
606  fi
607
Note: See TracBrowser for help on using the repository browser.