source: CONFIG/IPSLCM/IPSLCM5_v4/GENERAL/DRIVER/stomate.driver @ 1649

Last change on this file since 1649 was 1549, checked in by jgipsl, 13 years ago

Added directory EXPALL which contains the possibility to run all 5
experiences :

  • DRIVER : contains all *.driver before in COMP directory (the drivers are the same for all experiences)
  • PARAM : all files from EXP00/PARAM (not yet adapted for all experiences)
  • CARD : this directory contains one subdirectory per experience; hitorical, piControl, etc...
  • CARD/XXX : contains all *.card necessary to run experience XXX

*This revision contains the PARAM only for EXP00. In next commit,
modifications will be done so that all experience can be run correctly.
*Must be run with a modifcation in libIGCM concerning the DRIVER
directory.

File size: 2.9 KB
Line 
1#!/bin/ksh
2
3#D- Driver du script pour ORCHIDEE
4
5#-----------------------------------------------------------------
6function SBG_Initialize
7{
8    IGCM_debug_PushStack "SBG_Initialize"
9
10    RESOL_SBG=ALL
11   
12    IGCM_debug_PopStack "SBG_Initialize"
13}
14
15#-----------------------------------------------------------------
16function SBG_Update
17{
18    IGCM_debug_PushStack "SBG_Update"
19
20    typeset STOMATE_WRITE_STEP
21
22    case ${config_SBG_WriteFrequency} in
23        *Y|*y) 
24            WriteInYears=$( echo ${config_SBG_WriteFrequency} | awk -F '[yY]' '{print $1}' )
25            PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' )
26            (( STOMATE_WRITE_STEP = PeriodLengthInDays * WriteInYears / PeriodLengthInYears )) ;;
27        1M|1m) 
28            case ${config_UserChoices_PeriodLength} in
29            *Y|*y)
30                STOMATE_WRITE_STEP=-1.
31                ;;
32            *M|*m)
33                STOMATE_WRITE_STEP=-1.
34                ;;
35            *)
36                (( STOMATE_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) )) ;;
37            esac
38            ;;
39        *M|*m) 
40            WriteInMonths=$( echo ${config_SBG_WriteFrequency} | awk -F '[mM]' '{print $1}' )
41            case ${config_UserChoices_PeriodLength} in
42            *Y|*y)
43                PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' )
44                (( STOMATE_WRITE_STEP = 30 ))
45                ;;
46            *M|*m)
47                PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | awk -F '[mM]' '{print $1}' )
48                (( STOMATE_WRITE_STEP = PeriodLengthInDays * WriteInMonths / PeriodLengthInMonths ))
49                ;;
50            *)
51                (( STOMATE_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) )) ;;
52            esac
53            ;;
54        5D|5d) 
55            (( STOMATE_WRITE_STEP = 5 )) ;;
56        1D|1d) 
57            (( STOMATE_WRITE_STEP = 1 )) ;;
58        *s)
59            WriteInSeconds=$( echo ${config_SBG_WriteFrequency} | awk -F '[s]' '{print $1}' )
60            (( STOMATE_WRITE_STEP = 1 )) ;;
61        *) 
62            IGCM_debug_Exit "SBG_Update " ${config_SBG_WriteFrequency} " invalid WriteFrequency : choose in 1Y, 1M, 5D, 1D." 
63            IGCM_debug_Verif_Exit ;;
64    esac
65
66    ORCHIDEE_sed STOMATE_OK_STOMATE y
67
68    ORCHIDEE_sed STOMATE_HIST_DT ${STOMATE_WRITE_STEP}
69    ORCHIDEE_sed STOMATE_HISTLEVEL ${stomate_UserChoices_stomate_LEVEL}
70
71    if ( [ ${CumulPeriod} -eq 1 ] && [ "${config_SBG_Restart}" = "n" ] ) ; then
72        echo "STOMATE : without restart"
73    else
74        ORCHIDEE_sed STOMATE_RESTART_FILEIN stomate_rest_in.nc
75    fi
76
77    IGCM_debug_PopStack "SBG_Update"
78}
79
80#-----------------------------------------------------------------
81function SBG_Finalize
82{
83#set -vx
84    IGCM_debug_PushStack "SBG_Finalize"
85
86    if [ $( IGCM_date_DaysBetweenGregorianDate ${PeriodDateEnd} ${year}1230 ) -ge 0 ] ; then
87        IGCM_sys_Put_Out stomate_Cforcing.nc ${R_OUT_SBG_R}/${config_UserChoices_JobName}_${PeriodDateEnd}_stomate_Cforcing.nc
88        IGCM_sys_Put_Out stomate_forcing.nc  ${R_OUT_SBG_R}/${config_UserChoices_JobName}_${PeriodDateEnd}_stomate_forcing.nc
89#       rm -f stomate_Cforcing.nc
90#       rm -f stomate_forcing.nc
91    fi
92
93    IGCM_debug_PopStack "SBG_Finalize"
94}
Note: See TracBrowser for help on using the repository browser.