source: CONFIG/trunk/LMDZ4OR_v2/LMDZOR/COMP/orchidee.driver @ 233

Last change on this file since 233 was 233, checked in by mmaipsl, 15 years ago

Add possibility to use ORCHIDEE_WATCHOUT to run ORCHIDEE offline
with an online forcing dump.

File size: 2.8 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    typeset SECHIBA_WRITE_STEP STOMATE_WRITE_STEP
19
20    case ${config_SRF_WriteFrequency} in
21        1Y|1y) 
22            (( STOMATE_WRITE_STEP = PeriodLengthInDays ))
23            (( SECHIBA_WRITE_STEP = PeriodLengthInDays * 86400 )) ;;
24        1M|1m) 
25            if [ ${config_UserChoices_PeriodLength} = 1Y ] ; then
26                (( STOMATE_WRITE_STEP = PeriodLengthInDays / 12 ))
27                (( SECHIBA_WRITE_STEP = PeriodLengthInDays * 86400 / 12  ))
28            else
29                (( STOMATE_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) ))
30                (( SECHIBA_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) * 86400 ))
31            fi ;;
32        5D|5d) 
33            (( STOMATE_WRITE_STEP = 5 ))
34            (( SECHIBA_WRITE_STEP = 5 * 86400 )) ;;
35        1D|1d) 
36            (( STOMATE_WRITE_STEP = 1 ))
37            (( SECHIBA_WRITE_STEP = 86400 )) ;;
38        *) 
39            IGCM_debug_Exit "SRF_Update " ${config_SRF_WriteFrequency} " invalid WriteFrequency : choose in 1Y, 1M, 5D, 1D." 
40            IGCM_debug_Verif_Exit ;;
41    esac
42
43    if ( [ ${CumulPeriod} -eq 1 ] && [ "${config_SRF_Restart}" = "n" ] ) ; then
44        sed -e "s/WRITE_STEP= 86400.0/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/SECHIBA_restart_in= NONE/SECHIBA_restart_in= sechiba_rest_in.nc/" \
54            -e "s/WRITE_STEP = 86400.0/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
64    fi
65    IGCM_sys_Mv orchidee.def.tmp orchidee.def
66
67    IGCM_debug_PopStack "SRF_Update"
68}
69
70#-----------------------------------------------------------------
71function SRF_Finalize
72{
73    IGCM_debug_PushStack "SRF_Finalize"
74
75    echo FINALIZE SRF !!!
76
77# For STOMATE :
78#     if [ $( IGCM_date_DaysBetweenGregorianDate ${PeriodDateEnd} ${year}1230 ) -ge 0 ] ; then
79#       IGCM_sys_Put_Out stomate_Cforcing.nc ${R_OUT_SRF_O_M}/${PREFIX}_stomate_Cforcing.nc
80#       IGCM_sys_Put_Out stomate_forcing.nc  ${R_OUT_SRF_O_M}/${PREFIX}_stomate_forcing.nc
81#     fi
82
83    IGCM_debug_PopStack "SRF_Finalize"
84}
Note: See TracBrowser for help on using the repository browser.