Changeset 1711

Show
Ignore:
Timestamp:
12/21/07 20:19:01 (7 months ago)
Author:
peter
Message:

source/parse_table.cpp:
source/zero.cpp:
source/cont_createmesh.cpp:
source/rfield.h:
source/ion_recomb_Badnell.cpp:
source/atmdat_chianti.cpp:
source/cont_ffun.cpp:
source/atom_feii.cpp:

Bug-fix: close more files that were overlooked.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/source/atmdat_chianti.cpp

    r1700 r1711  
    686686        free( atmolStatesEnergy ); 
    687687        free( intNewIndex ); 
     688 
     689        fclose( atmolLevDATA ); 
     690        fclose( atmolTraDATA ); 
     691        fclose( atmolEleColDATA ); 
     692 
    688693        return; 
    689694} 
  • trunk/source/atom_feii.cpp

    r1698 r1711  
    679679        } 
    680680 
     681        fclose( ioDATA ); 
     682 
    681683        /*generate needed opacity data for the large FeII atom */ 
    682684 
  • trunk/source/cont_createmesh.cpp

    r1557 r1711  
    771771        } 
    772772 
     773        fclose( ioDATA ); 
     774 
    773775        /* now verify continuum grid is ok - first are all values but the last positive? */ 
    774776        for( i=1; i<continuum.nStoredBands-1; ++i ) 
  • trunk/source/cont_ffun.cpp

    r1557 r1711  
    1313 
    1414/*ReadTable called by TABLE READ to read in continuum from PUNCH TRANSMITTED CONTINUUM */ 
    15 STATIC void ReadTable(FILE * io); 
     15STATIC void ReadTable(const string& fnam); 
    1616 
    1717/* evaluate sum of all individual continua at one energy, return is 
     
    357357 
    358358/*ReadTable called by TABLE READ to read in continuum from PUNCH TRANSMITTED CONTINUUM */ 
    359 STATIC void ReadTable(FILE * io
     359STATIC void ReadTable(const string& fnam
    360360{ 
    361361        char chLine[INPUT_LINE_LENGTH]; 
     
    364364        double Differ,  
    365365          EnerLast; 
     366        FILE *io; 
    366367 
    367368        DEBUG_ENTRY( "ReadTable()" ); 
    368369 
    369370        /* make sure the file handle points somewhere */ 
    370         ASSERT( io != NULL ); 
     371        if( NULL == ( io = fopen(fnam.c_str(),"r") ) ) 
     372        { 
     373                fprintf( ioQQQ, " I could not open file %s.\n", fnam.c_str() ); 
     374                puts( "[Stop in ReadTable]" ); 
     375                cdEXIT(EXIT_FAILURE); 
     376        } 
    371377 
    372378        /* read in first line of header */ 
  • trunk/source/ion_recomb_Badnell.cpp

    r1679 r1711  
    812812        } 
    813813 
     814        fclose( ioDATA ); 
     815 
    814816        /*output coefficients for defined values for testing */ 
    815817#       ifdef PRINT_DR 
  • trunk/source/parse_table.cpp

    r1557 r1711  
    10581058                } 
    10591059 
    1060                 /* now open this file */ 
    1061                 if( NULL==(rfield.ioTableRead[rfield.nspec]=fopen( chFile,"r"))) 
    1062                 { 
    1063                         fprintf( ioQQQ, " I could not open file %s.\n",chFile ); 
    1064                         puts( "[Stop in ParseTable]" ); 
    1065                         cdEXIT(EXIT_FAILURE); 
    1066                 } 
     1060                /* store file name for later reading */ 
     1061                rfield.ioTableRead[rfield.nspec] = string( chFile ); 
    10671062 
    10681063                /* set flag saying really just read in continuum exactly as punched */ 
     
    10791074                ++rfield.nspec; 
    10801075                return; 
    1081  
    10821076        } 
    10831077 
  • trunk/source/rfield.h

    r1403 r1711  
    318318 
    319319        /** pointer to file for table read command */ 
    320         FILE *ioTableRead[LIMSPC]; 
     320        string ioTableRead[LIMSPC]; 
    321321 
    322322        /** these are total numbers of photons over various energy ranges */ 
  • trunk/source/zero.cpp

    r1703 r1711  
    12641264                rfield.range[i][0] = HIONPOT; 
    12651265                rfield.range[i][1] = rfield.egamry; 
    1266                 rfield.ioTableRead[i] = NULL
     1266                rfield.ioTableRead[i].clear()
    12671267        } 
    12681268        rfield.comtot = 0.;