source: trunk/mesoscale/LMD_MM_MARS/makemeso @ 87

Last change on this file since 87 was 86, checked in by aslmd, 14 years ago

*
mars + LMD_MM_MARS
* Precompilation flag MESOSCALE for better transparency

* in shared phymars between GCM and mesoscale model

*

M 85 mars/libf/phymars/meso_physiq.F
M 85 mars/libf/phymars/meso_inifis.F
Added a pre-compilation flag MESOSCALE so that the LMDZ.MARS GCM
will compile without stating errors because of mesoscale routines.

M 85 mars/libf/phymars/newcondens.F
M 85 mars/libf/phymars/testphys1d.F
M 85 mars/libf/phymars/dustlift.F
D 85 mars/libf/phymars/meso_testphys1d.F
D 85 mars/libf/phymars/meso_dustlift.F
D 85 mars/libf/phymars/meso_newcondens.F
Now, this MESOSCALE precompilation flag can be used to lower
the number of meso_* routines when adaptations for mesoscale
applications are not very extended.
--> Three meso_* routines were deleted and changes are
now impacted under the MESOSCALE flag in the original GCM routines
--> Completely transparent for GCM compilation since it is devoid
of the -DMESOSCALE option
--> Very good for syncing because changes in dustlift, newcondens
will be directly available in the mesoscale model

M 84 mesoscale/LMD_MM_MARS/makemeso
Changed meso_testphys1d in testphys1d

M 84 mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_pgf
M 84 mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_mpifort
M 84 mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_ifort
M 84 mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_g95
M 84 mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_mpi
Added the option -DMESOSCALE in these scripts

*
LMD_MM_MARS
* Various minor changes related to water cycle and plotting routines

* Also included the GW test case

*

A 0 mesoscale/LMDZ.MARS.new/myGCM/DEFS_JB/callphys.def.orig
M 84 mesoscale/NOTES.txt
D 84 mesoscale/LMD_MM_MARS/SRC/ARWpost/idl
M 84 mesoscale/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM
M 84 mesoscale/LMD_MM_MARS/SIMU/gnome_launch.meso
M 85 mesoscale/PLOT/MINIMAL/map_latlon.pro
D 85 mesoscale/PLOT/SPEC/LES/getget.pro
M 85 mesoscale/PLOT/SPEC/MAP/map_uvt.pro
A + - mesoscale/PLOT/SPEC/getget.pro
A 0 mesoscale/PLOT/RESERVE/obsolete
A 0 mesoscale/TESTS/TESTGW.tar.gz
M 84 000-USERS

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