Changeset 2125 for branches/newmole

Show
Ignore:
Timestamp:
06/24/08 16:39:58 (7 months ago)
Author:
rjrw
Message:

Merged from trunk r2111:2124

Location:
branches/newmole/source
Files:
12 modified

Legend:

Unmodified
Added
Removed
  • branches/newmole/source/cloudy.cpp

    r1739 r2125  
    223223 
    224224                        /* converge the pressure-temperature-ionization solution for this zone  
    225                          * NB ignoring return value - should be ok (return 1 for disaster) */ 
     225                         * NB ignoring return value - should be ok (return 1 for abort)  
     226                         * we can't break here in case of abort since there is still housekeeping 
     227                         * that must be done in following routines */ 
    226228                        ConvPresTempEdenIoniz(); 
    227229 
  • branches/newmole/source/cont_createmesh.cpp

    r2079 r2125  
    147147        /* nend_max+1 because search phase is zone 0, first zone at illumin face is 1 */ 
    148148        rfield.ConEmitLocal = (realnum**)MALLOC( (size_t)(geometry.nend_max+1)*sizeof(realnum *)  ); 
     149        rfield.ConSourceFcnLocal = (realnum**)MALLOC( (size_t)(geometry.nend_max+1)*sizeof(realnum *)  ); 
    149150        for( i=0;i<(geometry.nend_max+1); ++i ) 
    150151        { 
    151152                rfield.ConEmitLocal[i] = (realnum*)MALLOC( (size_t)rfield.nupper*sizeof(realnum)  ); 
     153                rfield.ConSourceFcnLocal[i] = (realnum*)MALLOC( (size_t)rfield.nupper*sizeof(realnum)  ); 
     154        } 
     155        for( i=0;i<(geometry.nend_max+1); ++i ) 
     156        { 
     157                for( long j=0; j<rfield.nupper; ++j) 
     158                { 
     159                        rfield.ConSourceFcnLocal[i][j] = 1.; 
     160                } 
    152161        } 
    153162 
  • branches/newmole/source/conv_base.cpp

    r2096 r2125  
    855855        PresTotCurrent(); 
    856856 
    857         if( trace.lgTrace ) 
    858         { 
    859                 fprintf( ioQQQ,  
    860                         "   ConvBase return. %.2f Te:%.3e  HI:%.3e  HII:%.3e  H2:%.3e  Ne:%.3e  htot:%.3e  CSUP:%.2e Conv?%c\n",  
    861                   fnzone, 
    862                   phycon.te,  
    863                   dense.xIonDense[ipHYDROGEN][0],  
    864                   dense.xIonDense[ipHYDROGEN][1],  
    865                   hmi.H2_total, 
    866                   dense.eden,  
    867                   thermal.htot,  
    868                   secondaries.csupra[ipHYDROGEN][0] , 
    869                   TorF(conv.lgConvIoniz) ); 
    870         } 
    871  
    872857        ASSERT(lgElemsConserved()); 
    873858 
     
    879864         * reset to zero each time ConvPresTempEdenIoniz is called */ 
    880865        ++conv.nPres2Ioniz; 
     866 
     867        if( trace.lgTrace ) 
     868        { 
     869                fprintf( ioQQQ,  
     870                        "   ConvBase return. fnzone %.2f nPres2Ioniz %li Te:%.3e  HI:%.3e  HII:%.3e  H2:%.3e  Ne:%.3e  htot:%.3e  CSUP:%.2e Conv?%c reason:%s\n",  
     871                        fnzone, 
     872                        conv.nPres2Ioniz, 
     873                        phycon.te,  
     874                        dense.xIonDense[ipHYDROGEN][0],  
     875                        dense.xIonDense[ipHYDROGEN][1],  
     876                        hmi.H2_total, 
     877                        dense.eden,  
     878                        thermal.htot,  
     879                        secondaries.csupra[ipHYDROGEN][0] , 
     880                        TorF(conv.lgConvIoniz) , 
     881                        conv.chConvIoniz); 
     882        } 
    881883 
    882884        /* this is abort option set with SET PRESIONIZ command, 
  • branches/newmole/source/conv_init_solution.cpp

    r2124 r2125  
    319319                PresTotCurrent(); 
    320320 
    321                 /* now get final temperature */ 
     321                /* now get new initial temperature */ 
    322322                if( ConvPresTempEdenIoniz() ) 
    323323                { 
  • branches/newmole/source/dynamics.cpp

    r1780 r2125  
    18501850        if( lgWind ) 
    18511851        { 
    1852                 /* increse precision of solution */ 
     1852                /* increase precision of solution */ 
    18531853                conv.EdenErrorAllowed = 1e-3; 
    18541854                /* the actual relative error is relative to the total heating and cooling, 
  • branches/newmole/source/iso_level.cpp

    r2112 r2125  
    202202        else 
    203203        { 
     204                /* this branch is main solver, full level populations  
     205                 * assert since this code must change if NISO ever increased */ 
    204206                ASSERT( NISO == 2 ); 
    205207                long SpinUsed[NISO] = {2,1}; 
     
    455457                 * 
    456458                 * ==================================================================== */ 
    457  
    458459                /* save matrix, this allocates SaveZ */ 
    459460                SaveZ = z; 
  • branches/newmole/source/iter_end_chk.cpp

    r1800 r2125  
    161161        } 
    162162 
     163        else if( (StopCalc.nTotalIonizStop>0) && conv.nTotalIoniz> StopCalc.nTotalIonizStop ) 
     164        { 
     165                /* stop if exceed number of calls to conv base set with  
     166                 * stop nTotalIonizStop command */ 
     167                lgDone = true; 
     168                strncpy( StopCalc.chReasonStop, "nTotalIonizStop reached.", sizeof(StopCalc.chReasonStop) ); 
     169        } 
     170 
    163171        /* this flag says that 21cm line optical depth is the stop quantity */ 
    164172        else if( StopCalc.lgStop21cm && (HFLines[0].Emis->TauCon >=  StopCalc.tauend) ) 
  • branches/newmole/source/mole_h2_io.cpp

    r2023 r2125  
    272272                strcpy( punch.chPunch[punch.npunch], "H2ln" ); 
    273273                sprintf( chHeader,  
    274                         "#H2 line\tEhi\tVhi\tJhi\tElo\tVlo\tJlo\twl(mic)\twl(lab)\tlog L or I\tI/Inorm\tExcit(hi, K)\tg_u h\\nu * Aul\n" ); 
     274                        "#H2 line\tEhi\tVhi\tJhi\tElo\tVlo\tJlo\twl(mic)\twl(lab)\tlog L or I\tI/Inorm\tExcit(hi, K)\tg_u h nu * Aul\n" ); 
    275275                /* first optional number changes the threshold of weakest line to print*/ 
    276276                /* fe2thresh is intensity relative to normalization line, 
     
    21922192                                                                                /* excitation energy of upper level in K */ 
    21932193                                                                                fprintf( io, "\t%.3f", energy_wn[iElecHi][iVibHi][iRotHi]*T1CM ); 
    2194                                                                                 /* the product h nu * Aul */ 
     2194                                                                                /* the product g_hi h nu * Aul */ 
    21952195                                                                                ASSERT( H2Lines[iElecHi][iVibHi][iRotHi][iElecLo][iVibLo][iRotLo].ipCont > 0 ); 
    21962196                                                                                fprintf( io, "\t%.3e", H2Lines[iElecHi][iVibHi][iRotHi][iElecLo][iVibLo][iRotLo].Emis->Aul*  
  • branches/newmole/source/parse_punch.cpp

    r2112 r2125  
    20072007        else if( nMatch("SOUR",chCard) ) 
    20082008        { 
     2009 
     2010                /* check for keyword UNITS on line, then scan wavelength or energy units if present, 
     2011                * units are copied into punch.chConPunEnr */ 
     2012                ChkUnits(chCard); 
     2013 
    20092014                if( nMatch("DEPT",chCard) ) 
    20102015                { 
     
    20192024                        strcpy( punch.chPunch[punch.npunch], "SOUS" ); 
    20202025                        sprintf( chHeader,  
    2021                                 "#continuum source function\n" ); 
     2026                                "#continuum source function nu(Ryd)\tConEmitLocal/widflx" 
     2027                                "\tabs opac\tConSourceFcnLocal\tConSourceFcnLocal[nzone][j]/plankf\n" ); 
    20222028                } 
    20232029                else 
  • branches/newmole/source/punch_do.cpp

    r2112 r2125  
    453453 
    454454                                                /* the outward emitted continuum */ 
    455                                                 conem = ((rfield.ConEmitOut[j])/ 
     455                                                conem = (rfield.ConEmitOut[j]/ 
    456456                                                  rfield.widflx[j]*rfield.anu2[j] + punch.PunchLWidth* 
    457457                                                  rfield.outlin[j]*rfield.anu[j])*radius.r1r0sq* 
     
    29012901                                        { 
    29022902                                                fprintf( punch.ipPnunit[ipPun],  
    2903                                                         "%.4e\t%.4e\t%.4e\t%.4e\t%.4e\n",  
    2904                                                   rfield.anu[j],  
     2903                                                        "%.4e\t%.4e\t%.4e\t%.4e\t%.4e\t%.4e\n",  
     2904                                                  AnuUnit(rfield.AnuOrg[j]), 
    29052905                                                  rfield.ConEmitLocal[nzone][j]/rfield.widflx[j],  
    29062906                                                  opac.opacity_abs[j],  
    2907                                                   rfield.ConEmitLocal[nzone][j]/rfield.widflx[j]/SDIV( opac.opacity_abs[j]),  
    2908                                                   rfield.ConEmitLocal[nzone][j]/rfield.widflx[j]/SDIV( opac.opacity_abs[j])/plankf(j) ); 
     2907                                                  rfield.ConSourceFcnLocal[nzone][j],  
     2908                                                  rfield.ConSourceFcnLocal[nzone][j]/plankf(j) ); 
    29092909                                        } 
    29102910                                } 
  • branches/newmole/source/rfield.h

    r1918 r2125  
    124124        realnum **ConEmitLocal/* [depth][energy]*/; 
    125125 
     126        /** the local source function - diffuse emission, photons Ryd-1 s-1 */ 
     127        realnum **ConSourceFcnLocal/* [depth][energy]*/; 
     128 
    126129        /** reflected diffuse emission continuum */ 
    127130        realnum *ConEmitReflec; 
     
    129132        /** outward diffuse emission continuum (not the interactive one), 
    130133         * this is incremented in radinc because of interplay between absorption 
    131          * and emission - get the outward bremsstrahlung right */ 
     134         * and emission - get the outward bremsstrahlung right  
     135         * photons cell-1 cm-2 s-1 */ 
    132136        realnum *ConEmitOut; 
    133137 
     
    168172                **otssav/*[NC_ELL][2]*/; 
    169173 
    170         /** outward directed line emission */ 
     174        /** outward directed line emission photons cm-2 s-1 */ 
    171175        realnum *outlin, 
    172176                *outlin_noplot; 
  • branches/newmole/source/rt_diffuse.cpp

    r2079 r2125  
    738738                /* >>chng 00 oct 03, add diffuse continua */ 
    739739                /* local diffuse continua */ 
    740                 rfield.OccNumbDiffCont[nu] = rfield.ConEmitLocal[nzone][nu]*rfield.convoc[nu]; 
     740                rfield.OccNumbDiffCont[nu] =  
     741                        rfield.ConEmitLocal[nzone][nu]*rfield.convoc[nu]; 
     742 
     743                rfield.ConSourceFcnLocal[nzone][nu] =  
     744                        rfield.ConEmitLocal[nzone][nu]/rfield.widflx[nu]/ 
     745                        (realnum)SDIV( opac.opacity_abs[nu]); 
    741746 
    742747                /* confirm that all are non-negative */