1 | #!/bin/bash |
---|
2 | # |
---|
3 | # define_config.sh is called from the main compilation script compile_ipslcm7.sh |
---|
4 | # The script will define which components to compile. |
---|
5 | # By default all availble components are compiled. |
---|
6 | # |
---|
7 | # Step 1: The avaible components are defined. |
---|
8 | # Step 2: Define which components to compile. If argument [-subconfig subconfig] is set |
---|
9 | # to the main compilation script, a control if the components needed are avaiable. |
---|
10 | # If argument is subconfig is not set, the components defined in step 1 will be defined. |
---|
11 | |
---|
12 | |
---|
13 | ### Step 1: Check available components possible to compile |
---|
14 | # LMDZ, ORCHIDEE and XIOS are considered mandatory and will not be checked. |
---|
15 | |
---|
16 | if [ -d ../../modeles/NEMO ] ; then |
---|
17 | compnemo=y |
---|
18 | else |
---|
19 | compnemo=n |
---|
20 | fi |
---|
21 | |
---|
22 | if [ -d ../../modeles/INCA ] ; then |
---|
23 | compinca=y |
---|
24 | else |
---|
25 | compinca=n |
---|
26 | fi |
---|
27 | |
---|
28 | if [ -d ../../modeles/DYNAMICO ] ; then |
---|
29 | compdyna=y |
---|
30 | else |
---|
31 | compdyna=n |
---|
32 | fi |
---|
33 | |
---|
34 | if [ -d ../../oasis3-mct ] ; then |
---|
35 | compoasis=y |
---|
36 | else |
---|
37 | compoasis=n |
---|
38 | fi |
---|
39 | |
---|
40 | |
---|
41 | |
---|
42 | ### Step 2: Define which components to compile. Check if the configuration set as argument is possible |
---|
43 | if [ $subconfig == default ] ; then |
---|
44 | echo ; echo Compilation of all availble components will be done: |
---|
45 | echo compinca=$compinca compnemo=$compnemo compoasis=$compoasis compdyna=$compdyna complmdz=y comporch=y compxios=y |
---|
46 | elif [ $subconfig == ICOLMDZORINCA ] ; then |
---|
47 | if [ $compinca == n ] || [ $compdyna == n ] ; then |
---|
48 | echo ; echo It is not possible to compile ICOLMDZORINCA. |
---|
49 | echo INCA or DYNAMICO source code is missing |
---|
50 | exit |
---|
51 | else |
---|
52 | echo Compilation of ICOLMDZORINCA configuration will be done |
---|
53 | fi |
---|
54 | elif [ $subconfig == ICOLMDZOR ] ; then |
---|
55 | if [ $compdyna == n ] ; then |
---|
56 | echo ; echo It is not possible to compile ICOLMDZOR |
---|
57 | echo DYNAMICO source code is missing |
---|
58 | exit |
---|
59 | else |
---|
60 | echo Compilation of ICOLMDZOR configuration will be done |
---|
61 | fi |
---|
62 | elif [ $subconfig == LMDZORINCA ] ; then |
---|
63 | if [ $compinca == n ] ; then |
---|
64 | echo ; echo It is not possible to compile LMDZORINCA. |
---|
65 | echo INCA source code is missing |
---|
66 | exit |
---|
67 | else |
---|
68 | regular_latlon=yes |
---|
69 | echo Compilation of regular LMDZORINCA configuration for grid $resol_atm will be done |
---|
70 | fi |
---|
71 | elif [ $subconfig == LMDZOR ] ; then |
---|
72 | regular_latlon=yes |
---|
73 | # We always suppose that LMDZ and ORCHIDEE are extracted. No check needs to be done. |
---|
74 | echo Compilation of regular LMDZOR configuration for grid $resol_atm will be done |
---|
75 | else |
---|
76 | echo ; echo The configuration $subconfig is not available |
---|
77 | echo Choose between ICOLMDZORINCA ICOLMDZOR LMDZORINCA or LMDZOR |
---|
78 | echo Exit now |
---|
79 | exit |
---|
80 | fi |
---|
81 | echo ; |
---|
82 | |
---|