source: CONFIG/UNIFORM/v6/LMDZOR_v6.2/GENERAL/DRIVER/stomate.driver @ 4260

Last change on this file since 4260 was 4260, checked in by jgipsl, 3 years ago

Added section in stomate.driver so that all drivers will be the same between v6, v6.2 and v6.3.

This section will modify the parameters STOMATE_IMPOSE_CN and NINPUT_UPDATE in orchidee.def. But as they are modified using nonblocker option it will not make any harm if the variables do not exist.

File size: 4.1 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
50    # Define in orchidee.def if restart file should be used
51    if ( [ ${CumulPeriod} -eq 1 ] && [ "${config_SBG_Restart}" = "n" ] ) ; then
52        echo "STOMATE : without restart"
53        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_RESTART_FILEIN NONE
54    else
55        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_RESTART_FILEIN stomate_rest_in.nc
56    fi
57
58
59    # Modify in orchidee.def NINPUT_UPDATE if it is set in stomate.card section UserChoices
60    # NINPUT_UPDATE inidcates if the nitrogen maps should be updated and at which frequency
61    if [ ! X${stomate_UserChoices_NINPUT_UPDATE} = X ] ; then
62        # Take the value from stomate.card
63        IGCM_comp_modifyDefFile nonblocker orchidee.def NINPUT_UPDATE   ${stomate_UserChoices_NINPUT_UPDATE}
64    else
65        # Set default value 0Y
66        IGCM_comp_modifyDefFile nonblocker orchidee.def NINPUT_UPDATE 0Y
67    fi
68
69    # Modify in orchidee.def STOMATE_IMPOSE_CN if it is set in stomate.card section UserChoices
70    # STOMATE_IMPOSE_CN inidcates if the nitrogen should be imposed or not.
71    if [ ! X${stomate_UserChoices_STOMATE_IMPOSE_CN} = X ] ; then
72        # Take the value from stomate.card
73        IGCM_comp_modifyDefFile nonblocker orchidee.def STOMATE_IMPOSE_CN   ${stomate_UserChoices_STOMATE_IMPOSE_CN}
74    else
75        # Set default value n (nitrogen is not imposed)
76        IGCM_comp_modifyDefFile nonblocker orchidee.def STOMATE_IMPOSE_CN n
77    fi
78
79
80    IGCM_debug_PopStack "SBG_Update"
81}
82
83#-----------------------------------------------------------------
84function SBG_Finalize
85{
86    IGCM_debug_PushStack "SBG_Finalize"
87   
88    IGCM_debug_PopStack "SBG_Finalize"
89}
Note: See TracBrowser for help on using the repository browser.