Show
Ignore:
Timestamp:
02/28/08 12:11:52 (9 months ago)
Author:
peter
Message:

source/path.h
source/helike_einsta.cpp
source/service.cpp
source/parse_state.cpp
source/parse_table.cpp
source/radius_increment.cpp
source/parse_init.cpp
source/grains_mie.cpp
source/cddefines.h
source/cdgetlinelist.cpp
source/cpu.h
source/punch_opacity.cpp
source/cont_setintensity.cpp
source/cont_createmesh.cpp
source/iso_radiative_recomb.cpp
source/parse_punch.cpp
source/mole_h2_io.cpp
source/optimize_do.cpp
source/atom_fe2ovr.cpp
source/optimize_phymir.cpp
source/ion_recomb_Badnell.cpp
source/nemala.cpp
source/temp_change.cpp
source/atmdat_readin.cpp
source/mole_h2_coll.cpp
source/atmdat_chianti.cpp
source/helike_cs.cpp
source/atmdat_lamda.cpp
source/cont_ffun.cpp
source/parse_print.cpp
source/prt_lines_helium.cpp
source/cpu.cpp
source/atom_feii.cpp
source/stars.cpp
source/cont_createpointers.cpp
source/grains.cpp
source/state.cpp
source/atom_hyperfine.cpp
source/h2_priv.h
source/cddrive.h
source/atmdat_adfa.cpp
source/parse_optimize.cpp

  • Enable using multiple paths on the Cloudy data search path.
  • open_data() is the new routine to open a file anywhere on the search path.
    It is now used everywhere, except in debugging code.
  • There is no longer any restriction on the length of a path or filename.
  • Some error messages may have altered (but should be equally informative),
    but apart from that the functionality of the code should be unchanged.
  • Split(), FindAndReplace?(), FindAndErase?() are new routines for manipulating
    C++ strings.
  • The routine path_not_set() has been removed since it has been integrated
    into open_data().
  • The method cpu.DataPath?() has been removed since it has been integrated
    into open_data().
  • The method cpu.printDataPath() has been added to print the entire search
    path to ioQQQ.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/atmdat_chianti.cpp

    r1771 r1815  
    3131 
    3232        char chLine[FILENAME_PATH_LENGTH_2] , 
    33                 chFilename[FILENAME_PATH_LENGTH_2], 
    3433                chEnFilename[FILENAME_PATH_LENGTH_2], 
    3534                chTraFilename[FILENAME_PATH_LENGTH_2], 
     
    5453        /*For the CHIANTI DATABASE*/ 
    5554        /*First Opening the energy levels file*/ 
    56         strcpy( chFilename , Species[intNS].chptrSpName );                       
    57         strcat( chFilename , ".elvlc"); 
    58         uncaps( chFilename ); 
    59         strcpy( chEnFilename , cpu.DataPath() ); 
    60         strcat( chEnFilename , chFilename ); 
    61         if(DEBUGSTATE) 
    62                 printf("The data file is %s \n",chFilename); 
     55        strcpy( chEnFilename , Species[intNS].chptrSpName );                     
     56        strcat( chEnFilename , ".elvlc"); 
     57        uncaps( chEnFilename ); 
     58        if(DEBUGSTATE) 
     59                printf("The data file is %s \n",chEnFilename); 
    6360 
    6461        /*Open the files*/ 
    6562        if( trace.lgTrace ) 
    66                 fprintf( ioQQQ," moldat_readin opening %s:",chFilename); 
    67  
    68         if( ( atmolLevDATA = fopen( chEnFilename , "r" ) ) == NULL ) 
    69         { 
    70                 fprintf( ioQQQ, " moldat_readin could not open %s \n",chFilename ); 
    71                 fprintf( ioQQQ, " even tried path\n" ); 
    72  
    73                 fprintf( ioQQQ, " moldat_readin could not open %s \n",chFilename); 
    74                 fprintf( ioQQQ, " path is ==%s==\n",cpu.DataPath() ); 
    75                 fprintf( ioQQQ, " final path is ==%s==\n",chEnFilename ); 
    76  
    77                 /* make announcement that path probably not set */ 
    78                 path_not_set(); 
    79  
    80                 cdEXIT(EXIT_FAILURE); 
    81         } 
    82  
    83         if( read_whole_line( chLine , (int)sizeof(chLine) , atmolLevDATA ) == NULL ) 
    84         { 
    85                 fprintf( ioQQQ, " moldat_readin could not read first line of %s.\n",chFilename); 
    86                 cdEXIT(EXIT_FAILURE); 
    87         } 
    88         /*Rewind the file*/ 
    89         if( fseek( atmolLevDATA , 0 , SEEK_SET ) != 0 ) 
    90         { 
    91                 fprintf( ioQQQ, " moldat_readin could not rewind %s.\n",chFilename); 
    92                 cdEXIT(EXIT_FAILURE); 
    93         } 
     63                fprintf( ioQQQ," moldat_readin opening %s:",chEnFilename); 
     64 
     65        atmolLevDATA = open_data( chEnFilename, "r" ); 
     66 
    9467        /*Second:Opening the transition probabilities file*/ 
    95         strcpy( chFilename , Species[intNS].chptrSpName );                       
    96         strcat( chFilename , ".wgfa"); 
    97         uncaps( chFilename ); 
    98         strcpy( chTraFilename , cpu.DataPath() ); 
    99         strcat( chTraFilename , chFilename ); 
    100         if(DEBUGSTATE) 
    101                 printf("The data file is %s \n",chFilename); 
     68        strcpy( chTraFilename , Species[intNS].chptrSpName );                    
     69        strcat( chTraFilename , ".wgfa"); 
     70        uncaps( chTraFilename ); 
     71        if(DEBUGSTATE) 
     72                printf("The data file is %s \n",chTraFilename); 
    10273 
    10374        /*Open the files*/ 
    10475        if( trace.lgTrace ) 
    105                 fprintf( ioQQQ," moldat_readin opening %s:",chFilename); 
    106  
    107         if( ( atmolTraDATA = fopen( chTraFilename , "r" ) ) == NULL ) 
    108         { 
    109                 fprintf( ioQQQ, " moldat_readin could not open %s \n",chFilename ); 
    110                 fprintf( ioQQQ, " even tried path\n" ); 
    111  
    112                 fprintf( ioQQQ, " moldat_readin could not open %s \n",chFilename); 
    113                 fprintf( ioQQQ, " path is ==%s==\n",cpu.DataPath() ); 
    114                 fprintf( ioQQQ, " final path is ==%s==\n",chTraFilename ); 
    115  
    116                 /* make announcement that path probably not set */ 
    117                 path_not_set(); 
    118  
    119                 cdEXIT(EXIT_FAILURE); 
    120         } 
    121  
    122         if( read_whole_line( chLine , (int)sizeof(chLine) , atmolTraDATA ) == NULL ) 
    123         { 
    124                 fprintf( ioQQQ, " moldat_readin could not read first line of %s.\n",chFilename); 
    125                 cdEXIT(EXIT_FAILURE); 
    126         } 
    127         /*Rewind the file*/ 
    128         if( fseek( atmolTraDATA , 0 , SEEK_SET ) != 0 ) 
    129         { 
    130                 fprintf( ioQQQ, " moldat_readin could not rewind %s.\n",chFilename); 
    131                 cdEXIT(EXIT_FAILURE); 
    132         } 
     76                fprintf( ioQQQ," moldat_readin opening %s:",chTraFilename); 
     77 
     78        atmolTraDATA = open_data( chTraFilename, "r" ); 
     79 
    13380        /*Third: Opening the electron collision data*/ 
    134         strcpy( chFilename , Species[intNS].chptrSpName );                       
    135         strcat( chFilename , ".splups"); 
    136         uncaps( chFilename ); 
    137         strcpy( chEleColFilename , cpu.DataPath() ); 
    138         strcat( chEleColFilename , chFilename ); 
    139         if(DEBUGSTATE) 
    140                 printf("The data file is %s \n",chFilename); 
     81        strcpy( chEleColFilename , Species[intNS].chptrSpName );                         
     82        strcat( chEleColFilename , ".splups"); 
     83        uncaps( chEleColFilename ); 
     84        if(DEBUGSTATE) 
     85                printf("The data file is %s \n",chEleColFilename); 
    14186        /*Open the files*/ 
    14287        if( trace.lgTrace ) 
    143                 fprintf( ioQQQ," moldat_readin opening %s:",chFilename); 
    144         if( ( atmolEleColDATA = fopen( chEleColFilename , "r" ) ) == NULL ) 
    145         { 
    146                 fprintf( ioQQQ, " moldat_readin could not open %s \n",chFilename ); 
    147                 fprintf( ioQQQ, " even tried path\n" ); 
    148  
    149                 fprintf( ioQQQ, " moldat_readin could not open %s \n",chFilename); 
    150                 fprintf( ioQQQ, " path is ==%s==\n",cpu.DataPath() ); 
    151                 fprintf( ioQQQ, " final path is ==%s==\n",chEleColFilename ); 
    152  
    153                 /* make announcement that path probably not set */ 
    154                 path_not_set(); 
    155  
    156                 cdEXIT(EXIT_FAILURE); 
    157         } 
    158  
    159         if( read_whole_line( chLine , (int)sizeof(chLine) , atmolEleColDATA ) == NULL ) 
    160         { 
    161                 fprintf( ioQQQ, " moldat_readin could not read first line of %s.\n",chFilename); 
    162                 cdEXIT(EXIT_FAILURE); 
    163         } 
    164         /*Rewind the electron collision data file*/ 
    165         if( fseek(atmolEleColDATA , 0 , SEEK_SET ) != 0 ) 
    166         { 
    167                 fprintf( ioQQQ, " moldat_readin could not rewind %s.\n",chFilename); 
    168                 cdEXIT(EXIT_FAILURE); 
    169         } 
     88                fprintf( ioQQQ," moldat_readin opening %s:",chEleColFilename); 
     89 
     90        atmolEleColDATA = open_data( chEleColFilename, "r" ); 
     91 
    17092        /*Fourth: Opening the proton collision data*/ 
    171         strcpy( chFilename , Species[intNS].chptrSpName );                       
    172         strcat( chFilename , ".psplups"); 
    173         uncaps( chFilename ); 
    174         strcpy( chProColFilename , cpu.DataPath() ); 
    175         strcat( chProColFilename , chFilename ); 
    176         if(DEBUGSTATE) 
    177                 printf("The data file is %s \n",chFilename); 
     93        strcpy( chProColFilename , Species[intNS].chptrSpName );                         
     94        strcat( chProColFilename , ".psplups"); 
     95        uncaps( chProColFilename ); 
     96        if(DEBUGSTATE) 
     97                printf("The data file is %s \n",chProColFilename); 
    17898        /*Open the files*/ 
    17999        if( trace.lgTrace ) 
    180                 fprintf( ioQQQ," moldat_readin opening %s:",chFilename); 
     100                fprintf( ioQQQ," moldat_readin opening %s:",chProColFilename); 
    181101 
    182102        nMolLevs = 0;