-
Notifications
You must be signed in to change notification settings - Fork 0
/
wgrid_obj.c
103 lines (86 loc) · 3.79 KB
/
wgrid_obj.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*******************************************************************************
MODULE: wgrid_obj.c
CONTAINING SYSTEM: SLEUTH-3r (based on SLEUTH Model 3.0 Beta)
(Slope, Land-cover, Exclusion, Urbanization,
Transportation, and Hillshade)
also known as UGM 3.0 Beta (for Urban Growth Model)
VERSION: SLEUTH-3r [Includes Version D features]
REVISION DATE: August 31, 2006a
[Annotations added August 19, 2009]
PURPOSE:
This module is a pseudo-object which provides functions for getting
and setting the number of wgrids (working grids) available.
NOTES:
MODIFICATIONS:
TO DO:
**************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "memory_obj.h"
#include "ugm_macros.h"
/*****************************************************************************\
*******************************************************************************
** **
** MACROS **
** **
*******************************************************************************
\*****************************************************************************/
#define NUM_WORKING_GRIDS 3
/*****************************************************************************\
*******************************************************************************
** **
** SCCS ID **
** **
*******************************************************************************
\*****************************************************************************/
char wgrid_obj_c_sccs_id[] = "@(#)wgrid_obj.c 1.84 12/4/00";
/*****************************************************************************\
*******************************************************************************
** **
** STATIC MEMORY FOR THIS OBJECT **
** **
*******************************************************************************
\*****************************************************************************/
static int num_working_grids;
static BOOLEAN set_flag;
/******************************************************************************
*******************************************************************************
** FUNCTION NAME: wgrid_GetWGridCount
** PURPOSE: return num_working_grids
** AUTHOR: Keith Clarke
** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500
** CREATION DATE: 11/11/1999
** DESCRIPTION:
**
**
*/
int
wgrid_GetWGridCount ()
{
char func[] = "wgrid_GetWGridCount";
if (set_flag != TRUE)
{
sprintf (msg_buf,
"NUM_WORKING_GRIDS is not set. Please set it in your scenario file");
LOG_ERROR (msg_buf);
EXIT (1);
}
return num_working_grids;
}
/******************************************************************************
*******************************************************************************
** FUNCTION NAME: wgrid_SetWGridCount
** PURPOSE: set num_working_grids
** AUTHOR: Keith Clarke
** PROGRAMMER: Tommy E. Cathey of NESC (919)541-1500
** CREATION DATE: 11/11/1999
** DESCRIPTION:
**
**
*/
void
wgrid_SetWGridCount (int val)
{
num_working_grids = val;
set_flag = TRUE;
}