source: trunk/MESOSCALE/LMD_MM_MARS/makemeso @ 2845

Last change on this file since 2845 was 2458, checked in by aslmd, 4 years ago

MESOSCALE Mars. same as previous commit (double compile physics) but for non-debug compile

  • Property svn:executable set to *
File size: 42.0 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                       if [ ${debug} -ne 0 ]   # not working for xlf!
484                             then
485                             echo 'DEBUG DEBUG DEBUG DEBUG'
486                             sed s+"#-g"+" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"+g configure.wrf > yeah
487                             mv -f yeah configure.wrf
488                       fi
489                       sed s+"O3"+"O2"+g configure.wrf > yeah ; mv -f yeah configure.wrf
490                                        #sed s+"O3"+"O0"+g configure.wrf > yeah ; mv -f yeah configure.wrf  ### pour compilation rapide
491                                        #-w -ftz -align all -fno-alias -fp-model precise >>> options indiquees dans WRF3
492                                        #http://software.intel.com/en-us/articles/performance-tools-for-software-developers-building-wrf-with-the-intel-compilers/
493                            #### NB: RSL is replaced by RSL_LITE, better memory capacity, less seg fault
494                            sed s+"../external/RSL/RSL"+"../external/RSL_LITE"+g configure.wrf > yeah ; mv -f yeah configure.wrf
495                            sed s+"-DWRF_RSL_IO"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
496                            sed s+"-DRSL"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
497                            sed s+"librsl.a"+"librsl_lite.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf
498                            sed s+"../external/RSL/gen"+"../external/RSL_LITE/gen"+g configure.wrf > yeah ; mv -f yeah configure.wrf
499                            sed s+"../external/RSL/module"+"../external/RSL_LITE/module"+g configure.wrf > yeah ; mv -f yeah configure.wrf
500                            sed s+"-lrsl"+"-lrsl_lite"+g configure.wrf > yeah ; mv -f yeah configure.wrf
501                            sed s+"linux"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf
502                         ### necessary even if mpi-selector is used (no need in makegcm though)
503                         sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g > yeah ; mv -f yeah configure.wrf
504                         sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g configure.wrf > yeah ; mv -f yeah configure.wrf
505                         ## !!! NETCDF must be defined
506                         if [[ "${phys}" != *"void"* ]]
507                         then
508                           sed s+"-L../$phys/libo -llmd"+"-L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah
509                         else
510                           sed s+"-lesmf_time"+"-lesmf_time $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah
511                         fi
512                         mv -f yeah configure.wrf
513                         #### POUR LE TRAITEMENT PARTICULIERS des NESTS sur iDATAPLEX [cf. module_lmd_driver]
514                         sed s+"ARCHFLAGS       =       "+"ARCHFLAGS       =       -DSPECIAL_NEST_SAVE "+g configure.wrf > yeah
515                         mv -f yeah configure.wrf ;;
516                     # MPICH, 64 bits, no nesting / nesting
517     mpi_64)           cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
518                       echo 3 | configure > log_compile 2> log_error
519                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf
520                       ### the following line is necessary because readtesassim has a line "use netcdf" in it!
521                       sed s+"-L../$phys/libo -llmd"+"-L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf
522                       sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah
523                       #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
524                                #| sed s+"fastsse"+"fast"+g > yeah
525                       mv -f yeah configure.wrf ;;
526                       #    #sed s+"-fastsse"+"-O2 -Munroll -Mcache_align"+g configure.wrf > yeah
527                       #    ##sed s+"-fastsse"+"-O2 -fpic"+g configure.wrf > yeah ## marche pas, ILM problem
528                       #    ##sed s+"-fastsse"+"-mcmodel=medium -Mlarge_arrays"+g configure.wrf > yeah ## marche pas, ILM problem
529                       #sed s+"-fastsse"+"-O3 -tp=nehalem-64 -fastsse -Mscalarsse -Mvect=sse -Mipa=fast"+g configure.wrf > yeah
530                       #sed s+"-fastsse"+"-O2 -Munroll -Mcache_align"+g configure.wrf > yeah
531                       #sed s+"-fastsse"+""+g configure.wrf > yeah
532                       #sed s+"-fastsse"+"-fast"+g configure.wrf > yeah
533                       #sed s+"-fastsse"+"-Mvect=noaltcode -Msmartalloc -Mprefetch=distance:8 -Mfprelaxed"+g configure.wrf > yeah
534                       #mv -f yeah configure.wrf ;;
535                     # MPICH, 64 bits, OK with periodic BC but no positive definite
536     mpi_64_test)      cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
537                       echo 2 | configure > log_compile 2> log_error
538                       sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf
539                       sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah
540                       mv -f yeah configure.wrf ;;
541                     # XLF+MPICH on AIX machine (64 bits) with nesting, NB: the 32bits notice is not to be considered
542     mpixlf_32)        cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
543                       echo 3 | configure > log_compile 2> log_error
544                       sed -f physics.sed configure.wrf > yeah
545                       mv -f yeah configure.wrf ;;
546                     # ANYTHING ELSE
547     *)                echo NO PRESETS ...
548                       if [ ${donotallow} -eq 0 ] 
549                       then
550                         configure
551                       else
552                         # problem when an input file is used
553                         echo 'please cd to '$PWD' and type ./configure' 
554                         exit   
555                       fi ;;
556  esac
557  ########################
558
559
560  ### here a case structure would be great
561
562  if [[ "${phys}" == *"new"* ]]
563  then
564     if [[ "${config}" == "les" ]]  ### LES is different because of WRFV3
565     then
566       sed s+"ARCH_LOCAL      =       "+"ARCH_LOCAL      =       -DNEWPHYS "+g configure.wrf > yeah
567     else
568       sed s+"ARCHFLAGS       =       "+"ARCHFLAGS       =       -DNEWPHYS "+g configure.wrf > yeah
569     fi
570     mv -f yeah configure.wrf
571  fi
572
573        ### SCENARIO SCENARIO SCENARIO
574        if [[ ! ("${scenario}" == "") ]]   ### not supported with LES for the moment?
575        then
576          # precompiling flag in WRF part
577          sed s+"ARCHFLAGS       =   "+"ARCHFLAGS       =   -D${scenario} "+g configure.wrf > yeah
578          mv -f yeah configure.wrf
579          # precompiling flag in LMD part
580          cd $phys
581          cp -Lrf makegcm_${compilo} yeah
582          \rm makegcm_${compilo}
583          sed s+"-DMESOSCALE"+"-D${scenario} -DMESOSCALE"+ yeah > makegcm_${compilo}
584          chmod 755 makegcm_${compilo}
585          \rm yeah
586          cd ..
587        fi
588
589  ################
590  #if [[ "${phys}" == "nophys_" ]]
591  #then
592  #   if [[ "${config}" == "les" ]]  ### LES is different because of WRFV3
593  #   then
594  #     sed s+"ARCH_LOCAL      =       "+"ARCH_LOCAL      =       -DNOPHYS "+g configure.wrf > yeah ; mv -f yeah configure.wrf
595  #     sed s+"-L../$phys/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf
596  #   else
597  #     ### not tested yet but should be working 
598  #     echo CAUTION CAUTION CAUTION NOT FULLY TESTED
599  #     sed s+"ARCHFLAGS       =       "+"ARCHFLAGS       =       -DNOPHYS "+g configure.wrf > yeah ; mv -f yeah configure.wrf
600  #     sed s+"-L../$phys/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf
601  #   fi
602  #fi
603  ################
604
605  if [[ "${phys}" == *"venus"* ]]
606  then
607    sed s+"LIB_BUNDLED     = "+"LIB_BUNDLED     =    /usr/lib64/liblapack.so  \ "+g configure.wrf > yeah ; mv -f yeah configure.wrf
608  fi
609
610  if [ ${debug} -ne 0 ]   # not working for xlf!
611  then
612    echo 'DEBUG DEBUG DEBUG DEBUG'
613    sed s+"# -g"+" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"+g configure.wrf > yeah
614    #sed s+"# -g"+"-g -Ktrap=fp -Mbounds"+g configure.wrf > yeah
615    #sed s+"# -g"+"-g"+g configure.wrf > yeah
616    mv -f yeah configure.wrf
617  fi
618
619  if [[ "${phys}" == *"prescribed"* ]]
620  then
621     donotcompilephys=1
622  fi
623
624  # some compiler and environment mess things up when using -C
625  sed s+"-C"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf   
626
627#exit
628##################################################
629# compile physics
630##################################################
631if [ ${donotcompilephys} -eq 0 ] #|| [[ "${phys}" != *"prescribed"* ]]
632then
633
634 cd $phys/
635
636 if [[ "${phys}" == *"new"* ]]
637 then
638  divx=1
639  divy=1
640 else
641  # required size
642  #----------------
643  case ${numproc} in
644      1) divx=1 ; divy=1  ;;
645      2) divx=1 ; divy=2  ;;
646      4) divx=2 ; divy=2  ;;
647      6) divx=2 ; divy=3  ;;
648      8) divx=2 ; divy=4  ;;
649     12) divx=3 ; divy=4  ;;
650     16) divx=4 ; divy=4  ;;
651     20) divx=4 ; divy=5  ;;
652     24) divx=4 ; divy=6  ;;
653     32) divx=4 ; divy=8  ;;
654     64) divx=8 ; divy=8  ;;
655    128) divx=8 ; divy=16 ;;
656      *) echo not yet supported ; exit ;;
657  esac
658 fi
659  physx=$(expr ${lon} - 1)
660  restex=$(expr ${physx} \% ${divx})   
661  physy=$(expr ${lat} - 1)
662  restey=$(expr ${physy} \% ${divy})
663  if [[ ${restex} != 0 || ${restey} != 0 ]]
664  then
665     echo nx-1 shall be divided by ${divx}
666     echo ny-1 shall be divided by ${divy}
667     exit
668  fi
669  physx=$(expr ${physx} \/ ${divx})
670  physy=$(expr ${physy} \/ ${divy})
671  physz=$(expr ${level} - 1)
672
673  # change this if you change num_soil_layers in WRF
674  # -- default is 10
675  if [[ "${phys}" == *"new"* ]]
676  then
677     soilsize=18 ## nouvelle physique. ne sert a rien ici. voir comsoil.
678  else
679     soilsize=10
680  fi
681
682  # GCM environment variables
683  #--------------------------
684  export LMDGCM=$PWD
685  export LIBOGCM=$PWD/libo
686
687  # generate the appropriate dimphys
688  #---------------------------------
689  if [[ "${phys}" == *"mars"* ]]
690  then
691    cd libf/phymars
692  elif [[ "${phys}" == *"venus"* ]]
693  then
694    cd libf/phyvenus
695  elif [[ "${phys}" == *"generic"* ]]
696  then
697    cd libf/phystd
698  elif [[ "${phys}" == *"titan"* ]]
699  then
700    cd libf/phytitan
701  fi
702  \rm dimphys.h 2> /dev/null
703#  if [[ "${phys}" == "newphys_" ]]
704#  then
705#    ln -sf ../../meso_dimphys.h_ref . ## ne sert plus !!
706#  else
707  if [[ "${phys}" == "mars_lmd" ]]
708  then
709    physize=$(expr ${physx} \* ${physy})
710    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
711    head -15 dimphys.h
712  fi
713     #### TEST new new phys
714     #if [[ "${phys}" == "newphys_" ]]
715     #then
716     #  touch gr_fi_dyn.F.lien
717     #    ln -sf ../dyn3d/gr_fi_dyn.F .  ## dommage, a corriger
718     ################################
719     ################################
720     ################################
721     #fi
722     ####
723     ####
724  cd ../..
725
726  # prepare for nesting
727  #---------------------
728  cd libf
729  duplicate${dom} 2> /dev/null
730  cd ..
731
732  # compile physics
733  #--------------------------
734  \rm libf/grid/dimensions.h 2> /dev/null
735  \rm -rf libo/* 2> /dev/null
736  echo 1. compiling LMD physics ...
737  echo compilation info in:
738  echo $PWD/libo/log_compile_phys
739
740  if [ ${debug} -ne 0 ] 
741  then
742    if [[ "${phys}" == *"mars"* ]]
743    then
744      echo 'DEBUG DEBUG DEBUG DEBUG'
745      nohup makegcm_${compilo} -debug -full -t ${tra} -p mars -d ${physz} testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
746      nohup makegcm_${compilo} -debug -full -t ${tra} -p mars -d ${physz} testphys1d | tee libo/log_compile_phys2 | grep 'warnings' >> libo/log_compile_phys2
747    elif [[ "${phys}" == *"venus"* ]]
748    then
749      echo 'DEBUG DEBUG DEBUG DEBUG'
750      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/
751      nohup ./makelmdz --debug p venus -d 51 rcm1d -arch linux-ifort -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
752    elif [[ "${phys}" == *"generic"* ]]
753    then
754      echo 'DEBUG DEBUG DEBUG DEBUG'
755      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
756    elif [[ "${phys}" == *"titan"* ]]
757    then
758      echo 'DEBUG DEBUG DEBUG DEBUG'
759      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
760    fi
761  else
762    if [[ "${phys}" == *"mars"* ]]
763    then
764      nohup makegcm_${compilo} -t ${tra} -p mars -d ${physz} testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
765      nohup makegcm_${compilo} -t ${tra} -p mars -d ${physz} testphys1d | tee libo/log_compile_phys2 | grep 'warnings' >> libo/log_compile_phys2
766    elif [[ "${phys}" == *"venus"* ]]
767    then
768      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/
769      nohup ./makelmdz -p venus -d 51 rcm1d -arch linux-ifort_meso -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
770      #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
771      #nohup ./makelmdz -p venus -d 51 rcm1d -arch CICLADifort -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
772      #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
773      #nohup ./makelmdz -p venus -d 51 rcm1d -arch X64_MESU -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
774      #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
775      #nohup makelmdz -p venus -d 51 rcm1d -arch X64_OCCIGEN -cpp MESOSCALE  | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
776    elif [[ "${phys}" == *"generic"* ]]
777    then
778      echo $PWD/libo/log_compile_phys2
779      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
780      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
781    elif [[ "${phys}" == *"titan"* ]]
782    then
783      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
784    fi
785  fi
786  echo ... done
787        # clean the duplicate routines
788        cd libf
789        duplicate1 2> /dev/null
790        cd ..
791
792  # merge LMD executables in one lib
793  #--------------------------------------
794  cd libo
795  mkdir temp
796  if [[ "${phys}" == *"mars"* ]]
797  then
798    cp -f LINUX*/*.a temp
799  else #VENUS and GENERIC
800#    cp -f linux*/*.a temp/ # on /u/ and /planeto/
801    cp -f */*.a temp/ # on /u/ and /planeto/
802    #cp -f /home/mlefevre/modipsl/lib/libioipsl.a temp/ #on CICLAD
803    #cp -f X64*/*.a temp #on MESU and OCCIGEN
804    cp -f $pathioipsl/libioipsl.a temp/
805  fi
806  cd temp
807  if [[ "${phys}" == *"mars"* ]]
808   then   
809   ar x libbibio.a
810   ar x libphymars.a
811   ar x libaeronomars.a
812  elif [[ "${phys}" == *"venus"* ]]
813   then
814   ar x libphyvenus.a
815   ar x libmisc.a
816   ar x libphy_common.a
817   ar x libioipsl.a
818  elif [[ "${phys}" == *"generic"* ]]
819   then
820   ar x libphystd.a
821   ar x libmisc.a
822   ar x libphy_common.a
823   ar x libioipsl.a
824  elif [[ "${phys}" == *"titan"* ]]
825  then
826   ar x libchimtitan.a
827   ar x libphytitan.a
828   ar x libmisc.a
829   ar x libphy_common.a
830   ar x libioipsl.a
831  fi
832  \rm *.a
833  ar r liblmd.a *
834  cp -f liblmd.a ..
835  cd ..
836  \rm -r temp
837  nm liblmd.a > liblmd_content
838  # finish merge
839  cd ..
840  if [[ "${phys}" == *"new"* ]]
841  then
842    if [[ "${phys}" == *"mars"* ]]
843    then
844      # include modules for interfacing
845      mv  *.mod ../inc/
846    else
847#      mv  ./libo/linux*/*.mod ../inc/ # on /u/ and /planeto/
848      mv  ./libo/*/*.mod ../inc/ # on /u/ and /planeto/
849      #mv  ./libo/CICLAD*/*.mod ../inc/ # on CICLAD
850      #mv  ./libo/X64*/*.mod ../inc/ # on MESU and OCCIGEN
851      cp -f $pathioipsl/*.mod ../inc/
852    fi
853  fi
854
855
856  # save a copy
857  #--------------
858  cp -f libo/liblmd.a libo/liblmd.a_${lon}_${lat}_${level}_${dom}_${tra}
859  echo '****************************************'
860
861  # ok
862  #----
863  cd ..
864
865  # manage nest includes in module_lmd_driver.F
866  #----
867  cp call_meso_inifis$dom.inc call_meso_inifis.inc
868  cp call_meso_physiq$dom.inc call_meso_physiq.inc
869
870
871fi
872##################################################
873# END compile physics
874##################################################
875
876#------------------
877# compile WRF
878#------------------
879if [ ${justphys} -eq 0 ]
880then
881
882  echo 2. compiling WRF dynamical core ...
883
884  #if [[ "${phys}" == "nophys_" ]]
885  #then
886  # echo 'NO LMD PHYSICS included'
887  #else
888  # if [[ ! ( -f "call_meso_physiq.inc" ) ]]
889  # then
890  #  echo 'did you compile the physics ? no call_meso_physiq.inc !'
891  #  exit
892  # fi
893  #fi
894
895  # be sure to compile with the most recent physics
896  touch phys/module_lmd_driver.F
897
898  # talk to user
899  echo '>>> compiling ... this may be long ... <<<'
900  echo check progress in:
901  echo $PWD/log_compile
902  echo check possible errors in:
903  echo $PWD/log_error
904 
905  # compile ...
906  echo '>>> YOUR CONFIG IS : '${config}
907  case ${config} in
908    'real')         ./compile em_real > log_compile 2> log_error
909                    # save executables 
910                    cd main
911                      if [[ -f real.exe ]]
912                      then
913                        echo 'Looks good ! real.exe is here...'
914                      fi
915                      if [[ -f wrf.exe ]]
916                      then
917                        echo 'Looks good ! wrf.exe is here...'
918                      fi
919                    cp -f real.exe ../../real_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
920                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
921                    cd ..  ;;
922    'ideal')        #mkdir 'test/em_quarter_ss' 2> /dev/null
923                    #echo '>>> YOUR CONFIG IS : '${config}
924                    ./compile em_quarter_ss > log_compile 2> log_error
925                    # save executables 
926                    cd main
927                      if [[ -f ideal.exe ]]
928                      then
929                        echo 'Looks good ! ideal.exe is here...'
930                      fi
931                      if [[ -f wrf.exe ]]
932                      then
933                        echo 'Looks good ! wrf.exe is here...'
934                      fi
935                    cp -f ideal.exe ../../ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
936                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
937                    cd ..  ;;
938    'les')          #echo '>>> YOUR CONFIG IS : '${config}
939                    mkdir 'test/em_les' 2> /dev/null                   
940                    ./compile em_les ###> log_compile 2> log_error
941                    # save executables 
942                    cd main
943                      if [[ -f ideal.exe ]]
944                      then
945                        echo 'Looks good ! ideal.exe is here...'
946                      fi
947                      if [[ -f wrf.exe ]]
948                      then
949                        echo 'Looks good ! wrf.exe is here...'
950                      fi
951                    cp -f ideal.exe ../../ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
952                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
953                    cd ..  ;;
954    *)              echo not supported... please use ; echo ideal les ; exit ;;
955  esac
956  echo '*******last lines from log_error*********'
957  tail -n 20 log_error
958fi
959
960  # the end
961  echo '****************************************'
962  echo 'done.'
963  echo '****************************************'
964  cp last ../makemeso_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}
965  mv last ../../
966  svn info ../../ > ../makemeso_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.svn.info
967
968  # link latest compiled folder as LATEST
969  cd ../../
970  rm -rf LATEST
971  ln -sf ${conf_wrf} LATEST
972
973  # link latest compiled exec
974  cd LATEST
975  case ${config} in
976    'real')         ln -sf real_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe real.exe ;;
977    'ideal')        ln -sf ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe ideal.exe ;;
978    'les')          ln -sf ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe ideal.exe ;;
979  esac
980  ln -sf wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe wrf.exe
981  cd ..
982
983  # add here specific messages
984  if [[ "${dom}" != "1" ]]
985  then
986  nest=$(expr ${lon} + 4)
987  echo NB: in namelist.input, please set:
988  echo '
989  max_dom = '$dom'
990  s_we    = 1,1,
991  e_we    = '$lon','$nest',
992  s_sn    = 1,1,
993  e_sn    = '$lat','$nest',
994  s_vert  = 1,1,
995  e_vert  = '$level','$level','
996  fi
997
998
Note: See TracBrowser for help on using the repository browser.