1 | #! /bin/bash |
---|
2 | |
---|
3 | #------------------------------ |
---|
4 | # makeles |
---|
5 | #------------------------------ |
---|
6 | # MMM must be defined |
---|
7 | #------------------------------ |
---|
8 | # A. Spiga 01/2009 |
---|
9 | #------------------------------ |
---|
10 | |
---|
11 | |
---|
12 | # |
---|
13 | # SPECIAL CICLAD |
---|
14 | # |
---|
15 | |
---|
16 | donotcompilephys=0 |
---|
17 | while getopts "n" options; do |
---|
18 | case $options in |
---|
19 | n ) donotcompilephys=1;; ## do not recompile physics |
---|
20 | esac |
---|
21 | done |
---|
22 | |
---|
23 | # |
---|
24 | # LOCATIONS |
---|
25 | # |
---|
26 | here=$PWD |
---|
27 | whereliblmd=$here |
---|
28 | |
---|
29 | |
---|
30 | ############################################################## |
---|
31 | ############################################################## |
---|
32 | if [ ${donotcompilephys} -eq 0 ] |
---|
33 | then |
---|
34 | |
---|
35 | # |
---|
36 | # COMPILE PHYSICS |
---|
37 | # |
---|
38 | cd $MMM |
---|
39 | makemeso -j |
---|
40 | # |
---|
41 | #makemeso -rd < last > /dev/null |
---|
42 | folder=$PWD'/'$(more what_folder)'/WRFV2/' |
---|
43 | libphys_folder=$folder'mars_lmd/libo/' |
---|
44 | phymars_folder=$folder'mars_lmd/libf/phymars/' |
---|
45 | \rm what_folder 2> /dev/null |
---|
46 | |
---|
47 | # |
---|
48 | # GET liblmd GENERATED LIBRARY and INCLUDEs |
---|
49 | # |
---|
50 | echo $libphys_folder |
---|
51 | cp -rf ${libphys_folder}/liblmd.a ${whereliblmd}/ |
---|
52 | #cp -rf ${phymars_folder}/dimphys.h ${here}/modif_mars/ |
---|
53 | cp -rf ${phymars_folder}/dimphys.h ${here}/mars_lmd/libf/phymars/ |
---|
54 | #cp -rf ${folder}/call_meso_inifis.inc ${here}/modif_mars/ |
---|
55 | #cp -rf ${folder}/call_meso_physiq.inc ${here}/modif_mars/ |
---|
56 | cp -rf ${folder}/call_meso_inifis.inc ${here}/ |
---|
57 | cp -rf ${folder}/call_meso_physiq.inc ${here}/ |
---|
58 | #cp -rf ${folder}/inc/module_lmd_driver_output*.inc ${here}/modif_mars/ |
---|
59 | cp -rf ${folder}/inc/module_lmd_driver_output*.inc ${here}/inc/ |
---|
60 | #cp -rf ${phymars_folder}/wrf_output_2d.h ${here}/modif_mars/ |
---|
61 | #cp -rf ${phymars_folder}/wrf_output_3d.h ${here}/modif_mars/ |
---|
62 | cp -rf ${phymars_folder}/wrf_output_2d.h ${here}/mars_lmd/libf/phymars/ |
---|
63 | cp -rf ${phymars_folder}/wrf_output_3d.h ${here}/mars_lmd/libf/phymars/ |
---|
64 | fi |
---|
65 | ############################################################## |
---|
66 | ############################################################## |
---|
67 | |
---|
68 | |
---|
69 | cd $here |
---|
70 | |
---|
71 | #------------------------------ |
---|
72 | #------------------------------ |
---|
73 | # |
---|
74 | # MPI (dm) 64 bits |
---|
75 | # |
---|
76 | #TODO: le rendre adapte aux reponses du user a makemeso |
---|
77 | touch conf |
---|
78 | echo 3 >> conf |
---|
79 | #echo 4 >> conf #openMP n'arrange pas beaucoup de le tps de calcul |
---|
80 | echo 1 >> conf |
---|
81 | #------------------------------ |
---|
82 | #------------------------------ |
---|
83 | |
---|
84 | |
---|
85 | |
---|
86 | ### SINGLE PROC 32 bits g95 |
---|
87 | #touch conf |
---|
88 | #echo 5 >> conf |
---|
89 | #echo 0 >> conf |
---|
90 | |
---|
91 | ## SINGLE PROC 64 bits |
---|
92 | #touch conf |
---|
93 | #echo 1 >> conf |
---|
94 | #echo 0 >> conf |
---|
95 | |
---|
96 | |
---|
97 | |
---|
98 | # |
---|
99 | # CONFIGURE |
---|
100 | # |
---|
101 | echo "configure..." |
---|
102 | #touch configure.wrf |
---|
103 | \rm configure.wrf |
---|
104 | ./configure < conf > /dev/null 2> /dev/null |
---|
105 | #./configure |
---|
106 | #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 |
---|
107 | #### NEW NEW NEW NEW |
---|
108 | 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 |
---|
109 | ##sed s+"# -g"+"-fno-second-underscore # -g"+g configure.wrf | sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g > yeah |
---|
110 | ##sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+"#-g"+"-g"+g > yeah |
---|
111 | ##sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf > yeah |
---|
112 | mv yeah configure.wrf |
---|
113 | #sed s+"-fastsse"+"-fastsse -mcmodel=medium -Mlarge_arrays"+g configure.wrf > yeah |
---|
114 | ##sed s+"-fastsse"+"-fastsse -mcmodel=medium"+g configure.wrf > yeah |
---|
115 | #mv yeah configure.wrf |
---|
116 | sed s+"-fastsse"+" "+g configure.wrf > yeah |
---|
117 | mv yeah configure.wrf |
---|
118 | \rm conf |
---|
119 | |
---|
120 | |
---|
121 | # |
---|
122 | # COMPILE LES TEST CASE w/ LMD PHYSICS |
---|
123 | # |
---|
124 | touch modif_mars/module_lmd_driver.F |
---|
125 | \rm log_compile |
---|
126 | \rm log_error |
---|
127 | echo "compile LES WRF with LMD Mars physics... look log_compile and log_error" |
---|
128 | compile em_les > log_compile 2> log_error |
---|
129 | |
---|
130 | echo '***********************************' |
---|
131 | tail -n 20 log_error |
---|
132 | |
---|