source: CONFIG/IPSLCM/IPSLCM5A/EXP00/COMP/stomate.driver @ 1013

Last change on this file since 1013 was 793, checked in by sdipsl, 15 years ago
  • First step towards sechiba+stomate in IPSLCM5_v2
    • add SBG comonent SurfaceBioGeoChemistry? (stomate)
    • merge orchidee.def with the one in EXPBIOS and EXPLAND from IPSLCM5_WORK
    • use ENSEMBLES PFT vegetation map for initialization (new one to come)
  • Del svn:executable property for some card and driver

SD, ACa, MM

File size: 2.6 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        *M|*m) 
28            WriteInMonths=$( echo ${config_SBG_WriteFrequency} | awk -F '[mM]' '{print $1}' )
29            case ${config_UserChoices_PeriodLength} in
30            *Y|*y)
31                PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' )
32                (( STOMATE_WRITE_STEP = 30 )) ;;
33            *M|*m)
34                PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | awk -F '[mM]' '{print $1}' )
35                (( STOMATE_WRITE_STEP = PeriodLengthInDays * WriteInMonths / PeriodLengthInMonths )) ;;
36            *)
37                (( STOMATE_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) )) ;;
38            esac
39            ;;
40        5D|5d) 
41            (( STOMATE_WRITE_STEP = 5 )) ;;
42        1D|1d) 
43            (( STOMATE_WRITE_STEP = 1 )) ;;
44        *s)
45            WriteInSeconds=$( echo ${config_SBG_WriteFrequency} | awk -F '[s]' '{print $1}' )
46            (( STOMATE_WRITE_STEP = 1 )) ;;
47        *) 
48            IGCM_debug_Exit "SBG_Update " ${config_SBG_WriteFrequency} " invalid WriteFrequency : choose in 1Y, 1M, 5D, 1D." 
49            IGCM_debug_Verif_Exit ;;
50    esac
51
52    ORCHIDEE_sed STOMATE_OK_STOMATE y
53
54    ORCHIDEE_sed STOMATE_HIST_DT ${STOMATE_WRITE_STEP}
55    ORCHIDEE_sed STOMATE_HISTLEVEL ${stomate_UserChoices_stomate_LEVEL}
56
57    if ( [ ${CumulPeriod} -eq 1 ] && [ "${config_SBG_Restart}" = "n" ] ) ; then
58        echo "STOMATE : without restart"
59    else
60        ORCHIDEE_sed STOMATE_RESTART_FILEIN stomate_rest_in.nc
61    fi
62
63    IGCM_debug_PopStack "SBG_Update"
64}
65
66#-----------------------------------------------------------------
67function SBG_Finalize
68{
69#set -vx
70    IGCM_debug_PushStack "SBG_Finalize"
71
72    if [ $( IGCM_date_DaysBetweenGregorianDate ${PeriodDateEnd} ${year}1230 ) -ge 0 ] ; then
73        IGCM_sys_Put_Out stomate_Cforcing.nc ${R_OUT_SBG_R}/${config_UserChoices_JobName}_${PeriodDateEnd}_stomate_Cforcing.nc
74        IGCM_sys_Put_Out stomate_forcing.nc  ${R_OUT_SBG_R}/${config_UserChoices_JobName}_${PeriodDateEnd}_stomate_forcing.nc
75#       rm -f stomate_Cforcing.nc
76#       rm -f stomate_forcing.nc
77    fi
78
79    IGCM_debug_PopStack "SBG_Finalize"
80}
Note: See TracBrowser for help on using the repository browser.