source: CONFIG/LMDZORINCA/trunk/EXP_NMHC/COMP/orchidee.driver @ 858

Last change on this file since 858 was 858, checked in by acosce, 15 years ago

ACo: update

  • LMDZ calendar
  • rebuild on archive
  • orchidee cards
  • Property svn:executable set to *
File size: 3.0 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    IGCM_debug_PopStack "SRF_Initialize"
27}
28
29#-----------------------------------------------------------------
30function SRF_Update
31{
32    IGCM_debug_PushStack "SRF_Update"
33
34    typeset SECHIBA_WRITE_STEP
35
36    case ${config_SRF_WriteFrequency} in
37        *Y|*y) 
38            WriteInYears=$( echo ${1} | awk -F '[yY]' "{print ${config_SRF_WriteFrequency}}" )
39            PeriodLengthInYears=$( echo ${1} | awk -F '[yY]' "{print ${config_UserChoices_PeriodLength}}" )
40            (( SECHIBA_WRITE_STEP = PeriodLengthInDays * WriteInYears / PeriodLengthInYears * 86400 )) ;;
41        *M|*m) 
42            WriteInMonths=$( echo ${1} | awk -F '[mM]' "{print ${config_SRF_WriteFrequency}}" )
43            case ${config_UserChoices_PeriodLength} in
44            *Y|*y)
45                PeriodLengthInYears=$( echo ${1} | awk -F '[yY]' "{print ${config_UserChoices_PeriodLength}}" )
46                (( SECHIBA_WRITE_STEP = PeriodLengthInDays * 86400 / PeriodLengthInYears / 12  ))
47                ;;
48            *M|*m)
49                PeriodLengthInMonths=$( echo ${1} | awk -F '[mM]' "{print ${config_UserChoices_PeriodLength}}" )
50                (( SECHIBA_WRITE_STEP = PeriodLengthInDays * WriteInMonths  * 86400 / PeriodLengthInMonths  ))
51                ;;
52            *)
53                (( SECHIBA_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) * 86400 ))
54                ;;
55            esac
56            ;;
57        5D|5d) 
58            (( SECHIBA_WRITE_STEP = 5 * 86400 )) ;;
59        1D|1d) 
60            (( SECHIBA_WRITE_STEP = 86400 )) ;;
61        *s)
62            WriteInSeconds=$( echo ${1} | awk -F '[s]' "{print ${config_SRF_WriteFrequency}}" )
63            (( SECHIBA_WRITE_STEP = WriteInSeconds )) ;;
64        *) 
65            IGCM_debug_Exit "SRF_Update " ${config_SRF_WriteFrequency} " invalid WriteFrequency : choose in 1Y, 1M, 5D, 1D." 
66            IGCM_debug_Verif_Exit ;;
67    esac
68
69    ORCHIDEE_sed HYDROL_CWRR ${orchidee_UserChoices_NEWHYDROL}
70
71    ORCHIDEE_sed WRITE_STEP ${SECHIBA_WRITE_STEP}
72    ORCHIDEE_sed SECHIBA_HISTLEVEL ${orchidee_UserChoices_sechiba_LEVEL}
73
74##    if [ ${year} -eq 1950 ] ; then
75#       ORCHIDEE_sed SECHIBA_HISTFILE2 y
76#       ORCHIDEE_sed SECHIBA_HISTLEVEL2 10
77#       ORCHIDEE_sed WRITE_STEP2 86400.0
78##    fi
79
80    if ( [ ${CumulPeriod} -ne 1 ] || [ "${config_SRF_Restart}" != "n" ] ) ; then
81        ORCHIDEE_sed SECHIBA_restart_in sechiba_rest_in.nc
82    fi
83
84    #IGCM_sys_Cp ${RUN_DIR}/orchidee.def ${RUN_DIR}/run.def
85    #IGCM_sys_Put_Out ${RUN_DIR}/run.def ${R_SAVE}/${PREFIX}_run.def
86
87    IGCM_debug_PopStack "SRF_Update"
88}
89
90#-----------------------------------------------------------------
91function SRF_Finalize
92{
93    IGCM_debug_PushStack "SRF_Finalize"
94
95    #IGCM_sys_Put_Out ${RUN_DIR}/used_run.def ${R_SAVE}/${PREFIX}_used_run.def
96
97    echo FINALIZE SRF !!!
98
99    IGCM_debug_PopStack "SRF_Finalize"
100}
Note: See TracBrowser for help on using the repository browser.