Ignore:
Timestamp:
06/26/15 13:17:19 (6 years ago)
Author:
jgipsl
Message:

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:
1 edited

Legend:

Unmodified
Added
Removed
  • CONFIG/UNIFORM/v6/LMDZOR_v6/GENERAL/DRIVER/orchidee.driver

    r2582 r2595  
    55{ 
    66    IGCM_debug_PushStack "SRF_Initialize" 
    7  
    8     RESOL_SRF=ALL 
    9  
    10     for frequency in ${config_SRF_WriteFrequency} ; do 
    11         case ${frequency} in 
    12             HF|hf) SRF_ok_hf=y ;; 
    13         esac 
    14     done 
    157 
    168    ##- Define variable DefSuffix set in orchidee.card 
     
    3325    # Activate STOMATE if the compontent SBG=stomate is set in config.card 
    3426    if [ X${config_ListOfComponents_SBG} = Xstomate ] ; then 
     27        # Activate stomate in orchidee.def 
    3528        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_OK_STOMATE y 
    3629    else 
     30        # Deactivate stomate in orchidee.def 
    3731        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. 
    3835    fi 
    3936 
    40     # Default init : files are desactivated 
    41     IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .FALSE. 
    42     IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba2 enabled .FALSE. 
     37    # Set default values for sechiba1_enabled, sechiba1_freq and sechiba2_enabled. 
     38    sechiba1_enabled=.FALSE. 
     39    sechiba2_enabled=.FALSE. 
     40    sechiba1_freq=0s 
    4341 
    44     SRF_WriteFrequency=$( echo ${config_SRF_WriteFrequency} | sed -e 's/\([0-9]*[yYmMdDs]\).*/\1/' ) 
    45     case ${SRF_WriteFrequency} in 
    46         *Y|*y) 
    47             WriteInYears=$( echo ${SRF_WriteFrequency} | awk -F '[yY]' '{print $1}' ) 
    48             PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' ) 
    49             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE. 
    50             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq ${WriteInYears}y 
    51             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history 
    52             ;; 
    53         *M|*m) 
    54             WriteInMonths=$( echo ${SRF_WriteFrequency} | awk -F '[mM]' '{print $1}' ) 
    55             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE. 
    56             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq ${WriteInMonths}mo 
    57             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history 
    58             ;; 
    59         5D|5d) 
    60             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE. 
    61             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq 5d 
    62             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history 
    63             ;; 
    64         1D|1d) 
    65             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE. 
    66             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq 1d 
    67             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history 
    68             ;; 
    69         *s) 
    70             WriteInSeconds=$( echo ${SRF_WriteFrequency} | awk -F '[s]' '{print $1}' ) 
    71             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE. 
    72             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq ${WriteInSeconds}s 
    73             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history 
    74             ;; 
    75         *) 
    76             IGCM_debug_Exit "SRF_Update " ${SRF_WriteFrequency} " invalid WriteFrequency : choose in 1Y, 1M, 5D, 1D." 
    77             IGCM_debug_Verif_Exit ;; 
    78     esac 
     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 
    7972 
    80     # Outputs HF in HISTFILE2 if required. Output frequency is 3 hours by default. 
    81     if [ X${SRF_ok_hf} = Xy ] ; then 
    82         IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba2 enabled .TRUE. 
    83         IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba2 output_freq 10800s 
    84         IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba2 name sechiba_out_2 
    85     fi 
     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} 
    8677 
     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 
    8788    if ( [ ${CumulPeriod} -ne 1 ] || [ "${config_SRF_Restart}" != "n" ] ) ; then 
    8889        IGCM_comp_modifyDefFile blocker orchidee.def SECHIBA_restart_in sechiba_rest_in.nc 
     
    103104    fi 
    104105 
    105     #IGCM_sys_Cp ${RUN_DIR}/orchidee.def ${RUN_DIR}/run.def 
    106     #IGCM_sys_Put_Out ${RUN_DIR}/run.def ${R_SAVE}/${PREFIX}_run.def 
    107  
    108     #Temporary way to fix bug on cimean variable 
    109     IGCM_comp_modifyXmlFile force field_def_orchidee.xml cimean enabled .FALSE. 
    110  
    111     # Add include of orchidee context in iodef.xml 
    112     # In iodef.xml add on next line after "COMPONENT CONTEXT" 
    113     #  <context id="orchidee" src="./context_orchidee.xml"/> 
    114     echo '<context id="orchidee" src="./context_orchidee.xml"/>' > add.tmp 
    115     cp iodef.xml iodef.xml.tmp 
    116     sed -e "/COMPONENT CONTEXT/r add.tmp" iodef.xml.tmp > iodef.xml 
    117     rm iodef.xml.tmp add.tmp 
    118  
    119106    IGCM_debug_PopStack "SRF_Update" 
    120107} 
     
    125112    IGCM_debug_PushStack "SRF_Finalize" 
    126113 
    127     #IGCM_sys_Put_Out ${RUN_DIR}/used_run.def ${R_SAVE}/${PREFIX}_used_run.def 
    128  
    129     echo FINALIZE SRF !!! 
    130  
    131114    IGCM_debug_PopStack "SRF_Finalize" 
    132115} 
Note: See TracChangeset for help on using the changeset viewer.