Changeset 1825


Ignore:
Timestamp:
2010-04-02T16:29:27+02:00 (11 years ago)
Author:
flavoni
Message:

added new variable to solve bug for interannual run,(run package of years in one time), see ticket: #654

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CONFIG/ORCA2_LIM/IGCM00/COMP/opa9.driver

    r1823 r1825  
    4949    (( DaysSinceJC = $( IGCM_date_DaysSinceJC ${DateBegin} ) + 1 )) 
    5050 
    51     # Definition from opa9.card of List_jobsbc used to do to interannual and climatological runs  
     51    # Definition from opa9.card of List_jobsbc and List_runsbc used to do to interannual and climatological runs  
    5252   IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/COMP/opa9.card Interannual List_jobsbc 
    5353        set -A ListFormulationJobsbc -- \${opa9_Interannual_Listjobsc${opa9_Interannual_List_jobsbc}[*]} 
     
    7171   typeset file  
    7272 
    73    (( final_year =${InitYear} + ${PeriodLengthInYears} - 1 )) 
     73   (( PeriodCumulPeriod =  ${CumulPeriod} - 1 ))  
     74   (( PeriodInitYear =${InitYear} + ${PeriodCumulPeriod} * ${PeriodLengthInYears} )) 
     75   (( PeriodFinalYear =${InitYear} + ${PeriodLengthInYears}*${CumulPeriod} - 1 )) 
     76 
    7477        NbFileInter=${#opa9_Interannual_List_jobsbc[*]} 
    75  
    7678        (( NbFileInter_tot=${#opa9_Interannual_List_jobsbc[*]} * ${PeriodLengthInYears} )) 
    77  
    7879   (( i = 0 )) 
    7980 
    80    while [ ${year} -le ${final_year} ] ; do #copy in ONCE of ALL necessary files for all PeriodLength 
     81   while [ ${year} -le ${PeriodFinalYear} ] ; do #copy in ONCE of ALL necessary files for all PeriodLength 
    8182        
    8283       while [ $i -lt ${NbFileInter} ] ; do 
    8384       
    8485      eval file=${opa9_Interannual_List_jobsbc[$i]} 
    85       # download (year-1) if it is first year and first month of run 
    86       if [ X${year} = X${InitYear} ] ; then   
    87             if [ X${Period} = X1 ] ; then 
     86      if [ X${year} = X${PeriodInitYear} ] ; then   
    8887                           if [ ${month} -eq 01 ] ; then 
    89                   # if year-1 does not exist create a dummy file (NEMO will use same year) 
     88                  # if year-1 does not exist we copy year in (year-1) 
    9089                  eval jobsbc_file_ym1=${R_BC}/OCE/${config_UserChoices_TagName}/${opa9_UserChoices_OPA_version}/${file}_$(( year - 1 )).nc 
    9190                  if  [ ! -f ${jobsbc_file_ym1} ] ; then 
     
    9796                  fi 
    9897 
    99                               IGCM_sys_Get ${jobsbc_file_ym1} ${runsbc_file_ym1} 
     98                            IGCM_sys_Get ${jobsbc_file_ym1} ${runsbc_file_ym1} 
    10099                           fi 
    101                     fi 
    102100      fi 
    103101       
     
    111109       
    112110      # download (year+1) if it is last year of run 
    113       if [ X${year} = X${final_year} ] ; then    
     111      if [ X${year} = X${PeriodFinalYear} ] ; then     
    114112    
    115113          eval jobsbc_file_yp1=${R_BC}/OCE/${config_UserChoices_TagName}/${opa9_UserChoices_OPA_version}/${file}_$(( year + 1 )).nc 
     
    118116          if  [ ! -f ${runsbc_file_yp1} ] ; then 
    119117          
    120               # if year+1 does not exist create a dummy file (NEMO will use same year) 
     118              # if year+1 does not exist we copy year in (year+1) 
    121119         if  [ ! -f ${jobsbc_file_yp1} ] ; then 
    122120             eval jobsbc_file_yp1=${R_BC}/OCE/${config_UserChoices_TagName}/${opa9_UserChoices_OPA_version}/${file}_${year}.nc 
     
    138136       (( i = 0 )) 
    139137   done 
     138 
    140139    # End interannual 
    141140    elif [ X${opa9_UserChoices_Interannual_Run} = Xn ] ; then 
     
    258257 
    259258 
     259    # update iodef.xml 
     260    
     261  if ( [ "${CumulPeriod}" -eq 1 ] || [ "${CumulPeriod}" -eq 6 ] ) ; then 
     262 
     263   sed -e "s/<group\ id=\"1m\"\ output_freq=\"-1\"\ output_level=\"10\"\ enabled=\".FALSE.\">/<group\ id=\"1m\"\ output_freq=\"-1\"\ output_level=\"10\"\ enabled=\".TRUE.\">/" \ 
     264           iodef.xml > iodef.xml.tmp 
     265       IGCM_sys_Mv iodef.xml.tmp iodef.xml 
     266  fi   
     267    
     268 
    260269    # update xmlio_server.def 
    261270 
Note: See TracChangeset for help on using the changeset viewer.