source: CONFIG/UNIFORM/v7/ICOLMDZOR_LAM_v7/GENERAL/DRIVER/stomate.driver @ 6179

Last change on this file since 6179 was 6179, checked in by aclsce, 23 months ago

First import of ICOLMDZOR_LAM_v7 configuration.

File size: 5.2 KB
Line 
1#!/bin/ksh
2
3#D- Driver for ORCHIDEE stomate component (SBG)
4
5#-----------------------------------------------------------------
6function SBG_Initialize
7{
8    IGCM_debug_PushStack "SBG_Initialize"
9
10    # Define the resolution only if the composant ICO for DYNAMICO is set in config.card
11    if [ ! X${config_ListOfComponents_ICO} = X ] ; then
12    RESOL_SBG="nbp${RESOL_NBP}"
13    fi
14
15    IGCM_debug_PopStack "SBG_Initialize"
16}
17
18#-----------------------------------------------------------------
19function SBG_Update
20{
21    IGCM_debug_PushStack "SBG_Update"
22   
23    # Output management
24    # Modify file_def_orchidee.xml file using settings from stomate.card
25    # We here suppose that for each file, in stomate.card UserChoices section, if the parameter
26    # output_level_filename is set, then also output_freq_filename must be set. The existance of output_freq_filename will not be checked.
27    # If output_level_filename=NONE or if it is not set, the corresponding file will be deactivated.
28   
29    if [ X${stomate_UserChoices_output_level_stomate_history} = X ] || [ X${stomate_UserChoices_output_level_stomate_history} = XNONE ] ; then
30        # output_level_stomate_history is not set in stomate.card or it is set to NONE.
31        # Deactivate the file.
32        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate1 enabled .FALSE.
33        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate1 output_level 0
34        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate1 output_freq 1mo
35    else
36        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate1 enabled      .TRUE.
37        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate1 output_level ${stomate_UserChoices_output_level_stomate_history}
38        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate1 output_freq  ${stomate_UserChoices_output_freq_stomate_history}
39    fi
40   
41    if [ X${stomate_UserChoices_output_level_stomate_ipcc_history} = X ] || [ X${stomate_UserChoices_output_level_stomate_ipcc_history} = XNONE ] ; then
42        # output_level_stomate_ipcc_history is not set in stomate.card or it is set to NONE.
43        # Deactivate the file.
44        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 enabled .FALSE.
45        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_level 0
46        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_freq 1mo
47    else
48        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 enabled      .TRUE.
49        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_level ${stomate_UserChoices_output_level_stomate_ipcc_history}
50        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_freq  ${stomate_UserChoices_output_freq_stomate_ipcc_history}
51    fi
52
53       
54    if [ X${stomate_UserChoices_output_level_stomate_history_4dim} = X ] || [ X${stomate_UserChoices_output_level_stomate_history_4dim} = XNONE ] ; then
55        # output_level_stomate_history_4dim is not set in stomate.card or it is set to NONE.
56        # Deactivate the file.
57        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 enabled .FALSE.
58        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 output_level 0
59        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 output_freq 1mo
60    else
61        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 enabled      .TRUE.
62        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 output_level ${stomate_UserChoices_output_level_stomate_history_4dim}
63        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 output_freq  ${stomate_UserChoices_output_freq_stomate_history_4dim}
64    fi
65
66
67    # Define in orchidee.def if restart file should be used
68    if ( [ ${CumulPeriod} -eq 1 ] && [ "${config_SBG_Restart}" = "n" ] ) ; then
69        echo "STOMATE : without restart"
70        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_RESTART_FILEIN NONE
71    else
72        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_RESTART_FILEIN stomate_rest_in.nc
73    fi
74
75
76    # Modify in orchidee.def NINPUT_UPDATE if it is set in stomate.card section UserChoices
77    # NINPUT_UPDATE inidcates if the nitrogen maps should be updated and at which frequency
78    if [ ! X${stomate_UserChoices_NINPUT_UPDATE} = X ] ; then
79        # Take the value from stomate.card
80        IGCM_comp_modifyDefFile nonblocker orchidee.def NINPUT_UPDATE   ${stomate_UserChoices_NINPUT_UPDATE}
81    else
82        # Set default value 0Y
83        IGCM_comp_modifyDefFile nonblocker orchidee.def NINPUT_UPDATE 0Y
84    fi
85
86    # Modify in orchidee.def STOMATE_IMPOSE_CN if it is set in stomate.card section UserChoices
87    # STOMATE_IMPOSE_CN inidcates if the nitrogen should be imposed or not.
88    if [ ! X${stomate_UserChoices_STOMATE_IMPOSE_CN} = X ] ; then
89        # Take the value from stomate.card
90        IGCM_comp_modifyDefFile nonblocker orchidee.def STOMATE_IMPOSE_CN   ${stomate_UserChoices_STOMATE_IMPOSE_CN}
91    else
92        # Set default value n (nitrogen is not imposed)
93        IGCM_comp_modifyDefFile nonblocker orchidee.def STOMATE_IMPOSE_CN n
94    fi
95
96
97    IGCM_debug_PopStack "SBG_Update"
98}
99
100#-----------------------------------------------------------------
101function SBG_Finalize
102{
103    IGCM_debug_PushStack "SBG_Finalize"
104   
105    IGCM_debug_PopStack "SBG_Finalize"
106}
Note: See TracBrowser for help on using the repository browser.