00001 /* This file is part of Cloudy and is copyright (C)1978-2010 by Gary J. Ferland and 00002 * others. For conditions of distribution and use see copyright notice in license.txt */ 00003 /*ParseMap parse map command to produce map of heating and cooling, 00004 * map is produced by calling punt(" map") */ 00005 #include "cddefines.h" 00006 #include "hcmap.h" 00007 #include "parser.h" 00008 00009 void ParseMap(Parser &p ) 00010 { 00011 bool 00012 lgLogOn; 00013 00014 DEBUG_ENTRY( "ParseMap()" ); 00015 00016 /* say output goes to stdout */ 00017 ioMAP = ( ioQQQ == NULL ) ? stdout : ioQQQ; 00018 00019 /* do cooling space map for specified zones 00020 * if no number, or <0, do map and punch out without doing first zone */ 00021 hcmap.MapZone = (long)p.FFmtRead(); 00022 if( p.lgEOL() ) 00023 { 00024 hcmap.MapZone = 0; 00025 return; 00026 } 00027 00028 if( p.nMatch("RANG") ) 00029 { 00030 hcmap.RangeMap[0] = (realnum)p.FFmtRead(); 00031 if( hcmap.RangeMap[0] <= 10. ) 00032 { 00033 hcmap.RangeMap[0] = (realnum)pow((realnum)10.f,hcmap.RangeMap[0]); 00034 lgLogOn = true; 00035 } 00036 else 00037 { 00038 lgLogOn = false; 00039 } 00040 hcmap.RangeMap[1] = (realnum)p.FFmtRead(); 00041 if( lgLogOn ) 00042 hcmap.RangeMap[1] = (realnum)pow((realnum)10.f,hcmap.RangeMap[1]); 00043 00044 if( p.lgEOL() ) 00045 { 00046 fprintf( ioQQQ, " There must be a zone number, followed by two temperatures, on this line. Sorry.\n" ); 00047 cdEXIT(EXIT_FAILURE); 00048 } 00049 return; 00050 } 00051 return; 00052 }