Ignore:
Timestamp:
03/23/18 15:32:55 (6 years ago)
Author:
acosce
Message:

remove these configuration not use anymore

File:
1 edited

Legend:

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

    r2456 r3688  
    11#!/bin/ksh 
    2 #D- Driver du script pour ORCHIDEE 
     2## Driver for the component SRF corresponding to the sechiba part of ORCHIDEE 
    33#----------------------------------------------------------------- 
    44function SRF_Initialize 
     
    66    IGCM_debug_PushStack "SRF_Initialize" 
    77 
    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 
    15  
    168    ##- Define variable DefSuffix set in orchidee.card 
    17     ##  This variable is used in orchidee.card to choose  
    18     ##  parameter file(orchidee.def_DefSuffix).  
     9    ##  This variable is used in orchidee.card to choose 
     10    ##  parameter file(orchidee.def_DefSuffix). 
    1911    if [ ! X${orchidee_UserChoices_DefSuffix} = X ] ; then 
    20         DefSuffix=${orchidee_UserChoices_DefSuffix} 
     12        DefSuffix=${orchidee_UserChoices_DefSuffix} 
    2113    else 
    22         DefSuffix=Choi 
     14        DefSuffix=Choi 
    2315    fi 
    2416 
     
    3123    IGCM_debug_PushStack "SRF_Update" 
    3224 
     25    ## 1. Modifications in orchidee.def parameter file 
     26 
    3327    # Activate STOMATE if the compontent SBG=stomate is set in config.card 
    3428    if [ X${config_ListOfComponents_SBG} = Xstomate ] ; then 
    35         IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_OK_STOMATE y 
     29        # Activate stomate in orchidee.def 
     30        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_OK_STOMATE y 
    3631    else 
    37         IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_OK_STOMATE n 
     32        # Deactivate stomate in orchidee.def 
     33        IGCM_comp_modifyDefFile blocker orchidee.def STOMATE_OK_STOMATE n 
     34        # Deactivate output files for stomate 
     35        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate1 enabled .FALSE. 
     36        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate1 output_level 0 
     37        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate1 output_freq 1mo 
     38        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 enabled .FALSE. 
     39        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_level 0 
     40        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_freq 1mo 
    3841    fi 
    3942 
    40     typeset SECHIBA_WRITE_STEP 
    41  
    42     if [ X${orchidee_UserChoices_XIOS} = Xy ] ; then 
    43         IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .FALSE.  
    44         IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba2 enabled .FALSE.  
    45         IGCM_comp_modifyDefFile nonblocker orchidee.def XIOS_ORCHIDEE_OK y 
     43    # Define in orchidee.def if restart file should be used 
     44    if ( [ ${CumulPeriod} -ne 1 ] || [ "${config_SRF_Restart}" != "n" ] ) ; then 
     45        IGCM_comp_modifyDefFile blocker orchidee.def SECHIBA_restart_in sechiba_rest_in.nc 
    4646    else 
    47         IGCM_comp_modifyDefFile nonblocker orchidee.def XIOS_ORCHIDEE_OK n 
    48     fi     
    49  
    50     SRF_WriteFrequency=$( echo ${config_SRF_WriteFrequency} | sed -e 's/\([0-9]*[yYmMdDs]\).*/\1/' )  
    51     case ${SRF_WriteFrequency} in 
    52         *Y|*y)  
    53             WriteInYears=$( echo ${SRF_WriteFrequency} | awk -F '[yY]' '{print $1}' ) 
    54             PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' ) 
    55             (( SECHIBA_WRITE_STEP = PeriodLengthInDays * WriteInYears / PeriodLengthInYears * 86400 ))  
    56             if [ X${orchidee_UserChoices_XIOS} = Xy ] ; then 
    57                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE.  
    58                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq ${WriteInYears}y 
    59                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history  
    60             fi 
    61             ;; 
    62         1M) 
    63             if [ X${orchidee_UserChoices_XIOS} = Xy ] ; then 
    64                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE.  
    65                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq 1mo 
    66                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history  
    67             fi 
    68             case ${config_UserChoices_PeriodLength} in 
    69             *Y|*y) 
    70                 SECHIBA_WRITE_STEP=-1. 
    71                 ;; 
    72             *M|*m) 
    73                 SECHIBA_WRITE_STEP=-1. 
    74                 ;; 
    75             *) 
    76                 (( SECHIBA_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) * 86400 )) 
    77                 ;; 
    78             esac 
    79             ;; 
    80         *M|*m)  
    81             WriteInMonths=$( echo ${SRF_WriteFrequency} | awk -F '[mM]' '{print $1}' ) 
    82             if [ X${orchidee_UserChoices_XIOS} = Xy ] ; then 
    83                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE.  
    84                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq ${WriteInMonths}mo 
    85                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history  
    86             fi 
    87             case ${config_UserChoices_PeriodLength} in 
    88             *Y|*y) 
    89                 PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' ) 
    90                 (( SECHIBA_WRITE_STEP = PeriodLengthInDays * 86400 / PeriodLengthInYears / 12  )) 
    91                 ;; 
    92             *M|*m) 
    93                 PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | awk -F '[mM]' '{print $1}' ) 
    94                 (( SECHIBA_WRITE_STEP = PeriodLengthInDays * WriteInMonths  * 86400 / PeriodLengthInMonths  )) 
    95                 ;; 
    96             *) 
    97                 (( SECHIBA_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) * 86400 )) 
    98                 if [ X${orchidee_UserChoices_XIOS} = Xy ] ; then 
    99                     IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE.  
    100                     IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq ${SECHIBA_WRITE_STEP}s 
    101                     IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history 
    102                 fi 
    103                 ;; 
    104             esac 
    105             ;; 
    106         5D|5d)  
    107             if [ X${orchidee_UserChoices_XIOS} = Xy ] ; then 
    108                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE.  
    109                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq 5d 
    110                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history  
    111             fi 
    112             (( SECHIBA_WRITE_STEP = 5 * 86400 ))  
    113             ;; 
    114         1D|1d)  
    115             if [ X${orchidee_UserChoices_XIOS} = Xy ] ; then 
    116                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE.  
    117                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq 1d 
    118                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history  
    119             fi 
    120             (( SECHIBA_WRITE_STEP = 86400 ))  
    121             ;; 
    122         *s) 
    123             WriteInSeconds=$( echo ${SRF_WriteFrequency} | awk -F '[s]' '{print $1}' ) 
    124             if [ X${orchidee_UserChoices_XIOS} = Xy ] ; then 
    125                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 enabled .TRUE.  
    126                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 output_freq ${WriteInSeconds}s 
    127                 IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba1 name sechiba_history  
    128             fi 
    129             (( SECHIBA_WRITE_STEP = WriteInSeconds )) ;; 
    130         *)  
    131             IGCM_debug_Exit "SRF_Update " ${SRF_WriteFrequency} " invalid WriteFrequency : choose in 1Y, 1M, 5D, 1D."  
    132             IGCM_debug_Verif_Exit ;; 
    133     esac 
    134  
    135 #Use of XIOS ouputs only 
    136  
    137     if [ X${orchidee_UserChoices_XIOS} = Xy ] ; then 
    138         (( SECHIBA_WRITE_STEP = 0 )) 
    139     fi 
    140     IGCM_comp_modifyDefFile nonblocker orchidee.def WRITE_STEP ${SECHIBA_WRITE_STEP} 
    141     IGCM_comp_modifyDefFile nonblocker orchidee.def SECHIBA_HISTLEVEL ${orchidee_UserChoices_sechiba_LEVEL} 
    142  
    143     # Outputs HF in HISTFILE2 if required 
    144     if [ X${SRF_ok_hf} = Xy ] ; then 
    145         IGCM_comp_modifyDefFile nonblocker orchidee.def SECHIBA_HISTFILE2 y 
    146         if [ X${orchidee_UserChoices_XIOS} = Xy ] ; then 
    147             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba2 enabled .TRUE.  
    148             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba2 output_freq 10800s 
    149             IGCM_comp_modifyXmlFile force file_def_orchidee.xml sechiba2 name sechiba_out_2 
    150         fi 
    151     else 
    152         IGCM_comp_modifyDefFile nonblocker orchidee.def SECHIBA_HISTFILE2 n 
    153     fi 
    154     IGCM_comp_modifyDefFile nonblocker orchidee.def SECHIBA_HISTLEVEL2 1 
    155     IGCM_comp_modifyDefFile nonblocker orchidee.def WRITE_STEP2 10800.0 
    156  
    157     if ( [ ${CumulPeriod} -ne 1 ] || [ "${config_SRF_Restart}" != "n" ] ) ; then 
    158         IGCM_comp_modifyDefFile blocker orchidee.def SECHIBA_restart_in sechiba_rest_in.nc 
    159     else 
    160         IGCM_comp_modifyDefFile blocker orchidee.def SECHIBA_restart_in NONE 
     47        IGCM_comp_modifyDefFile blocker orchidee.def SECHIBA_restart_in NONE 
    16148    fi 
    16249 
    163 # Modify in orchidee.def VEGET_UPDATE and LAND_COVER_CHANGE if they are set in orchidee.card section UserChoices 
    164     if [ ! X${orchidee_UserChoices_VEGET_UPDATE} = X ] ; then 
    165         IGCM_comp_modifyDefFile nonblocker orchidee.def VEGET_UPDATE   ${orchidee_UserChoices_VEGET_UPDATE} 
    166     else 
    167         IGCM_comp_modifyDefFile nonblocker orchidee.def VEGET_UPDATE 0Y 
    168     fi 
    169     if [ ! X${orchidee_UserChoices_LAND_COVER_CHANGE} = X ] ; then 
    170         IGCM_comp_modifyDefFile nonblocker orchidee.def LAND_COVER_CHANGE ${orchidee_UserChoices_LAND_COVER_CHANGE} 
    171     else 
    172         IGCM_comp_modifyDefFile nonblocker orchidee.def LAND_COVER_CHANGE n 
     50    # Set VEGET_UPDATE=1Y in orchidee.def if VEGET_UPDATE_at_start=y in orchidee.card and if it is the first cumul periond (start of new simulation) 
     51    if [ X${orchidee_UserChoices_VEGET_UPDATE_at_start} = Xy ] && [ ${CumulPeriod} -eq 1 ] ; then 
     52        IGCM_comp_modifyDefFile nonblocker orchidee.def VEGET_UPDATE   1Y 
    17353    fi 
    17454 
    175     #IGCM_sys_Cp ${RUN_DIR}/orchidee.def ${RUN_DIR}/run.def 
    176     #IGCM_sys_Put_Out ${RUN_DIR}/run.def ${R_SAVE}/${PREFIX}_run.def 
     55    # Modify in orchidee.def VEGET_UPDATE if it is set in orchidee.card section UserChoices 
     56    # Note: if the variable has been set by VEGET_UPDATE_at_start, this section will not overwrite it. 
     57    if [ ! X${orchidee_UserChoices_VEGET_UPDATE} = X ] ; then 
     58        IGCM_comp_modifyDefFile nonblocker orchidee.def VEGET_UPDATE   ${orchidee_UserChoices_VEGET_UPDATE} 
     59    else 
     60        IGCM_comp_modifyDefFile nonblocker orchidee.def VEGET_UPDATE 0Y 
     61    fi 
    17762 
    178 #Temporary way to fix bug on cimean variable 
    179     IGCM_comp_modifyXmlFile force field_def_orchidee.xml cimean enabled .FALSE.  
     63    # Activate creation of river description file only for the first period 
     64    if [ ${CumulPeriod} -eq 1 ] ; then 
     65        IGCM_comp_modifyDefFile nonblocker orchidee.def RIVER_DESC y 
     66    else 
     67        IGCM_comp_modifyDefFile nonblocker orchidee.def RIVER_DESC n 
     68    fi 
    18069 
    181     if [ X${orchidee_UserChoices_XIOS} = Xy ] ; then 
     70 
     71    ## 2. Mangement of output and modifications of related xml files 
     72    # Modify file_def_orchidee.xml file using settings from orchidee.card 
     73    # We here suppose that for each file, in orchidee.card UserChoices section, if the parameter  
     74    # output_level_filename is set, then also output_freq_filename must be set. The existance of output_freq_filename will not be checked.  
     75    # If output_level_filename=NONE or if it is not set, the corresponding file will be deactivated. 
     76    # Settings in config.card WriteFrequency are not used any more. 
     77     
     78    if [ X${orchidee_UserChoices_output_level_sechiba_history} = X ] || [ X${orchidee_UserChoices_output_level_sechiba_history} = XNONE ] ; then 
     79        # output_level_sechiba_history is not set in orchidee.card or it is set to NONE. 
     80        # Deactivate the file. 
     81        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 enabled .FALSE. 
     82        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 output_level 0 
     83        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 output_freq 1mo 
     84    else 
     85        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 enabled      .TRUE. 
     86        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 output_level ${orchidee_UserChoices_output_level_sechiba_history} 
     87        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 output_freq  ${orchidee_UserChoices_output_freq_sechiba_history} 
     88    fi 
     89     
     90    if [ X${orchidee_UserChoices_output_level_sechiba_out_2} = X ] || [ X${orchidee_UserChoices_output_level_sechiba_out_2} = XNONE ] ; then 
     91        # output_level_sechiba_out_2 is not set in orchidee.card or it is set to NONE. 
     92        # Deactivate the file. 
     93        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 enabled .FALSE. 
     94        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 output_level 0 
     95        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 output_freq 1mo 
     96    else 
     97        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 enabled      .TRUE. 
     98        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 output_level ${orchidee_UserChoices_output_level_sechiba_out_2} 
     99        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 output_freq  ${orchidee_UserChoices_output_freq_sechiba_out_2} 
     100    fi 
     101     
     102    if [ X${orchidee_UserChoices_output_level_sechiba_history_4dim} = X ] || [ X${orchidee_UserChoices_output_level_sechiba_history_4dim} = XNONE ] ; then 
     103        # output_level_sechiba_history_4dim is not set in orchidee.card or it is set to NONE. 
     104        # Deactivate the file. 
     105        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba3 enabled .FALSE. 
     106        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba3 output_level 0 
     107        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba3 output_freq 1mo 
     108    else 
     109        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba3 enabled      .TRUE. 
     110        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba3 output_level ${orchidee_UserChoices_output_level_sechiba_history_4dim} 
     111        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba3 output_freq  ${orchidee_UserChoices_output_freq_sechiba_history_4dim} 
     112    fi 
     113         
     114 
    182115    # Add include of orchidee context in iodef.xml 
    183116    # In iodef.xml add on next line after "COMPONENT CONTEXT" 
    184117    #  <context id="orchidee" src="./context_orchidee.xml"/> 
    185         echo '<context id="orchidee" src="./context_orchidee.xml"/>' > add.tmp 
    186         cp iodef.xml iodef.xml.tmp 
    187         sed -e "/COMPONENT CONTEXT/r add.tmp" \ 
    188             iodef.xml.tmp > iodef.xml 
    189         rm iodef.xml.tmp add.tmp 
     118    echo '<context id="orchidee" src="./context_orchidee.xml"/>' > add.tmp 
     119    if [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] ; then 
     120        echo '<context id="orchidee" src="./ping_orchidee.xml"/>' >> add.tmp 
     121        echo '<context id="orchidee" src="./dr2xml_orchidee.xml"/>' >> add.tmp 
    190122    fi 
     123    cp iodef.xml iodef.xml.tmp 
     124    sed -e "/COMPONENT CONTEXT/r add.tmp" iodef.xml.tmp > iodef.xml 
     125    rm iodef.xml.tmp add.tmp 
     126 
     127    # Add LongName as global attribute in XIOS output files (if LongName is not empty) 
     128    if [ ! "X${config_UserChoices_LongName}" = "X" ] ; then 
     129        listfile=$(ls file_def*orchidee.xml) 
     130        echo "<variable id=\"LongName\" type=\"string\">${config_UserChoices_LongName}</variable>" > add.tmp 
     131        for file in ${listfile} 
     132        do 
     133            cp ${file} ${file}.tmp 
     134            sed -e "/<file id/r add.tmp" \ 
     135                ${file}.tmp > ${file} 
     136            rm ${file}.tmp  
     137        done  
     138        rm add.tmp 
     139    fi 
     140 
    191141 
    192142    IGCM_debug_PopStack "SRF_Update" 
     
    198148    IGCM_debug_PushStack "SRF_Finalize" 
    199149 
    200     #IGCM_sys_Put_Out ${RUN_DIR}/used_run.def ${R_SAVE}/${PREFIX}_used_run.def 
    201  
    202     echo FINALIZE SRF !!! 
    203  
    204150    IGCM_debug_PopStack "SRF_Finalize" 
    205151} 
Note: See TracChangeset for help on using the changeset viewer.