1 | #!/bin/ksh |
---|
2 | |
---|
3 | #D- Driver for ORCHIDEE stomate component (SBG) |
---|
4 | |
---|
5 | #----------------------------------------------------------------- |
---|
6 | function SBG_Initialize |
---|
7 | { |
---|
8 | IGCM_debug_PushStack "SBG_Initialize" |
---|
9 | |
---|
10 | IGCM_debug_PopStack "SBG_Initialize" |
---|
11 | } |
---|
12 | |
---|
13 | #----------------------------------------------------------------- |
---|
14 | function 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 | IGCM_debug_PopStack "SBG_Update" |
---|
59 | } |
---|
60 | |
---|
61 | #----------------------------------------------------------------- |
---|
62 | function SBG_Finalize |
---|
63 | { |
---|
64 | IGCM_debug_PushStack "SBG_Finalize" |
---|
65 | |
---|
66 | IGCM_debug_PopStack "SBG_Finalize" |
---|
67 | } |
---|