source: CONFIG/UNIFORM/v7/ICOLMDZOR_v7/GENERAL/DRIVER/stomate.driver

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