source: trunk/mesoscale/LMD_MM_MARS/makemeso @ 54

Last change on this file since 54 was 54, checked in by aslmd, 15 years ago

LMD_LES_MARS: Tests with new physics in unified frame
M 53 mesoscale/LMD_LES_MARS/modif_mars/module_model_constants.F
M 53 mesoscale/LMD_LES_MARS/modif_mars/module_first_rk_step_part1.F
M 53 mesoscale/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F
Modifications made to cope with new soil scheme

M 53 mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd/libf/phymars/meso_physiq.F
Commented aeronomars in old physics so that the model can compile with lots of grid points


LMD_MM_MARS: Implement tracers with the new physics. Test with JBM runs with 5 tracers

including radiatively active dust and water ice

TODO: propagate reading "traceur.def" and few initialisations from

testphys1d.F into module_lmd_driver.F

M 53 mars/libf/phymars/dimradmars.h
M 53 mars/libf/phymars/callradite.F
Change it back to both dust and ice radiatively active

M 53 mesoscale/LMD_MM_MARS/makemeso
Allow to "fresh start" with the inclusion of "clean -a" in the script

M 53 mesoscale/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM
M 53 mesoscale/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_real.F
M 53 mesoscale/LMD_MM_MARS/SRC/WRFV2/dyn_em/solve_em.F
M 53 mesoscale/LMD_MM_MARS/SRC/WRFV2/main/real_em.F
M 53 mesoscale/LMD_MM_MARS/SIMU/runmeso
Added the option mars==11 with 5 tracers: CO2 H2Ovap H2Oice DUST DUSTN
-- Note that the order matters for H2Ovap and H2Oice

LMD_MM_MARS: Create a folder to run LMD GCM with exact same physics as mesoscale

A 0 mesoscale/LMDZ.MARS/libf/phymars/physiq.F
All files in mesoscale/LMDZ.MARS/libf are links except this one
--> Because specific WRITEDIAGFI commands are set to output what is needed PREP_MARS
--> Something must be done so that qCO2, qdust, qdustN can be propagated too !!!

A 0 mesoscale/LMDZ.MARS/libf_gcm
A 0 mesoscale/LMDZ.MARS/in_lmdz_mars_newphys
Two important links that must not be broken

A 0 mesoscale/LMDZ.MARS/myGCM
This folder is for runs. Only links here -- except temp files which are not synchronized.

M 53 mesoscale/LMD_MM_MARS/SIMU/in_lmdz_mars_newphys/compile
A 0 mesoscale/LMD_MM_MARS/SIMU/in_lmdz_mars_newphys/myGCM/run.def
A 0 mesoscale/LMD_MM_MARS/SIMU/in_lmdz_mars_newphys/myGCM/traceur.def
M 53 mesoscale/LMD_MM_MARS/SIMU/in_lmdz_mars_newphys/myGCM/callphys.def
A 0 mesoscale/LMD_MM_MARS/SIMU/in_lmdz_mars_newphys/myGCM/callphys.def.csttau
Those files are needed to run the GCM in order to prepare initial & boundary

conditions for the mesoscale... but basically it is the exact same GCM

--> compile is a convenient script

A 0 mesoscale/LMDZ.MARS/makegcm
A 0 mesoscale/LMDZ.MARS/makegcm_g95
A 0 mesoscale/LMDZ.MARS/create_make_gcm
This is supposed to be merged one day with files in trunk/mars/

A 0 mesoscale/LMDZ.MARS/myGCM/DEFS_JB
Necessary files to restart a GCM run corresponding to new water cycle in JB's thesis

  • Property svn:executable set to *
File size: 22.4 KB
RevLine 
[11]1#! /bin/bash
2
3
4##################################
5# makemeso allows you to compile #
6# WRF with modified LMD physics  #
7##################################
8
9##############################
10# Author: A. Spiga           #
11# New version : October 2008 #
12# Last update : January 2009 #
13#               November  09 #
[29]14#               January   11 #
[11]15##############################
16
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
[54]54fresh_start=0
[29]55phys=""
[54]56while getopts "drc:njhgpf" options; do
[11]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
[54]64   p ) phys="newphys_";;    ## with new physics
65   f ) fresh_start=1;;      ## a fresh start
[11]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
[29]85#
86# makemeso -p                ## with new LMD physics
[54]87#
88# makemeso -f                ## fresh start [clean -a]
[11]89" ; exit ;;
90  esac
91done   
92
93#--------------
94# talk w/ user
95#--------------
96  echo '****************************************'
97  echo ' LMD Mesoscale Model Compiler. Welcome.'
98  echo '****************************************'
[29]99  if [[ "${phys}" == "newphys_" ]]
100  then
101    echo '***********with new physics*************'
102    echo '****************************************'
103  fi
[11]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 ; read numproc ;;
131    4) compilo='ifort' ; numproc=1 ;;
132    5) compilo='mpifort' ; echo How many processors ? 1, 2, 4, 6, 8, 12, 16 ; read numproc ;;
133    7) compilo='mpixlf' ; echo How many processors ? 1, 2, 4, 6, 8, 12, 16 ; 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
[29]163    conf_wrf="${phys}${compilo}_${machine}${single}${testflag}"
[11]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
[29]189    if [[ "${phys}" == "newphys_" ]]
190    then
[54]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 ..
[29]200    else
[54]201     ./copy_model
202     mv WRFV2 ${conf_wrf}/
203     cd ${conf_wrf}/WRFV2
204     cd Registry ; Registry.bash ; cd ..
205     fi
[11]206  else
207    cd ${conf_wrf}/WRFV2
[54]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
[11]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  ########################
[30]270  conf_wrf_forall="${compilo}_${machine}${single}${testflag}"
271  case ${conf_wrf_forall} in
[11]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 ;;
[24]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;;
[11]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
[28]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 ;;
[11]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
[29]366  if [[ "${phys}" == "newphys_" ]]
367  then
[31]368     sed s+"ARCHFLAGS       =       "+"ARCHFLAGS       =       -DNEWPHYS "+g configure.wrf > yeah
[29]369     mv -f yeah configure.wrf
370  fi
[11]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    *) echo not supported ; exit
413  esac
414
415  # change this if you change num_soil_layers in WRF
416  # -- default is 10
[30]417  if [[ "${phys}" == "newphys_" ]]
418  then
419     soilsize=18 ## nouvelle physique
420  else
421     soilsize=10
422  fi
[11]423
424  # GCM environment variables
425  #--------------------------
426  export LMDGCM=$PWD
427  export LIBOGCM=$PWD/libo
428
429  # generate the appropriate dimphys
430  #---------------------------------
431  cd libf/phymars
432  \rm dimphys.h 2> /dev/null
433  physize=$(expr ${physx} \* ${physy})
434  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
435  head -15 dimphys.h
[42]436     ###
437     ### TEST new new phys
438     if [[ "${phys}" == "newphys_" ]]
439     then
[50]440       touch callkeys.h.meso 
[48]441         ln -sf meso_callkeys.h callkeys.h
[50]442       touch dustlift.F.meso
[48]443         ln -sf meso_dustlift.F dustlift.F  ## attention avec "ancienne nouvelle physique"
[50]444       touch readtesassim.F90.meso
[48]445         ln -sf meso_readtesassim.F90 readtesassim.F90  ## attention idem
[50]446       touch gr_fi_dyn.F.lien
[48]447         ln -sf ../dyn3d/gr_fi_dyn.F .  ## dommage, a corriger ## attention idem
[42]448     fi
449     ###
450     ###
[11]451  cd ../..
452
453  # prepare for nesting
454  #---------------------
455  cd libf
456  duplicate${dom} 2> /dev/null
457  cd ..
458
459  # compile physics
460  #--------------------------
461  \rm libf/grid/dimensions.h 2> /dev/null
462  \rm -rf libo/* 2> /dev/null
463  echo 1. compiling LMD physics ...
464  echo compilation info in:
465  echo $PWD/libo/log_compile_phys
466
467  if [ ${debug} -ne 0 ]
468  then
469    echo 'DEBUG DEBUG DEBUG DEBUG'
470    nohup makegcm_${compilo} -debug -t ${tra} -p mars -d ${physz} meso_testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
471  else
472    nohup makegcm_${compilo} -t ${tra} -p mars -d ${physz} meso_testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
473  fi
474  echo ... done
475        # clean the duplicate routines
476        cd libf
477        duplicate1 2> /dev/null
478        cd ..
479
480  # merge LMD executables in one lib
481  #--------------------------------------
482  cd libo
483  mkdir temp
484  #cp -f LINUXfastI._${physz}_t${tra}_reg/*.a temp
485  cp -f LINUX*/*.a temp
486  cd temp
487  ar x libbibio.a
488  ar x libphymars.a
489  ar x libaeronomars.a
490  \rm *.a
491  ar r liblmd.a *
492  cp -f liblmd.a ..
493  cd ..
494  \rm -r temp
495  nm liblmd.a > liblmd_content
496  # finish merge
497  cd ..
498
499  # save a copy
500  #--------------
501  cp -f libo/liblmd.a libo/liblmd.a_${lon}_${lat}_${level}_${dom}_${tra}
502  echo '****************************************'
503
504  # ok
505  #----
506  cd ..
507
508  # manage nest includes in module_lmd_driver.F
509  #----
510  cp call_meso_inifis$dom.inc call_meso_inifis.inc
511  cp call_meso_physiq$dom.inc call_meso_physiq.inc
512
513
514fi
515##################################################
516# END compile physics
517##################################################
518
519#------------------
520# compile WRF
521#------------------
522if [ ${justphys} -eq 0 ]
523then
524
525  echo 2. compiling WRF dynamical core ...
526
527  if [[ ! ( -f "call_meso_physiq.inc" ) ]]
528  then
529   echo 'did you compile the physics ? no call_meso_physiq.inc !'
530   exit
531  fi
532
533  # be sure to compile with the most recent physics
534  touch phys/module_lmd_driver.F
535
536  # talk to user
537  echo '>>> YOUR CONFIG IS : '${config}
538  echo '>>> compiling ... this may be long ... <<<'
539  echo check progress in:
540  echo $PWD/log_compile
541  echo check possible errors in:
542  echo $PWD/log_error
543 
544  # compile ...
545  case ${config} in
546    'real')         compile em_real > log_compile 2> log_error
547                    # save executables 
548                    cd main
549                      if [[ -f wrf.exe ]]
550                      then
551                        echo 'Looks good ! wrf.exe is here...'
552                      fi
553                    cp -f real.exe ../../real_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
554                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
555                    cd ..  ;;
556    'convection')   #mkdir 'test/em_quarter_ss' 2> /dev/null
557                    compile em_quarter_ss > log_compile 2> log_error
558                    # save executables 
559                    cd main
560                      if [[ -f wrf.exe ]]
561                      then
562                        echo 'Looks good ! wrf.exe is here...'
563                      fi
564                    cp -f ideal.exe ../../ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
565                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
566                    cd ..  ;;
567    *)              echo not supported please use ; echo real convection ; exit ;;
568  esac
569  echo '*******last lines from log_error*********'
570  tail -n 20 log_error
571fi
572
573  # the end
574  echo '****************************************'
575  echo 'done.'
576  echo '****************************************'
577  cp last ../makemeso_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}
578  mv last ../../
579
580  # add here specific messages
581  if [[ "${dom}" != "1" ]]
582  then
583  nest=$(expr ${lon} + 4)
584  echo NB: in namelist.input, please set:
585  echo '
586  max_dom = '$dom'
587  s_we    = 1,1,
588  e_we    = '$lon','$nest',
589  s_sn    = 1,1,
590  e_sn    = '$lat','$nest',
591  s_vert  = 1,1,
592  e_vert  = '$level','$level','
593  fi
594
Note: See TracBrowser for help on using the repository browser.