source: CONFIG/UNIFORM/v7/IPSLCM7/define_config.sh @ 6892

Last change on this file since 6892 was 6863, checked in by jgipsl, 6 months ago

Added missing l. After this correction, it is now possible to compile using the option -regular_latlon yes.

  • Property svn:executable set to *
File size: 4.8 KB
Line 
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
16if [ -d ../../modeles/NEMO ] ; then
17    compnemo=y
18else
19    compnemo=n
20fi
21
22if [ -d ../../modeles/INCA ] ; then
23    compinca=y
24else
25    compinca=n
26fi
27
28if [ -d ../../modeles/DYNAMICO ] ; then
29    compdyna=y
30else
31    compdyna=n
32    regular_latlon=y
33fi
34
35if [ -d ../../oasis3-mct ] ; then
36    compoasis=y
37else
38    compoasis=n
39fi
40
41if [ -d ../../modeles/LMDZ ] ; then
42    complmdz=y
43else
44    complmdz=n
45fi
46
47
48
49### Step 2: Define which components to compile. Check if the configuration set as argument is possible
50if [ $subconfig == default ] ; then
51    echo ; echo Compilation of all availble components will be done:
52
53elif [ $subconfig == IPSLCM ] || [ $subconfig == IPSLCM-ico ] ; then
54    # Full coupled model currently without INCA
55    if [ $compdyna == n ] || [ $compoasis == n ] || [ $compnemo == n ] || [ $complmdz == n ] ; then
56        echo ; echo It is not possible to compile IPSLCM.
57        echo Source code is missing
58        exit
59    else
60        echo "Compilation of IPSLCM configuration (without INCA) will be done"
61        compnemo=y compoasis=y compdyna=y compinca=n complmdz=y comporch=y compxios=y
62    fi
63elif [ $subconfig == IPSLCM-reg ] ; then
64    # Coupled model without DYNAMICO and INCA
65    if [ $compoasis == n ] || [ $compnemo == n ] || [ $complmdz == n ] ; then
66        echo ; echo It is not possible to compile IPSLCM-reg.
67        echo Source code is missing
68        exit
69    else
70        echo "Compilation of IPSLCM-reg configuration (without INCA and DYNAMICO) will be done"
71        compnemo=y compoasis=y compdyna=n compinca=n complmdz=y comporch=y compxios=y
72        regular_latlon=y
73    fi
74elif [ $subconfig == ICOLMDZORINCA ] ; then
75    if [ $compinca == n ] || [ $compdyna == n ] || [ $complmdz == n ] ; then
76        echo ; echo It is not possible to compile ICOLMDZORINCA.
77        echo INCA or DYNAMICO source code is missing
78        exit
79    else
80        echo Compilation of ICOLMDZORINCA configuration will be done
81        compnemo=n compoasis=n compdyna=y compinca=y complmdz=y comporch=y compxios=y
82    fi 
83elif [ $subconfig == ICOLMDZOR ] ; then
84    if [ $compdyna == n ] || [ $complmdz == n ] ; then
85        echo ; echo It is not possible to compile ICOLMDZOR
86        echo DYNAMICO source code is missing
87        exit
88    else
89        echo Compilation of ICOLMDZOR configuration will be done
90        compnemo=n compoasis=n compdyna=y compinca=n complmdz=y comporch=y compxios=y
91    fi
92elif [ $subconfig == LMDZORINCA ] ; then
93    if [ $compinca == n ] || [ $complmdz == n ] ; then
94        echo ;  echo It is not possible to compile LMDZORINCA.
95        echo INCA or LMDZ source code is missing
96        exit
97    else
98        regular_latlon=y
99        echo Compilation of regular LMDZORINCA configuration for grid $resol_atm will be done
100        compnemo=n compoasis=n compdyna=n compinca=y complmdz=y comporch=y compxios=y
101    fi 
102elif [ $subconfig == LMDZOR ] ; then
103   if [ $complmdz == n ] ; then
104        echo ;  echo It is not possible to compile LMDZOR.
105        echo LMDZ source code is missing
106        exit
107    else
108      regular_latlon=y
109      echo Compilation of regular LMDZOR configuration for grid $resol_atm will be done
110      compnemo=n compoasis=n compdyna=n compinca=n complmdz=y comporch=y compxios=y
111   fi
112elif [ $subconfig == ORCHIDEE_OL ] ; then
113    # We always suppose ORCHIDEE is extracted. No check needs to be done.
114    regular_latlon=n
115    echo Compilation of ORCHIDEE offline configuration will be done
116    compnemo=n compoasis=n compdyna=n compinca=n complmdz=n comporch=y compxios=y
117else
118    echo ; echo "The configuration $subconfig is not available"
119    echo "Choose between ICOLMDZORINCA, ICOLMDZOR, LMDZORINCA, LMDZOR"
120    echo "               IPSLCM or IPSLCM-reg" 
121    echo "Exit now"
122    exit
123fi
124echo compnemo=$compnemo compoasis=$compoasis compdyna=$compdyna compinca=$compinca complmdz=$complmdz comporch=y compxios=y
125echo ;
126
127
128# Coherence test for variable regular_latlon which can be set as input argument
129if [ $regular_latlon == yes ] || [ $regular_latlon == y ] ; then
130        regular_latlon=y
131elif [ $regular_latlon == no ] || [ $regular_latlon == n ] ; then
132        regular_latlon=n
133else
134        echo "regular_latlon=$regular_latlon : This option is not possible."
135        echo "Compile using argument '-regular_latlon' no or '-regular_latlon yes'" 
136        echo "Exit now"
137        exit
138fi
139
Note: See TracBrowser for help on using the repository browser.