[5542] | 1 | #!/bin/ksh |
---|
| 2 | |
---|
| 3 | #D- Driver du script pour INCA |
---|
| 4 | #----------------------------------------------------------------- |
---|
| 5 | function INCA_sed_replace |
---|
| 6 | { |
---|
| 7 | IGCM_debug_PushStack "INCA_sed_replace" |
---|
| 8 | |
---|
| 9 | sed -e "s/${2}/${3}/" ${1} > ${1}.tmp |
---|
| 10 | RET=$? |
---|
| 11 | echo "INCA_sed : ${1} ${2} ${3}" |
---|
| 12 | \mv ${1}.tmp ${1} |
---|
| 13 | |
---|
| 14 | IGCM_debug_PopStack "INCA_sed_replace" |
---|
| 15 | return $RET |
---|
| 16 | } |
---|
| 17 | #----------------------------------------------------------------- |
---|
| 18 | function CHM_Initialize |
---|
| 19 | { |
---|
| 20 | IGCM_debug_PushStack "CHM_Initialize" |
---|
| 21 | |
---|
[5625] | 22 | if [ X${config_ListOfComponents_ICO} = X ] ; then |
---|
[5542] | 23 | |
---|
[5625] | 24 | if [ X$ResolAtm != X ] ; then |
---|
| 25 | # ResolAtm is set in config.card |
---|
| 26 | RESOL_ATM_3D=${ResolAtm} |
---|
| 27 | RESOL_ATM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' ) |
---|
| 28 | RESOL_ATM_X=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $1}' ) |
---|
| 29 | RESOL_ATM_Y=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $2}' ) |
---|
| 30 | |
---|
| 31 | RESOL_CHM=${RESOL_ATM_X}${RESOL_ATM_Y}-L${RESOL_ATM_Z} |
---|
| 32 | elif [ -f ${SUBMIT_DIR}/../.resol ] ; then |
---|
| 33 | [ -f ${SUBMIT_DIR}/../.resol ] && eval $(grep RESOL_ATM_3D ${SUBMIT_DIR}/../.resol) || RESOL_ATM_3D=96x95x19 |
---|
| 34 | RESOL_CHM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' | awk "-F-" '{print $1}') |
---|
| 35 | else |
---|
[5542] | 36 | IGCM_debug_Exit "ResolAtm is not set in config.card and the .resol file does not exist." |
---|
| 37 | IGCM_debug_Verif_Exit |
---|
[5625] | 38 | fi |
---|
| 39 | else |
---|
| 40 | RESOL_ATM_Z=${dynamico_UserChoices_RESOL_ATM_Z} |
---|
| 41 | RESOL_NBP=${dynamico_UserChoices_RESOL_NBP} |
---|
| 42 | |
---|
[5542] | 43 | fi |
---|
| 44 | |
---|
| 45 | echo 'resol chimie', $RESOL_CHM |
---|
| 46 | CHEM=${ConfChem} |
---|
| 47 | echo "INCA Tag : LMDZ-INCA" ${config_UserChoices_TagName} |
---|
| 48 | |
---|
| 49 | ##- LMDZ physics version |
---|
| 50 | ## Read LMDZ_Physics option in lmdz.card, if not present take default value AP (old physics) |
---|
| 51 | if [ ! X${lmdz_UserChoices_LMDZ_Physics} = X ] ; then |
---|
| 52 | LMDZ_Physics=${lmdz_UserChoices_LMDZ_Physics} |
---|
| 53 | else |
---|
| 54 | LMDZ_Physics=AP |
---|
| 55 | fi |
---|
| 56 | echo LMDZ physics version : ${LMDZ_Physics} |
---|
| 57 | |
---|
| 58 | |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | IGCM_debug_PopStack "CHM_Initialize" |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | #----------------------------------------------------------------- |
---|
| 65 | function CHM_Update |
---|
| 66 | { |
---|
| 67 | IGCM_debug_PushStack "CHM_Update" |
---|
| 68 | |
---|
| 69 | if [ X${inca_UserChoices_output_frequency_chem} = X ] || [ X${inca_UserChoices_output_frequency_chem} = XNONE ] ; then |
---|
| 70 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry enabled FALSE |
---|
| 71 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry name inca1d_chem |
---|
| 72 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry output_freq 1d |
---|
| 73 | |
---|
| 74 | else |
---|
| 75 | if [ X${inca_UserChoices_output_frequency_chem} = X1d ] || [ X${inca_UserChoices_output_frequency_chem} = X1mo ] ; then |
---|
| 76 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry enabled TRUE |
---|
| 77 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry name inca${inca_UserChoices_output_frequency_chem}_chem |
---|
| 78 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry output_freq ${inca_UserChoices_output_frequency_chem} |
---|
| 79 | else |
---|
| 80 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry enabled TRUE |
---|
| 81 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry name inca1d_chem |
---|
| 82 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry output_freq ${inca_UserChoices_output_frequency_chem} |
---|
| 83 | |
---|
| 84 | fi |
---|
| 85 | fi |
---|
| 86 | |
---|
| 87 | if [ X${inca_UserChoices_output_frequency_emi} = X ] || [ X${inca_UserChoices_output_frequency_emi} = XNONE ] ; then |
---|
| 88 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions enabled FALSE |
---|
| 89 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions name inca1d_emi |
---|
| 90 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions output_freq 1d |
---|
| 91 | |
---|
| 92 | else |
---|
| 93 | if [ X${inca_UserChoices_output_frequency_emi} = X1d ] || [ X${inca_UserChoices_output_frequency_emi} = X1mo ] ; then |
---|
| 94 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions enabled TRUE |
---|
| 95 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions name inca${inca_UserChoices_output_frequency_emi}_emi |
---|
| 96 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions output_freq ${inca_UserChoices_output_frequency_emi} |
---|
| 97 | else |
---|
| 98 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions enabled TRUE |
---|
| 99 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions name inca1d_emi |
---|
| 100 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions output_freq ${inca_UserChoices_output_frequency_emi} |
---|
| 101 | fi |
---|
| 102 | fi |
---|
| 103 | |
---|
| 104 | |
---|
| 105 | if [ X${inca_UserChoices_output_frequency_species} = X ] || [ X${inca_UserChoices_output_frequency_species} = XNONE ] ; then |
---|
| 106 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species enabled FALSE |
---|
| 107 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species name inca1d_species |
---|
| 108 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species output_freq 1d |
---|
| 109 | |
---|
| 110 | else |
---|
| 111 | if [ X${inca_UserChoices_output_frequency_species} = X1d ] || [ X${inca_UserChoices_output_frequency_species} = X1mo ] ; then |
---|
| 112 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species enabled TRUE |
---|
| 113 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species name inca${inca_UserChoices_output_frequency_species}_species |
---|
| 114 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species output_freq ${inca_UserChoices_output_frequency_species} |
---|
| 115 | else |
---|
| 116 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species enabled TRUE |
---|
| 117 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species name inca1d_species |
---|
| 118 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species output_freq ${inca_UserChoices_output_frequency_species} |
---|
| 119 | fi |
---|
| 120 | fi |
---|
| 121 | |
---|
| 122 | |
---|
| 123 | if [ X${inca_UserChoices_output_frequency_forcage} = X ] || [ X${inca_UserChoices_output_frequency_forcage} = XNONE ] ; then |
---|
| 124 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage enabled FALSE |
---|
| 125 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage name inca1d_forcage |
---|
| 126 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage output_freq 1d |
---|
| 127 | |
---|
| 128 | else |
---|
| 129 | if [ X${inca_UserChoices_output_frequency_forcage} = X1d ] || [ X${inca_UserChoices_output_frequency_forcage} = X1mo ] ; then |
---|
| 130 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage enabled TRUE |
---|
| 131 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage name inca${inca_UserChoices_output_frequency_forcage}_forcage |
---|
| 132 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage output_freq ${inca_UserChoices_output_frequency_forcage} |
---|
| 133 | else |
---|
| 134 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage enabled TRUE |
---|
| 135 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage name inca1d_forcage |
---|
| 136 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage output_freq ${inca_UserChoices_output_frequency_forcage} |
---|
| 137 | fi |
---|
| 138 | fi |
---|
| 139 | |
---|
| 140 | |
---|
| 141 | if [ X${inca_UserChoices_output_frequency_aero} = X ] || [ X${inca_UserChoices_output_frequency_aero} = XNONE ] ; then |
---|
| 142 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero enabled FALSE |
---|
| 143 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero name inca1d_aero |
---|
| 144 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero output_freq 1d |
---|
| 145 | |
---|
| 146 | else |
---|
| 147 | if [ X${inca_UserChoices_output_frequency_aero} = X1d ] || [ X${inca_UserChoices_output_frequency_aero} = X1mo ] ; then |
---|
| 148 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero enabled TRUE |
---|
| 149 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero name inca${inca_UserChoices_output_frequency_aero}_aero |
---|
| 150 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero output_freq ${inca_UserChoices_output_frequency_aero} |
---|
| 151 | else |
---|
| 152 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero enabled TRUE |
---|
| 153 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero name inca1d_aero |
---|
| 154 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero output_freq ${inca_UserChoices_output_frequency_aero} |
---|
| 155 | fi |
---|
| 156 | fi |
---|
| 157 | |
---|
| 158 | |
---|
| 159 | if [ X${inca_UserChoices_output_frequency_dep} = X ] || [ X${inca_UserChoices_output_frequency_dep} = XNONE ] ; then |
---|
| 160 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel enabled FALSE |
---|
| 161 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel name inca1d_dep |
---|
| 162 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel output_freq 1d |
---|
| 163 | |
---|
| 164 | else |
---|
| 165 | if [ X${inca_UserChoices_output_frequency_dep} = X1d ] || [ X${inca_UserChoices_output_frequency_dep} = X1mo ] ; then |
---|
| 166 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel enabled TRUE |
---|
| 167 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel name inca${inca_UserChoices_output_frequency_dep}_dep |
---|
| 168 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel output_freq ${inca_UserChoices_output_frequency_dep} |
---|
| 169 | else |
---|
| 170 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel enabled TRUE |
---|
| 171 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel name inca1d_dep |
---|
| 172 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel output_freq ${inca_UserChoices_output_frequency_dep} |
---|
| 173 | fi |
---|
| 174 | fi |
---|
| 175 | |
---|
| 176 | if [ X${inca_UserChoices_output_frequency_washrate} = X ] || [ X${inca_UserChoices_output_frequency_washrate} = XNONE ] ; then |
---|
| 177 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout enabled FALSE |
---|
| 178 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout name inca1d_washrate |
---|
| 179 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout output_freq 1d |
---|
| 180 | |
---|
| 181 | else |
---|
| 182 | if [ X${inca_UserChoices_output_frequency_washrate} = X1d ] || [ X${inca_UserChoices_output_frequency_washrate} = X1mo ] ; then |
---|
| 183 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout enabled TRUE |
---|
| 184 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout name inca${inca_UserChoices_output_frequency_washrate}_washrate |
---|
| 185 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout output_freq ${inca_UserChoices_output_frequency_washrate} |
---|
| 186 | else |
---|
| 187 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout enabled TRUE |
---|
| 188 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout name inca1d_washrate |
---|
| 189 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout output_freq ${inca_UserChoices_output_frequency_washrate} |
---|
| 190 | fi |
---|
| 191 | fi |
---|
| 192 | |
---|
| 193 | if [ X${inca_UserChoices_output_frequency_veget} = X ] || [ X${inca_UserChoices_output_frequency_veget} = XNONE ] ; then |
---|
| 194 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation enabled FALSE |
---|
| 195 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation name inca1d_veget |
---|
| 196 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation output_freq 1d |
---|
| 197 | |
---|
| 198 | else |
---|
| 199 | if [ X${inca_UserChoices_output_frequency_veget} = X1d ] || [ X${inca_UserChoices_output_frequency_veget} = X1mo ] ; then |
---|
| 200 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation enabled TRUE |
---|
| 201 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation name inca${inca_UserChoices_output_frequency_veget}_veget |
---|
| 202 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation output_freq ${inca_UserChoices_output_frequency_veget} |
---|
| 203 | else |
---|
| 204 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation enabled TRUE |
---|
| 205 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation name inca1d_veget |
---|
| 206 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation output_freq ${inca_UserChoices_output_frequency_veget} |
---|
| 207 | fi |
---|
| 208 | fi |
---|
| 209 | |
---|
| 210 | |
---|
| 211 | if [ X${inca_UserChoices_output_frequency_reacflux} = X ] || [ X${inca_UserChoices_output_frequency_reacflux} = XNONE ] ; then |
---|
| 212 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux enabled FALSE |
---|
| 213 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux name inca1d_reacflux |
---|
| 214 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux output_freq 1d |
---|
| 215 | |
---|
| 216 | else |
---|
| 217 | if [ X${inca_UserChoices_output_frequency_reacflux} = X1d ] || [ X${inca_UserChoices_output_frequency_reacflux} = X1mo ] ; then |
---|
| 218 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux enabled TRUE |
---|
| 219 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux name inca${inca_UserChoices_output_frequency_reacflux}_reacflux |
---|
| 220 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux output_freq ${inca_UserChoices_output_frequency_reacflux} |
---|
| 221 | else |
---|
| 222 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux enabled TRUE |
---|
| 223 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux name inca1d_reacflux |
---|
| 224 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux output_freq ${inca_UserChoices_output_frequency_reacflux} |
---|
| 225 | fi |
---|
| 226 | fi |
---|
| 227 | |
---|
| 228 | |
---|
| 229 | if [ X${inca_UserChoices_output_frequency_phtrate} = X ] || [ X${inca_UserChoices_output_frequency_phtrate} = XNONE ] ; then |
---|
| 230 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate enabled FALSE |
---|
| 231 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate name inca1d_phtrate |
---|
| 232 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate output_freq 1d |
---|
| 233 | |
---|
| 234 | else |
---|
| 235 | if [ X${inca_UserChoices_output_frequency_phtrate} = X1d ] || [ X${inca_UserChoices_output_frequency_phtrate} = X1mo ] ; then |
---|
| 236 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate enabled TRUE |
---|
| 237 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate name inca${inca_UserChoices_output_frequency_phtrate}_phtrate |
---|
| 238 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate output_freq ${inca_UserChoices_output_frequency_phtrate} |
---|
| 239 | else |
---|
| 240 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate enabled TRUE |
---|
| 241 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate name inca1d_phtrate |
---|
| 242 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate output_freq ${inca_UserChoices_output_frequency_phtrate} |
---|
| 243 | fi |
---|
| 244 | fi |
---|
| 245 | |
---|
| 246 | if [ X${inca_UserChoices_output_frequency_ges} = X ] || [ X${inca_UserChoices_output_frequency_ges} = XNONE ] ; then |
---|
| 247 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges enabled FALSE |
---|
| 248 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges name inca1d_ges |
---|
| 249 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges output_freq 1d |
---|
| 250 | |
---|
| 251 | else |
---|
| 252 | if [ X${inca_UserChoices_output_frequency_ges} = X1d ] || [ X${inca_UserChoices_output_frequency_ges} = X1mo ] ; then |
---|
| 253 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges enabled TRUE |
---|
| 254 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges name inca${inca_UserChoices_output_frequency_ges}_ges |
---|
| 255 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges output_freq ${inca_UserChoices_output_frequency_ges} |
---|
| 256 | else |
---|
| 257 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges enabled TRUE |
---|
| 258 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges name inca1d_ges |
---|
| 259 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges output_freq ${inca_UserChoices_output_frequency_ges} |
---|
| 260 | fi |
---|
| 261 | fi |
---|
| 262 | |
---|
| 263 | if [ X${inca_UserChoices_output_frequency_invariants} = X ] || [ X${inca_UserChoices_output_frequency_invariants} = XNONE ] ; then |
---|
| 264 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants enabled FALSE |
---|
| 265 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants name inca1d_invariants |
---|
| 266 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants output_freq 1d |
---|
| 267 | |
---|
| 268 | else |
---|
| 269 | if [ X${inca_UserChoices_output_frequency_invariants} = X1d ] || [ X${inca_UserChoices_output_frequency_invariants} = X1mo ] ; then |
---|
| 270 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants enabled TRUE |
---|
| 271 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants name inca${inca_UserChoices_output_frequency_invariants}_invariants |
---|
| 272 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants output_freq ${inca_UserChoices_output_frequency_invariants} |
---|
| 273 | else |
---|
| 274 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants enabled TRUE |
---|
| 275 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants name inca1d_invariants |
---|
| 276 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants output_freq ${inca_UserChoices_output_frequency_invariants} |
---|
| 277 | fi |
---|
| 278 | fi |
---|
| 279 | |
---|
| 280 | if [ X${inca_UserChoices_output_frequency_aero_chem} = X ] || [ X${inca_UserChoices_output_frequency_aero_chem} = XNONE ] ; then |
---|
| 281 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem enabled FALSE |
---|
| 282 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem name inca1d_aero_chem |
---|
| 283 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem output_freq 1d |
---|
| 284 | |
---|
| 285 | else |
---|
| 286 | if [ X${inca_UserChoices_output_frequency_aero_chem} = X1d ] || [ X${inca_UserChoices_output_frequency_aero_chem} = X1mo ] || [ X${inca_UserChoices_output_frequency_aero_chem} = X1ts ] ; then |
---|
| 287 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem enabled TRUE |
---|
| 288 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem name inca${inca_UserChoices_output_frequency_aero_chem}_aero_chem |
---|
| 289 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem output_freq ${inca_UserChoices_output_frequency_aero_chem} |
---|
| 290 | else |
---|
| 291 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem enabled TRUE |
---|
| 292 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem name inca1ts_aero_chem |
---|
| 293 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem output_freq ${inca_UserChoices_output_frequency_aero_chem} |
---|
| 294 | fi |
---|
| 295 | fi |
---|
| 296 | |
---|
| 297 | case ${CHEM} in |
---|
| 298 | AER) |
---|
| 299 | |
---|
| 300 | if [ X${LMDZ_Physics} = X"AP" ] ; then |
---|
| 301 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aero |
---|
| 302 | else |
---|
| 303 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aeNP |
---|
| 304 | fi |
---|
| 305 | ;; |
---|
| 306 | DUSS) |
---|
| 307 | |
---|
| 308 | if [ X${LMDZ_Physics} = X"AP" ] ; then |
---|
| 309 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aero |
---|
| 310 | else |
---|
| 311 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aeNP |
---|
| 312 | fi |
---|
| 313 | ;; |
---|
| 314 | NMHC) |
---|
| 315 | |
---|
| 316 | IGCM_comp_modifyDefFile nonblocker run.def config_inca chem |
---|
| 317 | ;; |
---|
| 318 | NMHC_AER) |
---|
| 319 | |
---|
| 320 | if [ X${LMDZ_Physics} = X"AP" ] ; then |
---|
| 321 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aero |
---|
| 322 | else |
---|
| 323 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aeNP |
---|
| 324 | fi |
---|
| 325 | ;; |
---|
| 326 | |
---|
| 327 | NMHC_AER_S) |
---|
| 328 | |
---|
| 329 | if [ X${LMDZ_Physics} = X"AP" ] ; then |
---|
| 330 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aero |
---|
| 331 | else |
---|
| 332 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aeNP |
---|
| 333 | fi |
---|
| 334 | ;; |
---|
| 335 | GES) |
---|
| 336 | |
---|
| 337 | IGCM_comp_modifyDefFile nonblocker run.def config_inca chem |
---|
| 338 | esac |
---|
| 339 | |
---|
| 340 | |
---|
| 341 | # inca.def : Activate reading of 10m wind in files if LMDZ_10m_winds=n in inca.card |
---|
| 342 | if [ ! X${inca_UserChoices_LMDZ_10m_winds} = X ] ; then |
---|
| 343 | IGCM_comp_modifyDefFile nonblocker inca.def LMDZ_10m_winds ${inca_UserChoices_LMDZ_10m_winds} |
---|
| 344 | else |
---|
| 345 | IGCM_comp_modifyDefFile nonblocker inca.def LMDZ_10m_winds n |
---|
| 346 | fi |
---|
| 347 | |
---|
| 348 | |
---|
| 349 | if [ ! X${inca_UserChoices_wind_parameter} = X ] ; then |
---|
| 350 | IGCM_comp_modifyDefFile nonblocker inca.def tref ${inca_UserChoices_wind_parameter} |
---|
| 351 | else |
---|
| 352 | IGCM_comp_modifyDefFile nonblocker inca.def tref DEFAULT |
---|
| 353 | fi |
---|
| 354 | |
---|
| 355 | if [ X${inca_UserChoices_seasalt_corr} = X ] ; then |
---|
| 356 | IGCM_comp_modifyDefFile nonblocker inca.def ss_corr DEFAULT |
---|
| 357 | else |
---|
| 358 | IGCM_comp_modifyDefFile nonblocker inca.def ss_corr ${inca_UserChoices_seasalt_corr} |
---|
| 359 | fi |
---|
| 360 | |
---|
| 361 | |
---|
| 362 | |
---|
| 363 | # inca.def : choose write frequency for inca_avgr in inca.card |
---|
| 364 | if [ ! X${inca_UserChoices_freq_write_chem} = X ] ; then |
---|
| 365 | IGCM_comp_modifyDefFile nonblocker inca.def freq_write_chem ${inca_UserChoices_freq_write_chem} |
---|
| 366 | else |
---|
| 367 | IGCM_comp_modifyDefFile nonblocker inca.def freq_write_chem 86400 |
---|
| 368 | fi |
---|
| 369 | |
---|
| 370 | #inca.def : choose aerosol effect with feedback variable |
---|
| 371 | if [ ! X${inca_UserChoices_feedb} = X ] ; then |
---|
| 372 | IGCM_comp_modifyDefFile nonblocker inca.def feedb ${inca_UserChoices_feedb} |
---|
| 373 | else |
---|
| 374 | IGCM_comp_modifyDefFile nonblocker inca.def feedb 0 |
---|
| 375 | fi |
---|
| 376 | |
---|
| 377 | #inca.def : choose coupled model with orchidee |
---|
| 378 | if [ ! X${inca_UserChoices_CoupOrchInca} = X ]; then |
---|
| 379 | IGCM_comp_modifyDefFile nonblocker inca.def CoupOrchInca ${inca_UserChoices_CoupOrchInca} |
---|
| 380 | else |
---|
| 381 | IGCM_comp_modifyDefFile nonblocker inca.def CoupOrchInca n |
---|
| 382 | fi |
---|
| 383 | |
---|
| 384 | #inca.def : choose sedimentation schema |
---|
| 385 | if [ ! X${inca_UserChoices_multilayer_sedim} = X ]; then |
---|
| 386 | IGCM_comp_modifyDefFile nonblocker inca.def multilayer_sediment ${inca_UserChoices_multilayer_sedim} |
---|
| 387 | else |
---|
| 388 | IGCM_comp_modifyDefFile nonblocker inca.def multilayer_sediment y |
---|
| 389 | fi |
---|
| 390 | |
---|
| 391 | #inca.def : choose calcul interactif des diagnostiques flux chimique ou non |
---|
| 392 | if [ ! X${inca_UserChoices_calcul_flux} = X ]; then |
---|
| 393 | IGCM_comp_modifyDefFile nonblocker inca.def calcul_flux ${inca_UserChoices_calcul_flux} |
---|
| 394 | else |
---|
| 395 | IGCM_comp_modifyDefFile nonblocker inca.def calcul_flux n |
---|
| 396 | fi |
---|
| 397 | |
---|
| 398 | #inca.def : choose aircraft emission |
---|
| 399 | if [ ! X${inca_UserChoices_flag_plane} = X ]; then |
---|
| 400 | IGCM_comp_modifyDefFile nonblocker inca.def flag_plane ${inca_UserChoices_flag_plane} |
---|
| 401 | else |
---|
| 402 | IGCM_comp_modifyDefFile nonblocker inca.def flag_plane 0 |
---|
| 403 | fi |
---|
| 404 | |
---|
| 405 | #inca.def : choose time interpolation for sflx.nc |
---|
| 406 | if [ ! X${inca_UserChoices_emi_interp_time} = X ]; then |
---|
| 407 | IGCM_comp_modifyDefFile nonblocker inca.def emi_interp_time ${inca_UserChoices_emi_interp_time} |
---|
| 408 | else |
---|
| 409 | IGCM_comp_modifyDefFile nonblocker inca.def emi_interp_time 1 |
---|
| 410 | fi |
---|
| 411 | |
---|
| 412 | |
---|
| 413 | |
---|
| 414 | #inca.def : choose which xml will be use (with group or no = cmip files) |
---|
| 415 | if [ X${inca_UserChoices_cmip_xml} = Xy ] ; then |
---|
| 416 | |
---|
| 417 | IGCM_comp_modifyDefFile nonblocker inca.def cmip_xml y |
---|
| 418 | else |
---|
| 419 | IGCM_comp_modifyDefFile nonblocker inca.def cmip_xml n |
---|
| 420 | fi |
---|
| 421 | |
---|
| 422 | |
---|
| 423 | |
---|
| 424 | # Add include of INCA context in iodef.xml |
---|
| 425 | # In iodef.xml add on next line after "COMPONENT CONTEXT" |
---|
| 426 | # <context id="inca" src="./context_inca.xml"/> |
---|
| 427 | echo '<context id="inca" src="./context_inca.xml"/>' > add.tmp |
---|
[5586] | 428 | if [ -f context_input_inca.xml ] ; then |
---|
| 429 | echo '<context id="inca" src="./context_input_inca.xml"/>' >> add.tmp |
---|
[5651] | 430 | echo '<context id="inca" src="./context_start_inca.xml"/>' >> add.tmp |
---|
[5586] | 431 | echo '<context id="inca" src="./context_sflx_inca.xml"/>' >> add.tmp |
---|
| 432 | echo '<context id="inca" src="./context_winds_inca.xml"/>' >> add.tmp |
---|
| 433 | echo '<context id="inca" src="./context_oxydants_inca.xml"/>' >> add.tmp |
---|
[5594] | 434 | if [ X${CHEM} = XGES ] ; then |
---|
| 435 | echo '<context id="inca" src="./context_co2_bis_inca.xml"/>' >> add.tmp |
---|
| 436 | fi |
---|
| 437 | |
---|
[5542] | 438 | fi |
---|
| 439 | cp iodef.xml iodef.xml.tmp |
---|
| 440 | sed -e "/COMPONENT CONTEXT/r add.tmp" \ |
---|
| 441 | iodef.xml.tmp > iodef.xml |
---|
| 442 | rm iodef.xml.tmp add.tmp |
---|
| 443 | |
---|
| 444 | |
---|
| 445 | # Add LongName as global attribute in XIOS output files (if LongName is not empty) |
---|
| 446 | if [ ! "X${config_UserChoices_LongName}" = "X" ] ; then |
---|
| 447 | listfile=$(ls file_def*inca.xml) |
---|
| 448 | echo "<variable id=\"LongName\" type=\"string\">${config_UserChoices_LongName}</variable>" > add.tmp |
---|
| 449 | for file in ${listfile} |
---|
| 450 | do |
---|
| 451 | cp ${file} ${file}.tmp |
---|
| 452 | sed -e "/<file id/r add.tmp" \ |
---|
| 453 | ${file}.tmp > ${file} |
---|
| 454 | rm ${file}.tmp |
---|
| 455 | done |
---|
| 456 | rm add.tmp |
---|
| 457 | fi |
---|
| 458 | |
---|
[5594] | 459 | # remove unlimited from time axis for allowed xios to read all values in one time |
---|
| 460 | echo "retire UNLIMITED sur axe temps " |
---|
| 461 | nccopy -u u10xios.nc tmp.nc |
---|
| 462 | mv tmp.nc u10xios.nc |
---|
| 463 | nccopy -u v10xios.nc tmp.nc |
---|
| 464 | mv tmp.nc v10xios.nc |
---|
[5542] | 465 | nccopy -u oxydants.nc tmp.nc |
---|
| 466 | mv tmp.nc oxydants.nc |
---|
| 467 | |
---|
| 468 | |
---|
[5586] | 469 | |
---|
[5594] | 470 | # Set interpolated output grid depending on resoultion, only if ICO component is set in config.card |
---|
| 471 | if [ ! "X${config_ListOfComponents_ICO}" = "X" ] ; then |
---|
| 472 | if [ ${RESOL_NBP} == 40 ] ; then |
---|
| 473 | valuei=144 |
---|
| 474 | valuej=143 |
---|
| 475 | elif [ ${RESOL_NBP} == 80 ] ; then |
---|
| 476 | valuei=360 |
---|
| 477 | valuej=180 |
---|
| 478 | elif [ ${RESOL_NBP} == 160 ] ; then |
---|
| 479 | valuei=720 |
---|
| 480 | valuej=360 |
---|
| 481 | elif [ ${RESOL_NBP} == 320 ] ; then |
---|
| 482 | valuei=1440 |
---|
| 483 | valuej=720 |
---|
| 484 | else |
---|
| 485 | IGCM_debug_Exit "RESOL_NBP=${RESOL_NBP} is not yet implemented in drivers" |
---|
| 486 | IGCM_debug_Verif_Exit |
---|
| 487 | fi |
---|
| 488 | |
---|
| 489 | IGCM_debug_Print 1 "Modify output grid parameters for current resolution in context_inca.xml" |
---|
| 490 | cp context_inca.xml context_inca.xml.init |
---|
| 491 | sed -e "s/ni_glo.*=.*\"144\"/ni_glo=\"${valuei}\"/" \ |
---|
| 492 | -e "s/nj_glo.*=.*\"143\"/nj_glo=\"${valuej}\"/" \ |
---|
| 493 | context_inca.xml.init > context_inca.xml |
---|
| 494 | |
---|
| 495 | fi |
---|
[5586] | 496 | |
---|
[5594] | 497 | |
---|
[5542] | 498 | IGCM_debug_PopStack "CHM_Update" |
---|
| 499 | } |
---|
| 500 | |
---|
| 501 | #----------------------------------------------------------------- |
---|
| 502 | function CHM_Finalize |
---|
| 503 | { |
---|
| 504 | IGCM_debug_PushStack "CHM_Finalize" |
---|
| 505 | |
---|
| 506 | echo FINALIZE CHM !!! |
---|
| 507 | # |
---|
| 508 | # IGCM_sys_Mkdir ${R_OUT_EXE} |
---|
| 509 | # cd ${MODIPSL} |
---|
| 510 | # tar cf src_${config_UserChoices_JobName}.tar modeles |
---|
| 511 | # IGCM_sys_Mv src_${config_UserChoices_JobName}.tar ${R_OUT_EXE}/. |
---|
| 512 | # cd - |
---|
| 513 | # |
---|
| 514 | |
---|
| 515 | IGCM_debug_PopStack "CHM_Finalize" |
---|
| 516 | } |
---|