source: CONFIG/UNIFORM/v5_dev/LMDZORINCA_v5/HELIUM/LMDZORINCA_v5/GENERAL/DRIVER/inca.driver @ 2183

Last change on this file since 2183 was 2183, checked in by acosce, 9 years ago

Fix a bug

File size: 3.1 KB
Line 
1#- $Id: inca.driver 119 2007-07-31 13:56:33Z acosce $
2#!/bin/ksh
3
4#D- Driver du script pour INCA
5#-----------------------------------------------------------------
6function INCA_sed_replace
7{
8    IGCM_debug_PushStack "INCA_sed_replace"
9
10    sed -e "s/${2}/${3}/" ${1} > ${1}.tmp
11    RET=$?
12    echo "INCA_sed : ${1} ${2} ${3}"
13    \mv ${1}.tmp ${1}
14
15    IGCM_debug_PopStack "INCA_sed_replace"
16    return $RET
17}
18function INCA_sed_complete
19{
20    IGCM_debug_PushStack "INCA_sed_complete"
21
22    sed -e "s/^${2}\ *=.*/${2}= ${3}/" ${1} > ${1}.tmp
23    RET=$?
24    echo "INCA_sed : ${1} ${2} ${3}"
25    \mv ${1}.tmp ${1}
26
27    IGCM_debug_PopStack "INCA_sed_complete"
28    return $RET
29}
30
31#-----------------------------------------------------------------
32function CHM_Initialize
33{
34    IGCM_debug_PushStack "CHM_Initialize"
35
36    RESOL_CHM=$( echo $RESOL | awk "-Fx" '{print $2}' | awk "-FD" '{print $2}')
37
38    [ -f ${SUBMIT_DIR}/../.resol ] && eval $(grep RESOL_ATM_3D ${SUBMIT_DIR}/../.resol) || RESOL_ATM_3D=96x95x19
39    RESOL_CHM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' | awk "-F-" '{print $1}')
40    echo 'resol chimie', $RESOL_CHM
41
42    [ -f ${SUBMIT_DIR}/../.chimie ] && eval $(grep CHEM ${SUBMIT_DIR}/../.chimie) 
43    INCA_sed_replace ${SUBMIT_DIR}/config.card \${CHEM} ${CHEM}
44    echo "INCA Tag : LMDZ-INCA" ${config_UserChoices_TagName}
45
46    IGCM_debug_PopStack "CHM_Initialize"
47}
48
49#-----------------------------------------------------------------
50function CHM_Update
51{
52    IGCM_debug_PushStack "CHM_Update"
53
54    case ${CHEM} in
55        AER)
56        INCA_sed_complete run.def config_inca aero
57        ;;
58        NMHC) 
59        INCA_sed_complete run.def config_inca chem
60        ;;
61        NMHC_AER)
62        INCA_sed_complete run.def config_inca aero
63        ;;
64        CH4)
65        INCA_sed_complete run.def config_inca chem
66        ;;
67        CH4_AER)
68        INCA_sed_complete run.def config_inca aero
69        ;;
70        GES)
71        INCA_sed_complete run.def config_inca chem
72        ;;
73        HELIUM) 
74        INCA_sed_complete run.def config_inca chem
75        esac
76
77
78    # inca.def : Activate reading of 10m wind in files if climatological=n in inca.card
79    if [ ! X${inca_UserChoices_climatological} = X ] ; then
80        INCA_sed_complete inca.def climatological  ${inca_UserChoices_climatological}
81    else
82        INCA_sed_complete inca.def climatological  n
83    fi
84
85    # inca.def : choose write frequency for inca_avgr in inca.card
86    if [ ! X${inca_UserChoices_freq_write_chem} = X ] ; then
87        INCA_sed_complete inca.def freq_write_chem  ${inca_UserChoices_freq_write_chem}
88    else
89        INCA_sed_complete inca.def freq_write_chem  86400
90    fi
91
92    #inca.def : choose aerosol effect with feedback variable
93    if [ ! X${inca_UserChoices_feedb} = X ] ; then
94        INCA_sed_complete inca.def feedb  ${inca_UserChoices_feedb}
95    else
96        INCA_sed_complete inca.def feedb  0
97    fi
98   
99
100    IGCM_debug_PopStack "CHM_Update"
101}
102
103#-----------------------------------------------------------------
104function CHM_Finalize
105{
106    IGCM_debug_PushStack "CHM_Finalize"
107
108    echo FINALIZE CHM !!!
109#
110#    IGCM_sys_Mkdir ${R_OUT_EXE}
111#    cd ${MODIPSL}
112#    tar cf src_${config_UserChoices_JobName}.tar  modeles
113#    IGCM_sys_Mv src_${config_UserChoices_JobName}.tar ${R_OUT_EXE}/.
114#    cd -
115#
116
117    IGCM_debug_PopStack "CHM_Finalize"
118}
Note: See TracBrowser for help on using the repository browser.