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