Changeset 1997
- Timestamp:
- 04/30/08 09:59:27 (2 weeks ago)
- Files:
-
- trunk/source/helike_einsta.cpp (modified) (1 diff)
- trunk/source/hydroeinsta.cpp (modified) (1 diff)
- trunk/source/parse_commands.cpp (modified) (3 diffs)
- trunk/source/parse_dlaw.cpp (modified) (3 diffs)
- trunk/source/parse_fluc.cpp (modified) (3 diffs)
- trunk/source/parse_globule.cpp (modified) (1 diff)
- trunk/source/parse_hden.cpp (modified) (3 diffs)
- trunk/source/zero.cpp (modified) (1 diff)
- trunk/tsuite/auto/checkall.pl (modified) (2 diffs)
- trunk/tsuite/auto/func_dlaw.in (modified) (1 diff)
- trunk/tsuite/slow/checkall.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/source/helike_einsta.cpp
r1986 r1997 1032 1032 } 1033 1033 else 1034 iso.CachedAs[ipISO][nelem][ N_(ipHi)-iso.n_HighestResolved_max[ipISO][nelem]-1 ][ ipLo ][1] = NULL;1034 iso.CachedAs[ipISO][nelem][ N_(ipHi)-iso.n_HighestResolved_max[ipISO][nelem]-1 ][ ipLo ][1] = 0.f; 1035 1035 1036 1036 iso_put_error(ipHE_LIKE,nelem,ipHi,ipLo,IPRAD,0.01f); trunk/source/hydroeinsta.cpp
r1986 r1997 82 82 } 83 83 else 84 iso.CachedAs[ipISO][nelem][ N_(ipHi)-iso.n_HighestResolved_max[ipISO][nelem]-1 ][ ipLo ][1] = NULL;84 iso.CachedAs[ipISO][nelem][ N_(ipHi)-iso.n_HighestResolved_max[ipISO][nelem]-1 ][ ipLo ][1] = 0.f; 85 85 86 86 iso_put_error(ipISO,nelem,ipHi,ipLo,IPRAD,0.01f); trunk/source/parse_commands.cpp
r1960 r1997 1837 1837 } 1838 1838 1839 /* check whether hydrogen density has been set - this value was 1840 * set to -99 in zero - density is log of hydrogen density at this 1841 * point */ 1842 /**\todo 0 why not set to 0 and insist on positive value? */ 1843 if( dense.gas_phase[ipHYDROGEN] == -99. ) 1844 { 1845 fprintf( ioQQQ, " Hydrogen density MUST be specified.\n" ); 1846 lgStop_not_enough_info = true; 1847 lgStop = true; 1848 } 1849 1850 /* set hydrogen density to linear density - was log up to now */ 1851 dense.gas_phase[ipHYDROGEN] = (realnum)pow((realnum)10.f,dense.gas_phase[ipHYDROGEN]); 1852 1853 radius.rinner = radius.Radius; 1854 1855 /* mass flux for wind model - used for mass conservation */ 1856 wind.emdot = dense.gas_phase[ipHYDROGEN]*wind.windv0; 1857 1858 /* set converge criteria - limit number of iterations and zones */ 1859 if( iterations.lgConverge_set) 1860 { 1861 iterations.itermx = MIN2( iterations.itermx , iterations.lim_iter ); 1862 for( j=0; j < iterations.iter_malloc; j++ ) 1863 { 1864 geometry.nend[j] = MIN2( geometry.nend[j] , iterations.lim_zone ); 1865 } 1866 } 1867 1868 /* find density in these special cases where set externally to this routine 1869 *>>chng 07 feb 25, BUGFIX - had been log10 - error - PvH */ 1839 /* set density from DLAW command, must be done here since it may depend on later input commands */ 1870 1840 if( strcmp(dense.chDenseLaw,"DLW1") == 0 ) 1871 1841 { 1872 1842 dense.gas_phase[ipHYDROGEN] = (realnum)dense_fabden(radius.Radius,radius.depth); 1843 1844 if( dense.gas_phase[ipHYDROGEN] <= 0. ) 1845 { 1846 fprintf( ioQQQ, " PROBLEM DISASTER Hydrogen density set by DLAW must be > 0.\n" ); 1847 cdEXIT(EXIT_FAILURE); 1848 } 1873 1849 } 1874 1850 else if( strcmp(dense.chDenseLaw,"DLW2") == 0 ) 1875 1851 { 1876 /* >>chng 96 nov 29, added dense_tabden, based on Kevin Volk code */ 1877 dense.gas_phase[ipHYDROGEN] =(realnum)dense_tabden(radius.Radius,radius.depth); 1852 dense.gas_phase[ipHYDROGEN] = (realnum)dense_tabden(radius.Radius,radius.depth); 1853 1854 if( dense.gas_phase[ipHYDROGEN] <= 0. ) 1855 { 1856 fprintf( ioQQQ, " PROBLEM DISASTER Hydrogen density set by DLAW must be > 0.\n" ); 1857 cdEXIT(EXIT_FAILURE); 1858 } 1878 1859 } 1879 1860 … … 1884 1865 lgStop_not_enough_info = false; 1885 1866 lgStop = false; 1867 1868 /* check whether hydrogen density has been set - this value was set to 0 in zero */ 1869 if( dense.gas_phase[ipHYDROGEN] <= 0. ) 1870 { 1871 fprintf( ioQQQ, " PROBLEM DISASTER Hydrogen density MUST be specified.\n" ); 1872 lgStop_not_enough_info = true; 1873 lgStop = true; 1874 } 1875 1876 radius.rinner = radius.Radius; 1877 1878 /* mass flux for wind model - used for mass conservation */ 1879 wind.emdot = dense.gas_phase[ipHYDROGEN]*wind.windv0; 1880 1881 /* set converge criteria - limit number of iterations and zones */ 1882 if( iterations.lgConverge_set) 1883 { 1884 iterations.itermx = MIN2( iterations.itermx , iterations.lim_iter ); 1885 for( j=0; j < iterations.iter_malloc; j++ ) 1886 { 1887 geometry.nend[j] = MIN2( geometry.nend[j] , iterations.lim_zone ); 1888 } 1889 } 1886 1890 1887 1891 /* NSAVE is number of lines saved, =0 if no commands entered */ … … 2024 2028 } 2025 2029 2026 /* dense.gas_phase[ipHYDROGEN] is linear hydrogen density (cm-3) unless not set and so zero */ 2027 /**\todo 0 this cannot trip since var init to -99 and already tested, 2028 * but then 10**x so 1e-99 - should change to init gas_phase to zero 2029 * init is in zero.cpp */ 2030 if( called.lgTalk && dense.gas_phase[ipHYDROGEN] == 0 ) 2031 { 2032 fprintf( ioQQQ, " PROBLEM DISASTER The hydrogen density has not been specified - use the HDEN command to do this.\n"); 2033 lgStop_not_enough_info = true; 2034 } 2035 else if( called.lgTalk && dense.gas_phase[ipHYDROGEN] < 1e-4 ) 2030 /* dense.gas_phase[ipHYDROGEN] is linear hydrogen density (cm-3) */ 2031 /* test for hydrogen density properly set has already been done above */ 2032 if( called.lgTalk && dense.gas_phase[ipHYDROGEN] < 1e-4 ) 2036 2033 { 2037 2034 fprintf( ioQQQ, " NOTE Is the entered value of the hydrogen density (%.2e) reasonable?\n", trunk/source/parse_dlaw.cpp
r1771 r1997 7 7 #include "abund.h" 8 8 #include "input.h" 9 #include "radius.h" 9 10 #include "parse.h" 10 11 … … 18 19 19 20 DEBUG_ENTRY( "ParseDLaw()" ); 21 22 if( dense.gas_phase[ipHYDROGEN] > 0. ) 23 { 24 fprintf( ioQQQ, " PROBLEM DISASTER More than one density command was entered.\n" ); 25 cdEXIT(EXIT_FAILURE); 26 } 20 27 21 28 /* call fcn dense_fabden(RADIUS) which uses the ten parameters … … 113 120 } 114 121 } 122 123 /* set fake density to signal that density command was entered */ 124 /* real density will be set once all input commands have been read */ 125 /* this is necessary since density may depend on subsequent commands */ 126 dense.gas_phase[ipHYDROGEN] = 1.f; 127 115 128 return; 116 129 } trunk/source/parse_fluc.cpp
r1771 r1997 48 48 temp = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL); 49 49 50 /* check size of density - will we crash? */ 51 if( temp > log10(FLT_MAX) || temp < log10(FLT_MIN) ) 52 { 53 fprintf(ioQQQ, 54 " DISASTER - the log of the entered max hydrogen density is %.3f - too extreme for this processor.\n", 55 temp); 56 if( temp > 0. ) 57 fprintf(ioQQQ, 58 " DISASTER - the log of the largest hydrogen density this processor can do is %.3f.\n", 59 log10(FLT_MAX) ); 60 else 61 fprintf(ioQQQ, 62 " DISASTER - the log of the smallest hydrogen density this processor can do is %.3f.\n", 63 log10(FLT_MIN) ); 64 fprintf(ioQQQ," Sorry.\n" ); 65 cdEXIT(EXIT_FAILURE); 66 } 67 50 68 /* 2nd number log of max hydrogen density */ 51 69 flmax = pow(10.,temp); 52 70 71 temp = FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL); 72 73 /* check size of density - will we crash? */ 74 if( temp > log10(FLT_MAX) || temp < log10(FLT_MIN) ) 75 { 76 fprintf(ioQQQ, 77 " DISASTER - the log of the entered min hydrogen density is %.3f - too extreme for this processor.\n", 78 temp); 79 if( temp > 0. ) 80 fprintf(ioQQQ, 81 " DISASTER - the log of the largest hydrogen density this processor can do is %.3f.\n", 82 log10(FLT_MAX) ); 83 else 84 fprintf(ioQQQ, 85 " DISASTER - the log of the smallest hydrogen density this processor can do is %.3f.\n", 86 log10(FLT_MIN) ); 87 fprintf(ioQQQ," Sorry.\n" ); 88 cdEXIT(EXIT_FAILURE); 89 } 90 53 91 /* 3rd number log of min hydrogen density */ 54 flmin = pow(10.,FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL)); 92 flmin = pow(10.,temp); 93 55 94 if( flmax/flmin > 100. ) 56 95 { … … 65 104 fprintf( ioQQQ, "There MUST be three numbers on this line.\n" ); 66 105 fprintf( ioQQQ, "These must be the period(cm), max, min densities, all logs, in that order.\n" ); 106 if( flmin > flmax ) 107 fprintf( ioQQQ, "The max density must be greater or equal than the min density.\n" ); 67 108 cdEXIT(EXIT_FAILURE); 68 109 } … … 93 134 strcpy( dense.chDenseLaw, "SINE" ); 94 135 136 if( dense.gas_phase[ipHYDROGEN] > 0. ) 137 { 138 fprintf( ioQQQ, " PROBLEM DISASTER More than one density command was entered.\n" ); 139 cdEXIT(EXIT_FAILURE); 140 } 141 95 142 /* depth is zero for first zone */ 96 143 dense.gas_phase[ipHYDROGEN] = dense.cfirst*(realnum)cos(dense.flcPhase) + dense.csecnd; 97 dense.gas_phase[ipHYDROGEN] = (realnum)log10(dense.gas_phase[ipHYDROGEN]); 144 145 if( dense.gas_phase[ipHYDROGEN] <= 0. ) 146 { 147 fprintf( ioQQQ, " PROBLEM DISASTER Hydrogen density must be > 0.\n" ); 148 cdEXIT(EXIT_FAILURE); 149 } 98 150 } 99 151 return; trunk/source/parse_globule.cpp
r1732 r1997 16 16 DEBUG_ENTRY( "ParseGlobule()" ); 17 17 18 if( dense.gas_phase[ipHYDROGEN] > 0. ) 19 { 20 fprintf( ioQQQ, " PROBLEM DISASTER More than one density command was entered.\n" ); 21 cdEXIT(EXIT_FAILURE); 22 } 23 18 24 /* globule with density increasing inward 19 25 * parameters are outer density, radius of globule, and density power */ 20 26 i = 5; 21 27 radius.glbden = (realnum)FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL); 22 if( lgEOL ) 28 radius.glbden = lgEOL ? 1. : (realnum)pow((realnum)10.f,radius.glbden); 29 dense.gas_phase[ipHYDROGEN] = radius.glbden; 30 31 if( dense.gas_phase[ipHYDROGEN] <= 0. ) 23 32 { 24 radius.glbden = 1.; 25 dense.gas_phase[ipHYDROGEN] = 0.; 26 } 27 28 else 29 { 30 dense.gas_phase[ipHYDROGEN] = radius.glbden; 31 radius.glbden = (realnum)pow((realnum)10.f,radius.glbden); 33 fprintf( ioQQQ, " PROBLEM DISASTER Hydrogen density must be > 0.\n" ); 34 cdEXIT(EXIT_FAILURE); 32 35 } 33 36 trunk/source/parse_hden.cpp
r1771 r1997 15 15 DEBUG_ENTRY( "ParseHDEN()" ); 16 16 17 if( dense.gas_phase[ipHYDROGEN] > 0. ) 18 { 19 fprintf( ioQQQ, " PROBLEM DISASTER More than one density command was entered.\n" ); 20 cdEXIT(EXIT_FAILURE); 21 } 22 17 23 /* log of hydrogen density */ 18 24 i = 5; … … 20 26 if( lgEOL ) 21 27 { 22 fprintf( ioQQQ, " log(n)MUST be entered with this command. STOP\n" );28 fprintf( ioQQQ, " DISASTER The density MUST be entered with this command. STOP\n" ); 23 29 cdEXIT(EXIT_FAILURE); 24 30 } 25 31 26 32 /* check for further options */ 27 if( nMatch("LINE",chCard) )33 if( ! nMatch("LINE",chCard) ) 28 34 { 29 /* linear option */ 30 if( dense.gas_phase[ipHYDROGEN] <= 0. ) 35 /* check size of density - will we crash? */ 36 if( dense.gas_phase[ipHYDROGEN] > log10(FLT_MAX) || 37 dense.gas_phase[ipHYDROGEN] < log10(FLT_MIN) ) 31 38 { 32 fprintf( ioQQQ, " A negative density is not physical.\n" ); 39 fprintf(ioQQQ, 40 " DISASTER - the log of the entered hydrogen density is %.3f - too extreme for this processor.\n", 41 dense.gas_phase[ipHYDROGEN]); 42 if( dense.gas_phase[ipHYDROGEN] > 0. ) 43 fprintf(ioQQQ, 44 " DISASTER - the log of the largest hydrogen density this processor can do is %.3f.\n", 45 log10(FLT_MAX) ); 46 else 47 fprintf(ioQQQ, 48 " DISASTER - the log of the smallest hydrogen density this processor can do is %.3f.\n", 49 log10(FLT_MIN) ); 50 fprintf(ioQQQ," Sorry.\n" ); 51 33 52 cdEXIT(EXIT_FAILURE); 34 53 } 35 else 36 { 37 dense.gas_phase[ipHYDROGEN] = (realnum)log10(dense.gas_phase[ipHYDROGEN]); 38 } 54 55 dense.gas_phase[ipHYDROGEN] = (realnum)pow((realnum)10.f,dense.gas_phase[ipHYDROGEN]); 39 56 } 40 57 41 /* check size of density - will we crash? */ 42 if( fabs(dense.gas_phase[ipHYDROGEN]) > log10(FLT_MAX) ) 58 if( dense.gas_phase[ipHYDROGEN] <= 0. ) 43 59 { 44 fprintf(ioQQQ, 45 " DISASTER - the log of the entered hydrogen density is %.3f - too large for this processor.\n", 46 dense.gas_phase[ipHYDROGEN]); 47 fprintf(ioQQQ, 48 " DISASTER - the log of the largest hydrogen density this processor can do is %.3f.\n", 49 log10(FLT_MAX) ); 50 fprintf(ioQQQ," Sorry.\n" ); 51 60 fprintf( ioQQQ, " PROBLEM DISASTER Hydrogen density must be > 0.\n" ); 52 61 cdEXIT(EXIT_FAILURE); 53 62 } 54 63 55 64 /* this is the linear initial density */ 56 dense.den0 = (realnum)pow((realnum)10.f,dense.gas_phase[ipHYDROGEN]);65 dense.den0 = dense.gas_phase[ipHYDROGEN]; 57 66 58 67 /* check if exponent entered */ … … 99 108 /* pointer to where to write */ 100 109 optimize.nvfpnt[optimize.nparm] = input.nRead; 101 optimize.vparm[0][optimize.nparm] = (realnum) dense.gas_phase[ipHYDROGEN];110 optimize.vparm[0][optimize.nparm] = (realnum)log10(dense.gas_phase[ipHYDROGEN]); 102 111 optimize.vincr[optimize.nparm] = 1.; 103 112 trunk/source/zero.cpp
r1960 r1997 900 900 901 901 dense.eden = 1.; 902 /* >>chng 02 feb 28, this was set to 1 here, and to -99 in zerologic, so that903 * check whether hden was specified was defeated. Reset to correct -99. here.*/904 dense.gas_phase[ipHYDROGEN] = -99.;905 902 906 903 /* now set physical conditions array trunk/tsuite/auto/checkall.pl
r1779 r1997 59 59 while( <OUTP> ) 60 60 { 61 # find " BOTCH " and "W-" strings in all the output fileand write61 # find "DISASTER", "Botched" and "W-" strings in all the output files and write 62 62 # corresponding line into serious.txt file. 63 if( / Botched/ || /W-/ )63 if( /DISASTER/ || /Botched/ || /W-/ ) 64 64 { 65 65 print SERIOUS "$output: $_"; … … 72 72 # now look for string PROBLEM, which indicates an internal problem 73 73 # during the calculation - this is not a serious problem 74 if( /PROBLEM/ )74 if( /PROBLEM/ && ! /DISASTER/ ) 75 75 { 76 76 print MINOR "$output: $_"; trunk/tsuite/auto/func_dlaw.in
r1092 r1997 6 6 c 7 7 c commands for density & abundances ========= 8 hden 7 -49 8 dlaw table radius 10 9 continue 16 9 trunk/tsuite/slow/checkall.pl
r1883 r1997 59 59 while( <OUTP> ) 60 60 { 61 # find " BOTCH " and "W-" strings in all the output fileand write61 # find "DISASTER", "Botched" and "W-" strings in all the output files and write 62 62 # corresponding line into serious.txt file. 63 if( / Botched/ || /W-/ )63 if( /DISASTER/ || /Botched/ || /W-/ ) 64 64 { 65 65 print SERIOUS "$output: $_"; … … 72 72 # now look for string PROBLEM, which indicates an internal problem 73 73 # during the calculation - this is not a serious problem 74 if( /PROBLEM/ )74 if( /PROBLEM/ && ! /DISASTER/ ) 75 75 { 76 76 print MINOR "$output: $_";
