Everglades Landscape Model (ELM) Home Page
Main Page | Data Structures | Directories | File List | Data Fields | Globals

serial.h

Go to the documentation of this file.
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         
00016 */
00017 
00018 #ifndef SERIAL_H
00019 #define SERIAL_H
00020 
00021 #include "globals.h"
00022 #if HDF /* (Nov 2004): do not #define HDF to true (globals.h) until hdf header sources are updated */
00023 #include "hdf.h"
00024 #endif
00025 
00026 
00027 #define HDF_VERIFY(a) if(ret == FAIL) { printf("*** UNEXPECTED RETURN from %s is %d\n", a, (int)ret); }
00028 
00030 struct combo_table      
00031 {
00032   char  name[25];       
00033   int step;             
00034   int type;             
00035   int ocnt;             
00036   float fvalue[10];     
00037   UCHAR  free;          
00038 };
00039 
00040 
00041 /* char gSectorChar = '¥'; */ /* this was changed (in HabParms dbase); the ascii special char had Macintosh origin (worked in code, but obscure translation in other OS) */
00042 /* char gHabChar = 'É'; */    /* this was changed (in HabParms dbase); the ascii special char had Macintosh origin (worked in code, but obscure translation in other OS) */
00043 char gSectorChar = '@';         
00044 char gHabChar = '^';             
00045 int habNumTot = 0;                                      
00047 char fileDelimitChar = 'È'; /* unused in v2.3 and above; the special char removed from .c source, put here only to indicate the past use of this special char in file name delimitation */
00048 char cTemp[200];                
00049 char gTerm[4];                  
00051 char gCArg[kCArgDepth][kCArgWidth];     
00053 int cell_pts[MAX_TS_FILES];     
00054 int numPtFiles=0;                               
00056 FILE* dFile;                    
00057 FILE* Driver_outfile;   
00058 FILE* *cnfgFile;                
00060 #define MAXCOMBOS  30                                   
00061 struct combo_table ctable[MAXCOMBOS];   
00062 UINT max_combos_open;                                    
00064 void writeMap(char*, void*, int, unsigned char, int);
00065 void write_header(char* mapFileName,int size);
00066 void send_point_lists2(SeriesParm *pSeries, int nSeries);
00067 void writeSeries(void* fValue, char* label, char* desc, int N0, int N1, byte Mtype, byte format);
00068 void Combine(float* fValue, char* label, int nComp, int cType, int step);
00069 void open_point_lists(SeriesParm *pSeries, int nSeries);
00070 
00071 void exparam( struct nodenv* envInfo);
00072 void exgridsplit(int nprocs, int ndim,int nprocs2[2]);
00073 void exgridcoord(int pnum, int rnum[2]);
00074 void exgridsize( int pnum, int gsize[2],int lsize[2],int lstart[2]);
00075 void set_async_mode(FILE* file);
00076 void fmulti(FILE* file);
00077 void fsingl(FILE* file);
00078 void fasync(FILE* file);
00079 void exchange_borders(UCHAR* map, int size);
00080 void Cplot(VOIDP Map, unsigned char Mtype, float max_value, float min_value);
00081 void broadcastMsg( UCHAR* msgPtr);
00082 void broadcastInt(int* iValPtr);
00083 void broadcastChar(UCHAR* cPtr);
00084 void broadcastData( void* dataPtr, int *dataSize);
00085 void broadcastFloat(void* dataPtr);
00086 void sync_processors();
00087 void open_debug_outFile(int index);
00088 int exgridinit(int dim, int* nprocs);
00089 int on_this_proc(int x,int y);
00090 void local_setup(int argc, char** argv);
00091 
00092 int init_config_file(FILE *vpFile, char term1, char term2, char term3, char term4);
00093 int skip_cnfg_space(FILE *vpFile, char* tch);
00094 int parse_packet( FILE *vpFile, int* nArgs, char* test);
00095 int get_number(FILE *infile );
00096 int goto_index(FILE *infile, char tchar, int index);
00097 int read_header(char* mapfile);
00098 int getCombineIndex( char* name, int step,int type,int *last);
00099 
00100 float* get_hab_parm(char* s_parm_name, int s_parm_relval, char* parmName);
00101 float get_global_parm(char* s_parm_name, int s_parm_relval, char* parmName );
00102 float get_Nth_parm( FILE *infile, int pIndex, int* end, int hIndex );
00103 char* match_Sparm( char* s_parm_name, int s_parm_relval, char* parmName); 
00104 
00105 float SMDRAND(float fminVal, float fmaxVal);
00106 float* readSeriesCol(char *filename, int format, int index, int* Npt, float* TStep, int col);
00107 
00108 byte readMap(char*, void*);
00109 
00110 int gSLen[MAX_NHAB]; /* unused */
00111 
00112 /* externs */
00113 /* from driver_utilities.h */
00114 extern char *ProjName;
00115 extern char *ModelPath;
00116 extern char *OutputPath;
00117 extern char modelName[20], modelVers[10];
00118 
00119 extern void fatal(const char *msg);
00120 extern void calcdate(double jd, int *m, int *d, int *y, int *h, int *mi, double *sec);
00121 extern int skip_white(FILE* infile);
00122 extern int scan_forward (FILE* infile, const char* tstring);
00123 extern int find_char(FILE *infile, char tchar);
00124 extern double julday(int mon, int day, int year, int h, int mi, double se);
00125 extern VOIDP nalloc(unsigned mem_size, const char var_name[]);
00126 
00127 /* from generic_driver.h */
00128 extern char SimAlt[20];        
00129 extern char SimModif[20];        
00130 extern int gbl_size[2]; 
00131 extern int seed; 
00132 extern int procnum, Lprocnum, nprocs[2], nproc, recpnum[2], tramType, tramNum[2];
00133 extern int PORnumday;
00134 extern double Jdate_init;
00135 
00136 #endif  /* SERIAL_H */

Generated on Thu Jul 6 11:17:48 2006 for ELM source code by  doxygen 1.3.9.1