1612 double relint , absint;
1622 long lgDisambiguate =
false;
1623 char chCaps[5], chFind[5];
1664 ipDisambiguate[i][j] = -1;
1675 if( ipDisambiguate[i][0] <= 0 )
1678 " monitor error: lgCheckMonitors could not find a line with label %s ",
1681 fprintf( ioMONITOR,
"\n" );
1684 " monitor error: The \"save line labels\" command is a good way to get a list of line labels.\n\n");
1687 RelError[i] = 100000.;
1710 if( j==ipDisambiguate[i][0] )
1725 if( strcmp(chCaps,chFind) == 0 )
1727 double relint1, absint1, current_error;
1733 current_error < 2.*fabs(RelError[i]) )
1735 lgDisambiguate =
true;
1738 if( ipDisambiguate[i][1] > 0 )
1740 ipDisambiguate[i][2] = j;
1745 ipDisambiguate[i][1] = j;
1753 PredQuan[i] = relint;
1764 " monitor error: lgCheckMonitors could not find a line with label %s ",
1767 fprintf( ioMONITOR,
"\n" );
1770 " monitor error: The \"save line labels\" command is a good way to get a list of line labels.\n\n");
1773 RelError[i] = 10000000.;
1781 PredQuan[i] = pow(10.,absint);
1787 double hfrac , hefrac;
1802 " monitor error: lgCheckMonitors could not find h ionization fraction \n");
1822 " monitor error: lgCheckMonitors could not find h ionization fraction \n");
1830 PredQuan[i] = hefrac-hfrac;
1837 PredQuan[i] =
cpu.i().lgMPI() ? 1. : 0.;
1845 PredQuan[i] = (double)
nzone;
1856 PredQuan[i] =
h2.ortho_density /
SDIV(
h2.para_density );
1865 PredQuan[i] =
gv.rate_h2_form_grains_used_total;
1881 double sumx=0., sumx2=0., average;
1884 for( n=0; n<
nzone; n++ )
1886 sumx +=
struc.pressure[n];
1892 average = sumx/
nzone;
1896 PredQuan[i] = sumx / average;
1904 RelError[i] = PredQuan[i];
1911 PredQuan[i] = (double)(
conv.nTotalIoniz-
conv.nTotalIoniz_start)/(double)(
nzone);
1926 PredQuan[i] =
dense.eden;
1934 PredQuan[i] = pow((
rfield.EnergyIncidCont+
rfield.EnergyDiffCont)/
1943 PredQuan[i] =
radius.depth;
1951 PredQuan[i] =
radius.Radius;
1959 PredQuan[i] =
wind.windv/1e5;
2009 long int nISOCaseB = (long)
Param[i][0];
2010 long int nelemCaseB = (long)
Param[i][1];
2011 char chElemLabelCaseB[5];
2013 strcpy( chElemLabelCaseB ,
elementnames.chElementSym[nelemCaseB] );
2015 sprintf( chNumb ,
"%2li" , nelemCaseB+1-nISOCaseB );
2016 strcat( chElemLabelCaseB , chNumb );
2028 long nHighestPrinted =
iso_sp[nISOCaseB][nelemCaseB].n_HighestResolved_max;
2031 fprintf(ioMONITOR,
" Species nHi nLo Wl Computed Asserted error\n");
2036 for(
long int ipLo=1+iCase; ipLo<
MIN2(10,nHighestPrinted-1); ++ipLo )
2038 for(
long int ipHi=ipLo+1; ipHi<
MIN2(25,nHighestPrinted); ++ipHi )
2041 realnum wl =
atmdat.WaveLengthCaseB[nelemCaseB][ipHi][ipLo];
2046 double relint , absint,CBrelint , CBabsint;
2049 if( CBrelint <
Param[i][4] )
2051 CBabsint = pow( 10., CBabsint );
2054 if(
cdLine( chElemLabelCaseB , wl , &relint , &absint ) >0)
2056 absint = pow( 10., absint );
2057 error = (CBabsint - absint)/
MAX2(CBabsint , absint);
2058 double RelativeError = fabs(error) /
AssertError[i];
2060 if( RelativeError < 1. )
2062 if( RelativeError < 0.25 )
2064 fprintf( ioMONITOR,
" ChkMonitor ");
2066 else if( RelativeError < 0.50 )
2068 fprintf( ioMONITOR,
" ChkMonitor - ");
2070 else if( RelativeError < 0.75 )
2072 fprintf( ioMONITOR,
" ChkMonitor -- ");
2074 else if( RelativeError < 0.90 )
2076 fprintf( ioMONITOR,
" ChkMonitor --- ");
2078 else if( RelativeError < 0.95 )
2080 fprintf( ioMONITOR,
" ChkMonitor ---- ");
2082 else if( RelativeError < 0.98 )
2084 fprintf( ioMONITOR,
" ChkMonitor ----- ");
2088 fprintf( ioMONITOR,
" ChkMonitor ------ ");
2094 fprintf( ioMONITOR,
" ChkMonitor botch>>");
2096 fprintf(ioMONITOR,
" %s %3li %3li ",
2097 chElemLabelCaseB , ipHi , ipLo );
2099 fprintf(ioMONITOR,
" %.2e %.2e %10.3f",
2100 absint , CBabsint , error );
2105 fprintf(ioMONITOR ,
" botch \n");
2107 fprintf(ioMONITOR ,
"\n");
2111 RelError[i] =
MAX2( RelError[i] , fabs(error) );
2119 fprintf(ioMONITOR,
"\n");
2125 fprintf(
ioQQQ,
"PROBLEM monitor case B for a He is requested but He is not "
2127 fprintf(
ioQQQ,
"Do not turn off He if you want to monitor its spectrum.\n");
2132 fprintf(ioMONITOR,
" Wl Computed Asserted error\n");
2140 double relint , absint,CBrelint , CBabsint;
2142 if( CBrelint <
Param[i][4] )
2144 CBabsint = pow( 10., CBabsint );
2146 if(
cdLine( chElemLabelCaseB , wl , &relint , &absint ) >0)
2148 absint = pow( 10., absint );
2149 error = (CBabsint - absint)/
MAX2(CBabsint , absint);
2150 double RelativeError = fabs(error) /
AssertError[i];
2152 if( RelativeError < 1. )
2154 if( RelativeError < 0.25 )
2156 fprintf( ioMONITOR,
" ChkMonitor ");
2158 else if( RelativeError < 0.50 )
2160 fprintf( ioMONITOR,
" ChkMonitor - ");
2162 else if( RelativeError < 0.75 )
2164 fprintf( ioMONITOR,
" ChkMonitor -- ");
2166 else if( RelativeError < 0.90 )
2168 fprintf( ioMONITOR,
" ChkMonitor --- ");
2170 else if( RelativeError < 0.95 )
2172 fprintf( ioMONITOR,
" ChkMonitor ---- ");
2174 else if( RelativeError < 0.98 )
2176 fprintf( ioMONITOR,
" ChkMonitor ----- ");
2180 fprintf( ioMONITOR,
" ChkMonitor ------ ");
2186 fprintf( ioMONITOR,
" ChkMonitor botch>>");
2189 fprintf(ioMONITOR,
" %.2e %.2e %10.3f",
2190 absint , CBabsint , error );
2195 fprintf(ioMONITOR ,
" botch \n");
2197 fprintf(ioMONITOR ,
"\n");
2201 RelError[i] =
MAX2( RelError[i] , fabs(error) );
2207 fprintf(ioMONITOR,
"\n");
2218 long ipISO = (long)
Param[i][0];
2220 if( !
dense.lgElmtOn[nelem] )
2222 fprintf(
ioQQQ,
"PROBLEM asserted element %ld is not turned on!\n",nelem);
2235 PredQuan[i] +=
iso_sp[ipISO][nelem].fb[n].DepartCoef;
2237 relerror =
iso_sp[ipISO][nelem].fb[n].DepartCoef -1.;
2238 relerror =
MAX2( relerror , 1. -
iso_sp[ipISO][nelem].fb[n].DepartCoef );
2241 PredQuan[i] /= (double)(numPrintLevels);
2245 ASSERT(
dense.xIonDense[nelem][nelem-ipISO]==0. ||
dense.xIonDense[nelem][nelem+1-ipISO]==0. );
2255 double BigError , StdDev;
2261 RelError[i] = StdDev;
2267 PredQuan[i] =
hmi.hmidep;
2268 RelError[i] = fabs(
hmi.hmidep - 1.);
2278 strcpy( chWeight ,
"VOLUME" );
2283 strcpy( chWeight ,
"RADIUS" );
2299 " monitor error: lgCheckMonitors could not find a line with label %s %f \n",
2309 PredQuan[i] = relint;
2323 fprintf(
ioQQQ,
" PROBLEM lgCheckMonitors did not find v=%li, J=%li for H2 column density.\n",
2345 " monitor error: lgCheckMonitors could not find a molecule with label %s %f \n",
2356 PredQuan[i] = relint;
2378 " monitor error: lgCheckMonitors could not find a molecule with label %s %f \n",
2387 PredQuan[i] = relint;
2396 if(
hcmap.nMapAlloc == 0 )
2400 " monitor error: lgCheckMonitors cannot check map since map not done.\n");
2411 " monitor error: lgCheckMonitors cannot check map since temperature not within range.\n");
2431 PredQuan[i] =
hcmap.hmap[j];
2437 PredQuan[i] =
hcmap.cmap[j];
2450 strcpy( chWeight ,
"VOLUME" );
2455 strcpy( chWeight ,
"RADIUS" );
2465 if( nd >=
gv.bin.size() )
2468 fprintf(
ioQQQ,
"Use 1 for first grain that is turned on, " );
2469 fprintf(
ioQQQ,
"2 for second, etc....\n" );
2470 fprintf(
ioQQQ,
"Old style grain numbers are not valid anymore !!\n" );
2473 relint =
gv.bin[nd]->avdust/
radius.depth_x_fillfac;
2478 relint =
struc.testr[0];
2494 " monitor error: lgCheckMonitors could not find an ion with label %s ion %li \n",
2505 PredQuan[i] = relint;
2515 if( nd >=
gv.bin.size() )
2518 fprintf(
ioQQQ,
"Use 1 for first grain that is turned on, " );
2519 fprintf(
ioQQQ,
"2 for second, etc....\n" );
2520 fprintf(
ioQQQ,
"Old style grain numbers are not valid anymore !!\n" );
2525 PredQuan[i] =
gv.bin[nd]->avdpot/
radius.depth_x_fillfac;
2533 " monitor error: lgCheckMonitors received an insane chAssertType=%s, impossible\n",
2555 if( RelError[i] <= 0. )
2565 if( RelError[i] >= 0. )
2579 if( lgDisambiguate )
2582 long sigfigsav =
LineSave.sig_figs;
2583 double relint1, relint2, absint1;
2587 fprintf( ioMONITOR,
"=============Line Disambiguation=======================================================\n" );
2588 fprintf( ioMONITOR,
" Wavelengths || Intensities \n" );
2589 fprintf( ioMONITOR,
"Label line match1 match2 match3 || asserted match1 match2 match3\n" );
2593 if( ipDisambiguate[i][1] > 0 )
2597 fprintf( ioMONITOR ,
" " );
2599 fprintf( ioMONITOR ,
" " );
2601 fprintf( ioMONITOR ,
" " );
2602 if( ipDisambiguate[i][2] > 0 )
2605 cdLine_ip( ipDisambiguate[i][2], &relint2, &absint1 );
2609 fprintf( ioMONITOR ,
"--------" );
2612 fprintf( ioMONITOR ,
" ||" );
2614 cdLine_ip( ipDisambiguate[i][1], &relint1, &absint1 );
2618 fprintf( ioMONITOR ,
" %10.3e %10.3e %10.3e %10.3e\n",
2626 fprintf( ioMONITOR ,
" %10.4f %10.4f %10.4f %10.4f\n",
2634 fprintf( ioMONITOR,
"\n" );
2641 fprintf( ioMONITOR,
"=============Results of monitors: Cloudy %s ",
t_version::Inst().chVersion );
2645 if(
prt.lgPrintTime )
2650 fprintf(ioMONITOR,
"%s", ctime(&now) );
2654 fprintf(ioMONITOR,
"\n" );
2659 fprintf( ioMONITOR,
" No errors were found. Summary follows.\n");
2663 fprintf( ioMONITOR,
" Errors were found. Summary follows.\n");
2667 " Label line computed asserted Rel Err Set err\n");
2671 double prtPredQuan, prtAssertQuantity;
2681 prtPredQuan = PredQuan[i];
2693 fprintf( ioMONITOR,
" ChkMonitor ");
2695 else if( relative < 0.50 )
2697 fprintf( ioMONITOR,
" ChkMonitor - ");
2699 else if( relative < 0.75 )
2701 fprintf( ioMONITOR,
" ChkMonitor -- ");
2703 else if( relative < 0.90 )
2705 fprintf( ioMONITOR,
" ChkMonitor --- ");
2707 else if( relative < 0.95 )
2709 fprintf( ioMONITOR,
" ChkMonitor ---- ");
2711 else if( relative < 0.98 )
2713 fprintf( ioMONITOR,
" ChkMonitor ----- ");
2717 fprintf( ioMONITOR,
" ChkMonitor ------ ");
2723 fprintf( ioMONITOR,
" ChkMonitor botch>>");
2728 fprintf( ioMONITOR ,
"%4s ",
2735 fprintf( ioMONITOR ,
" %10.3e %c %10.3e %7.3f %7.3f ",
2744 fprintf( ioMONITOR ,
" %10.4f %c %10.4f %7.3f %7.3f ",
2753 enum {DEBUG_LOC=
false};
2769 fprintf(
ioQQQ,
"\t%li %li %li %li %li %li",
2786 fprintf( ioMONITOR ,
"%4s %6i %10.4f %c %10.4f %7.3f %7.3f ",
2801 if( !lg1OK[i] && (fabs(RelError[i]) > 3.*
AssertError[i]) && lgFound[i] )
2803 fprintf( ioMONITOR ,
" <<BIG BOTCH!!\n");
2808 fprintf( ioMONITOR ,
"\n");
2811 fprintf( ioMONITOR ,
" \n");
2818 fprintf( ioMONITOR,
" BIG BOTCHED MONITORS!!! Big Botched Monitors!!! \n");
2822 fprintf( ioMONITOR,
" BOTCHED MONITORS!!! Botched Monitors!!! \n");
2827 fprintf(ioMONITOR,
"\n The mean of the %li monitor Case A, B relative "
2828 "residuals is %.2f\n\n" ,
2834 if(
prt.lgPrintTime )