[4625] | 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 | |
---|
| 22 | if [ X$ResolAtm != X ] ; then |
---|
| 23 | # ResolAtm is set in config.card |
---|
| 24 | RESOL_ATM_3D=${ResolAtm} |
---|
| 25 | RESOL_ATM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' ) |
---|
| 26 | RESOL_ATM_X=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $1}' ) |
---|
| 27 | RESOL_ATM_Y=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $2}' ) |
---|
| 28 | |
---|
| 29 | RESOL_CHM=${RESOL_ATM_X}${RESOL_ATM_Y}-L${RESOL_ATM_Z} |
---|
| 30 | elif [ -f ${SUBMIT_DIR}/../.resol ] ; then |
---|
| 31 | [ -f ${SUBMIT_DIR}/../.resol ] && eval $(grep RESOL_ATM_3D ${SUBMIT_DIR}/../.resol) || RESOL_ATM_3D=96x95x19 |
---|
| 32 | RESOL_CHM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' | awk "-F-" '{print $1}') |
---|
| 33 | else |
---|
| 34 | IGCM_debug_Exit "ResolAtm is not set in config.card and the .resol file does not exist." |
---|
| 35 | IGCM_debug_Verif_Exit |
---|
| 36 | fi |
---|
| 37 | |
---|
| 38 | echo 'resol chimie', $RESOL_CHM |
---|
| 39 | CHEM=${ConfChem} |
---|
| 40 | echo "INCA Tag : LMDZ-INCA" ${config_UserChoices_TagName} |
---|
| 41 | |
---|
| 42 | ##- LMDZ physics version |
---|
| 43 | ## Read LMDZ_Physics option in lmdz.card, if not present take default value AP (old physics) |
---|
| 44 | if [ ! X${lmdz_UserChoices_LMDZ_Physics} = X ] ; then |
---|
| 45 | LMDZ_Physics=${lmdz_UserChoices_LMDZ_Physics} |
---|
| 46 | else |
---|
| 47 | LMDZ_Physics=AP |
---|
| 48 | fi |
---|
| 49 | echo LMDZ physics version : ${LMDZ_Physics} |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | IGCM_debug_PopStack "CHM_Initialize" |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | #----------------------------------------------------------------- |
---|
| 58 | function CHM_Update |
---|
| 59 | { |
---|
| 60 | IGCM_debug_PushStack "CHM_Update" |
---|
| 61 | |
---|
[4971] | 62 | if [ X${inca_UserChoices_output_frequency_chem} = X ] || [ X${inca_UserChoices_output_frequency_chem} = XNONE ] ; then |
---|
| 63 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry enabled FALSE |
---|
| 64 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry name inca1d_chem |
---|
| 65 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry output_freq 1d |
---|
| 66 | |
---|
| 67 | else |
---|
| 68 | if [ X${inca_UserChoices_output_frequency_chem} = X1d ] || [ X${inca_UserChoices_output_frequency_chem} = X1mo ] ; then |
---|
| 69 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry enabled TRUE |
---|
| 70 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry name inca${inca_UserChoices_output_frequency_chem}_chem |
---|
| 71 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry output_freq ${inca_UserChoices_output_frequency_chem} |
---|
| 72 | else |
---|
| 73 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry enabled TRUE |
---|
| 74 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry name inca1d_chem |
---|
| 75 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry output_freq ${inca_UserChoices_output_frequency_chem} |
---|
[4625] | 76 | |
---|
[4971] | 77 | fi |
---|
| 78 | fi |
---|
[4625] | 79 | |
---|
[4971] | 80 | if [ X${inca_UserChoices_output_frequency_emi} = X ] || [ X${inca_UserChoices_output_frequency_emi} = XNONE ] ; then |
---|
| 81 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions enabled FALSE |
---|
| 82 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions name inca1d_emi |
---|
| 83 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions output_freq 1d |
---|
| 84 | |
---|
| 85 | else |
---|
| 86 | if [ X${inca_UserChoices_output_frequency_emi} = X1d ] || [ X${inca_UserChoices_output_frequency_emi} = X1mo ] ; then |
---|
| 87 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions enabled TRUE |
---|
| 88 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions name inca${inca_UserChoices_output_frequency_emi}_emi |
---|
| 89 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions output_freq ${inca_UserChoices_output_frequency_emi} |
---|
| 90 | else |
---|
| 91 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions enabled TRUE |
---|
| 92 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions name inca1d_emi |
---|
| 93 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions output_freq ${inca_UserChoices_output_frequency_emi} |
---|
| 94 | fi |
---|
| 95 | fi |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | if [ X${inca_UserChoices_output_frequency_species} = X ] || [ X${inca_UserChoices_output_frequency_species} = XNONE ] ; then |
---|
| 99 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species enabled FALSE |
---|
| 100 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species name inca1d_species |
---|
| 101 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species output_freq 1d |
---|
| 102 | |
---|
| 103 | else |
---|
| 104 | if [ X${inca_UserChoices_output_frequency_species} = X1d ] || [ X${inca_UserChoices_output_frequency_species} = X1mo ] ; then |
---|
| 105 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species enabled TRUE |
---|
| 106 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species name inca${inca_UserChoices_output_frequency_species}_species |
---|
| 107 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species output_freq ${inca_UserChoices_output_frequency_species} |
---|
| 108 | else |
---|
| 109 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species enabled TRUE |
---|
| 110 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species name inca1d_species |
---|
| 111 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species output_freq ${inca_UserChoices_output_frequency_species} |
---|
| 112 | fi |
---|
| 113 | fi |
---|
| 114 | |
---|
| 115 | |
---|
| 116 | if [ X${inca_UserChoices_output_frequency_forcage} = X ] || [ X${inca_UserChoices_output_frequency_forcage} = XNONE ] ; then |
---|
| 117 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage enabled FALSE |
---|
| 118 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage name inca1d_forcage |
---|
| 119 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage output_freq 1d |
---|
| 120 | |
---|
| 121 | else |
---|
| 122 | if [ X${inca_UserChoices_output_frequency_forcage} = X1d ] || [ X${inca_UserChoices_output_frequency_forcage} = X1mo ] ; then |
---|
| 123 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage enabled TRUE |
---|
| 124 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage name inca${inca_UserChoices_output_frequency_forcage}_forcage |
---|
| 125 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage output_freq ${inca_UserChoices_output_frequency_forcage} |
---|
| 126 | else |
---|
| 127 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage enabled TRUE |
---|
| 128 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage name inca1d_forcage |
---|
| 129 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage output_freq ${inca_UserChoices_output_frequency_forcage} |
---|
| 130 | fi |
---|
| 131 | fi |
---|
| 132 | |
---|
| 133 | |
---|
| 134 | if [ X${inca_UserChoices_output_frequency_aero} = X ] || [ X${inca_UserChoices_output_frequency_aero} = XNONE ] ; then |
---|
| 135 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero enabled FALSE |
---|
| 136 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero name inca1d_aero |
---|
| 137 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero output_freq 1d |
---|
| 138 | |
---|
| 139 | else |
---|
| 140 | if [ X${inca_UserChoices_output_frequency_aero} = X1d ] || [ X${inca_UserChoices_output_frequency_aero} = X1mo ] ; then |
---|
| 141 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero enabled TRUE |
---|
| 142 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero name inca${inca_UserChoices_output_frequency_aero}_aero |
---|
| 143 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero output_freq ${inca_UserChoices_output_frequency_aero} |
---|
| 144 | else |
---|
| 145 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero enabled TRUE |
---|
| 146 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero name inca1d_aero |
---|
| 147 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero output_freq ${inca_UserChoices_output_frequency_aero} |
---|
| 148 | fi |
---|
| 149 | fi |
---|
| 150 | |
---|
| 151 | |
---|
| 152 | if [ X${inca_UserChoices_output_frequency_dep} = X ] || [ X${inca_UserChoices_output_frequency_dep} = XNONE ] ; then |
---|
| 153 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel enabled FALSE |
---|
| 154 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel name inca1d_dep |
---|
| 155 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel output_freq 1d |
---|
| 156 | |
---|
| 157 | else |
---|
| 158 | if [ X${inca_UserChoices_output_frequency_dep} = X1d ] || [ X${inca_UserChoices_output_frequency_dep} = X1mo ] ; then |
---|
| 159 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel enabled TRUE |
---|
| 160 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel name inca${inca_UserChoices_output_frequency_dep}_dep |
---|
| 161 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel output_freq ${inca_UserChoices_output_frequency_dep} |
---|
| 162 | else |
---|
| 163 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel enabled TRUE |
---|
| 164 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel name inca1d_dep |
---|
| 165 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel output_freq ${inca_UserChoices_output_frequency_dep} |
---|
| 166 | fi |
---|
| 167 | fi |
---|
| 168 | |
---|
| 169 | if [ X${inca_UserChoices_output_frequency_washrate} = X ] || [ X${inca_UserChoices_output_frequency_washrate} = XNONE ] ; then |
---|
| 170 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout enabled FALSE |
---|
| 171 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout name inca1d_washrate |
---|
| 172 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout output_freq 1d |
---|
| 173 | |
---|
| 174 | else |
---|
| 175 | if [ X${inca_UserChoices_output_frequency_washrate} = X1d ] || [ X${inca_UserChoices_output_frequency_washrate} = X1mo ] ; then |
---|
| 176 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout enabled TRUE |
---|
| 177 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout name inca${inca_UserChoices_output_frequency_washrate}_washrate |
---|
| 178 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout output_freq ${inca_UserChoices_output_frequency_washrate} |
---|
| 179 | else |
---|
| 180 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout enabled TRUE |
---|
| 181 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout name inca1d_washrate |
---|
| 182 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout output_freq ${inca_UserChoices_output_frequency_washrate} |
---|
| 183 | fi |
---|
| 184 | fi |
---|
| 185 | |
---|
| 186 | if [ X${inca_UserChoices_output_frequency_veget} = X ] || [ X${inca_UserChoices_output_frequency_veget} = XNONE ] ; then |
---|
| 187 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation enabled FALSE |
---|
| 188 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation name inca1d_veget |
---|
| 189 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation output_freq 1d |
---|
| 190 | |
---|
| 191 | else |
---|
| 192 | if [ X${inca_UserChoices_output_frequency_veget} = X1d ] || [ X${inca_UserChoices_output_frequency_veget} = X1mo ] ; then |
---|
| 193 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation enabled TRUE |
---|
| 194 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation name inca${inca_UserChoices_output_frequency_veget}_veget |
---|
| 195 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation output_freq ${inca_UserChoices_output_frequency_veget} |
---|
| 196 | else |
---|
| 197 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation enabled TRUE |
---|
| 198 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation name inca1d_veget |
---|
| 199 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation output_freq ${inca_UserChoices_output_frequency_veget} |
---|
| 200 | fi |
---|
| 201 | fi |
---|
| 202 | |
---|
| 203 | |
---|
| 204 | if [ X${inca_UserChoices_output_frequency_reacflux} = X ] || [ X${inca_UserChoices_output_frequency_reacflux} = XNONE ] ; then |
---|
| 205 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux enabled FALSE |
---|
| 206 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux name inca1d_reacflux |
---|
| 207 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux output_freq 1d |
---|
| 208 | |
---|
| 209 | else |
---|
| 210 | if [ X${inca_UserChoices_output_frequency_reacflux} = X1d ] || [ X${inca_UserChoices_output_frequency_reacflux} = X1mo ] ; then |
---|
| 211 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux enabled TRUE |
---|
| 212 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux name inca${inca_UserChoices_output_frequency_reacflux}_reacflux |
---|
| 213 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux output_freq ${inca_UserChoices_output_frequency_reacflux} |
---|
| 214 | else |
---|
| 215 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux enabled TRUE |
---|
| 216 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux name inca1d_reacflux |
---|
| 217 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux output_freq ${inca_UserChoices_output_frequency_reacflux} |
---|
| 218 | fi |
---|
| 219 | fi |
---|
| 220 | |
---|
| 221 | |
---|
| 222 | if [ X${inca_UserChoices_output_frequency_phtrate} = X ] || [ X${inca_UserChoices_output_frequency_phtrate} = XNONE ] ; then |
---|
| 223 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate enabled FALSE |
---|
| 224 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate name inca1d_phtrate |
---|
| 225 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate output_freq 1d |
---|
| 226 | |
---|
| 227 | else |
---|
| 228 | if [ X${inca_UserChoices_output_frequency_phtrate} = X1d ] || [ X${inca_UserChoices_output_frequency_phtrate} = X1mo ] ; then |
---|
| 229 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate enabled TRUE |
---|
| 230 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate name inca${inca_UserChoices_output_frequency_phtrate}_phtrate |
---|
| 231 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate output_freq ${inca_UserChoices_output_frequency_phtrate} |
---|
| 232 | else |
---|
| 233 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate enabled TRUE |
---|
| 234 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate name inca1d_phtrate |
---|
| 235 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate output_freq ${inca_UserChoices_output_frequency_phtrate} |
---|
| 236 | fi |
---|
| 237 | fi |
---|
| 238 | |
---|
| 239 | if [ X${inca_UserChoices_output_frequency_ges} = X ] || [ X${inca_UserChoices_output_frequency_ges} = XNONE ] ; then |
---|
| 240 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges enabled FALSE |
---|
| 241 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges name inca1d_ges |
---|
| 242 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges output_freq 1d |
---|
| 243 | |
---|
| 244 | else |
---|
| 245 | if [ X${inca_UserChoices_output_frequency_ges} = X1d ] || [ X${inca_UserChoices_output_frequency_ges} = X1mo ] ; then |
---|
| 246 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges enabled TRUE |
---|
| 247 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges name inca${inca_UserChoices_output_frequency_ges}_ges |
---|
| 248 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges output_freq ${inca_UserChoices_output_frequency_ges} |
---|
| 249 | else |
---|
| 250 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges enabled TRUE |
---|
| 251 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges name inca1d_ges |
---|
| 252 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges output_freq ${inca_UserChoices_output_frequency_ges} |
---|
| 253 | fi |
---|
| 254 | fi |
---|
| 255 | |
---|
| 256 | if [ X${inca_UserChoices_output_frequency_invariants} = X ] || [ X${inca_UserChoices_output_frequency_invariants} = XNONE ] ; then |
---|
| 257 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants enabled FALSE |
---|
| 258 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants name inca1d_invariants |
---|
| 259 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants output_freq 1d |
---|
| 260 | |
---|
| 261 | else |
---|
| 262 | if [ X${inca_UserChoices_output_frequency_invariants} = X1d ] || [ X${inca_UserChoices_output_frequency_invariants} = X1mo ] ; then |
---|
| 263 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants enabled TRUE |
---|
| 264 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants name inca${inca_UserChoices_output_frequency_invariants}_invariants |
---|
| 265 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants output_freq ${inca_UserChoices_output_frequency_invariants} |
---|
| 266 | else |
---|
| 267 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants enabled TRUE |
---|
| 268 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants name inca1d_invariants |
---|
| 269 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants output_freq ${inca_UserChoices_output_frequency_invariants} |
---|
| 270 | fi |
---|
| 271 | fi |
---|
| 272 | |
---|
| 273 | if [ X${inca_UserChoices_output_frequency_aero_chem} = X ] || [ X${inca_UserChoices_output_frequency_aero_chem} = XNONE ] ; then |
---|
| 274 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem enabled FALSE |
---|
| 275 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem name inca1d_aero_chem |
---|
| 276 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem output_freq 1d |
---|
| 277 | |
---|
| 278 | else |
---|
| 279 | 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 |
---|
| 280 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem enabled TRUE |
---|
| 281 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem name inca${inca_UserChoices_output_frequency_aero_chem}_aero_chem |
---|
| 282 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem output_freq ${inca_UserChoices_output_frequency_aero_chem} |
---|
| 283 | else |
---|
| 284 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem enabled TRUE |
---|
| 285 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem name inca1ts_aero_chem |
---|
| 286 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem output_freq ${inca_UserChoices_output_frequency_aero_chem} |
---|
| 287 | fi |
---|
| 288 | fi |
---|
| 289 | |
---|
[4625] | 290 | case ${CHEM} in |
---|
| 291 | AER) |
---|
| 292 | |
---|
| 293 | if [ X${LMDZ_Physics} = X"AP" ] ; then |
---|
| 294 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aero |
---|
| 295 | else |
---|
| 296 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aeNP |
---|
| 297 | fi |
---|
| 298 | ;; |
---|
| 299 | DUSS) |
---|
| 300 | |
---|
| 301 | if [ X${LMDZ_Physics} = X"AP" ] ; then |
---|
| 302 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aero |
---|
| 303 | else |
---|
| 304 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aeNP |
---|
| 305 | fi |
---|
| 306 | ;; |
---|
| 307 | NMHC) |
---|
| 308 | |
---|
| 309 | IGCM_comp_modifyDefFile nonblocker run.def config_inca chem |
---|
| 310 | ;; |
---|
| 311 | NMHC_AER) |
---|
| 312 | |
---|
| 313 | if [ X${LMDZ_Physics} = X"AP" ] ; then |
---|
| 314 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aero |
---|
| 315 | else |
---|
| 316 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aeNP |
---|
| 317 | fi |
---|
| 318 | ;; |
---|
| 319 | |
---|
| 320 | NMHC_AER_S) |
---|
[4884] | 321 | |
---|
[4625] | 322 | if [ X${LMDZ_Physics} = X"AP" ] ; then |
---|
| 323 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aero |
---|
| 324 | else |
---|
| 325 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aeNP |
---|
| 326 | fi |
---|
| 327 | ;; |
---|
| 328 | GES) |
---|
| 329 | |
---|
| 330 | IGCM_comp_modifyDefFile nonblocker run.def config_inca chem |
---|
| 331 | esac |
---|
| 332 | |
---|
| 333 | |
---|
[5919] | 334 | # inca.def : choose if we read input file with xios or netcdf |
---|
| 335 | if [ ! X${inca_UserChoices_xios_read} = X ] ; then |
---|
| 336 | IGCM_comp_modifyDefFile nonblocker inca.def xios_read ${inca_UserChoices_xios_read} |
---|
| 337 | else |
---|
| 338 | IGCM_comp_modifyDefFile nonblocker inca.def xios_read y |
---|
| 339 | fi |
---|
| 340 | |
---|
[4625] | 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 |
---|
[4884] | 350 | IGCM_comp_modifyDefFile nonblocker inca.def tref ${inca_UserChoices_wind_parameter} |
---|
[4625] | 351 | else |
---|
[4884] | 352 | IGCM_comp_modifyDefFile nonblocker inca.def tref DEFAULT |
---|
[4625] | 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 | |
---|
[4884] | 413 | |
---|
| 414 | #inca.def : choose which xml will be use (with group or no = cmip files) |
---|
[4889] | 415 | if [ X${inca_UserChoices_cmip_xml} = Xy ] ; then |
---|
[4884] | 416 | |
---|
| 417 | IGCM_comp_modifyDefFile nonblocker inca.def cmip_xml y |
---|
[4625] | 418 | else |
---|
[4884] | 419 | IGCM_comp_modifyDefFile nonblocker inca.def cmip_xml n |
---|
[4625] | 420 | fi |
---|
[4884] | 421 | |
---|
[4625] | 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"/> |
---|
[4884] | 427 | echo '<context id="inca" src="./context_inca.xml"/>' > add.tmp |
---|
[5919] | 428 | |
---|
| 429 | if [ -f context_input_inca.xml ] ; then |
---|
| 430 | echo '<context id="inca" src="./context_input_inca.xml"/>' >> add.tmp |
---|
| 431 | fi |
---|
| 432 | if [ -f context_sflx_inca.xml ] ; then |
---|
| 433 | echo '<context id="inca" src="./context_sflx_inca.xml"/>' >> add.tmp |
---|
| 434 | fi |
---|
| 435 | if [ -f context_co2_inca.xml ] ; then |
---|
| 436 | echo '<context id="inca" src="./context_co2_inca.xml"/>' >> add.tmp |
---|
| 437 | fi |
---|
| 438 | if [ -f context_oxydants_inca.xml ] ; then |
---|
| 439 | echo '<context id="inca" src="./context_oxydants_inca.xml"/>' >> add.tmp |
---|
| 440 | fi |
---|
| 441 | if [ -f context_start_inca.xml ] ; then |
---|
| 442 | if [ -f chem_start.nc ] ; then |
---|
| 443 | echo '<context id="inca" src="./context_start_inca.xml"/>' >> add.tmp |
---|
| 444 | fi |
---|
| 445 | fi |
---|
| 446 | if [ -f context_dust_inca.xml ] ; then |
---|
| 447 | echo '<context id="inca" src="./context_dust_inca.xml"/>' >> add.tmp |
---|
| 448 | fi |
---|
| 449 | if [ -f context_winds_inca.xml ] ; then |
---|
| 450 | echo '<context id="inca" src="./context_winds_inca.xml"/>' >> add.tmp |
---|
| 451 | fi |
---|
| 452 | |
---|
[4884] | 453 | cp iodef.xml iodef.xml.tmp |
---|
| 454 | sed -e "/COMPONENT CONTEXT/r add.tmp" \ |
---|
| 455 | iodef.xml.tmp > iodef.xml |
---|
| 456 | rm iodef.xml.tmp add.tmp |
---|
[4625] | 457 | |
---|
| 458 | |
---|
| 459 | # Add LongName as global attribute in XIOS output files (if LongName is not empty) |
---|
| 460 | if [ ! "X${config_UserChoices_LongName}" = "X" ] ; then |
---|
| 461 | listfile=$(ls file_def*inca.xml) |
---|
| 462 | echo "<variable id=\"LongName\" type=\"string\">${config_UserChoices_LongName}</variable>" > add.tmp |
---|
| 463 | for file in ${listfile} |
---|
| 464 | do |
---|
| 465 | cp ${file} ${file}.tmp |
---|
| 466 | sed -e "/<file id/r add.tmp" \ |
---|
| 467 | ${file}.tmp > ${file} |
---|
| 468 | rm ${file}.tmp |
---|
| 469 | done |
---|
| 470 | rm add.tmp |
---|
| 471 | fi |
---|
| 472 | |
---|
[5919] | 473 | # remove unlimited from time axis for allowed xios to read all values in one time |
---|
| 474 | echo "retire UNLIMITED sur axe temps " |
---|
| 475 | nccopy -u u10xios.nc tmp.nc |
---|
| 476 | mv tmp.nc u10xios.nc |
---|
| 477 | nccopy -u v10xios.nc tmp.nc |
---|
| 478 | mv tmp.nc v10xios.nc |
---|
| 479 | nccopy -u oxydants.nc tmp.nc |
---|
| 480 | mv tmp.nc oxydants.nc |
---|
| 481 | |
---|
| 482 | |
---|
[4625] | 483 | IGCM_debug_PopStack "CHM_Update" |
---|
| 484 | } |
---|
| 485 | |
---|
| 486 | #----------------------------------------------------------------- |
---|
| 487 | function CHM_Finalize |
---|
| 488 | { |
---|
| 489 | IGCM_debug_PushStack "CHM_Finalize" |
---|
| 490 | |
---|
| 491 | echo FINALIZE CHM !!! |
---|
| 492 | # |
---|
| 493 | # IGCM_sys_Mkdir ${R_OUT_EXE} |
---|
| 494 | # cd ${MODIPSL} |
---|
| 495 | # tar cf src_${config_UserChoices_JobName}.tar modeles |
---|
| 496 | # IGCM_sys_Mv src_${config_UserChoices_JobName}.tar ${R_OUT_EXE}/. |
---|
| 497 | # cd - |
---|
| 498 | # |
---|
| 499 | |
---|
| 500 | IGCM_debug_PopStack "CHM_Finalize" |
---|
| 501 | } |
---|