Changeset 5691 for CONFIG/UNIFORM
- Timestamp:
- 04/27/21 17:02:24 (3 years ago)
- Location:
- CONFIG/UNIFORM/v6/LMDZREPR_v6/GENERAL/DRIVER
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
CONFIG/UNIFORM/v6/LMDZREPR_v6/GENERAL/DRIVER/lmdz.driver
r5608 r5691 5 5 IGCM_debug_PushStack "ATM_Initialize" 6 6 7 RESOL_ATM=$( echo $RESOL | awk "-Fx" '{print $2}' | awk "-F-" '{print $1}') 8 9 [ -f ${SUBMIT_DIR}/../.resol ] && eval $(grep RESOL_ATM_3D ${SUBMIT_DIR}/../.resol) || RESOL_ATM_3D=96x95x39 7 # Read the resolution from the variables ResolAtm set in config.card UserChoices section or from .resol file 8 if [ X$ResolAtm != X ] ; then 9 # ResolAtm is set in config.card 10 RESOL_ATM_3D=${ResolAtm} 11 elif [ -f ${SUBMIT_DIR}/../.resol ] ; then 12 # ResolAtm was not set in config.card, try to read .resol file 13 eval $(grep RESOL_ATM_3D ${SUBMIT_DIR}/../.resol) || RESOL_ATM_3D=96x95x39 14 else 15 IGCM_debug_Exit "ResolAtm is not set in config.card and the .resol file does not exist." 16 IGCM_debug_Verif_Exit 17 fi 18 19 IGCM_debug_Print 1 "The atomsopheric resolution is ${RESOL_ATM_3D} " 10 20 11 21 RESOL_ATM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' ) … … 13 23 RESOL_ATM_Y=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $2}' ) 14 24 RESOL_ATM_XY="${RESOL_ATM_X}x${RESOL_ATM_Y}" 25 RESOL_ATM=LMD${RESOL_ATM_X}${RESOL_ATM_Y} 15 26 16 27 ##- LMDZ physics version … … 37 48 ConfType=${lmdz_UserChoices_ConfType} 38 49 39 ##- LMDZ output level, to be set in lmdz.card40 if [ X${lmdz_UserChoices_OutLevel} = X ] ; then41 # OutLevel is not set. Take default value low.42 OutLevel=low43 else44 OutLevel=${lmdz_UserChoices_OutLevel}45 fi46 47 ##-- Output frequency purpose ....48 ##-- Initialisation ....49 ok_mensuel=.FALSE.50 ok_journe=.FALSE.51 ok_hf=.FALSE.52 ok_hf3h=.FALSE.53 ok_hf3hm=.FALSE.54 ok_stn=.FALSE.55 56 57 case ${config_UserChoices_PeriodLength} in58 1Y|1y|1M|1m) ok_mensuel=.TRUE. ;;59 5D|5d|1D|1d) ok_journe=.TRUE. ;;60 esac61 62 for frequency in ${config_ATM_WriteFrequency} ; do63 case ${frequency} in64 1M|1m) ok_mensuel=.TRUE. ;;65 esac66 case ${frequency} in67 5D|5d|1D|1d) ok_journe=.TRUE. ;;68 esac69 case ${frequency} in70 HF|hf) ok_hf=.TRUE. ;;71 esac72 case ${frequency} in73 HF3h|hf3h) ok_hf3h=.TRUE. ;;74 esac75 case ${frequency} in76 HF3hm|hf3hm) ok_hf3hm=.TRUE. ;;77 esac78 case ${frequency} in79 STN|stn) ok_stn=.TRUE. ;;80 esac81 done82 83 84 ## Read LMDZ_COSP_OK in lmdz.card85 if [ X${lmdz_UserChoices_LMDZ_COSP_OK} = Xy ] ; then86 ## LMDZ_COSP_OK=y, now read all other COSP variables87 ## Read LMDZ_COSP_monthly in lmdz.card88 if [ X${lmdz_UserChoices_LMDZ_COSP_monthly} = Xy ] ; then89 LMDZ_COSP_monthly=.TRUE.90 else91 LMDZ_COSP_monthly=.FALSE.92 fi93 ## Read LMDZ_COSP_daily in lmdz.card94 if [ X${lmdz_UserChoices_LMDZ_COSP_daily} = Xy ] ; then95 LMDZ_COSP_daily=.TRUE.96 else97 LMDZ_COSP_daily=.FALSE.98 fi99 ## Read LMDZ_COSP_hf in lmdz.card100 if [ X${lmdz_UserChoices_LMDZ_COSP_hf} = Xy ] ; then101 LMDZ_COSP_hf=.TRUE.102 else103 LMDZ_COSP_hf=.FALSE.104 fi105 else106 # LMDZ_COSP_OK=n : All cosp output are deactivated107 LMDZ_COSP_monthly=.FALSE.108 LMDZ_COSP_daily=.FALSE.109 LMDZ_COSP_hf=.FALSE.110 fi111 112 ## Read LMDZ_NMC_monthly in lmdz.card113 if [ X${lmdz_UserChoices_LMDZ_NMC_monthly} = Xy ] ; then114 LMDZ_NMC_monthly=.TRUE.115 else116 LMDZ_NMC_monthly=.FALSE.117 fi118 119 ## Read LMDZ_NMC_daily in lmdz.card120 if [ X${lmdz_UserChoices_LMDZ_NMC_daily} = Xy ] ; then121 LMDZ_NMC_daily=.TRUE.122 else123 LMDZ_NMC_daily=.FALSE.124 fi125 126 ## Read LMDZ_NMC_hf in lmdz.card127 if [ X${lmdz_UserChoices_LMDZ_NMC_hf} = Xy ] ; then128 LMDZ_NMC_hf=.TRUE.129 else130 LMDZ_NMC_hf=.FALSE.131 fi132 133 134 50 IGCM_debug_PopStack "ATM_Initialize" 135 51 } … … 276 192 IGCM_comp_modifyDefFile nonblocker config.def t_coupl ${LMDZ_t_coupl} 277 193 278 ##-- Add special treatement for CARBON CYCLE 279 if [ X"${lmdz_UserChoices_CARBON_CYCLE}" = X"control" ] || [ X"${lmdz_UserChoices_CARBON_CYCLE}" = X"historical" ] ; then 280 ATM_Carbon_Update 281 fi 282 283 284 ##-- Set LMDZ_COSP_daily1979=y in section UserChoices in lmdz.card to activate 285 ## COSP daily output for years 1979 and later (mandatory for historical CMIP5 run). 286 if ([ X"${lmdz_UserChoices_LMDZ_COSP_daily1979}" = X"y" ] && [ ${year} -ge 1979 ]) ; then 287 LMDZ_COSP_daily=.TRUE. 288 fi 289 290 ## Modifiy 291 IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth enabled ${ok_mensuel} 292 293 IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday enabled ${ok_journe} 294 295 if [ X${OutLevel} = Xlow ] || [ X${OutLevel} = Xmedium ] ; then 296 IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday output_level 2 297 else 298 IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday output_level 5 299 fi 300 301 IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf enabled ${ok_hf} 302 303 if [ X${OutLevel} = Xlow ] ; then 304 IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level 5 305 IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth output_level 5 306 elif [ X${OutLevel} = Xmedium ] ; then 307 IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level 6 308 IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth output_level 6 309 elif [ X${OutLevel} = Xhigh ] ; then 310 IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level 7 311 IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth output_level 7 312 fi 313 314 IGCM_comp_modifyXmlFile nonblocker file_def_histhf3h_lmdz.xml histhf3h enabled ${ok_hf3h} 315 IGCM_comp_modifyXmlFile nonblocker file_def_histhf3hm_lmdz.xml histhf3hm enabled ${ok_hf3hm} 316 317 IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn enabled ${ok_stn} 318 319 IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC enabled ${LMDZ_NMC_monthly} 320 IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC enabled ${LMDZ_NMC_daily} 321 IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC enabled ${LMDZ_NMC_hf} 322 323 IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP enabled ${LMDZ_COSP_monthly} 324 IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP enabled ${LMDZ_COSP_daily} 325 IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP enabled ${LMDZ_COSP_hf} 326 327 # Activate the histstrataer output files only for configuration with interactive stratospheric aerosols 328 # done by setting the key word LMDZ_strataero=y in lmdz.card 329 if [ X${lmdz_UserChoices_LMDZ_strataero} = Xy ] ; then 330 IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer enabled .TRUE. 331 IGCM_comp_modifyXmlFile nonblocker file_def_histdaystrataer_lmdz.xml histdaystrataer enabled .TRUE. 332 else 333 IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer enabled .FALSE. 334 IGCM_comp_modifyXmlFile nonblocker file_def_histdaystrataer_lmdz.xml histdaystrataer enabled .FALSE. 194 195 196 ## Activate diagnostic output files and set output_level for each file 197 198 # histmth 199 if [ X${lmdz_UserChoices_output_level_histmth} = X ] || [ X${lmdz_UserChoices_output_level_histmth} = XNONE ] ; then 200 IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth enabled FALSE 201 IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth output_level 0 202 else 203 IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth enabled TRUE 204 IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth output_level ${lmdz_UserChoices_output_level_histmth} 205 fi 206 207 # histday 208 if [ X${lmdz_UserChoices_output_level_histday} = X ] || [ X${lmdz_UserChoices_output_level_histday} = XNONE ] ; then 209 IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday enabled FALSE 210 IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday output_level 0 211 else 212 IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday enabled TRUE 213 IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday output_level ${lmdz_UserChoices_output_level_histday} 214 fi 215 216 # histhf 217 if [ X${lmdz_UserChoices_output_level_histhf} = X ] || [ X${lmdz_UserChoices_output_level_histhf} = XNONE ] ; then 218 IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf enabled FALSE 219 IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level 0 220 else 221 IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf enabled TRUE 222 IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level ${lmdz_UserChoices_output_level_histhf} 223 fi 224 225 # histmthNMC 226 if [ X${lmdz_UserChoices_output_level_histmthNMC} = X ] || [ X${lmdz_UserChoices_output_level_histmthNMC} = XNONE ] ; then 227 IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC enabled FALSE 228 IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC output_level 0 229 else 230 IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC enabled TRUE 231 IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC output_level ${lmdz_UserChoices_output_level_histmthNMC} 232 fi 233 234 # histdayNMC 235 if [ X${lmdz_UserChoices_output_level_histdayNMC} = X ] || [ X${lmdz_UserChoices_output_level_histdayNMC} = XNONE ] ; then 236 IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC enabled FALSE 237 IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC output_level 0 238 else 239 IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC enabled TRUE 240 IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC output_level ${lmdz_UserChoices_output_level_histdayNMC} 241 fi 242 243 # histhfNMC 244 if [ X${lmdz_UserChoices_output_level_histhfNMC} = X ] || [ X${lmdz_UserChoices_output_level_histhfNMC} = XNONE ] ; then 245 IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC enabled FALSE 246 IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC output_level 0 247 else 248 IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC enabled TRUE 249 IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC output_level ${lmdz_UserChoices_output_level_histhfNMC} 250 fi 251 252 # histstrataer 253 if [ X${lmdz_UserChoices_output_level_histstrataer} = X ] || [ X${lmdz_UserChoices_output_level_histstrataer} = XNONE ] ; then 254 IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer enabled FALSE 255 IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer output_level 0 256 else 257 IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer enabled TRUE 258 IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer output_level ${lmdz_UserChoices_output_level_histstrataer} 259 fi 260 261 # histdaystrataer 262 if [ X${lmdz_UserChoices_output_level_histdaystrataer} = X ] || [ X${lmdz_UserChoices_output_level_histdaystrataer} = XNONE ] ; then 263 IGCM_comp_modifyXmlFile nonblocker file_def_histdaystrataer_lmdz.xml histdaystrataer enabled FALSE 264 IGCM_comp_modifyXmlFile nonblocker file_def_histdaystrataer_lmdz.xml histdaystrataer output_level 0 265 else 266 IGCM_comp_modifyXmlFile nonblocker file_def_histdaystrataer_lmdz.xml histdaystrataer enabled TRUE 267 IGCM_comp_modifyXmlFile nonblocker file_def_histdaystrataer_lmdz.xml histdaystrataer output_level ${lmdz_UserChoices_output_level_histstrataer} 268 fi 269 270 # histstn 271 if [ X${lmdz_UserChoices_output_level_histstn} = X ] || [ X${lmdz_UserChoices_output_level_histstn} = XNONE ] ; then 272 IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn enabled FALSE 273 IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn output_level 0 274 else 275 IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn enabled TRUE 276 IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn output_level ${lmdz_UserChoices_output_level_histstn} 277 fi 278 279 280 # histmthCOSP 281 if [ X${lmdz_UserChoices_output_level_histmthCOSP} = X ] || [ X${lmdz_UserChoices_output_level_histmthCOSP} = XNONE ] ; then 282 IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP enabled FALSE 283 IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP output_level 0 284 else 285 IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP enabled TRUE 286 IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP output_level ${lmdz_UserChoices_output_level_histmthCOSP} 287 fi 288 289 290 # histdayCOSP 291 if [ X${lmdz_UserChoices_output_level_histdayCOSP} = X ] || [ X${lmdz_UserChoices_output_level_histdayCOSP} = XNONE ] ; then 292 IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP enabled FALSE 293 IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP output_level 0 294 else 295 IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP enabled TRUE 296 IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP output_level ${lmdz_UserChoices_output_level_histdayCOSP} 297 fi 298 299 300 # histhfCOSP 301 if [ X${lmdz_UserChoices_output_level_histhfCOSP} = X ] || [ X${lmdz_UserChoices_output_level_histhfCOSP} = XNONE ] ; then 302 IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP enabled FALSE 303 IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP output_level 0 304 else 305 IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP enabled TRUE 306 IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP output_level ${lmdz_UserChoices_output_level_histhfCOSP} 335 307 fi 336 308 … … 395 367 fi 396 368 397 if [ X${config_ListOfComponents_CHM} = Xinca ] ; then 398 echo "Activate coupling to INCA, set type_trac=inca in run.def" 399 IGCM_comp_modifyDefFile blocker run.def type_trac inca 369 if [ X${config_UserChoices_ConfigType} = XESMCO2AER ] ; then 370 echo "ESM config, with INCA and CO2i, set type_trac=inco in run.def" 371 IGCM_comp_modifyDefFile blocker run.def type_trac inco 372 IGCM_comp_modifyDefFile blocker run.def iflag_phytrac 1 373 elif [ X${config_ListOfComponents_CHM} = Xinca ] ; then 374 echo "Activate coupling to INCA, set type_trac=inca in run.def" 375 IGCM_comp_modifyDefFile blocker run.def type_trac inca 376 IGCM_comp_modifyDefFile blocker run.def iflag_phytrac 1 400 377 elif [ X${config_ListOfComponents_CHM} = Xreprobus ] ; then 401 402 378 echo "Activate coupling to REPROBUS, set type_trac=repr in run.def" 379 IGCM_comp_modifyDefFile blocker run.def type_trac repr 403 380 IGCM_comp_modifyDefFile blocker run.def config_inca none 381 IGCM_comp_modifyDefFile blocker run.def iflag_phytrac 1 382 elif [ X${config_UserChoices_ConfigType} = XESMCO2 ] ; then 383 echo "ESM config, set type_trac=co2i in run.def" 384 IGCM_comp_modifyDefFile blocker run.def type_trac co2i 385 IGCM_comp_modifyDefFile blocker run.def config_inca none 386 IGCM_comp_modifyDefFile blocker run.def iflag_phytrac 1 404 387 elif [ X${lmdz_UserChoices_LMDZ_strataero} = Xy ] ; then 405 388 echo "No coupling to chemistry model but it is a LMDZ STRATAER configuration, set type_trac=coag in run.def" 406 389 IGCM_comp_modifyDefFile blocker run.def type_trac coag 407 390 IGCM_comp_modifyDefFile blocker run.def config_inca none 408 else 409 echo "No coupling to chemistry model, set type_trac=lmdz in run.def" 410 IGCM_comp_modifyDefFile blocker run.def type_trac lmdz 391 IGCM_comp_modifyDefFile blocker run.def iflag_phytrac 1 392 else 393 echo "No coupling to chemistry model, set type_trac=lmdz in run.def" 394 IGCM_comp_modifyDefFile blocker run.def type_trac lmdz 411 395 IGCM_comp_modifyDefFile blocker run.def config_inca none 412 fi 413 414 # run.def : Activate the call to phytrac 415 if [ ! X${lmdz_UserChoices_iflag_phytrac} = X ]; then 416 IGCM_comp_modifyDefFile nonblocker run.def iflag_phytrac ${lmdz_UserChoices_iflag_phytrac} 417 elif [ X${lmdz_UserChoices_LMDZ_strataero} = Xy ] ; then 418 IGCM_comp_modifyDefFile nonblocker run.def iflag_phytrac 1 419 else 420 IGCM_comp_modifyDefFile nonblocker run.def iflag_phytrac 0 396 IGCM_comp_modifyDefFile blocker run.def iflag_phytrac 0 397 fi 398 399 # run.def : Activate the new calving 400 if [ ! X${lmdz_UserChoices_cpl_old_calving} = X ]; then 401 IGCM_comp_modifyDefFile nonblocker run.def cpl_old_calving ${lmdz_UserChoices_cpl_old_calving} 402 else 403 IGCM_comp_modifyDefFile nonblocker run.def cpl_old_calving y 421 404 fi 422 405 … … 426 409 else 427 410 IGCM_comp_modifyDefFile nonblocker physiq.def ok_bug_cv_trac n 411 fi 412 413 # config.def : Activate aerosol strato 414 if [ ! X${lmdz_UserChoices_flag_aerosol_strat} = X ]; then 415 IGCM_comp_modifyDefFile nonblocker config.def flag_aerosol_strat ${lmdz_UserChoices_flag_aerosol_strat} 416 else 417 IGCM_comp_modifyDefFile nonblocker config.def flag_aerosol_strat DEFAULT 428 418 fi 429 419 … … 494 484 fi 495 485 496 # config.def : Modify parameter ok_volcan if it is set in lmdz.card497 if [ ! X${lmdz_UserChoices_ok_volcan} = X ]; then 498 IGCM_comp_modifyDefFile nonblocker config.def ok_volcan ${lmdz_UserChoices_ok_volcan} 499 else 500 # Take default value set in config.def 501 IGCM_comp_modifyDefFile nonblocker config.def ok_volcan DEFAULT 502 fi503 504 # config.def : set ok_volcan to y if we are in the strataero config 505 if [ X${lmdz_UserChoices_LMDZ_strataero} = Xy ] ; then 506 IGCM_comp_modifyDefFile nonblocker config.def ok_volcan y 507 else 508 IGCM_comp_modifyDefFile nonblocker config.def ok_volcan DEFAULT509 fi 510 486 if ( [ X${config_UserChoices_ConfigType} = XESMCO2 ] || [ X${config_UserChoices_ConfigType} = XESMCO2AER ] ) ; then 487 # Set carbon cycle parameters according to parmeters in lmdz.card 488 IGCM_comp_modifyDefFile blocker config.def level_coupling_esm 2 489 IGCM_comp_modifyDefFile blocker config.def carbon_cycle_cpl ${lmdz_UserChoices_carbon_cycle_cpl} 490 IGCM_comp_modifyDefFile blocker config.def carbon_cycle_tr ${lmdz_UserChoices_carbon_cycle_tr} 491 IGCM_comp_modifyDefFile blocker config.def carbon_cycle_rad ${lmdz_UserChoices_carbon_cycle_rad} 492 else 493 # Take default value set in config.def 494 IGCM_comp_modifyDefFile nonblocker config.def level_coupling_esm DEFAULT 495 IGCM_comp_modifyDefFile nonblocker config.def carbon_cycle_cpl DEFAULT 496 IGCM_comp_modifyDefFile nonblocker config.def carbon_cycle_tr DEFAULT 497 IGCM_comp_modifyDefFile nonblocker config.def carbon_cycle_rad DEFAULT 498 fi 499 500 # config.def : Modify parameter ok_volcan if ok_volcan=y or LMDZ_strataero=y in lmdz.card 511 501 # Note: ok_volcan is a flag allowing a double-call with/without natural forcing (instead of with/without anthro forcing). 502 if [ ! X${lmdz_UserChoices_ok_volcan} = X ] || [ X${lmdz_UserChoices_LMDZ_strataero} = Xy ] ; then 503 IGCM_comp_modifyDefFile nonblocker config.def ok_volcan ${lmdz_UserChoices_ok_volcan} 504 else 505 # Take default value set in config.def 506 IGCM_comp_modifyDefFile nonblocker config.def ok_volcan DEFAULT 507 fi 512 508 513 509 # physiq.def : Modify parameter tau_gl if it is set in lmdz.card … … 562 558 fi 563 559 # Include xml files for output configuration if running with workflow CMIP6 564 if [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ]; then560 if ( [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] || [ X${config_Post_dr2xmlIPSL} = XTRUE ] ) ; then 565 561 echo '<context id="LMDZ" src="./ping_lmdz.xml"/>' >> add.tmp 566 562 echo '<context id="LMDZ" src="./dr2xml_lmdz.xml"/>' >> add.tmp 567 563 fi 568 564 cp iodef.xml iodef.xml.tmp … … 584 580 fi 585 581 586 # Compression level (if CompressionLevel is not empty)582 # Compression level (if CompressionLevel is not empty) 587 583 if [ ! "X${config_UserChoices_CompressionLevel}" = "X" ] ; then 588 584 echo "NetCDF output files compression level is " ${config_UserChoices_CompressionLevel} 589 585 listfile=$(ls file_def*lmdz.xml) 590 for file in ${listfile} 591 do 586 for file in ${listfile} ; do 592 587 sed -i -e "s/\(compression_level=\"\)[^\"]*\(\"\)/\1${config_UserChoices_CompressionLevel}\2/" ${file} 593 588 done … … 603 598 IGCM_debug_PushStack "ATM_Finalize" 604 599 605 # Add special treatement for CARBON CYCLE 606 if [ X"${lmdz_UserChoices_CARBON_CYCLE}" = X"control" ] || [ X"${lmdz_UserChoices_CARBON_CYCLE}" = X"historical" ] ; then 607 ATM_Carbon_Finalize 608 fi 609 610 echo FINALIZE ATM ! 600 IGCM_debug_Print 1 "FINALIZE ATM !" 611 601 612 602 IGCM_debug_PopStack "ATM_Finalize" 613 603 } 614 604 615 616 617 function ATM_Carbon_Update618 {619 # This fuction will be called only if CARBON_CYCLE is set to control or historical in lmdz.card620 621 IGCM_debug_PushStack "ATM_Carbon_Update"622 623 typeset InitPeriodCo2 InitDateBeginCo2 InitDateEndCo2624 typeset CO2SBG CO2MBG CO2LU CO2_ppm CO2_ppm_prec fCO2_ff625 typeset PathCO2log626 typeset PreviousLinelog LastPeriodDateBegin LastPeriodDateEnd LastDatesPeriod LastPREFIX627 628 if ( ${FirstInitialize} && [ X"${config_ATM_Restart}" = X"n" ] ) ; then629 ##--Initialization of fluxes to an undefined value at the first run630 UndefinedValueCo2=-9999631 InitPeriodCo2=0632 InitDateBeginCo2=${UndefinedValueCo2}633 InitYearCo2=$(( ${year} - 1 ))634 InitDateEndCo2=${InitYearCo2}1231635 fCO2_ff=${UndefinedValueCo2}636 CO2SBG=${UndefinedValueCo2}637 CO2LU=${UndefinedValueCo2}638 CO2MBG=${UndefinedValueCo2}639 CO2_ppm_prec=${UndefinedValueCo2}640 # Get the initial value of atmosp. pco2641 CO2_ppm=${lmdz_UserChoices_co2_init}642 643 IGCM_sys_Cp ${SUBMIT_DIR}/co2.log.init ${SUBMIT_DIR}/co2.log644 IGCM_sys_Chmod u+w ${SUBMIT_DIR}/co2.log645 646 # Save CO2 values in ExeCpuLog variable contents 5 fields647 echo "${InitPeriodCo2} ${InitDateBeginCo2} ${InitDateEndCo2} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SBG} ${CO2LU}" | \648 gawk '{printf(" %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \649 $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log650 651 # Get the path where the log file co2.log is652 PathCO2log=${SUBMIT_DIR}653 # Get Previous line in co2.log654 PreviousLinelog=$( tail -1 ${PathCO2log}/co2.log )655 656 else657 658 # NEW parameter in config.card (even for Overule all restarts, you must modify the line after this comment ):659 # !! NEW for Carbone cycle !! Path where to find old co2.log file for restart CO2.660 #SubmitRestartPath=661 if ( ${FirstInitialize} && [ X"${config_ATM_Restart}" = X"y" ] ) ; then662 IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ATM SubmitRestartPath663 PathCO2log=${config_ATM_SubmitRestartPath}664 Date_r=$( IGCM_date_ConvertFormatToGregorian ${config_ATM_RestartDate} )665 PreviousLinelog=$( grep ${Date_r} ${PathCO2log}/co2.log )666 667 IGCM_sys_Cp ${SUBMIT_DIR}/co2.log.init ${SUBMIT_DIR}/co2.log668 IGCM_sys_Chmod u+w ${SUBMIT_DIR}/co2.log669 670 # Save Last Line of control in new co2.log file671 InitPeriodCo2=0672 InitDateBeginCo2=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $2}' )673 InitDateEndCo2=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $3}' )674 fCO2_ff=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $6}' )675 CO2SBG=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $8}' )676 CO2LU=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $9}' )677 CO2MBG=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $7}' )678 CO2_ppm_prec=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $5}' )679 CO2_ppm=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' )680 681 echo "${InitPeriodCo2} ${InitDateBeginCo2} ${InitDateEndCo2} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SBG} ${CO2LU}" | \682 gawk '{printf(" %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \683 $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log684 else685 # Get restart line in co2.log686 PathCO2log=${SUBMIT_DIR}687 PreviousLinelog=$( tail -1 ${PathCO2log}/co2.log )688 # Get the value of atmosp. pco2 in co2.log689 CO2_ppm=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' )690 fi691 692 fi693 694 if [ ${lmdz_UserChoices_CARBON_CYCLE} = historical ] ; then695 # Modify co2_ppm in config.def only for historical run696 # If not historical run, keep co2_ppm value set earlier by IGCM_comp_modifyDefFile697 IGCM_comp_modifyDefFile force config.def co2_ppm ${CO2_ppm}698 fi699 IGCM_debug_PopStack "ATM_Carbon_Update"700 }701 702 703 function ATM_Carbon_Finalize704 {705 # This fuction will be called only if CARBON_CYCLE is set to control or historical in lmdz.card706 707 IGCM_debug_PushStack "ATM_Carbon_Finalize"708 709 typeset CO2SBG_3V CO2SBG CO2MBG CO2SRF CO2LU CO2_ppm CO2_ppm_prec fCO2_ff710 711 # Fossil fuel emission712 if [ ${lmdz_UserChoices_CARBON_CYCLE} = control ] ; then713 # For Control, no fossil fuel emission :714 fCO2_ff=0715 echo "Fossil Fuel for control run :" ${fCO2_ff}716 else717 # For historical, get the fossile fuel file :718 fCO2_ff=$( gawk "{if (match(\$0,\"${year}\ *${month}\")) {print \$3}}" ${SUBMIT_DIR}/PARAM/CMIP5_gridcar_CO2_emissions_fossil_fuel_Andres_1751-2007_monthly_SC.txt )719 echo "Fossil Fuel for historical run :" ${fCO2_ff}720 fi721 722 # Get the value of ocean carbon flux723 CO2MBG=$( ${SUBMIT_DIR}/COMP/lmdz_analyse_pisces_out.awk ocean.output )724 CO2MBG=$( echo ${CO2MBG} | sed -e "s/ *//" )725 echo "Ocean carbon flux :" ${CO2MBG}726 727 # Get the value of land fluxes728 set +A CO2SBG_3V -- $( ${SUBMIT_DIR}/COMP/lmdz_analyse_stomate_out.awk out_orchidee_0000 )729 CO2SRF=$( echo ${CO2SBG_3V[0]} | sed -e "s/ *//" )730 CO2LU=$( echo ${CO2SBG_3V[1]} | sed -e "s/ *//" )731 CO2SBG=$( echo ${CO2SBG_3V[2]} | sed -e "s/ *//" )732 echo "Land carbon flux (NEP) :" ${CO2SRF}733 echo "LU flux (FLUC) :" ${CO2LU}734 echo "Total Land carbon flux (NBP) :" ${CO2SBG}735 736 # Previous CO2737 CO2_ppm_prec=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' )738 echo "Previous CO2 :" ${CO2_ppm_prec}739 740 # Formula741 CO2_ppm=$( echo "${CO2_ppm_prec} + (${fCO2_ff} + ${CO2MBG} + ${CO2SBG}) / 2.12" | bc -l )742 echo "New CO2 :" ${CO2_ppm}743 744 # Save CO2 values in ExeCpuLog variable contents 5 fields745 echo "${CumulPeriod} ${PeriodDateBegin} ${PeriodDateEnd} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SBG} ${CO2LU}" | \746 gawk '{printf(" %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \747 $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log748 749 IGCM_debug_PopStack "ATM_Carbon_Finalize"750 } -
CONFIG/UNIFORM/v6/LMDZREPR_v6/GENERAL/DRIVER/xios.driver
r5608 r5691 19 19 IGCM_comp_modifyXmlFile force iodef.xml using_server NONE true 20 20 21 # Activate 2nd server level for CMIP6 type experiments (CMIP6 workflow) 22 23 if ( [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] || [ X"$( echo ${config_UserChoices_ExpType} | grep MR025 )" != "X" ] || [ X${config_Post_dr2xmlIPSL} = XTRUE ] ) ; then 24 IGCM_comp_modifyXmlFile force iodef.xml using_server2 NONE true 25 fi 26 21 27 if [ -f namcouple ] ; then 22 28 sed -e "s/2 LMDZ oceanx/3 LMDZ oceanx ${config_Executable_IOS[1]}/" namcouple > namcouple.tmp
Note: See TracChangeset
for help on using the changeset viewer.