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 | #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-pgf/bin/mpicc -DMPI2_SUPPORT'+g > yeah |
---|
123 | ##### NEW NEW NEW NEW |
---|
124 | #sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+'mpif90 -f90=$(SFC)'+'/usr/lib64/openmpi/1.4.2-pgf/bin/mpif90'+g | sed s+'mpicc -cc=$(SCC)'+'/usr/lib64/openmpi/1.4.2-gfortran/bin/mpicc -DMPI2_SUPPORT'+g > yeah |
---|
125 | sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+'mpif90 -f90=$(SFC)'+'/usr/lib64/openmpi/1.4.3-pgfgcc/bin/mpif90'+g | sed s+'mpicc -cc=$(SCC)'+'/usr/lib64/openmpi/1.4.3-pgfgcc/bin/mpicc -DMPI2_SUPPORT'+g > yeah |
---|
126 | #sed s+"# -g"+"-fno-second-underscore # -g"+g configure.wrf | sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g > yeah |
---|
127 | #sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+"#-g"+"-g"+g > yeah |
---|
128 | #sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf > yeah |
---|
129 | mv yeah configure.wrf |
---|
130 | |
---|
131 | #### |
---|
132 | #### provoque des seg faults.... |
---|
133 | #### |
---|
134 | #sed s+"-fastsse"+"-fastsse -mcmodel=medium -Mlarge_arrays"+g configure.wrf > yeah |
---|
135 | #### TEST TEST |
---|
136 | #mv yeah configure.wrf |
---|
137 | |
---|
138 | sed s+"-fastsse"+" "+g configure.wrf > yeah |
---|
139 | #sed s+"-fastsse"+"-mcmodel=medium -Mlarge_arrays"+g configure.wrf > yeah ##marche pas |
---|
140 | # |
---|
141 | # sometimes fastsse is problematic |
---|
142 | # |
---|
143 | |
---|
144 | ##sed s+"-fastsse"+"-fastsse -mcmodel=medium"+g configure.wrf > yeah |
---|
145 | mv yeah configure.wrf |
---|
146 | |
---|
147 | #sed s+"-Mvect=noaltcode"+"#-Mvect=noaltcode"+g configure.wrf > yeah ; mv yeah configure.wrf |
---|
148 | |
---|
149 | #sed s+"-mp -Minfo=mp"+"-mp -Minfo=mp -mp=nonuma"+g configure.wrf > yeah |
---|
150 | #mv yeah configure.wrf |
---|
151 | |
---|
152 | #### OBLIGATOIRE POUR IFORT, OK AVEC LES AUTRES ??? a priori oui |
---|
153 | sed s+"-llmd"+"-llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah |
---|
154 | mv yeah configure.wrf |
---|
155 | |
---|
156 | ############################################################# |
---|
157 | if [[ "${phys}" == "newphys_" ]] |
---|
158 | then |
---|
159 | sed s+"ARCH_LOCAL = "+"ARCH_LOCAL = -DNEWPHYS "+g configure.wrf > yeah |
---|
160 | mv -f yeah configure.wrf |
---|
161 | #touch modif_mars/module_model_constants.F |
---|
162 | #touch modif_mars/module_first_rk_step_part1.F |
---|
163 | fi |
---|
164 | ############################################################# |
---|
165 | |
---|
166 | |
---|
167 | \rm conf |
---|
168 | |
---|
169 | # |
---|
170 | # COMPILE LES TEST CASE w/ LMD PHYSICS |
---|
171 | # |
---|
172 | touch modif_mars/module_lmd_driver.F |
---|
173 | \rm log_compile |
---|
174 | \rm log_error |
---|
175 | echo "compile LES WRF with LMD Mars physics... look log_compile and log_error" |
---|
176 | compile em_les > log_compile 2> log_error |
---|
177 | |
---|
178 | echo '***********************************' |
---|
179 | tail -n 20 log_error |
---|
180 | |
---|