source: CONFIG/LMDZOR/branches/LMDZOR_v4/AMIP/COMP/orchidee.driver @ 1195

Last change on this file since 1195 was 1195, checked in by jgipsl, 12 years ago

config LMDZOR_v4 :

  • desactive filtre fft for resolution 280x280x39 (because of zoom)
  • desactive river_routing for resolution 280x280x39 (because to high resolution)
File size: 4.7 KB
Line 
1#!/bin/ksh
2
3#D- Driver du script pour ORCHIDEE
4
5function ORCHIDEE_sed
6{
7    IGCM_debug_PushStack "ORCHIDEE_sed"
8   
9    sed -e "s/^${1}\ *=.*/${1}= ${2}/" \
10        orchidee.def > orchidee.def.tmp
11    RET=$?
12    echo "ORCHIDEE_sed : ${1} ${2}"
13    \mv orchidee.def.tmp orchidee.def
14   
15    IGCM_debug_PopStack "ORCHIDEE_sed"
16    return $RET
17}
18
19#-----------------------------------------------------------------
20function SRF_Initialize
21{
22    IGCM_debug_PushStack "SRF_Initialize"
23
24    RESOL_SRF=ALL
25
26    for frequency in ${config_SRF_WriteFrequency} ; do
27        case ${frequency} in
28            HF|hf) SRF_ok_hf=y ;;
29        esac
30    done
31
32    [ -f ${SUBMIT_DIR}/../.resol ] && eval $(grep RESOL_SRF_3D ${SUBMIT_DIR}/../.resol) || RESOL_SRF_3D=96x95x19
33
34    IGCM_debug_PopStack "SRF_Initialize"
35}
36
37#-----------------------------------------------------------------
38function SRF_PeriodStart
39{
40
41    IGCM_debug_PushStack "SRF_PeriodStart"
42    if [ ${year} -gt 2004 ] ; then
43
44        PFTmap="${R_BC}/SRF/${config_UserChoices_TagName}/ORCHIDEE_PFTmap_2006to2100_AR5_RCP8.5_MESSAGE.nc"
45        if [ ${year} -eq 2005 ] ; then
46            IGCM_sys_Rm -f PFTmap.nc
47        fi
48
49    else
50        PFTmap="${R_BC}/SRF/${config_UserChoices_TagName}/PFTmap_1850to2005_AR5_LUHa.rc2.nc"
51    fi
52
53    BC_SRF_PFTmap=${PFTmap}
54
55    IGCM_debug_PopStack "SRF_PeriodStart"
56
57}
58
59#-----------------------------------------------------------------
60function SRF_Update
61{
62    IGCM_debug_PushStack "SRF_Update"
63
64    typeset SECHIBA_WRITE_STEP
65
66    SRF_WriteFrequency=$( echo ${config_SRF_WriteFrequency} | sed -e 's/\([0-9]*[yYmMdDs]\).*/\1/' ) 
67    case ${SRF_WriteFrequency} in
68        *Y|*y) 
69            WriteInYears=$( echo ${SRF_WriteFrequency} | awk -F '[yY]' '{print $1}' )
70            PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' )
71            (( SECHIBA_WRITE_STEP = PeriodLengthInDays * WriteInYears / PeriodLengthInYears * 86400 )) ;;
72        1M)
73            case ${config_UserChoices_PeriodLength} in
74            *Y|*y)
75                SECHIBA_WRITE_STEP=-1.
76                ;;
77            *M|*m)
78                SECHIBA_WRITE_STEP=-1.
79                ;;
80            *)
81                (( SECHIBA_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) * 86400 ))
82                ;;
83            esac
84            ;;
85        *M|*m) 
86            WriteInMonths=$( echo ${SRF_WriteFrequency} | awk -F '[mM]' '{print $1}' )
87            case ${config_UserChoices_PeriodLength} in
88            *Y|*y)
89                PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' )
90                (( SECHIBA_WRITE_STEP = PeriodLengthInDays * 86400 / PeriodLengthInYears / 12  ))
91                ;;
92            *M|*m)
93                PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | awk -F '[mM]' '{print $1}' )
94                (( SECHIBA_WRITE_STEP = PeriodLengthInDays * WriteInMonths  * 86400 / PeriodLengthInMonths  ))
95                ;;
96            *)
97                (( SECHIBA_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) * 86400 ))
98                ;;
99            esac
100            ;;
101        5D|5d) 
102            (( SECHIBA_WRITE_STEP = 5 * 86400 )) ;;
103        1D|1d) 
104            (( SECHIBA_WRITE_STEP = 86400 )) ;;
105        *s)
106            WriteInSeconds=$( echo ${SRF_WriteFrequency} | awk -F '[s]' '{print $1}' )
107            (( SECHIBA_WRITE_STEP = WriteInSeconds )) ;;
108        *) 
109            IGCM_debug_Exit "SRF_Update " ${SRF_WriteFrequency} " invalid WriteFrequency : choose in 1Y, 1M, 5D, 1D." 
110            IGCM_debug_Verif_Exit ;;
111    esac
112
113    # Dans le cas de test :
114    if [ ${year} -eq 1979 ] ; then
115        ORCHIDEE_sed VEGET_REINIT y
116        ORCHIDEE_sed VEGET_YEAR 131
117    fi
118   
119    # Dans le cas historique :
120    if [ ${year} -eq 2005 ] ; then
121        ORCHIDEE_sed VEGET_REINIT y
122        ORCHIDEE_sed VEGET_YEAR 1
123#       ORCHIDEE_sed VEGET_UPDATE '0Y'
124    fi
125
126#     # Dans le cas sans changement de carte aprÚs 2005
127#     if [ ${year} -gt 2005 ] ; then
128#       ORCHIDEE_sed VEGET_UPDATE '0Y'
129#     fi
130 
131    ORCHIDEE_sed HYDROL_CWRR ${orchidee_UserChoices_NEWHYDROL}
132
133    ORCHIDEE_sed WRITE_STEP ${SECHIBA_WRITE_STEP}
134    ORCHIDEE_sed SECHIBA_HISTLEVEL ${orchidee_UserChoices_sechiba_LEVEL}
135
136    # Outputs HF in HISTFILE2 if required
137    [ X${SRF_ok_hf} = Xy ] && ORCHIDEE_sed SECHIBA_HISTFILE2 y
138    ORCHIDEE_sed SECHIBA_HISTLEVEL2 1
139    ORCHIDEE_sed WRITE_STEP2 10800.0
140
141    if ( [ ${CumulPeriod} -ne 1 ] || [ "${config_SRF_Restart}" != "n" ] ) ; then
142        ORCHIDEE_sed SECHIBA_restart_in sechiba_rest_in.nc
143    fi
144
145# Desactivate river routing for high resolution
146    if ( [ ${RESOL_SRF_3D} -eq "280x280x39" ] ) ; then
147        ORCHIDEE_sed  RIVER_ROUTING n
148    fi
149
150    #IGCM_sys_Cp ${RUN_DIR}/orchidee.def ${RUN_DIR}/run.def
151    #IGCM_sys_Put_Out ${RUN_DIR}/run.def ${R_SAVE}/${PREFIX}_run.def
152
153    IGCM_debug_PopStack "SRF_Update"
154}
155
156#-----------------------------------------------------------------
157function SRF_Finalize
158{
159    IGCM_debug_PushStack "SRF_Finalize"
160
161    #IGCM_sys_Put_Out ${RUN_DIR}/used_run.def ${R_SAVE}/${PREFIX}_used_run.def
162
163    echo FINALIZE SRF !!!
164
165    IGCM_debug_PopStack "SRF_Finalize"
166}
Note: See TracBrowser for help on using the repository browser.