source: CONFIG/trunk/LMDZORINCA/EXP00/COMP/orchidee.driver @ 345

Last change on this file since 345 was 345, checked in by acosce, 14 years ago

Update LMDZORINCA config

File size: 2.7 KB
Line 
1#!/bin/ksh
2
3#D- Driver du script pour ORCHIDEE_OL (off-line)
4
5#-----------------------------------------------------------------
6function SRF_Initialize
7{
8    IGCM_debug_PushStack "SRF_Initialize"
9
10    IGCM_debug_PopStack "SRF_Initialize"
11}
12
13#-----------------------------------------------------------------
14function SRF_Update
15{
16    IGCM_debug_PushStack "SRF_Update"
17
18    case ${config_SRF_WriteFrequency} in
19        1Y|1y) 
20            (( STOMATE_WRITE_STEP = PeriodLengthInDays ))
21            (( SECHIBA_WRITE_STEP = PeriodLengthInDays * 86400 )) ;;
22        1M|1m) 
23            if [ ${config_UserChoices_PeriodLength} = 1Y ] ; then
24                (( STOMATE_WRITE_STEP = PeriodLengthInDays / 12 ))
25                (( SECHIBA_WRITE_STEP = PeriodLengthInDays * 86400 / 12  ))
26            else
27                (( STOMATE_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) ))
28                (( SECHIBA_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) * 86400 ))
29            fi ;;
30        5D|5d) 
31            (( STOMATE_WRITE_STEP = 5 ))
32            (( SECHIBA_WRITE_STEP = 5 * 86400 )) ;;
33        1D|1d) 
34            (( STOMATE_WRITE_STEP = 1 ))
35            (( SECHIBA_WRITE_STEP = 86400 )) ;;
36        *) 
37            IGCM_debug_Exit "SRF_Update " ${config_SRF_WriteFrequency} " invalid WriteFrequency : choose in 1Y, 1M, 5D, 1D." 
38            IGCM_debug_Verif_Exit ;;
39    esac
40
41
42    if ( [ ${CumulPeriod} -eq 1 ] && [ "${config_SRF_Restart}" = "n" ] ) ; then
43        sed -e "s/_start_sech_/default/" \
44            -e "s/_write_step_/${SECHIBA_WRITE_STEP}/" \
45            orchidee.def > orchidee.def.tmp
46## For STOMATE
47#           -e "s/STOMATE_HIST_DT= 10./STOMATE_HIST_DT = ${STOMATE_WRITE_STEP}/" \
48
49## For ORCHIDEE_WATCHOUT_FILE :
50#            -e "s/ORCHIDEE_WATCHOUT= n/ORCHIDEE_WATCHOUT= y/" \
51#            -e "s/DT_WATCHOUT= 1800/DT_WATCHOUT= 3600/" \
52    else
53        sed -e "s/_start_sech_/start_sech.nc/" \
54            -e "s/_write_step_/${SECHIBA_WRITE_STEP}/" \
55            orchidee.def > orchidee.def.tmp
56## For STOMATE
57#            -e "s/STOMATE_RESTART_FILEIN= NONE/STOMATE_RESTART_FILEIN = stomate_rest_in.nc/" \
58#            -e "s/STOMATE_HIST_DT= 10./STOMATE_HIST_DT = ${STOMATE_WRITE_STEP}/" \
59
60## For ORCHIDEE_WATCHOUT_FILE :
61#            -e "s/ORCHIDEE_WATCHOUT= n/ORCHIDEE_WATCHOUT= y/" \
62#            -e "s/DT_WATCHOUT= 1800/DT_WATCHOUT= 3600/" \
63    fi
64    IGCM_sys_Mv orchidee.def.tmp orchidee.def
65
66    IGCM_debug_PopStack "SRF_Update"
67}
68
69#-----------------------------------------------------------------
70function SRF_Finalize
71{
72    IGCM_debug_PushStack "SRF_Finalize"
73
74# For STOMATE :
75#     if [ $( IGCM_date_DaysBetweenGregorianDate ${PeriodDateEnd} ${year}1230 ) -ge 0 ] ; then
76#       IGCM_sys_Put_Out stomate_Cforcing.nc ${R_OUT_SRF_O_M}/${PREFIX}_stomate_Cforcing.nc
77#       IGCM_sys_Put_Out stomate_forcing.nc  ${R_OUT_SRF_O_M}/${PREFIX}_stomate_forcing.nc
78#     fi
79
80    echo FINALIZE SRF !!!
81
82    IGCM_debug_PopStack "SRF_Finalize"
83}
Note: See TracBrowser for help on using the repository browser.