Cloudy Data Archive
cloudy
trunk
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
parse_map.cpp
Go to the documentation of this file.
1
/* This file is part of Cloudy and is copyright (C)1978-2022 by Gary J. Ferland and
2
* others. For conditions of distribution and use see copyright notice in license.txt */
3
/*ParseMap parse map command to produce map of heating and cooling,
4
* map is produced by calling punt(" map") */
5
#include "
cddefines.h
"
6
#include "
hcmap.h
"
7
#include "
parser.h
"
8
9
void
ParseMap
(
Parser
&p )
10
{
11
DEBUG_ENTRY
(
"ParseMap()"
);
12
13
/* say output goes to stdout */
14
ioMAP
= (
ioQQQ
== NULL ) ? stdout :
ioQQQ
;
15
16
/* do cooling space map for specified zones
17
* if no number, or <0, do map and punch out without doing first zone */
18
hcmap
.
MapZone
= (long)p.
FFmtRead
();
19
if
( p.
lgEOL
() )
20
{
21
hcmap
.
MapZone
= 0;
22
return
;
23
}
24
25
if
( p.
nMatch
(
"RANG"
) )
26
{
27
bool
lgLogOn;
28
hcmap
.
RangeMap
[0] = (
realnum
)p.
FFmtRead
();
29
if
(
hcmap
.
RangeMap
[0] <= 10. )
30
{
31
hcmap
.
RangeMap
[0] =
exp10
(
hcmap
.
RangeMap
[0]);
32
lgLogOn =
true
;
33
}
34
else
35
{
36
lgLogOn =
false
;
37
}
38
hcmap
.
RangeMap
[1] = (
realnum
)p.
FFmtRead
();
39
if
( lgLogOn )
40
hcmap
.
RangeMap
[1] =
exp10
(
hcmap
.
RangeMap
[1]);
41
42
if
( p.
lgEOL
() )
43
{
44
fprintf
(
ioQQQ
,
" There must be a zone number, followed by two temperatures, on this line. Sorry.\n"
);
45
cdEXIT
(
EXIT_FAILURE
);
46
}
47
if
(
hcmap
.
RangeMap
[1] <=
hcmap
.
RangeMap
[0] )
48
{
49
fprintf
(
ioQQQ
,
" The upper temperature limit must be larger than the lower: "
50
"found lower=%g upper=%g.\n"
,
hcmap
.
RangeMap
[0],
hcmap
.
RangeMap
[1] );
51
cdEXIT
(
EXIT_FAILURE
);
52
}
53
}
54
}
Parser::nMatch
bool nMatch(const char *chKey) const
Definition:
parser.h:150
ioMAP
FILE * ioMAP
Definition:
cdinit.cpp:9
Parser::FFmtRead
double FFmtRead(void)
Definition:
parser.cpp:472
exp10
double exp10(double x)
Definition:
cddefines.h:1368
t_hcmap::MapZone
long int MapZone
Definition:
hcmap.h:20
ioQQQ
FILE * ioQQQ
Definition:
cddefines.cpp:7
Parser
Definition:
parser.h:43
parser.h
ParseMap
void ParseMap(Parser &p)
Definition:
parse_map.cpp:9
realnum
float realnum
Definition:
cddefines.h:124
EXIT_FAILURE
#define EXIT_FAILURE
Definition:
cddefines.h:168
cdEXIT
#define cdEXIT(FAIL)
Definition:
cddefines.h:482
t_hcmap::RangeMap
realnum RangeMap[2]
Definition:
hcmap.h:23
cddefines.h
DEBUG_ENTRY
#define DEBUG_ENTRY(funcname)
Definition:
cddefines.h:723
hcmap.h
Parser::lgEOL
bool lgEOL(void) const
Definition:
parser.h:113
fprintf
int fprintf(const Output &stream, const char *format,...)
Definition:
service.cpp:1121
hcmap
t_hcmap hcmap
Definition:
hcmap.cpp:23
Generated by
1.8.5