Ignore:
Timestamp:
06/04/09 09:08:25 (15 years ago)
Author:
mmaipsl
Message:

Add experience type management : JobType? = DEB(ug), DEV(elopment), RUN (default)
(No propoagation in Post-treatment for instance).
Put "Where do we run ?" question in libIGCM_sys.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_config/libIGCM_config.ksh

    r124 r128  
    1919    IGCM_debug_PushStack "IGCM_config_Initialize" 
    2020 
    21     echo 
    22     # Where do we run ? 
    23     uname -a 
    24  
    2521    # Debug Print : 
    2622    echo 
     
    198194    R_OUT_EXE=${R_SAVE}/Exe 
    199195 
     196    #==================================================== 
     197    # Experience type : DEB(ug), DEV(elopment), RUN  
     198    if [ X${JobType} != XRUN ] ; then 
     199        echo 
     200        echo "====================================================" 
     201        echo "libIGCM JOB is NOT in RUN type mode." 
     202        echo "!! OUTPUT files will NOT be PROTECTED !!" 
     203        echo "Be carefull : you can ERASE the result of this job !" 
     204 
     205        case ${JobType} in 
     206            DEB) 
     207                echo "DEBUG mode : activation of 'set -vx' mode.";; 
     208            DEV) 
     209                echo "DEVelopment mode : no protection for output files." 
     210                ;; 
     211        esac     
     212        echo "====================================================" 
     213        echo 
     214    fi 
     215 
    200216    IGCM_debug_PopStack "IGCM_config_Initialize" 
    201217} 
     
    206222    IGCM_debug_PushStack "IGCM_config_Analyse_PeriodLength" 
    207223 
    208     echo "config_UserChoices_PeriodLength : " ${config_UserChoices_PeriodLength} ${month} ${year} 
    209  
    210224    typeset i 
    211225 
     
    213227    case ${config_UserChoices_PeriodLength} in 
    214228        *Y|*y) 
    215 #MM a enlever apres les tests  
    216             echo " ${config_UserChoices_PeriodLength} | gawk -F '[yY]' " '{print $1}'  
    217             PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[yY]' '{print $1}' )  
     229            PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | sed -e 's/[yY]//' )  
    218230            IGCM_debug_Print 1 "Number of years for PeriodLength : ${PeriodLengthInYears}" 
    219231            PeriodLengthInDays=0 
     
    225237            ;; 
    226238        *M|*m) 
    227             PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[mM]' '{print $1}' )  
     239            PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | sed -e 's/[mM]//' )  
    228240            IGCM_debug_Print 1 "Number of months for PeriodLength : ${PeriodLengthInMonths}" 
    229241            PeriodLengthInDays=0 
     
    239251            ;; 
    240252        *D|*d)   
    241             PeriodLengthInDays=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[dD]' '{print $1}' ) ;; 
     253            PeriodLengthInMonths=0 
     254            PeriodLengthInDays=$( echo ${config_UserChoices_PeriodLength} | sed -e 's/[dD]//' );; 
    242255        *)  
    243256            IGCM_debug_Exit "IGCM_config_Analyse_PeriodLength " ${config_UserChoices_PeriodLength} " invalid period length : choose in *Y, *M, *D." 
     
    371384 
    372385    # Test if the same run as already been saved : 
    373     if [ ${DRYRUN} -le 0 ] ; then 
     386    if [ X${JobType} = XRUN ] ; then 
     387        if [ ${DRYRUN} -le 0 ] ; then 
     388            if ( IGCM_sys_TestFileArchive ${R_OUT_KSH}/${PREFIX}_${Exe_Output} ) ; then 
     389                IGCM_debug_Exit "IGCM_config_PeriodStart" "RErun an old job." 
     390                IGCM_debug_Print 1 "Because of readonly permissions, you can't RErun a job when saved files" 
     391                IGCM_debug_Print 1 " are still in the ARCHIVE directory. You must deleted those files, or " 
     392                IGCM_debug_Print 1 " the whole ${R_SAVE} tree." 
     393                IGCM_debug_Verif_Exit 
     394            fi 
     395        fi 
     396    else 
    374397        if ( IGCM_sys_TestFileArchive ${R_OUT_KSH}/${PREFIX}_${Exe_Output} ) ; then 
    375             IGCM_debug_Exit "IGCM_config_PeriodStart" "RErun an old job." 
    376             IGCM_debug_Print 1 "Because of readonly permissions, you can't RErun a job when saved files" 
    377             IGCM_debug_Print 1 " are still in the ARCHIVE directory. You must deleted those files, or " 
    378             IGCM_debug_Print 1 " the whole ${R_SAVE} tree." 
    379             IGCM_debug_Verif_Exit 
    380         fi 
    381     fi 
     398            IGCM_debug_Print 1 "IGCM_config_PeriodStart" "RErun an old job. DEBUG of DEV mode." 
     399        fi 
     400    fi 
     401 
    382402    IGCM_debug_PopStack "IGCM_config_PeriodStart" 
    383403} 
Note: See TracChangeset for help on using the changeset viewer.