source: CONFIG/UNIFORM/v7/IPSLCM7/GENERAL/DRIVER/stomate.driver @ 6662

Last change on this file since 6662 was 6662, checked in by cetlod, 9 months ago

CM7_work : finalisation, update drivers and monitoring files

File size: 7.0 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        if [ ! X${config_ListOfComponents_ICO} = X ] ; then
40           IGCM_comp_modifyXmlFile force      file_def_orchidee.xml groupremap_stomate1 group_ref remap_${stomate_UserChoices_output_freq_stomate_history}
41        fi
42    fi
43   
44    if [ X${stomate_UserChoices_output_level_stomate_ipcc_history} = X ] || [ X${stomate_UserChoices_output_level_stomate_ipcc_history} = XNONE ] ; then
45        # output_level_stomate_ipcc_history is not set in stomate.card or it is set to NONE.
46        # Deactivate the file.
47        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 enabled .FALSE.
48        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_level 0
49        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_freq 1mo
50    else
51        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 enabled      .TRUE.
52        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_level ${stomate_UserChoices_output_level_stomate_ipcc_history}
53        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_freq  ${stomate_UserChoices_output_freq_stomate_ipcc_history}
54        if [ ! X${config_ListOfComponents_ICO} = X ] ; then
55           IGCM_comp_modifyXmlFile force      file_def_orchidee.xml groupremap_stomate2 group_ref remap_${stomate_UserChoices_output_freq_stomate_ipcc_history}
56        fi
57    fi
58
59       
60    if [ X${stomate_UserChoices_output_level_stomate_history_4dim} = X ] || [ X${stomate_UserChoices_output_level_stomate_history_4dim} = XNONE ] ; then
61        # output_level_stomate_history_4dim is not set in stomate.card or it is set to NONE.
62        # Deactivate the file.
63        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 enabled .FALSE.
64        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 output_level 0
65        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 output_freq 1mo
66    else
67        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 enabled      .TRUE.
68        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 output_level ${stomate_UserChoices_output_level_stomate_history_4dim}
69        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 output_freq  ${stomate_UserChoices_output_freq_stomate_history_4dim}
70        if [ ! X${config_ListOfComponents_ICO} = X ] ; then
71           IGCM_comp_modifyXmlFile force      file_def_orchidee.xml groupremap_stomate3 group_ref remap_${stomate_UserChoices_output_freq_stomate_history_4dim}
72        fi
73    fi
74
75
76    if [ X${stomate_UserChoices_output_level_stomate_fixed_dia} = X ] || [ X${stomate_UserChoices_output_level_stomate_fixed_dia} = XNONE ] ; then
77        # output_level_stomate_fixed_dia is not set in stomate.card or it is set to NONE.
78        # Deactivate the file.
79        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate4 enabled .FALSE.
80        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate4 output_level 0
81        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate4 output_freq 1mo
82    else
83        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate4 enabled      .TRUE.
84        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate4 output_level ${stomate_UserChoices_output_level_stomate_fixed_dia}
85        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate4 output_freq  ${stomate_UserChoices_output_freq_stomate_fixed_dia}
86        if [ ! X${config_ListOfComponents_ICO} = X ] ; then
87           IGCM_comp_modifyXmlFile force      file_def_orchidee.xml groupremap_stomate4 group_ref remap_${stomate_UserChoices_output_freq_stomate_history_fixed_dia}
88        fi
89    fi
90
91
92    # Define in orchidee.def if restart file should be used
93    if ( [ ${CumulPeriod} -eq 1 ] && [ "${config_SBG_Restart}" = "n" ] ) ; then
94        echo "STOMATE : without restart"
95        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_RESTART_FILEIN NONE
96    else
97        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_RESTART_FILEIN stomate_rest_in.nc
98    fi
99
100
101    # Modify in orchidee.def NINPUT_UPDATE if it is set in stomate.card section UserChoices
102    # NINPUT_UPDATE inidcates if the nitrogen maps should be updated and at which frequency
103    if [ ! X${stomate_UserChoices_NINPUT_UPDATE} = X ] ; then
104        # Take the value from stomate.card
105        IGCM_comp_modifyDefFile nonblocker orchidee.def NINPUT_UPDATE   ${stomate_UserChoices_NINPUT_UPDATE}
106    else
107        # Set default value 0Y
108        IGCM_comp_modifyDefFile nonblocker orchidee.def NINPUT_UPDATE 0Y
109    fi
110
111    # Modify in orchidee.def STOMATE_IMPOSE_CN if it is set in stomate.card section UserChoices
112    # STOMATE_IMPOSE_CN inidcates if the nitrogen should be imposed or not.
113    if [ ! X${stomate_UserChoices_STOMATE_IMPOSE_CN} = X ] ; then
114        # Take the value from stomate.card
115        IGCM_comp_modifyDefFile nonblocker orchidee.def STOMATE_IMPOSE_CN   ${stomate_UserChoices_STOMATE_IMPOSE_CN}
116    else
117        # Set default value n (nitrogen is not imposed)
118        IGCM_comp_modifyDefFile nonblocker orchidee.def STOMATE_IMPOSE_CN n
119    fi
120
121
122    IGCM_debug_PopStack "SBG_Update"
123}
124
125#-----------------------------------------------------------------
126function SBG_Finalize
127{
128    IGCM_debug_PushStack "SBG_Finalize"
129   
130    IGCM_debug_PopStack "SBG_Finalize"
131}
Note: See TracBrowser for help on using the repository browser.