source: CONFIG/UNIFORM/v6/LMDZORINCA_v6/GENERAL/DRIVER/inca.driver @ 2399

Last change on this file since 2399 was 2399, checked in by acosce, 7 years ago

In LMDZORINCA_v6 config

  • Add possibility to choose between xios and/or ioipsl for output library
  • Correct a path for limit.nc files
  • Add input files for nitrate on p86ispl/rpsl035 login
File size: 3.7 KB
Line 
1#!/bin/ksh
2
3#D- Driver du script pour INCA
4#-----------------------------------------------------------------
5function 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#-----------------------------------------------------------------
18function CHM_Initialize
19{
20    IGCM_debug_PushStack "CHM_Initialize"
21
22    RESOL_CHM=$( echo $RESOL | awk "-Fx" '{print $2}' | awk "-FD" '{print $2}')
23
24    [ -f ${SUBMIT_DIR}/../.resol ] && eval $(grep RESOL_ATM_3D ${SUBMIT_DIR}/../.resol) || RESOL_ATM_3D=96x95x19
25    RESOL_CHM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' | awk "-F-" '{print $1}')
26    echo 'resol chimie', $RESOL_CHM
27
28    [ -f ${SUBMIT_DIR}/../.chimie ] && eval $(grep CHEM ${SUBMIT_DIR}/../.chimie) 
29    INCA_sed_replace ${SUBMIT_DIR}/config.card \${CHEM} ${CHEM}
30    echo "INCA Tag : LMDZ-INCA" ${config_UserChoices_TagName}
31
32    IGCM_debug_PopStack "CHM_Initialize"
33}
34
35#-----------------------------------------------------------------
36function CHM_Update
37{
38    IGCM_debug_PushStack "CHM_Update"
39
40    case ${CHEM} in
41        AER)
42        IGCM_comp_modifyDefFile nonblocker run.def config_inca aero
43        ;;
44        NMHC) 
45        IGCM_comp_modifyDefFile nonblocker run.def config_inca chem
46        ;;
47        NMHC_AER)
48        IGCM_comp_modifyDefFile nonblocker run.def config_inca aero
49        ;;
50        CH4)
51        IGCM_comp_modifyDefFile nonblocker run.def config_inca chem
52        ;;
53        CH4_AER)
54        IGCM_comp_modifyDefFile nonblocker run.def config_inca aero
55        ;;
56        GES)
57        IGCM_comp_modifyDefFile nonblocker run.def config_inca chem
58        esac
59
60    # inca.def : Activate reading of 10m wind in files if climatological=n in inca.card
61    if [ ! X${inca_UserChoices_climatological} = X ] ; then
62        IGCM_comp_modifyDefFile nonblocker inca.def climatological  ${inca_UserChoices_climatological}
63    else
64        IGCM_comp_modifyDefFile nonblocker inca.def climatological  n
65    fi
66
67    # inca.def : choose write frequency for inca_avgr in inca.card
68    if [ ! X${inca_UserChoices_freq_write_chem} = X ] ; then
69        IGCM_comp_modifyDefFile nonblocker inca.def freq_write_chem  ${inca_UserChoices_freq_write_chem}
70    else
71        IGCM_comp_modifyDefFile nonblocker inca.def  freq_write_chem  86400
72    fi
73
74    #inca.def : choose aerosol effect with feedback variable
75    if [ ! X${inca_UserChoices_feedb} = X ] ; then
76        IGCM_comp_modifyDefFile nonblocker inca.def  feedb  ${inca_UserChoices_feedb}
77    else
78        IGCM_comp_modifyDefFile nonblocker inca.def feedb  0
79    fi
80   
81    #inca.def : choose output library
82    if [  X${inca_UserChoices_XIOS} = Xy ] ; then
83        IGCM_comp_modifyDefFile nonblocker inca.def  XIOS_INCA_OK  y
84    else
85        IGCM_comp_modifyDefFile nonblocker inca.def  XIOS_INCA_OK n
86    fi
87
88    if [  X${inca_UserChoices_IOIPSL} = Xy ] ; then
89        IGCM_comp_modifyDefFile nonblocker inca.def  IOIPSL_INCA_OK  y
90    else
91        IGCM_comp_modifyDefFile nonblocker inca.def  IOIPSL_INCA_OK n
92    fi
93
94
95    if [ X${inca_UserChoices_XIOS}  = Xy ] ; then
96    # Add include of INCA context in iodef.xml
97    # In iodef.xml add on next line after "COMPONENT CONTEXT"
98    #  <context id="inca" src="./context_inca.xml"/>
99        echo '<context id="inca" src="./context_inca.xml"/>' > add.tmp
100        cp iodef.xml iodef.xml.tmp
101        sed -e "/COMPONENT CONTEXT/r add.tmp" \
102            iodef.xml.tmp > iodef.xml
103        rm iodef.xml.tmp add.tmp
104    fi
105
106    IGCM_debug_PopStack "CHM_Update"
107}
108
109#-----------------------------------------------------------------
110function CHM_Finalize
111{
112    IGCM_debug_PushStack "CHM_Finalize"
113
114    echo FINALIZE CHM !!!
115#
116#    IGCM_sys_Mkdir ${R_OUT_EXE}
117#    cd ${MODIPSL}
118#    tar cf src_${config_UserChoices_JobName}.tar  modeles
119#    IGCM_sys_Mv src_${config_UserChoices_JobName}.tar ${R_OUT_EXE}/.
120#    cd -
121#
122
123    IGCM_debug_PopStack "CHM_Finalize"
124}
Note: See TracBrowser for help on using the repository browser.