Everglades Landscape Model (ELM) Home Page |
00001 00012 /* General notes on revisions to this source file. 00013 Nov/Dec 2004 v2.3.2: documentation upgrade 00014 - Re-organized, clarified scopes, Doxygen tags added 00015 Apr 2005 v2.4.4 - final version of all code for internal review 00016 00017 */ 00018 00019 #ifndef GLOBALS_H 00020 #define GLOBALS_H 00021 00022 #include <ctype.h> 00023 #include <time.h> 00024 #include <string.h> 00025 #include <stdlib.h> 00026 #include <stdio.h> 00027 #include <math.h> 00028 00029 typedef int BOOL; 00030 typedef FILE* STREAM; 00031 typedef char* STRING; 00032 typedef unsigned char UCHAR; 00033 typedef unsigned char byte; 00034 typedef unsigned int UINT; 00035 typedef unsigned short USHORT; 00036 typedef long SLONG; 00037 typedef unsigned long ULONG; 00038 00042 typedef struct prog_attr { 00043 char S_ParmName[30]; 00045 int S_ParmRelVal; 00046 float S_ParmVal; 00047 } ProgAttr; 00048 00049 int SensiOn; 00052 struct simTime { 00053 float TIME; 00056 double Jdate; 00057 int yr[2]; 00058 int mo[2]; 00059 int da[2]; 00060 int hr[2]; 00061 int mi[2]; 00062 double se[2]; 00063 int IsSimulationEnd; 00064 int IsMonthEnd; 00065 int IsYearEnd; 00066 int IsWetSeasEnd; 00067 int IsDrySeasEnd; 00068 int IsBudgEnd; 00069 int IsBIRavgEnd; 00070 int IsBudgFirst; 00071 int IsDay0; 00072 } SimTime; 00073 00075 typedef struct pTSeries { 00076 int fX; 00077 int fY; 00078 int fNpt; 00079 float fTS; 00080 float *fValue; 00081 } PTSeries; 00082 00084 typedef struct pTSeriesList { 00085 PTSeries* fList; 00086 int fNSlots; 00087 int fNSlotsUsed; 00088 int fNptTS; 00089 int fFormat; 00090 int fIndex; 00091 } PTSeriesList; 00092 00094 typedef struct rPoint { 00095 float fr; 00096 int fX; 00097 int fY; 00098 float falpha; 00099 float fValue; 00100 } RPoint; 00101 00103 typedef struct rPointList { 00104 RPoint* fList; 00105 int fNPt; 00106 int fNPtUsed; 00107 } RPointList; 00108 00109 00111 typedef struct { 00112 float **pfvar; 00115 const char *pname; 00116 char ctype; 00117 } outVar_struct; 00118 00120 typedef struct basndef { 00121 char basnTxt[12]; 00122 int numIR; 00123 int IR[30]; 00124 int FLok[30]; 00125 int numFLok; 00126 int parent; 00127 int family; 00128 double conv_m3TOcm; 00129 double conv_kgTOmgm2; 00130 } basnDef; 00131 00132 00134 typedef struct point3D { 00135 int x; 00136 int y; 00137 int z; 00138 unsigned char type; 00139 unsigned char format; 00140 } Point3D; 00141 00143 typedef struct point2D { 00144 int x; 00145 int y; 00146 } Point2D; 00147 00149 typedef struct scale1 { 00150 float s; 00151 float o; 00152 } Scale1; 00153 00155 typedef struct scale2 { 00156 float Vmin; 00157 float Vmax; 00158 } Scale2; 00159 00161 typedef struct viewParm { 00162 Scale1 scale; 00163 Scale2 gScale; 00164 Scale2 bounds; 00165 Point3D *points; 00166 unsigned char nPoints; 00167 unsigned char maxPoints; 00168 int step; 00169 unsigned char mapType; 00170 unsigned int flags; 00171 char fileName[24]; 00172 } ViewParm; 00173 00175 typedef struct seriesParm { 00176 float* data; 00177 Point2D Loc; 00178 char name[24]; 00179 int Length; 00180 int outstep; 00181 int laststep; 00182 } SeriesParm; 00183 00185 typedef struct nodenv { 00186 int procnum; 00187 int nprocs; 00188 int groupid; 00189 int taskid; 00190 } nodenv; 00191 00192 00193 #define VOIDP void* 00194 00195 #define HDF 0 00197 #define UNIX 1 00198 #define H_OPSYS UNIX 00201 #define kMAX 0 00202 #define kMIN 1 00203 #define kMAXMIN 2 00204 #define kSUM 3 00205 #define kAVE 4 00206 #define kSUMCUM 5 00207 #define kAVECUM 6 00210 #define MAX_PTSERIES 800 00211 #define MAX_TS_FILES 50 00212 #define MAX_MSG_SIZE 1200 00214 #define ISARRAY 0x8000 /* TRUE/ is Array */ 00215 #define PMASK2 0x0200 /* TRUE/ */ 00216 #define PMASK1 0x0100 /* TRUE/ */ 00217 00218 #define kCArgDepth 10 00219 #define kCArgWidth 50 00222 #define EOL '\n' 00223 #define EOS '\0' 00224 #define TAB '\t' 00225 #define POUND ((UCHAR)0x23) 00226 #define True 1 00227 #define False 0 00228 #define CASE 0 00229 #define NOCASE 1 00230 #define BEG 0 00231 #define END 1 00232 00233 #define DT dt 00234 #define T(x,y) ((int)((x)*(s1+2)+(y))) 00235 #define sec_per_day 86400.0 00236 #define PI 3.1415927 00237 #define wetEndMon 9 00238 #define wetEndDay 30 00239 #define dryEndMon 4 00240 #define dryEndDay 30 00242 #define Abs(x) (((x)>=0) ? (x) : -(x)) 00243 #define Cos(x) cos((double)x) 00244 #define Sin(x) sin((double)x) 00245 #define Tan(x) tan((double)x) 00246 #define Arctan(x) atan((double)x) 00247 #define Exp(x) exp((double)x) 00248 #define Max(x,y) (((x)>(y))?(x):(y)) 00249 #define Min(x,y) (((y)>(x))?(x):(y)) 00250 #define ramp(x) (((x)>0)?(x):0) 00251 #define sgn(x) (((x)>=0) ? 1.0 : -1.0) 00252 00253 #define conv_mgTOg 1.0e-3 00254 #define conv_gTOkg 1.0e-3 00255 #define conv_kgTO_Mg 1.0e-3 00257 #define conv_mgTOug 1.0e3 00258 #define conv_gTOmg 1.0e3 00259 #define conv_kgTOg 1.0e3 00260 #define conv_kgTOmg 1.0e6 00262 #define conv_inTOtenths_mm 254.0 00263 #define conv_ftTOm 0.3048 00265 #define conv_mTOcm 100.0 00266 #define conv_cmTOmm 10.0 00267 #define conv_mTOkm 0.001 00269 #define MAX_NHAB 255 00270 #define MAX_SECTOR 30 00272 char msgStr[MAX_MSG_SIZE]; 00281 float dt, sfstep, gwstep, canstep; 00282 int hyd_iter; 00284 unsigned char *ON_MAP; 00291 float CELL_SIZE, celWid, sq_celWid; 00292 int s0; 00293 int s1; 00306 int debug; 00307 int dynERRORnum; 00309 void WriteMsg(const char* msg, int wh); 00310 void usrErr(const char* dString); 00311 void usrErr0(const char* dString); 00312 00313 00314 #endif /* GLOBALS_H */