Ecological Landscape Modeling: Models Pages

grid_io.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                 - Doxygen tags added 
00015         
00016 */
00017 
00018 /*
00019 SCCS ID: "@(#)grid_io.h 1.10 05/22/00 SFWMD Research and Planning Departments"
00020 
00021 Copyright, 1995, South Florida Water Management District
00022 
00023 DISCLAIMER:
00024 
00025 ANY INFORMATION, INCLUDING BUT NOT LIMITED TO SOFTWARE AND DATA,
00026 RECEIVED FROM THE SOUTH FLORIDA WATER MANAGEMENT DISTRICT ("DISTRICT")
00027 IN FULFILLMENT OF A PUBLIC RECORDS REQUEST IS PROVIDED "AS IS" WITHOUT
00028 WARRANTY OF ANY KIND, AND THE DISTRICT EXPRESSLY DISCLAIMS ALL EXPRESS
00029 AND IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00030 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00031 THE DISTRICT DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS
00032 REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE INFORMATION
00033 PROVIDED TO YOU BY THE DISTRICT IN TERMS OF CORRECTNESS, ACCURACY,
00034 RELIABILITY, TIMELINESS OR OTHERWISE.  THE ENTIRE RISK AS TO THE
00035 RESULTS AND PERFORMANCE OF ANY INFORMATION OBTAINED FROM THE DISTRICT
00036 IS ENTIRELY ASSUMED BY THE RECIPIENT.
00037 
00038 */
00039 
00040 /* -------------------------------------------------------------
00041    header grid_io.h
00042    This header contains definitions for SFWMM data grid and 
00043    io routines
00044    ------------------------------------------------------------- */
00045 #ifndef GRID_IO_H
00046 #define GRID_IO_H
00047 #include "stdlib.h"
00048 #include "stdio.h"
00049 
00050 /* grid definition record - contains all information necessary to
00051    define the areal grid */
00052 
00053 #ifndef MAX_GRID_ROWS
00054 #define MAX_GRID_ROWS 66                
00055 #endif
00056 
00057 #define GRID_TITLE_LENGTH 80            
00058 #define GRID_TAG_LENGTH 80                      
00061 typedef struct {
00062         char title[GRID_TITLE_LENGTH];          
00063         int number_of_rows;                                     
00064         int number_of_nodes;                            
00065         struct { float x, y; } size;             /* TODO: verify, ELMchange, original had "struct { float x, y; } size", no semicolon after size */
00066 } GR_HEADER;
00067 
00069 typedef struct {
00070   int *xstart;                                                  
00071   int *xend;                                                    
00072   int *cum_node_count;                                  
00073 } GR_CONFIG;
00074 
00076 typedef struct {
00077         GR_HEADER header;                                               
00078         GR_CONFIG config;                                               
00079 } GRID;
00080 
00081 /* fortran interface for files */
00082 
00083 struct GR_FORTRAN_FILE_STRUC {
00084        FILE *fptr;
00085        int unit_number;
00086        struct GR_FORTRAN_FILE_STRUC *next;
00087 };
00088 typedef struct GR_FORTRAN_FILE_STRUC GR_FORTRAN_FILE;
00089 
00090 /* available routines */
00091 #ifdef __cplusplus
00092 extern "C" {
00093 #endif
00094 int grid_write_header(FILE *file, GRID *grid);
00095 #ifdef __cplusplus
00096 }
00097 #endif
00098 
00099 #ifdef __cplusplus
00100 extern "C" {
00101 #endif
00102 int grid_read_header(FILE *file, GRID *grid);
00103 #ifdef __cplusplus
00104 }
00105 #endif
00106 
00107 #ifdef __cplusplus
00108 extern "C" {
00109 #endif
00110 int grid_write(FILE *file, GRID *grid, char *tag, float *values);
00111 #ifdef __cplusplus
00112 }
00113 #endif
00114 
00115 #ifdef __cplusplus
00116 extern "C" {
00117 #endif
00118 int grid_read(FILE *file, GRID *grid, char *tag, float *values);
00119 #ifdef __cplusplus
00120 }
00121 #endif
00122 
00123 
00124 /*int grid_find_tag(FILE *file, GRID *grid);*/
00125 #ifdef __cplusplus
00126 extern "C" {
00127 #endif
00128 int grid_skip(FILE *file, GRID *grid, int num);
00129 #ifdef __cplusplus
00130 }
00131 #endif
00132 
00133 #ifdef __cplusplus
00134 extern "C" {
00135 #endif
00136 int grid_tag_search(FILE *file, GRID *grid, char *string);
00137 #ifdef __cplusplus
00138 }
00139 #endif
00140 
00141 #ifdef __cplusplus
00142 extern "C" {
00143 #endif
00144 int grid_top(FILE *file, GRID *grid);
00145 #ifdef __cplusplus
00146 }
00147 #endif
00148 
00149 #ifdef __cplusplus
00150 extern "C" {
00151 #endif
00152 int grid_bottom(FILE *file, GRID *grid);
00153 #ifdef __cplusplus
00154 }
00155 #endif
00156 
00157 #ifdef __cplusplus
00158 extern "C" {
00159 #endif
00160 int grid_count_snapshots(FILE *file, GRID *grid);
00161 #ifdef __cplusplus
00162 }
00163 #endif
00164 
00165 #ifdef __cplusplus
00166 extern "C" {
00167 #endif
00168 int grid_free(GRID *grid);
00169 #ifdef __cplusplus
00170 }
00171 #endif
00172 /* end of header */
00173 
00174 #endif /* GRID_IO_H */

Generated on Sat Jan 7 14:04:15 2012 for ELM source code by  doxygen 1.5.6