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

Last change on this file since 2582 was 2582, checked in by jgipsl, 6 years ago

Update with changes done on v6_rc0 (sdipsl) :

  • remove IOIPSL
  • clean

This is done only for IPSLCM6 and LMDZOR_v6 configurations and only for the part LMDZ and ORCHIDEE.

File size: 5.0 KB
Line 
1#!/bin/ksh
2
3#D- Driver du script pour ORCHIDEE
4
5#-----------------------------------------------------------------
6function SBG_Initialize
7{
8    IGCM_debug_PushStack "SBG_Initialize"
9
10    RESOL_SBG=ALL
11
12    IGCM_debug_PopStack "SBG_Initialize"
13}
14
15#-----------------------------------------------------------------
16function SBG_Update
17{
18    IGCM_debug_PushStack "SBG_Update"
19
20    # Default init : files are desactivated
21    IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 enabled .FALSE.
22    IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 enabled .FALSE.
23
24    case ${config_SBG_WriteFrequency} in
25        *Y|*y)
26            WriteInYears=$( echo ${config_SBG_WriteFrequency} | awk -F '[yY]' '{print $1}' )
27            PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' )
28            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 enabled .TRUE.
29            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 output_freq ${WriteInYears}y
30            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 name stomate_history
31            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 enabled .TRUE.
32            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 output_freq ${WriteInYears}y
33            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 name stomate_ipcc_history
34            ;;
35        *M|*m)
36            WriteInMonths=$( echo ${config_SBG_WriteFrequency} | awk -F '[mM]' '{print $1}' )
37            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 enabled .TRUE.
38            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 output_freq ${WriteInMonths}mo
39            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 name stomate_history
40            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 enabled .TRUE.
41            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 output_freq ${WriteInMonths}mo
42            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 name stomate_ipcc_history
43            ;;
44        5D|5d)
45            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 enabled .TRUE.
46            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 output_freq 5d
47            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 name stomate_history
48            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 enabled .TRUE.
49            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 output_freq 5d
50            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 name stomate_ipcc_history
51            ;;
52        1D|1d)
53            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 enabled .TRUE.
54            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 output_freq 1d
55            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate1 name stomate_history
56            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 enabled .TRUE.
57            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 output_freq 1d
58            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 name stomate_ipcc_history
59            ;;
60        *s)
61            WriteInSeconds=$( echo ${config_SBG_WriteFrequency} | awk -F '[s]' '{print $1}' )
62            IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE.
63            IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq ${WriteInSeconds}s
64            IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history
65            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 enabled .TRUE.
66            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 output_freq ${WriteInSeconds}s
67            IGCM_comp_modifyXmlFile force file_def_orchidee.xml stomate2 name stomate_ipcc_history
68            ;;
69        *)
70            IGCM_debug_Exit "SBG_Update " ${config_SBG_WriteFrequency} " invalid WriteFrequency : choose in 1Y, 1M, 5D, 1D."
71            IGCM_debug_Verif_Exit ;;
72    esac
73
74    if ( [ ${CumulPeriod} -eq 1 ] && [ "${config_SBG_Restart}" = "n" ] ) ; then
75        echo "STOMATE : without restart"
76        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_RESTART_FILEIN NONE
77    else
78        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_RESTART_FILEIN stomate_rest_in.nc
79    fi
80
81    IGCM_debug_PopStack "SBG_Update"
82}
83
84#-----------------------------------------------------------------
85function SBG_Finalize
86{
87#set -vx
88    IGCM_debug_PushStack "SBG_Finalize"
89
90    if [ $( IGCM_date_DaysBetweenGregorianDate ${PeriodDateEnd} ${year}1230 ) -ge 0 ] ; then
91        IGCM_sys_Put_Out stomate_Cforcing.nc ${R_OUT_SBG_R}/${config_UserChoices_JobName}_${PeriodDateEnd}_stomate_Cforcing.nc
92        IGCM_sys_Put_Out stomate_forcing.nc  ${R_OUT_SBG_R}/${config_UserChoices_JobName}_${PeriodDateEnd}_stomate_forcing.nc
93#       rm -f stomate_Cforcing.nc
94#       rm -f stomate_forcing.nc
95    fi
96
97    IGCM_debug_PopStack "SBG_Finalize"
98}
Note: See TracBrowser for help on using the repository browser.