1 | #! /bin/bash |
---|
2 | |
---|
3 | #------------------------------ |
---|
4 | # makeles |
---|
5 | #------------------------------ |
---|
6 | # MMM must be defined |
---|
7 | #------------------------------ |
---|
8 | # A. Spiga 01/2009 |
---|
9 | #------------------------------ |
---|
10 | |
---|
11 | |
---|
12 | echo "Use -n if you don't want to recompile physics" |
---|
13 | echo "Use -p if you want the new LMD physics" |
---|
14 | |
---|
15 | # |
---|
16 | # SPECIAL CICLAD |
---|
17 | # |
---|
18 | |
---|
19 | donotcompilephys=0 |
---|
20 | phys="" |
---|
21 | while getopts "np" options; do |
---|
22 | case $options in |
---|
23 | n ) donotcompilephys=1;; ## do not recompile physics |
---|
24 | p ) phys="newphys_";; ## with new physics |
---|
25 | esac |
---|
26 | done |
---|
27 | |
---|
28 | # |
---|
29 | # LOCATIONS |
---|
30 | # |
---|
31 | here=$PWD |
---|
32 | whereliblmd=$here |
---|
33 | |
---|
34 | |
---|
35 | ############################################################## |
---|
36 | ############################################################## |
---|
37 | if [ ${donotcompilephys} -eq 0 ] |
---|
38 | then |
---|
39 | |
---|
40 | # |
---|
41 | # COMPILE PHYSICS |
---|
42 | # |
---|
43 | cd $MMM |
---|
44 | if [[ "${phys}" == "newphys_" ]] |
---|
45 | then |
---|
46 | makemeso -j -p |
---|
47 | else |
---|
48 | makemeso -j |
---|
49 | fi |
---|
50 | # |
---|
51 | #makemeso -rd < last > /dev/null |
---|
52 | folder=$PWD'/'$(more what_folder)'/WRFV2/' |
---|
53 | libphys_folder=$folder'mars_lmd/libo/' |
---|
54 | phymars_folder=$folder'mars_lmd/libf/phymars/' |
---|
55 | \rm what_folder 2> /dev/null |
---|
56 | |
---|
57 | # |
---|
58 | # GET liblmd GENERATED LIBRARY and INCLUDEs |
---|
59 | # |
---|
60 | echo $libphys_folder |
---|
61 | cp -rf ${libphys_folder}/liblmd.a ${whereliblmd}/ |
---|
62 | #cp -rf ${phymars_folder}/dimphys.h ${here}/modif_mars/ |
---|
63 | cp -rf ${phymars_folder}/dimphys.h ${here}/mars_lmd/libf/phymars/ |
---|
64 | #cp -rf ${folder}/call_meso_inifis.inc ${here}/modif_mars/ |
---|
65 | #cp -rf ${folder}/call_meso_physiq.inc ${here}/modif_mars/ |
---|
66 | cp -rf ${folder}/call_meso_inifis.inc ${here}/ |
---|
67 | cp -rf ${folder}/call_meso_physiq.inc ${here}/ |
---|
68 | #cp -rf ${folder}/inc/module_lmd_driver_output*.inc ${here}/modif_mars/ |
---|
69 | cp -rf ${folder}/inc/module_lmd_driver_output*.inc ${here}/inc/ |
---|
70 | #cp -rf ${phymars_folder}/wrf_output_2d.h ${here}/modif_mars/ |
---|
71 | #cp -rf ${phymars_folder}/wrf_output_3d.h ${here}/modif_mars/ |
---|
72 | cp -rf ${phymars_folder}/wrf_output_2d.h ${here}/mars_lmd/libf/phymars/ |
---|
73 | cp -rf ${phymars_folder}/wrf_output_3d.h ${here}/mars_lmd/libf/phymars/ |
---|
74 | fi |
---|
75 | ############################################################## |
---|
76 | ############################################################## |
---|
77 | |
---|
78 | |
---|
79 | cd $here |
---|
80 | |
---|
81 | ##------------------------------ |
---|
82 | ##------------------------------ |
---|
83 | ## |
---|
84 | ## MPI (dm) 64 bits |
---|
85 | ## |
---|
86 | ##TODO: le rendre adapte aux reponses du user a makemeso |
---|
87 | touch conf |
---|
88 | echo 3 >> conf |
---|
89 | ##echo 4 >> conf #openMP n'arrange pas beaucoup de le tps de calcul |
---|
90 | echo 1 >> conf |
---|
91 | ##------------------------------ |
---|
92 | ##------------------------------ |
---|
93 | |
---|
94 | |
---|
95 | |
---|
96 | ### SINGLE PROC 32 bits g95 |
---|
97 | #touch conf |
---|
98 | #echo 5 >> conf |
---|
99 | #echo 0 >> conf |
---|
100 | |
---|
101 | ## SINGLE PROC 64 bits |
---|
102 | #touch conf |
---|
103 | #echo 1 >> conf |
---|
104 | #echo 0 >> conf |
---|
105 | |
---|
106 | ### MPI (dm) 64 bits IFORT |
---|
107 | #echo IFORT IFORT IFORT IFORT |
---|
108 | #touch conf |
---|
109 | #echo 7 >> conf |
---|
110 | #echo 1 >> conf |
---|
111 | |
---|
112 | |
---|
113 | # |
---|
114 | # CONFIGURE |
---|
115 | # |
---|
116 | echo "configure..." |
---|
117 | #touch configure.wrf |
---|
118 | \rm configure.wrf |
---|
119 | ./configure < conf > /dev/null 2> /dev/null |
---|
120 | #./configure |
---|
121 | #sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+'mpif90 -f90=$(SFC)'+'/usr/lib64/openmpi/1.2.8-pgf/bin/mpif90'+g | sed s+'mpicc -cc=$(SCC)'+'/usr/lib64/openmpi/1.2.8-gcc/bin/mpicc -DMPI2_SUPPORT'+g > yeah |
---|
122 | ## WHERE_MPI must be defined |
---|
123 | sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+"mpif90"+"$WHERE_MPI/mpif90"+g | sed s+"mpicc"+"$WHERE_MPI/mpicc -DMPI2_SUPPORT"+g > yeah |
---|
124 | #sed s+"# -g"+"-fno-second-underscore # -g"+g configure.wrf | sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g > yeah |
---|
125 | #sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+"#-g"+"-g"+g > yeah |
---|
126 | #sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf > yeah |
---|
127 | mv yeah configure.wrf |
---|
128 | |
---|
129 | #### |
---|
130 | #### provoque des seg faults.... |
---|
131 | #### |
---|
132 | #sed s+"-fastsse"+"-fastsse -mcmodel=medium -Mlarge_arrays"+g configure.wrf > yeah |
---|
133 | #### TEST TEST |
---|
134 | #mv yeah configure.wrf |
---|
135 | |
---|
136 | sed s+"-fastsse"+" "+g configure.wrf > yeah |
---|
137 | #sed s+"-fastsse"+"-mcmodel=medium -Mlarge_arrays"+g configure.wrf > yeah ##marche pas |
---|
138 | # |
---|
139 | # sometimes fastsse is problematic |
---|
140 | # |
---|
141 | |
---|
142 | ##sed s+"-fastsse"+"-fastsse -mcmodel=medium"+g configure.wrf > yeah |
---|
143 | mv yeah configure.wrf |
---|
144 | |
---|
145 | #sed s+"-Mvect=noaltcode"+"#-Mvect=noaltcode"+g configure.wrf > yeah ; mv yeah configure.wrf |
---|
146 | |
---|
147 | #sed s+"-mp -Minfo=mp"+"-mp -Minfo=mp -mp=nonuma"+g configure.wrf > yeah |
---|
148 | #mv yeah configure.wrf |
---|
149 | |
---|
150 | #### OBLIGATOIRE POUR IFORT, OK AVEC LES AUTRES ??? a priori oui |
---|
151 | sed s+"-llmd"+"-llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah |
---|
152 | mv yeah configure.wrf |
---|
153 | |
---|
154 | ############################################################# |
---|
155 | if [[ "${phys}" == "newphys_" ]] |
---|
156 | then |
---|
157 | sed s+"ARCH_LOCAL = "+"ARCH_LOCAL = -DNEWPHYS "+g configure.wrf > yeah |
---|
158 | mv -f yeah configure.wrf |
---|
159 | fi |
---|
160 | ############################################################# |
---|
161 | |
---|
162 | |
---|
163 | \rm conf |
---|
164 | |
---|
165 | # |
---|
166 | # COMPILE LES TEST CASE w/ LMD PHYSICS |
---|
167 | # |
---|
168 | touch modif_mars/module_lmd_driver.F |
---|
169 | \rm log_compile |
---|
170 | \rm log_error |
---|
171 | echo "compile LES WRF with LMD Mars physics... look log_compile and log_error" |
---|
172 | compile em_les > log_compile 2> log_error |
---|
173 | |
---|
174 | echo '***********************************' |
---|
175 | tail -n 20 log_error |
---|
176 | |
---|