source: CONFIG/UNIFORM/v6/LMDZORINCA_v6.2/GENERAL/DRIVER/stomate.driver

Last change on this file was 6262, checked in by jgipsl, 19 months ago

Allow a new file in stomate to exist and be set to AUTO in file_def_orchidee.xml. The file is not activated in the coupled set up. This modification is needed since ORCHIDEE/trunk revision 7789.

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