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

stage.h File Reference

Header file for acquiring water depth (misnamed stage) grid_io data. More...

#include "gridmap.h"
#include "globals.h"

Include dependency graph for stage.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

int stage_data_wmm (float *)
VOIDP nalloc (unsigned mem_size, const char var_name[])
 Allocate memory for a variable.

Variables

applicationStruct stage_struct
char stage_binfilename [135]
char * ModelPath
char * ProjName


Detailed Description

Header file for acquiring water depth (misnamed stage) grid_io data.

This defines or declares variables & functions that are global to stage_inp.c.

Note: documented with Doxygen, which expects specific syntax within special comments.

The Everglades Landscape Model (ELM).
last updated: Jan 2005

Definition in file stage.h.


Function Documentation

int stage_data_wmm float *   ) 
 

stage (depth) data array

Definition at line 30 of file stage_inp.c.

00031 {
00032 
00033   int i,j,k;
00034   int success = 1, fail = -1;
00035   int stat = success;
00036   char gridmapfilename[135];
00037 
00038   if(SimTime.TIME==0)  {      
00039 /* elm_OG_map is data structure containing the mapping attributes at two scales */
00040     elm_wmm_map = elm_OG_map;
00041 
00042     if(elm_wmm_map == NULL) {
00043       sprintf(msgStr, "Mapping grids and setting up stage data...");
00044       usrErr (msgStr);
00045 
00046       sprintf(gridmapfilename, "%s%s/Data/gridmapping.txt", ModelPath, ProjName );   
00047       stat = mapGrids(gridmapfilename);
00048       elm_wmm_map = elm_OG_map;
00049     }
00050 
00051     if(debug > 4) {
00052       printGridMap();
00053       sprintf(msgStr,"stage_data_wmm==> Finished mapping grids");
00054       usrErr (msgStr);
00055     }
00056 
00057     sprintf(stage_binfilename, "%s%s/Data/BoundCond_stage.BIN", ModelPath, ProjName );
00058     /* initializing data structures, move pointer to initial date (gridmap.c) */
00059     stat = initDataStruct(stage_binfilename,&stage_struct);  
00060 
00061     if(debug > 4) {
00062       /*printELM2Grid_io(); */
00063       /*drawELM2Grid_io(); */
00064       sprintf(msgStr,"stage_data_wmm==> Finished initializing");
00065       usrErr (msgStr); 
00066     }
00067 
00068   } /* end of SimTime.TIME=0 */
00069   
00070   
00071   if(stage_struct.day >= stage_struct.recRead) {      /* process the data in batch */
00072       sprintf(msgStr,"Processing batch of stage data...");
00073       usrErr (msgStr); 
00074       stat = processData(stage_binfilename,&stage_struct);
00075 
00076       if(debug > 4 ) {
00077         /*printBatchData(stageWMM,gridio_batch_len,widCnt);*/ /* TODO: remove this printBatchData function when sure is no longer needed */
00078         sprintf(msgStr,"stage_data_wmm==> Finished processing data");
00079         usrErr (msgStr); 
00080       }
00081   } /* end of if */
00082 
00083 
00084   if(stage_struct.day < stage_struct.recRead) {      /* pass the data day by day */
00085     returnData(stageSME,&stage_struct); 
00086 
00087     for(i = 0; i < s0; i++) {
00088       for(j = 0; j < s1; j++) {
00089         k = i*s1+j;
00090         stageSME[T((i+1),(j+1))] = stage_struct.dataELM[k] * conv_ftTOm;  /* convert data from feet to meters */
00091       }
00092     } 
00093 
00094     if(debug > 4) {
00095       sprintf(msgStr,"stage_data_wmm==> Finished returning data");
00096       usrErr (msgStr); 
00097     }
00098 
00099   } /* end of if */
00100     
00101   return success;
00102 }

VOIDP nalloc unsigned  mem_size,
const char  var_name[]
 

Allocate memory for a variable.

Parameters:
mem_size The size of memory space
var_name The variable's name
Returns:
Pointer to that memory

Definition at line 1774 of file Driver_Utilities.c.

01775 {
01776   VOIDP rp;
01777 
01778   
01779   if(mem_size == 0) return(NULL);
01780   rp = (VOIDP)malloc( mem_size );
01781   total_memory += mem_size;
01782   fasync(stderr);
01783   if( rp == NULL ) {
01784     fprintf(stderr,"Sorry, out of memory(%d): %s\n",mem_size,var_name);
01785     Exit(0);
01786   }
01787   fmulti(stderr);
01788   return(rp);
01789 }


Variable Documentation

applicationStruct stage_struct
 

Definition at line 18 of file stage.h.

Referenced by stage_data_wmm().

char stage_binfilename[135]
 

grid_io binary data file name

Definition at line 20 of file stage.h.

Referenced by stage_data_wmm().

char* ModelPath
 

Environment variables used in model

ModelPath environment variable, base pathname for executable and input data
ProjName environment variable, the name of the model project
DriverPath environment variable, base pathname for source code
OS_TYPE environment variable, the type of operating system being used (informational purpose only, not used in code)

Definition at line 36 of file driver_utilities.h.

char * ProjName
 

Environment variables used in model

ModelPath environment variable, base pathname for executable and input data
ProjName environment variable, the name of the model project
DriverPath environment variable, base pathname for source code
OS_TYPE environment variable, the type of operating system being used (informational purpose only, not used in code)

Definition at line 36 of file driver_utilities.h.


Generated on Thu Jul 6 11:19:53 2006 for ELM source code by  doxygen 1.3.9.1