source: CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/DRIVER/stomate.driver @ 3545

Last change on this file since 3545 was 3476, checked in by aclsce, 7 years ago
  • First commit for CMIP6 experiments (outputs required by CMIP6 DR).
File size: 2.4 KB
Line 
1#!/bin/ksh
2
3#D- Driver pour ORCHIDEE stomate component
4
5#-----------------------------------------------------------------
6function SBG_Initialize
7{
8    IGCM_debug_PushStack "SBG_Initialize"
9
10    IGCM_debug_PopStack "SBG_Initialize"
11}
12
13#-----------------------------------------------------------------
14function SBG_Update
15{
16    IGCM_debug_PushStack "SBG_Update"
17   
18    # Output management
19
20    # Set default values for stomate output files.
21    stomate_enabled=.FALSE.
22    stomate_freq=0s
23
24    # Read WriteFrequency set in config.card section SBG.
25    # Only one choice can be set as WriteFrequency. The same choice will be used for
26    # both stomate_history and stomate_ipcc_history files.
27    for frequency in ${config_SBG_WriteFrequency} ; do
28        case ${frequency} in
29            *Y|*y) 
30                NbYears=$( echo ${frequency} | awk -F '[yY]' '{print $1}' )
31                NbDaysYear=$( IGCM_date_DaysInYear ${year} )
32                stomate_enabled=.TRUE.
33                stomate_freq=${NbYears}y ;;
34            *M|*m) 
35                NbMonths=$( echo ${frequency} | awk -F '[mM]' '{print $1}' )
36                stomate_enabled=.TRUE.
37                stomate_freq=${NbMonths}mo ;;
38            *D|*d)
39                NbDays=$( echo ${frequency} | awk -F '[dD]' '{print $1}' )
40                stomate_enabled=.TRUE.
41                stomate_freq=${NbDays}d ;;
42            *) 
43                IGCM_debug_Exit "SBG WriteFrequency=${frequency} is invalid. Choose between xY, xM and xD for Stomate." ;;
44        esac
45    done
46
47    if [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] ; then       
48        stomate_enabled=.FALSE.
49    fi
50
51    # Modify file_def_orchidee.xml
52    IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate1 enabled ${stomate_enabled}
53    IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate1 output_freq ${stomate_freq}
54    IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 enabled ${stomate_enabled}
55    IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_freq ${stomate_freq}
56   
57
58    # Define in orchidee.def if restart file should be used
59    if ( [ ${CumulPeriod} -eq 1 ] && [ "${config_SBG_Restart}" = "n" ] ) ; then
60        echo "STOMATE : without restart"
61        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_RESTART_FILEIN NONE
62    else
63        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_RESTART_FILEIN stomate_rest_in.nc
64    fi
65
66    IGCM_debug_PopStack "SBG_Update"
67}
68
69#-----------------------------------------------------------------
70function SBG_Finalize
71{
72    IGCM_debug_PushStack "SBG_Finalize"
73   
74    IGCM_debug_PopStack "SBG_Finalize"
75}
Note: See TracBrowser for help on using the repository browser.