1 | #! /bin/bash |
---|
2 | |
---|
3 | ########################################################## |
---|
4 | laphysiq="mars_lmd" ## default value |
---|
5 | config="" ## default value |
---|
6 | while getopts "p:c:" options; do |
---|
7 | case $options in |
---|
8 | p ) laphysiq="${OPTARG}";; ## choose physics |
---|
9 | c ) config="${OPTARG}";; ## choose config |
---|
10 | esac |
---|
11 | done |
---|
12 | ########################################################## |
---|
13 | echo '*** copying physics: '$laphysiq |
---|
14 | ########################################################## |
---|
15 | |
---|
16 | echo '*** linking sources from ...' |
---|
17 | WRFSRC=$PWD/SRC/ |
---|
18 | if [[ "${config}" == "les" ]] |
---|
19 | then |
---|
20 | WRFSRC=$PWD/SRC/LES/ |
---|
21 | fi |
---|
22 | echo $WRFSRC |
---|
23 | echo '*** to ...' |
---|
24 | HERE=$PWD |
---|
25 | echo $HERE |
---|
26 | |
---|
27 | |
---|
28 | #mkdir WPS |
---|
29 | #cd WPS |
---|
30 | #ln -sf $WRFSRC/WPS/wps_mars . |
---|
31 | #ln -sf $WRFSRC/WPS/switch_WPS_Mars . |
---|
32 | #cd .. |
---|
33 | |
---|
34 | mkdir zeWRFV2 |
---|
35 | #ln -sf $WRFSRC/prepare_ini . |
---|
36 | cd zeWRFV2 |
---|
37 | |
---|
38 | echo '*** start defining folders and links' |
---|
39 | ln -sf $WRFSRC/WRFV2/clean . |
---|
40 | ln -sf $WRFSRC/WRFV2/compile . |
---|
41 | #ln -sf $WRFSRC/WRFV2/makemeso . |
---|
42 | ln -sf $WRFSRC/WRFV2/configure . |
---|
43 | ln -sf $WRFSRC/WRFV2/Makefile . |
---|
44 | #ln -sf $WRFSRC/WRFV2/mars.sed* . |
---|
45 | ln -sf $WRFSRC/WRFV2/*.h . |
---|
46 | ln -sf $WRFSRC/WRFV2/configure.defaults.* . |
---|
47 | ln -sf $WRFSRC/WRFV2/call_meso_inifis?.inc . |
---|
48 | ln -sf $WRFSRC/WRFV2/call_meso_physiq?.inc . |
---|
49 | |
---|
50 | #\rm meso_dimphys.h |
---|
51 | #cp $WRFSRC/WRFV2/meso_dimphys.h . |
---|
52 | #cp $WRFSRC/WRFV2/call_*.inc . |
---|
53 | #cp $WRFSRC/WRFV2/custom*.inc . |
---|
54 | mkdir Registry |
---|
55 | ln -sf $WRFSRC/WRFV2/Registry/* Registry/ |
---|
56 | ### this is to allow one to change Registry somewhere without it being changed everywhere ! |
---|
57 | rm Registry/Registry.EM |
---|
58 | cp $WRFSRC/WRFV2/Registry/Registry.EM Registry/ |
---|
59 | mkdir arch |
---|
60 | ln -sf $WRFSRC/WRFV2/arch/* arch/ |
---|
61 | mkdir dyn_em |
---|
62 | ln -sf $WRFSRC/WRFV2/dyn_em/* dyn_em/ |
---|
63 | mkdir dyn_exp |
---|
64 | ln -sf $WRFSRC/WRFV2/dyn_exp/* dyn_exp/ |
---|
65 | mkdir dyn_nmm |
---|
66 | ln -sf $WRFSRC/WRFV2/dyn_nmm/* dyn_nmm/ |
---|
67 | mkdir frame |
---|
68 | ln -sf $WRFSRC/WRFV2/frame/* frame/ |
---|
69 | mkdir inc |
---|
70 | ln -sf $WRFSRC/WRFV2/inc/* inc/ |
---|
71 | mkdir main |
---|
72 | ln -sf $WRFSRC/WRFV2/main/* main/ |
---|
73 | mkdir phys |
---|
74 | ln -sf $WRFSRC/WRFV2/phys/* phys/ |
---|
75 | echo $laphysiq |
---|
76 | ln -sf $WRFSRC/WRFV2/phys/dynphy_wrf_$laphysiq/* phys/ |
---|
77 | mkdir run |
---|
78 | ln -sf $WRFSRC/WRFV2/run/* run/ |
---|
79 | mkdir share |
---|
80 | ln -sf $WRFSRC/WRFV2/share/* share/ |
---|
81 | mkdir tools |
---|
82 | ln -sf $WRFSRC/WRFV2/tools/* tools/ |
---|
83 | \rm tools/DOMAIN_TIME_TEST |
---|
84 | \rm tools/CodeBase |
---|
85 | mkdir tools/DOMAIN_TIME_TEST |
---|
86 | ln -sf $WRFSRC/WRFV2/tools/DOMAIN_TIME_TEST/* tools/DOMAIN_TIME_TEST/ |
---|
87 | mkdir tools/CodeBase |
---|
88 | ln -sf $WRFSRC/WRFV2/tools/CodeBase/* tools/CodeBase/ |
---|
89 | mkdir external |
---|
90 | ln -sf $WRFSRC/WRFV2/external/Makefile external/ |
---|
91 | mkdir external/io_int |
---|
92 | ln -sf $WRFSRC/WRFV2/external/io_int/* external/io_int/ |
---|
93 | mkdir external/esmf_time_f90 |
---|
94 | ln -sf $WRFSRC/WRFV2/external/esmf_time_f90/* external/esmf_time_f90/ |
---|
95 | mkdir external/io_netcdf |
---|
96 | ln -sf $WRFSRC/WRFV2/external/io_netcdf/* external/io_netcdf/ |
---|
97 | mkdir external/io_grib1 |
---|
98 | ln -sf $WRFSRC/WRFV2/external/io_grib1/* external/io_grib1/ |
---|
99 | \rm external/io_grib1/MEL_grib1 |
---|
100 | \rm external/io_grib1/WGRIB |
---|
101 | \rm external/io_grib1/build |
---|
102 | \rm external/io_grib1/grib1_util |
---|
103 | mkdir external/io_grib1/MEL_grib1 |
---|
104 | ln -sf $WRFSRC/WRFV2/external/io_grib1/MEL_grib1/* external/io_grib1/MEL_grib1/ |
---|
105 | mkdir external/io_grib1/WGRIB |
---|
106 | ln -sf $WRFSRC/WRFV2/external/io_grib1/WGRIB/* external/io_grib1/WGRIB/ |
---|
107 | mkdir external/io_grib1/grib1_util |
---|
108 | ln -sf $WRFSRC/WRFV2/external/io_grib1/grib1_util/* external/io_grib1/grib1_util/ |
---|
109 | mkdir external/io_grib1/build |
---|
110 | mkdir external/io_grib_share |
---|
111 | ln -sf $WRFSRC/WRFV2/external/io_grib_share/* external/io_grib_share/ |
---|
112 | \rm external/io_grib_share/build |
---|
113 | mkdir external/io_grib_share/build |
---|
114 | ln -sf $WRFSRC/WRFV2/external/io_grib_share/build/* external/io_grib_share/build/ |
---|
115 | mkdir external/ioapi_share |
---|
116 | ln -sf $WRFSRC/WRFV2/external/ioapi_share/* external/ioapi_share/ |
---|
117 | mkdir external/io_phdf5 |
---|
118 | ln -sf $WRFSRC/WRFV2/external/io_phdf5/* external/io_phdf5/ |
---|
119 | mkdir external/RSL_LITE |
---|
120 | ln -sf $WRFSRC/WRFV2/external/RSL_LITE/* external/RSL_LITE/ |
---|
121 | mkdir external/io_grib2 |
---|
122 | ln -sf $WRFSRC/WRFV2/external/io_grib2/* external/io_grib2/ |
---|
123 | \rm external/io_grib2/bacio-1.3 |
---|
124 | \rm external/io_grib2/g2lib |
---|
125 | mkdir external/io_grib2/bacio-1.3 |
---|
126 | ln -sf $WRFSRC/WRFV2/external/io_grib2/bacio-1.3/* external/io_grib2/bacio-1.3/ |
---|
127 | mkdir external/io_grib2/g2lib |
---|
128 | ln -sf $WRFSRC/WRFV2/external/io_grib2/g2lib/* external/io_grib2/g2lib/ |
---|
129 | mkdir external/io_pnetcdf |
---|
130 | ln -sf $WRFSRC/WRFV2/external/io_pnetcdf/* external/io_pnetcdf/ |
---|
131 | mkdir external/RSL |
---|
132 | ln -sf $WRFSRC/WRFV2/external/RSL/* external/RSL/ |
---|
133 | \rm external/RSL/RSL |
---|
134 | mkdir external/RSL/RSL |
---|
135 | ln -sf $WRFSRC/WRFV2/external/RSL/RSL/* external/RSL/RSL/ |
---|
136 | mkdir external/io_esmf |
---|
137 | ln -sf $WRFSRC/WRFV2/external/io_esmf/* external/io_esmf/ |
---|
138 | mkdir external/io_mcel |
---|
139 | ln -sf $WRFSRC/WRFV2/external/io_mcel/* external/io_mcel/ |
---|
140 | echo ${laphysiq} |
---|
141 | if [[ "${laphysiq}" == *"void"* ]] |
---|
142 | then |
---|
143 | |
---|
144 | ## case with no physics |
---|
145 | rm -f physics.sed |
---|
146 | touch physics.sed |
---|
147 | |
---|
148 | else |
---|
149 | ## case with physics |
---|
150 | echo $laphysiq |
---|
151 | mkdir $laphysiq |
---|
152 | mkdir $laphysiq/libf |
---|
153 | mkdir $laphysiq/libf/grid |
---|
154 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/grid/* $laphysiq/libf/grid/ |
---|
155 | mkdir $laphysiq/libf/dyn3d |
---|
156 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/dyn3d/* $laphysiq/libf/dyn3d/ |
---|
157 | mkdir $laphysiq/libf/bibio |
---|
158 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/bibio/* $laphysiq/libf/bibio/ |
---|
159 | if [[ "${laphysiq}" == *"mars"* ]] |
---|
160 | then |
---|
161 | ln -sf $WRFSRC/WRFV2/$laphysiq/makegcm* $laphysiq/ |
---|
162 | ln -sf $WRFSRC/WRFV2/$laphysiq/meso_dimphys.h* $laphysiq/ |
---|
163 | ln -sf $WRFSRC/WRFV2/$laphysiq/create_make_gcm $laphysiq/ |
---|
164 | #ln -sf $WRFSRC/WRFV2/$laphysiq/makefile $laphysiq/ |
---|
165 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/duplicate* $laphysiq/libf/ |
---|
166 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/generate* $laphysiq/libf/ |
---|
167 | mkdir $laphysiq/libf/aeronomars |
---|
168 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/aeronomars/* $laphysiq/libf/aeronomars/ |
---|
169 | mkdir $laphysiq/libf/phymars |
---|
170 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phymars/* $laphysiq/libf/phymars/ |
---|
171 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phy_common/* $laphysiq/libf/phymars/ |
---|
172 | ### |
---|
173 | \rm $laphysiq/libf/phymars/dimphys.h |
---|
174 | elif [[ "${laphysiq}" == *"venus"* ]] |
---|
175 | then |
---|
176 | ln -sf $WRFSRC/WRFV2/$laphysiq/makelmdz $laphysiq/ |
---|
177 | ln -sf $WRFSRC/WRFV2/$laphysiq/deftank $laphysiq/ |
---|
178 | ln -sf $WRFSRC/WRFV2/$laphysiq/arch* $laphysiq/ |
---|
179 | ln -sf $WRFSRC/WRFV2/$laphysiq/tmp* $laphysiq/ |
---|
180 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf_gcm $laphysiq/ |
---|
181 | ln -sf $WRFSRC/WRFV2/$laphysiq/makefile $laphysiq/ |
---|
182 | ln -sf $WRFSRC/WRFV2/$laphysiq/make_dir $laphysiq/ |
---|
183 | ln -sf $WRFSRC/WRFV2/$laphysiq/create_make_gcm $laphysiq/ |
---|
184 | ln -sf $WRFSRC/WRFV2/$laphysiq/Tools $laphysiq/ |
---|
185 | mkdir $laphysiq/ioipsl |
---|
186 | ln -sf $WRFSRC/WRFV2/$laphysiq/ioipsl/modipsl/lib/* $laphysiq/ioipsl/ |
---|
187 | mkdir $laphysiq/libf/phyvenus |
---|
188 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phyvenus/* $laphysiq/libf/phyvenus/ |
---|
189 | mkdir $laphysiq/libf/phy_common |
---|
190 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phy_common/* $laphysiq/libf/phy_common/ |
---|
191 | mkdir $laphysiq/libf/misc |
---|
192 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/misc/* $laphysiq/libf/misc/ |
---|
193 | mkdir $laphysiq/libf/filtrez |
---|
194 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/filtrez/* $laphysiq/libf/filtrez/ |
---|
195 | elif [[ "${laphysiq}" == *"generic"* ]] |
---|
196 | then |
---|
197 | ln -sf $WRFSRC/WRFV2/$laphysiq/arch* $laphysiq/ |
---|
198 | ln -sf $WRFSRC/WRFV2/$laphysiq/build_gcm $laphysiq/ |
---|
199 | ln -sf $WRFSRC/WRFV2/$laphysiq/makelmdz* $laphysiq/ |
---|
200 | ln -sf $WRFSRC/WRFV2/$laphysiq/makegcm* $laphysiq/ |
---|
201 | ln -sf $WRFSRC/WRFV2/$laphysiq/create_make_gcm $laphysiq/ |
---|
202 | mkdir $laphysiq/libf/phystd |
---|
203 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phystd/* $laphysiq/libf/phystd/ |
---|
204 | cp -r $WRFSRC/WRFV2/$laphysiq/libf/phystd/bands $laphysiq/libf/phystd/ |
---|
205 | cp -r $WRFSRC/WRFV2/$laphysiq/libf/phystd/scatterers $laphysiq/libf/phystd/ |
---|
206 | mkdir $laphysiq/libf/phy_common |
---|
207 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phy_common/* $laphysiq/libf/phy_common/ |
---|
208 | mkdir $laphysiq/libf/misc |
---|
209 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/misc/* $laphysiq/libf/misc/ |
---|
210 | mkdir $laphysiq/libf/filtrez |
---|
211 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/filtrez/* $laphysiq/libf/filtrez/ |
---|
212 | elif [[ "${laphysiq}" == *"titan"* ]] |
---|
213 | then |
---|
214 | ln -sf $WRFSRC/WRFV2/$laphysiq/arch* $laphysiq/ |
---|
215 | ln -sf $WRFSRC/WRFV2/$laphysiq/build_gcm $laphysiq/ |
---|
216 | ln -sf $WRFSRC/WRFV2/$laphysiq/makelmdz* $laphysiq/ |
---|
217 | ln -sf $WRFSRC/WRFV2/$laphysiq/create_make_gcm $laphysiq/ |
---|
218 | mkdir $laphysiq/libf/phytitan |
---|
219 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phytitan/* $laphysiq/libf/phytitan/ |
---|
220 | cp -r $WRFSRC/WRFV2/$laphysiq/libf/phytitan/bands $laphysiq/libf/phytitan/ |
---|
221 | cp -r $WRFSRC/WRFV2/$laphysiq/libf/phytitan/scatterers $laphysiq/libf/phytitan/ |
---|
222 | mkdir $laphysiq/libf/chimtitan |
---|
223 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/chimtitan/* $laphysiq/libf/chimtitan/ |
---|
224 | mkdir $laphysiq/libf/muphytitan |
---|
225 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/muphytitan/* $laphysiq/libf/muphytitan/ |
---|
226 | mkdir $laphysiq/libf/phy_common |
---|
227 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phy_common/* $laphysiq/libf/phy_common/ |
---|
228 | mkdir $laphysiq/libf/misc |
---|
229 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/misc/* $laphysiq/libf/misc/ |
---|
230 | mkdir $laphysiq/libf/filtrez |
---|
231 | ln -sf $WRFSRC/WRFV2/$laphysiq/libf/filtrez/* $laphysiq/libf/filtrez/ |
---|
232 | fi |
---|
233 | mkdir $laphysiq/libo |
---|
234 | #touch $laphysiq/makefile |
---|
235 | |
---|
236 | sed s+"YORGLYORGL"+"$laphysiq"+g $WRFSRC/WRFV2/physics.sed > physics.sed |
---|
237 | fi |
---|
238 | |
---|
239 | mkdir test |
---|
240 | mkdir test/em_real |
---|
241 | mkdir test/em_quarter_ss |
---|
242 | ln -sf $WRFSRC/WRFV2/test/em_real/* test/em_real/ |
---|
243 | |
---|
244 | echo '*** end' |
---|
245 | |
---|
246 | |
---|
247 | |
---|
248 | |
---|