source: CONFIG/UNIFORM/v6/LMDZOR_v6/GENERAL/DRIVER/orchidee.driver @ 2595

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

Modifications to be used with ORCHIDEE trunk rev 2724 or later.

  • Remove reftemp.nc : not needed anymore for ORCHIDEE trunk rev 2724 or later
  • Coping PFTmap file for current year : since ORCHIDEE trunk rev 2724
  • Moved file_def_orchidee.xml into PARAM directory : add AUTO and revision number for correspondance to ORCHIDEE trunk.
  • orchidee.driver/ stomate.driver :
    • modify to use nonblocker option with IGCM_comp_modifyXmlFile.
    • some homogenization between offline ORCHIDEE_OL and LMDZOR_v6
File size: 4.3 KB
Line 
1#!/bin/ksh
2#D- Driver du script pour ORCHIDEE
3#-----------------------------------------------------------------
4function SRF_Initialize
5{
6    IGCM_debug_PushStack "SRF_Initialize"
7
8    ##- Define variable DefSuffix set in orchidee.card
9    ##  This variable is used in orchidee.card to choose
10    ##  parameter file(orchidee.def_DefSuffix).
11    if [ ! X${orchidee_UserChoices_DefSuffix} = X ] ; then
12        DefSuffix=${orchidee_UserChoices_DefSuffix}
13    else
14        DefSuffix=Choi
15    fi
16
17    IGCM_debug_PopStack "SRF_Initialize"
18}
19
20#-----------------------------------------------------------------
21function SRF_Update
22{
23    IGCM_debug_PushStack "SRF_Update"
24
25    # Activate STOMATE if the compontent SBG=stomate is set in config.card
26    if [ X${config_ListOfComponents_SBG} = Xstomate ] ; then
27        # Activate stomate in orchidee.def
28        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_OK_STOMATE y
29    else
30        # Deactivate stomate in orchidee.def
31        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_OK_STOMATE n
32        # Deactivate output files for stomate
33        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate1 enabled .FALSE.
34        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 enabled .FALSE.
35    fi
36
37    # Set default values for sechiba1_enabled, sechiba1_freq and sechiba2_enabled.
38    sechiba1_enabled=.FALSE.
39    sechiba2_enabled=.FALSE.
40    sechiba1_freq=0s
41
42    # Get WriteFrenquecies from config.card for SECHIBA
43    # Note that it is only possible to have one HF and one other option.
44    # If more options are set in config.card only the latest will be used.
45    for frequency in ${config_SRF_WriteFrequency} ; do
46        case ${frequency} in
47            *Y|*y) 
48                NbYears=$( echo ${frequency} | awk -F '[yY]' '{print $1}' )
49                NbDaysYear=$( IGCM_date_DaysInYear ${year} )
50                sechiba1_enabled=.TRUE.
51                sechiba1_freq=${NbYears}y
52            *M|*m)
53                NbMonths=$( echo ${frequency} | awk -F '[mM]' '{print $1}' )
54                sechiba1_enabled=.TRUE.
55                sechiba1_freq=${NbMonths}mo
56            *D|*d)
57                NbDayss=$( echo ${frequency} | awk -F '[dD]' '{print $1}' )
58                sechiba1_enabled=.TRUE.
59                sechiba1_freq=${NbDays}d
60            *s)
61                WriteInSeconds=$( echo ${frequency} | awk -F '[s]' '{print $1}' )
62                sechiba1_enabled=.TRUE.
63                sechiba1_freq=${WriteInSeconds}s
64            HF|hf) 
65                SRF_ok_hf=y
66                sechiba2_enabled=.TRUE. ;;
67            *) 
68                IGCM_debug_Exit "SRF_Update " ${frequency} " invalid WriteFrequency : choose in xY, xM, xD, xs and HF" 
69                IGCM_debug_Verif_Exit ;;
70        esac
71    done
72
73    # Do the modifications in file_def_orchidee.xml
74    IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 enabled ${sechiba1_enabled}
75    IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 output_freq ${sechiba1_freq}
76    IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 enabled ${sechiba2_enabled}
77
78    # Add include of orchidee context in iodef.xml
79    # In iodef.xml add on next line after "COMPONENT CONTEXT"
80    #  <context id="orchidee" src="./context_orchidee.xml"/>
81    echo '<context id="orchidee" src="./context_orchidee.xml"/>' > add.tmp
82    cp iodef.xml iodef.xml.tmp
83    sed -e "/COMPONENT CONTEXT/r add.tmp" iodef.xml.tmp > iodef.xml
84    rm iodef.xml.tmp add.tmp
85
86
87    # Define in orchidee.def if restart file should be used
88    if ( [ ${CumulPeriod} -ne 1 ] || [ "${config_SRF_Restart}" != "n" ] ) ; then
89        IGCM_comp_modifyDefFile blocker orchidee.def SECHIBA_restart_in sechiba_rest_in.nc
90    else
91        IGCM_comp_modifyDefFile blocker orchidee.def SECHIBA_restart_in NONE
92    fi
93
94    # Modify in orchidee.def VEGET_UPDATE and LAND_COVER_CHANGE if they are set in orchidee.card section UserChoices
95    if [ ! X${orchidee_UserChoices_VEGET_UPDATE} = X ] ; then
96        IGCM_comp_modifyDefFile nonblocker orchidee.def VEGET_UPDATE   ${orchidee_UserChoices_VEGET_UPDATE}
97    else
98        IGCM_comp_modifyDefFile nonblocker orchidee.def VEGET_UPDATE 0Y
99    fi
100    if [ ! X${orchidee_UserChoices_LAND_COVER_CHANGE} = X ] ; then
101        IGCM_comp_modifyDefFile nonblocker orchidee.def LAND_COVER_CHANGE ${orchidee_UserChoices_LAND_COVER_CHANGE}
102    else
103        IGCM_comp_modifyDefFile nonblocker orchidee.def LAND_COVER_CHANGE n
104    fi
105
106    IGCM_debug_PopStack "SRF_Update"
107}
108
109#-----------------------------------------------------------------
110function SRF_Finalize
111{
112    IGCM_debug_PushStack "SRF_Finalize"
113
114    IGCM_debug_PopStack "SRF_Finalize"
115}
Note: See TracBrowser for help on using the repository browser.