Ignore:
Timestamp:
12/03/09 10:14:54 (13 years ago)
Author:
acosce
Message:

ACo: new parameter files for orchidee in LMDZORINCA

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CONFIG/LMDZORINCA/trunk/EXP_IPCC/COMP/orchidee.driver

    r644 r835  
    11#!/bin/ksh 
    22 
    3 #D- Driver du script pour ORCHIDEE_OL (off-line) 
     3#D- Driver du script pour ORCHIDEE 
     4 
     5function ORCHIDEE_sed 
     6{ 
     7    IGCM_debug_PushStack "ORCHIDEE_sed" 
     8     
     9    sed -e "s/^${1}\ *=.*/${1}= ${2}/" \ 
     10        orchidee.def > orchidee.def.tmp 
     11    RET=$? 
     12    echo "ORCHIDEE_sed : ${1} ${2}" 
     13    \mv orchidee.def.tmp orchidee.def 
     14     
     15    IGCM_debug_PopStack "ORCHIDEE_sed" 
     16    return $RET 
     17} 
    418 
    519#----------------------------------------------------------------- 
     
    721{ 
    822    IGCM_debug_PushStack "SRF_Initialize" 
     23 
     24    RESOL_SRF=ALL 
    925 
    1026    IGCM_debug_PopStack "SRF_Initialize" 
     
    1632    IGCM_debug_PushStack "SRF_Update" 
    1733 
     34    typeset SECHIBA_WRITE_STEP 
     35 
    1836    case ${config_SRF_WriteFrequency} in 
    19         1Y|1y)  
    20             (( STOMATE_WRITE_STEP = PeriodLengthInDays )) 
    21             (( SECHIBA_WRITE_STEP = PeriodLengthInDays * 86400 )) ;; 
    22         1M|1m)  
    23             if [ ${config_UserChoices_PeriodLength} = 1Y ] ; then 
    24                 (( STOMATE_WRITE_STEP = PeriodLengthInDays / 12 )) 
    25                 (( SECHIBA_WRITE_STEP = PeriodLengthInDays * 86400 / 12  )) 
    26             else 
    27                 (( STOMATE_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) )) 
     37        *Y|*y)  
     38            WriteInYears=$( echo ${1} | awk -F '[yY]' "{print ${config_SRF_WriteFrequency}}" ) 
     39            PeriodLengthInYears=$( echo ${1} | awk -F '[yY]' "{print ${config_UserChoices_PeriodLength}}" ) 
     40            (( SECHIBA_WRITE_STEP = PeriodLengthInDays * WriteInYears / PeriodLengthInYears * 86400 )) ;; 
     41        *M|*m)  
     42            WriteInMonths=$( echo ${1} | awk -F '[mM]' "{print ${config_SRF_WriteFrequency}}" ) 
     43            case ${config_UserChoices_PeriodLength} in 
     44            *Y|*y) 
     45                PeriodLengthInYears=$( echo ${1} | awk -F '[yY]' "{print ${config_UserChoices_PeriodLength}}" ) 
     46                (( SECHIBA_WRITE_STEP = PeriodLengthInDays * 86400 / PeriodLengthInYears / 12  )) 
     47                ;; 
     48            *M|*m) 
     49                PeriodLengthInMonths=$( echo ${1} | awk -F '[mM]' "{print ${config_UserChoices_PeriodLength}}" ) 
     50                (( SECHIBA_WRITE_STEP = PeriodLengthInDays * WriteInMonths  * 86400 / PeriodLengthInMonths  )) 
     51                ;; 
     52            *) 
    2853                (( SECHIBA_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) * 86400 )) 
    29             fi ;; 
     54                ;; 
     55            esac 
     56            ;; 
    3057        5D|5d)  
    31             (( STOMATE_WRITE_STEP = 5 )) 
    3258            (( SECHIBA_WRITE_STEP = 5 * 86400 )) ;; 
    3359        1D|1d)  
    34             (( STOMATE_WRITE_STEP = 1 )) 
    3560            (( SECHIBA_WRITE_STEP = 86400 )) ;; 
     61        *s) 
     62            WriteInSeconds=$( echo ${1} | awk -F '[s]' "{print ${config_SRF_WriteFrequency}}" ) 
     63            (( SECHIBA_WRITE_STEP = WriteInSeconds )) ;; 
    3664        *)  
    3765            IGCM_debug_Exit "SRF_Update " ${config_SRF_WriteFrequency} " invalid WriteFrequency : choose in 1Y, 1M, 5D, 1D."  
     
    3967    esac 
    4068 
     69    ORCHIDEE_sed HYDROL_CWRR ${orchidee_UserChoices_NEWHYDROL} 
    4170 
    42     if ( [ ${CumulPeriod} -eq 1 ] && [ "${config_SRF_Restart}" = "n" ] ) ; then 
    43         sed -e "s/_start_sech_/default/" \ 
    44             -e "s/_write_step_/${SECHIBA_WRITE_STEP}/" \ 
    45             orchidee.def > orchidee.def.tmp 
    46 ## For STOMATE 
    47 #           -e "s/STOMATE_HIST_DT= 10./STOMATE_HIST_DT = ${STOMATE_WRITE_STEP}/" \ 
     71    ORCHIDEE_sed WRITE_STEP ${SECHIBA_WRITE_STEP} 
     72    ORCHIDEE_sed SECHIBA_HISTLEVEL ${orchidee_UserChoices_sechiba_LEVEL} 
    4873 
    49 ## For ORCHIDEE_WATCHOUT_FILE :  
    50 #            -e "s/ORCHIDEE_WATCHOUT= n/ORCHIDEE_WATCHOUT= y/" \ 
    51 #            -e "s/DT_WATCHOUT= 1800/DT_WATCHOUT= 3600/" \ 
    52     else 
    53         sed -e "s/_start_sech_/start_sech.nc/" \ 
    54             -e "s/_write_step_/${SECHIBA_WRITE_STEP}/" \ 
    55             orchidee.def > orchidee.def.tmp 
    56 ## For STOMATE 
    57 #            -e "s/STOMATE_RESTART_FILEIN= NONE/STOMATE_RESTART_FILEIN = stomate_rest_in.nc/" \ 
    58 #            -e "s/STOMATE_HIST_DT= 10./STOMATE_HIST_DT = ${STOMATE_WRITE_STEP}/" \ 
     74##    if [ ${year} -eq 1950 ] ; then 
     75#       ORCHIDEE_sed SECHIBA_HISTFILE2 y 
     76#       ORCHIDEE_sed SECHIBA_HISTLEVEL2 10 
     77#       ORCHIDEE_sed WRITE_STEP2 86400.0 
     78##    fi 
    5979 
    60 ## For ORCHIDEE_WATCHOUT_FILE :  
    61 #            -e "s/ORCHIDEE_WATCHOUT= n/ORCHIDEE_WATCHOUT= y/" \ 
    62 #            -e "s/DT_WATCHOUT= 1800/DT_WATCHOUT= 3600/" \ 
     80    if ( [ ${CumulPeriod} -ne 1 ] || [ "${config_SRF_Restart}" != "n" ] ) ; then 
     81        ORCHIDEE_sed SECHIBA_restart_in sechiba_rest_in.nc 
    6382    fi 
    64     IGCM_sys_Mv orchidee.def.tmp orchidee.def 
     83 
     84    #IGCM_sys_Cp ${RUN_DIR}/orchidee.def ${RUN_DIR}/run.def 
     85    #IGCM_sys_Put_Out ${RUN_DIR}/run.def ${R_SAVE}/${PREFIX}_run.def 
    6586 
    6687    IGCM_debug_PopStack "SRF_Update" 
     
    7293    IGCM_debug_PushStack "SRF_Finalize" 
    7394 
    74 # For STOMATE : 
    75 #     if [ $( IGCM_date_DaysBetweenGregorianDate ${PeriodDateEnd} ${year}1230 ) -ge 0 ] ; then 
    76 #       IGCM_sys_Put_Out stomate_Cforcing.nc ${R_OUT_SRF_O_M}/${PREFIX}_stomate_Cforcing.nc 
    77 #       IGCM_sys_Put_Out stomate_forcing.nc  ${R_OUT_SRF_O_M}/${PREFIX}_stomate_forcing.nc 
    78 #     fi 
     95    #IGCM_sys_Put_Out ${RUN_DIR}/used_run.def ${R_SAVE}/${PREFIX}_used_run.def 
    7996 
    8097    echo FINALIZE SRF !!! 
Note: See TracChangeset for help on using the changeset viewer.