Changeset 1144

Show
Ignore:
Timestamp:
05/21/07 20:25:16 (18 months ago)
Author:
gary
Message:

most files, remove dead code, correct comments

init_coreload.cpp - start of reorganizing punch commands

Location:
trunk/source
Files:
1 added
13 modified
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/source/date.h

    r1122 r1144  
    99#define YEAR    107 
    1010#define MONTH   4 
    11 #define DAY     15 
     11#define DAY     21 
  • trunk/source/grid_do.cpp

    r1122 r1144  
    1515#include "grid.h" 
    1616 
    17 /*grid_do called by cdDrive, this returns 0 if things went ok, 1 for disaster */ 
     17/*grid_do called by cdDrive, calls gridXspec, returns 0 if ok, 1 for disaster */ 
    1818bool grid_do(void) 
    1919{ 
     
    398398                /* though a page eject */ 
    399399                fprintf( ioQQQ, "\f" ); 
    400                  
    401                 /* 
    402                 called.lgTalk = true; 
    403                 called.lgTalkIsOK = true; 
    404                 prt.lgFaintOn = true; 
    405                 */ 
    406                 /* flag that punch files should be opened this time */ 
    407                 /* punch.lgOpenUnits = true; */ 
    408400        } 
    409401        else 
  • trunk/source/grid_xspec.cpp

    r849 r1144  
    1818/*static void gridFunc(float param[] );*/ 
    1919 
    20 /*gridXspec handles all grid calculations, called by griddo */ 
     20/*gridXspec handles all grid calculations, called by grid_do */ 
    2121void gridXspec(float xc[], long int nInterpVars) 
    2222{ 
  • trunk/source/init_coreload.cpp

    r1121 r1144  
    22* For conditions of distribution and use, see copyright notice in license.txt */ 
    33/* initialization routines for Cloudy 
    4 *init_coreload - one time initialization, called from cdInit 
     4*InitCoreload - one time initialization, called from cdInit 
    55*/ 
    66#include "cddefines.h" 
     
    1212#include "path.h" 
    1313 
    14 /** one time initialization of core load, called from cdInit */ 
    15 void init_coreload( void ) 
     14/** one time initialization of core load, called from cdInit before first 
     15 * look at input commands */ 
     16void InitCoreload( void ) 
    1617{ 
    1718        static int nCalled=0; 
    1819        long int nelem; 
    1920 
    20         DEBUG_ENTRY( "init_coreload()" ); 
     21        DEBUG_ENTRY( "InitCoreload()" ); 
    2122 
    2223        /* sanity check */ 
     24        if( nCalled ) 
     25        { 
     26                /* return since already called */ 
     27                DEBUG_EXIT( "InitCoreload()" ); 
     28                return; 
     29        } 
    2330        ++nCalled; 
    24         ASSERT( nCalled==1 ); 
    25  
    26         /* set ioQQQ to standard output */ 
    27         ioQQQ = stdout; 
    28  
    29         /* set ioStdin to standard input, will get line images from here */ 
    30         ioStdin = stdin; 
    31  
    32         /* set ioPrnErr to stderr */ 
    33         ioPrnErr = stderr; 
    34  
    35         /* but don't want to usually do this */ 
    36         lgPrnErr = false; 
    3731 
    3832        strncpy( chOptimFileName , "optimal.in" , sizeof( chOptimFileName ) ); 
     
    269263        } 
    270264 
    271         DEBUG_EXIT( "init_coreload()" ); 
     265        DEBUG_EXIT( "InitCoreload()" ); 
    272266        return; 
    273267} 
  • trunk/source/iter_startend.cpp

    r1124 r1144  
    574574         * as now coded this memory is freed and reallocated on every iteration. 
    575575         * this allows some details of line emission to change for last iteration, 
    576          * but may not really be necessary  
    577         if( LineDSv!=NULL ) 
     576         * but may not really be necessary */ 
     577 
     578        if( LineSv!=NULL ) 
    578579        { 
    579580                if( trace.lgTrace ) 
    580581                { 
    581                         fprintf( ioQQQ, "IterStart has freed LindDSv \n" ); 
    582                 } 
    583                 free(LineDSv ); 
    584                 LineDSv = NULL; 
    585         }*/ 
    586  
    587         if( LineSv!=NULL ) 
    588         { 
    589                 if( trace.lgTrace ) 
    590                 { 
    591582                        fprintf( ioQQQ, "IterStart has freed LindSv \n" ); 
    592583                } 
    593                 free(LineSv ); 
     584                free( LineSv ); 
    594585                LineSv = NULL; 
    595586        } 
    596  
    597         /* >>chng 06 mar 09 rm this 
    598          * only allocate space if this sum is positive - will be zero if no grains present 
    599         if( LineSave.nsum > 0 ) 
    600         { 
    601                 LineDSv = (LinDstSv*)MALLOC((unsigned)LineSave.nsum*sizeof( LinDstSv ) ); 
    602         } */ 
    603587 
    604588        /* this is the large main line array */ 
  • trunk/source/mole_h2.cpp

    r1128 r1144  
    37413741                old_HeatH2Dexc = hmi.HeatH2Dexc_BigH2; 
    37423742        } 
     3743        /*fprintf(ioQQQ,"DEBUG H2 vib deex Te %.2e heat %.2e\n",  
     3744                phycon.te, hmi.HeatH2Dexc_BigH2);*/ 
    37433745        if( mole.nH2_TRACE >= mole.nH2_trace_full )  
    37443746                fprintf(ioQQQ, 
  • trunk/source/parse_punch.cpp

    r1123 r1144  
    10841084                        } 
    10851085                } 
    1086  
    10871086        } 
    10881087 
  • trunk/source/parse_trace.cpp

    r759 r1144  
    4444        } 
    4545 
    46         /* >>chng 02 jun 14, change to set of if else rather than simply series of if  
    47          * makes it possible to use keywords on converge without triggering other trace */ 
    48  
    49         /* >>chng 05 apr 13, changed all from else if to if, so that more than one 
    50          * keyword can be recognized on each command line */ 
    5146        /* trace convergence is a special command,  
    5247         * only convergence loops, not full trace */ 
     
    196191                /* this says which element, on the C scale (H=0), to trace */ 
    197192                trace.ipIsoTrace[ipH_LIKE] = 0; 
    198  
    199193        } 
    200194 
  • trunk/source/pressure_total.cpp

    r1113 r1144  
    172172        dense.xMassDensity = (float)(dense.wmole*ATOMIC_MASS_UNIT*dense.pden); 
    173173         
    174         /*>>chng 04 may 25, introduce folling test on xMassDensity0  
     174        /*>>chng 04 may 25, introduce following test on xMassDensity0  
    175175         * WJH 21 may 04, this is the mass density that corresponds to the hden  
    176176         * specified in the init file. It is used to calculate the mass flux in the  
     
    282282                                                TotalInsanity(); 
    283283                                        /* >>chng 01 jan 08, do not include highest level since maser can occur, 
    284                                         * and pops are set to small number in this case */ 
     284                                         * and pops are set to small number in this case */ 
    285285                                        /* >>chng 06 aug 17, should go to numLevels_local instead of _max. */ 
    286286                                        for( ipLo=0; ipLo < (iso.numLevels_local[ipISO][nelem] - 2); ipLo++ )  
     
    330330                                                        /* >>chng 04 may 13, add Aul > 10 to prevent forbidden lines with 
    331331                                                         * tiny optical depths - taumin doubled - occur, but still opt thin  
    332                                                          * sympton was very large radiation pressure from Paschen beta */ 
     332                                                         * symptom was very large radiation pressure from Paschen beta */ 
    333333                                                        /* >>chng 04 aug 28, add test on ipCont being positive to skip bogus lines*/ 
    334                                                         /*NB - this code must be kep parrallel with code in prt_linepres */ 
     334                                                        /*NB - this code must be keep parallel with code in prt_linepres */ 
    335335                                                        if( Transitions[ipISO][nelem][ipHi][ipLo].Emis.ipCont > 0 && 
    336336                                                                Transitions[ipISO][nelem][ipHi][ipLo].Emis.Aul > 10. && 
    337337                                                            Transitions[ipISO][nelem][ipHi][ipLo].Hi.Pop > smallfloat && 
    338338                                                                /* >>chng 04 may 21, change PopOpc to poplo as defined above, 
    339                                                                  * to not overcount 23P of He */ 
     339                                                                 * to not over count 23P of He */ 
    340340                                                                /*Transitions[ipISO][nelem][ipHi][ipLo].PopOpc > smallfloat &&*/ 
    341341                                                                poplo > smallfloat && 
     
    351351                                                                        StatesElem[ipISO][nelem][ipHi].g)/ 
    352352                                                                        /* >>chng 04 may 21, change PopOpc to poplo as defined above, 
    353                                                                          * to not overcount 23P of He */ 
     353                                                                         * to not over count 23P of He */ 
    354354                                                                        /*(Transitions[ipISO][nelem][ipHi][ipLo].PopOpc/ */ 
    355355                                                                        (poplo/ 
     
    709709        { 
    710710                /* this branch is time dependent AND constant density */ 
    711                 /*fprintf(ioQQQ,"DEBUG enthalph HIT1\n");*/ 
     711                /*fprintf(ioQQQ,"DEBUG enthalpy HIT1\n");*/ 
    712712                /* this is the time-varying case where density is constant */ 
    713                 /* \todo        1       this has 3/2 on the PresGasCurr while trule dynamics case below 
     713                /* \todo        1       this has 3/2 on the PresGasCurr while true dynamics case below 
    714714                 * has 5/2 - so this is not really the enthalpy density - better 
    715715                 * would be to always use this term and add the extra PresGasCurr 
     
    723723        { 
    724724                /* this branch either advective or constant pressure */ 
    725                 /*fprintf(ioQQQ,"DEBUG enthalph HIT2\n");*/ 
     725                /*fprintf(ioQQQ,"DEBUG enthalpy HIT2\n");*/ 
    726726                /* this is usual dynamics case, or time-varying case where pressure 
    727727                 * is kept constant and PdV work is added to the cell */ 
     
    740740                /* >>chng 05 feb 03, do not update RadBetaMax in this block, wait until 
    741741                 * following, which also protects against the evaluation before zone 1, 
    742                  * when soln may not be stable 
     742                 * when solution may not be stable 
    743743                pressure.RadBetaMax = (float)MAX2(pressure.RadBetaMax,pressure.pbeta); */ 
    744744                /* stop RadPres from exceeding the gas pressure on first iteration */ 
     
    767767                                /*@+redef@*/ 
    768768                                /*lint -e644 Piso_seq not initialized */ 
    769                                 /* trace verious constituents in radiation pressure */ 
     769                                /* trace serious constituents in radiation pressure */ 
    770770                                if( DEBUG_LOC  ) 
    771771                                { 
     
    823823                else if( ipSet == 8 ) 
    824824                { 
    825                         /* hyperfile struct lines */ 
     825                        /* hyperfine struct lines */ 
    826826                        strcpy( pressure.chLineRadPres, "hyperf "); 
    827827                        ASSERT( ip1>=0  ); 
     
    875875 
    876876        { 
    877                 /*@-redef@*/ 
    878877                enum{DEBUG_LOC=false}; 
    879                 /*@+redef@*/ 
    880878                if( DEBUG_LOC && pressure.PresTotlCurr > SMALLFLOAT /*&& iteration > 1*/ ) 
    881879                { 
  • trunk/source/punch_do.cpp

    r1142 r1144  
    175175                /* this global variable to remember where in the punch stack we are */ 
    176176                punch.ipConPun = ipPun; 
    177                 /*  
     177 
     178                /* iterations.lgLastIt is true if this is last iteration 
    178179                 * lgPunLstIter set true if 'last' key occurred on punch command 
    179180                 * normally is false.  This will skip punching if last set and 
    180                  * this is not last iteration 
    181                  */ 
    182  
     181                 * this is not last iteration */ 
    183182                if( iterations.lgLastIt || (!punch.lgPunLstIter[ipPun]) ) 
    184183                { 
  • trunk/source/radius_next.cpp

    r1111 r1144  
    567567 
    568568        /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ 
    569         /* check whether change in wind velocity constrains DRAD */ 
    570         /*>>chng 04 may 25, 
    571          *  WJH 22 May 2004: disable when we are near the sonic point since 
     569        /* check whether change in wind velocity constrains DRAD  
     570         * WJH 22 May 2004: disable when we are near the sonic point since 
    572571         * the velocity may be jumping all over the place but we just want 
    573572         * to push through it as quickly as we can */ 
     
    575574        { 
    576575                double v = fabs(wind.windv); 
    577                 /* this is fractional accel over length */ 
     576                /* this is fractional acceleration over length */ 
    578577                dVeldRad = fabs(wind.windv-OldWindVelocity)/ 
    579578                        MAX2(v,0.1*timesc.sound_speed_isothermal)/radius.drad; 
     
    16151614                { 
    16161615                        fprintf( punch.ipDRout,  
    1617                                 "Wind, dVeldRad=%10.3e\n",  
    1618                            dVeldRad ); 
     1616                                "Wind, dVeldRad=%.3e windv=%.3e\n",  
     1617                           dVeldRad , 
     1618                           wind.windv); 
    16191619                } 
    16201620 
  • trunk/source/rt.h

    r1111 r1144  
    22 * For conditions of distribution and use see copyright notice in license.txt */ 
    33/**MakeRT drive static or wind metal line radiative transfer, 
    4  * if argument is true then do both escape and deEXTERN struction probs, 
    5  * if false only update deEXTERN struction probabilities.  routine only 
     4 * if argument is true then do both escape and destruction probabilities, 
     5 * if false only update destruction probabilities.  routine only 
    66 * called by cloudy(true) and ConvBase(false)  
    7  \param lgDoEsc this is true if we want to do both escape and destruction probs, 
     7 \param lgDoEsc this is true if we want to do both escape and destruction probabilities, 
    88        and false if only destruction probabilities are needed  
    99 \param lgUpdateFineOpac flag saying whether to update fine opacities  
     
    1313        bool lgUpdateFineOpac ); 
    1414 
    15 /**rt_radiative_acceleration radiative accel due to incident continuum, calls rt_line_driving for lines*/ 
     15/**rt_radiative_acceleration radiative acceleration due to incident continuum,  
     16 * calls rt_line_driving for lines*/ 
    1617void RT_radiative_acceleration(void); 
    1718 
    18 /**rt_line_driving radiative acceleration due to line absorption of incident continuum */ 
     19/**rt_line_driving radiative acceleration due to line absorption of incident continuum 
     20 * returns line radiative acceleration cm s-2 */ 
    1921double RT_line_driving(void); 
    2022 
    2123/* in following two the logical variable says whether to do the 
    22  * escape probs too (true) or just the deEXTERN struction probs (false) */ 
     24 * escape probabilities too (true) or just the destruction probabilities (false) */ 
    2325 
    2426/**RT_line_one do line radiative transfer  
    2527\param t 
    2628\param lgDoEsc the logical variable says whether to do the 
    27                 escape probs too (true) or just the deEXTERN struction probs (false) 
     29                escape probabilities too (true) or just the destruction probabilities (false) 
    2830\param lgUpdateFineOpac 
    2931\param lgShield_this_zone this is option to not include line self shielding across this zone. 
  • trunk/source/rt_line_driving.cpp

    r1111 r1144  
    11/* This file is part of Cloudy and is copyright (C)1978-2007 by Gary J. Ferland 
    22 * For conditions of distribution and use see copyright notice in license.txt */ 
    3 /*RT_line_driving derive radiative acceleration due to line absorption of incident continuum */ 
     3/*RT_line_driving derive radiative acceleration due to line absorption of incident continuum, 
     4 * return value is line radiative acceleration */ 
    45#include "cddefines.h" 
    56#include "physconst.h" 
     
    1112#include "rt.h" 
    1213 
     14/*RT_line_driving derive radiative acceleration due to line absorption of incident continuum, 
     15 * return value is line radiative acceleration */ 
    1316double RT_line_driving(void) 
    1417{