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

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

CM7_work : Minor changes

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