Changeset 59 for trunk


Ignore:
Timestamp:
02/18/09 17:42:07 (15 years ago)
Author:
pinsard
Message:

add some try/catch on opening file for reading

Location:
trunk/src
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SIMULS_IRCAAM/carte_eof_df.m

    r56 r59  
    124124 
    125125fullfilename=[IRCAAM_ID,'eof_',ircaam_dataset,'_', simulation, '_', df, '.mat']; 
    126 status=load(fullfilename,'C','L'); 
     126try  
     127 status=load(fullfilename,'C','L'); 
     128catch 
     129 error('eee : File %s not found\n', fullfilename); 
     130end 
     131 
    127132clear fullfilename; 
    128133 
  • trunk/src/SIMULS_IRCAAM/eof_df.m

    r56 r59  
    5252% 
    5353% $Id$ 
     54% 
     55% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
     56% 
     57%   * add try/catch on opening file for reading 
    5458% 
    5559% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    112116close all; 
    113117 
    114 fullfilename=[IRCAAM_ID,'olrf_',ircaam_dataset,'_', simulation, '_', df, '.80.dat']; fid=fopen(fullfilename,'r'); 
     118fullfilename=[IRCAAM_ID,'olrf_',ircaam_dataset,'_', simulation, '_', df, '.80.dat'];  
     119try 
     120 fid=fopen(fullfilename,'r'); 
     121catch 
     122 error('eee : File %s not found\n', fullfilename); 
     123end 
    115124clear fullfilename; 
    116125siz=24*15*3538; 
  • trunk/src/SIMULS_IRCAAM/prepare_olr_filtre_simulation.m

    r58 r59  
    8181% force output to be written using IEEE floating point with little-endian byte  
    8282% order 
    83 machineformat='l'  
     83machineformat='l'; 
    8484 
    8585if nargin==2 
  • trunk/src/SIMULS_IRCAAM/time_serie_eof_df.m

    r56 r59  
    5858% 
    5959% $Id$ 
     60% 
     61% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
     62% 
     63%   * add try/catch on opening file for reading 
    6064% 
    6165% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    121125 
    122126fullfilename=[IRCAAM_ID,'eof_',ircaam_dataset,'_', simulation, '_', df, '.mat']; 
    123 status=load(fullfilename,'C','olr'); 
     127try 
     128 status=load(fullfilename,'C','olr'); 
     129catch 
     130 error('eee : File %s not found\n', fullfilename); 
     131end 
     132 
    124133clear fullfilename; 
    125134 
  • trunk/src/ircaam_profile.sh

    r55 r59  
    9999# $Id$ 
    100100# 
     101# - fplod 2009-02-17T11:59:35Z aedon.locean-ipsl.upmc.fr (Darwin) 
     102# 
     103#  * more unset statements 
     104# 
    101105# - fplod 2009-02-04T13:35:30Z zeus.locean-ipsl.upmc.fr (Linux) 
    102106# 
     
    121125 ;; 
    122126esac 
     127unset system 
    123128# 
    124129# as this script might be launch in .profile, command is forced. 
     
    154159done 
    155160# 
     161unset usage 
     162# 
    156163# check for ${directory} 
    157164if [ ! -d ${directory} ] 
     
    169176# 
    170177set -u 
    171 system=$(uname) 
    172 case "${system}" in 
    173 IRIX64) 
    174   echo " www : no specific posix checking" 
    175 ;; 
    176 *) 
    177   set -o posix 
    178 ;; 
    179 esac 
    180178# 
    181179IRCAAM=${directory} 
    182180export IRCAAM 
     181unset directory 
    183182# 
    184183# add IRCAAM tools to PATH 
     
    194193   echo "${command} : iii : ${IRCAAM}/ already in \${PATH}" 
    195194fi 
     195unset test_path 
    196196# 
    197197# add IRCAAM manuals to MANPATH 
     
    207207   echo "${command} : iii : ${IRCAAM}/man/ already in \${MANPATH}" 
    208208fi 
     209unset test_manpath 
    209210# 
    210211# add ${IRCAAM}/../bin tools to PATH 
     
    220221   echo "${command} : iii : ${IRCAAM}/../bin/ already in \${PATH}" 
    221222fi 
     223unset test_path 
    222224# 
    223225IRCAAM_LOG=${tempdir} 
    224226export IRCAAM_LOG 
     227unset tempdir 
    225228if [ ! -d ${IRCAAM_LOG} ] 
    226229then 
     
    248251IRCAAM_ID=${indir} 
    249252export IRCAAM_ID 
     253unset indir 
    250254if [ ! -d ${IRCAAM_ID} ] 
    251255then 
     
    262266IRCAAM_OD=${outdir} 
    263267export IRCAAM_OD 
     268unset outdir 
    264269if [ ! -d ${IRCAAM_OD} ] 
    265270then 
     
    279284fi 
    280285# 
     286# 
     287unset command 
     288# 
    281289# end 
    282290# nb : no exit because this file should be launched by login process 
  • trunk/src/makefile

    r58 r59  
    5151-Wextra -Wunused -Wuninitialized -Wprecision-loss \ 
    5252-ftrapv -fexceptions -std=f2003 -fno-static \ 
     53-freal=nan \ 
    5354-fendian=little \ 
    5455-pedantic-errors 
  • trunk/src/mode_sahelien/carte_eof234_jjas_df.m

    r56 r59  
    6464% 
    6565% $Id$ 
     66% 
     67% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
     68% 
     69%   * add try/catch on opening file for reading 
    6670% 
    6771% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    104108 
    105109fullfilename=[IRCAAM_ID,'eof_',df,'_jjas.mat']; 
    106 status=load(fullfilename,'C','L'); 
     110try 
     111 status=load(fullfilename,'C','L'); 
     112catch 
     113 error('eee : File %s not found\n', fullfilename); 
     114end 
     115 
    107116clear fullfilename; 
    108117 
  • trunk/src/mode_sahelien/carte_eof_ER_jjas_df.m

    r56 r59  
    6363% 
    6464% $Id$ 
     65% 
     66% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
     67% 
     68%   * add try/catch on opening file for reading 
    6569% 
    6670% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    99103 
    100104fullfilename=[IRCAAM_ID,'eof_rossby_jjas_2006_',df,'.mat']; 
    101 status=load(fullfilename,'C','L'); 
     105try 
     106 status=load(fullfilename,'C','L'); 
     107catch 
     108 error('eee : File %s not found\n', fullfilename); 
     109end 
     110 
    102111clear fullfilename; 
    103112 
  • trunk/src/mode_sahelien/composite_olr_eof_df.m

    r56 r59  
    5353% improve description 
    5454% 
    55 % improve file pb 
     55% improve file pb especialy ncload 
    5656% 
    5757% use return function 
     
    6565% 
    6666% $Id$ 
     67% 
     68% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
     69% 
     70%   * add try/catch on opening file for reading 
    6771% 
    6872% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    115119fullfilename=[IRCAAM_ID,'olr.day.mean.nc']; 
    116120ncload(fullfilename); 
     121 
    117122clear fullfilename; 
    118123 
     
    256261 
    257262fullfilename=[IRCAAM_ID,'eof',int2str(eof_num),'_',df,'.txt']; 
    258 status=load(fullfilename); 
     263try 
     264 status=load(fullfilename); 
     265catch 
     266 error('eee : File %s not found\n', fullfilename); 
     267end 
     268 
    259269clear fullfilename; 
    260270 
     
    454464 
    455465figure(1); 
    456 fullfilename=[IRCAAM_OD,'composite_olr_eof',int2str(eof_num),'_', df, _part1.eps']; 
     466fullfilename=[IRCAAM_OD,'composite_olr_eof',int2str(eof_num),'_', df, '_part1.eps']; 
    457467print('-depsc2',fullfilename); 
    458468clear fullfilename; 
  • trunk/src/mode_sahelien/composite_olr_phase_num.m

    r44 r59  
    5454% improve description 
    5555% 
    56 % improve file pb 
     56% improve file pb especialy ncload 
    5757% 
    5858% use return function 
     
    6868% 
    6969% $Id$ 
     70% 
     71% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
     72% 
     73%   * add try/catch on opening file for reading 
    7074% 
    7175% - fplod 2009-01-28T10:38:44Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    97101fullfilename=[IRCAAM_ID,'olr.day.mean.nc']; 
    98102ncload(fullfilename); 
     103 
    99104clear fullfilename; 
    100105 
     
    245250 
    246251fullfilename=[IRCAAM_OD,'phase',int2str(phase_num),'.txt']; 
    247 status=load(fullfilename); 
     252try 
     253 status=load(fullfilename); 
     254catch 
     255 error('eee : File %s not found\n', fullfilename); 
     256end 
     257 
    248258clear fullfilename; 
    249259 
  • trunk/src/mode_sahelien/olr_eof_jjas2006_rossby_df.m

    r56 r59  
    5858% $Id$ 
    5959% 
     60% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
     61% 
     62%   * add try/catch on opening file for reading 
    6063% 
    6164% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    97100 
    98101fullfilename=[IRCAAM_ID,'olrfilernew7900jjas_',df,'.dat']; 
    99 fid=fopen(fullfilename); 
     102try 
     103 fid=fopen(fullfilename); 
     104catch 
     105 error('eee : File %s not found\n', fullfilename); 
     106end 
     107 
    100108clear fullfilename; 
    101109 
  • trunk/src/mode_sahelien/reconstitution_ER_rossby_df.m

    r56 r59  
    6060% $Id$ 
    6161% 
     62% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
     63% 
     64%   * add try/catch on opening file for reading 
    6265% 
    6366% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    99102 
    100103fullfilename=[IRCAAM_ID,'eof_rossby_jjas_2006_',df,'.mat']; 
    101 status=load(fullfilename,'C','olr'); 
     104try 
     105 status=load(fullfilename,'C','olr'); 
     106catch 
     107 error('eee : File %s not found\n', fullfilename); 
     108end 
     109 
    102110clear fullfilename; 
    103111 
  • trunk/src/mode_sahelien/time_serie_ER_rossby_df.m

    r56 r59  
    6060% $Id$ 
    6161% 
     62% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
     63% 
     64%   * add try/catch on opening file for reading 
    6265% 
    6366% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    9699 
    97100fullfilename=[IRCAAM_ID,'eof_rossby_jjas_2006_',df,'.mat']; 
    98 status=load(fullfilename,'C','olr'); 
     101try 
     102 status=load(fullfilename,'C','olr'); 
     103catch 
     104 error('eee : File %s not found\n', fullfilename); 
     105end 
     106 
    99107clear fullfilename; 
    100108C=status.C; 
  • trunk/src/mode_sahelien/time_serie_ER_rossby_df_complet.m

    r56 r59  
    5252% ========== 
    5353% 
     54% $Id$ 
     55% 
     56% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
     57% 
     58%   * add try/catch on opening file for reading 
    5459% 
    5560% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    97102 
    98103fullfilename=[IRCAAM_ID,'eof_rossby_jjas_2006_',df,'.mat']; 
    99 status=load(fullfilename,'C','olr'); 
     104try 
     105 status=load(fullfilename,'C','olr'); 
     106catch 
     107 error('eee : File %s not found\n', fullfilename); 
     108end 
     109 
    100110clear fullfilename; 
    101111C=status.C; 
  • trunk/src/mode_sahelien/time_serie_histog_phase_num.m

    r42 r59  
    5454% 
    5555% $Id$ 
     56% 
     57% 
     58% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
     59% 
     60%   * add try/catch on opening file for reading 
    5661% 
    5762% - fplod 2009-01-28T09:01:45Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    8186 
    8287fullfilename=[IRCAAM_ID,'phase',int2str(phase_num),'.txt']; 
    83 status=load(fullfilename); 
     88try 
     89 status=load(fullfilename); 
     90catch 
     91 error('eee : File %s not found\n', fullfilename); 
     92end 
     93 
    8494clear fullfilename; 
    8595 
  • trunk/src/mode_sahelien/time_serie_jjas_df.m

    r56 r59  
    5959% $Id$ 
    6060% 
     61% - fplod 2009-02-11T16:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
     62% 
     63%   * add try/catch on opening file for reading 
     64% 
    6165% - fplod 2009-02-10T14:28:00Z aedon.locean-ipsl.upmc.fr (Darwin) 
    6266% 
     
    9498 
    9599fullfilename=[IRCAAM_ID,'eof_', df, '_jjas.mat']; 
    96 status=load(fullfilename); 
     100try 
     101 status=load(fullfilename); 
     102catch 
     103 error('eee : File %s not found\n', fullfilename); 
     104end 
     105 
    97106clear fullfilename; 
     107 
    98108C=status.C; 
    99109olr=status.olr; 
Note: See TracChangeset for help on using the changeset viewer.