Ecological Landscape Modeling: Models Pages |
#include "gridmap.h"
#include "globals.h"
Go to the source code of this file.
Functions | |
int | evap_data_wmm (float *) |
VOIDP | nalloc (unsigned mem_size, const char var_name[]) |
Allocate memory for a variable. | |
Variables | |
applicationStruct | evap_struct |
char | evap_binfilename [335] |
char * | ModelPath |
char * | ProjName |
This defines or declares variables & functions that are global to evap_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 evap.h.
int evap_data_wmm | ( | float * | ) |
potential ET data array
Definition at line 30 of file evap_inp.c.
Referenced by cell_dyn1().
00031 { 00032 00033 int i,j,k; 00034 int success = 1, fail = -1; 00035 int stat = success; 00036 char gridmapfilename[335]; 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 pET 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,"evap_data_wmm==> Finished mapping grids"); 00054 usrErr (msgStr); 00055 } 00056 00057 sprintf(evap_binfilename, "%s%s/Data/ETp.BIN", ModelPath, ProjName ); 00058 /* initializing data structures, move pointer to initial date (gridmap.c) */ 00059 stat = initDataStruct(evap_binfilename,&evap_struct); 00060 00061 if(debug > 4) { 00062 /*printELM2Grid_io(); */ 00063 /*drawELM2Grid_io(); */ 00064 sprintf(msgStr,"evap_data_wmm==> Finished initializing"); 00065 usrErr (msgStr); 00066 } 00067 00068 } /* end of SimTime.TIME=0 */ 00069 00070 00071 if(evap_struct.day >= evap_struct.recRead) { /* process the data in batch */ 00072 sprintf(msgStr,"Processing batch of pET data..."); 00073 usrErr (msgStr); 00074 stat = processData(evap_binfilename,&evap_struct); 00075 00076 if(debug > 4 ) { 00077 /*printBatchData(evapWMM,gridio_batch_len,widCnt);*/ /* TODO: remove this printBatchData function when sure is no longer needed */ 00078 sprintf(msgStr,"evap_data_wmm==> Finished processing data"); 00079 usrErr (msgStr); 00080 } 00081 } /* end of if */ 00082 00083 00084 if(evap_struct.day < evap_struct.recRead) { /* pass the data day by day */ 00085 returnData(evapSME,&evap_struct); 00086 00087 for(i = 0; i < s0; i++) { 00088 for(j = 0; j < s1; j++) { 00089 k = i*s1+j; 00090 evapSME[T((i+1),(j+1))] = evap_struct.dataELM[k] * conv_inTOtenths_mm; /* convert data from inches to tenths of mm */ 00091 } 00092 } 00093 00094 if(debug > 4) { 00095 sprintf(msgStr,"evap_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.
mem_size | The size of memory space | |
var_name | The variable's name |
Definition at line 1857 of file Driver_Utilities.c.
Referenced by alloc_hab_hist(), alloc_mem_stats(), alloc_memory(), Canal_Network_Init(), Channel_configure(), initDataStruct(), read_map_file(), readSeriesCol(), ReadStructFlow_PtSer(), readViewParms(), setup_grid(), and write_map_file().
01858 { 01859 VOIDP rp; 01860 01861 01862 if(mem_size == 0) return(NULL); 01863 rp = (VOIDP)malloc( mem_size ); 01864 total_memory += mem_size; 01865 fasync(stderr); 01866 if( rp == NULL ) { 01867 fprintf(stderr,"Sorry, out of memory(%d): %s\n",mem_size,var_name); 01868 Exit(0); 01869 } 01870 fmulti(stderr); 01871 return(rp); 01872 }
char evap_binfilename[335] |
char* ModelPath |
Definition at line 40 of file driver_utilities.h.
Referenced by BIRinit(), evap_data_wmm(), get_global_parm(), get_hab_parm(), get_modexperim_parm(), get_parmf(), ModExperim_test(), PTSL_ReadLists(), PTSL_test(), rain_data_wmm(), read_header(), read_map_dims(), Read_schedule(), ReadChanStruct(), readMap(), readOutlist(), ReadStructFlow_PtSer(), ReadStructTP_PtSer(), ReadStructTS_PtSer(), ReadStructures(), SensiParm_list(), set_env_vars(), and stage_data_wmm().
char * ProjName |
Definition at line 40 of file driver_utilities.h.
Referenced by BIRinit(), BIRoutfiles(), Canal_Network_Init(), cell_dyn1(), Channel_configure(), evap_data_wmm(), get_global_parm(), get_hab_parm(), get_modexperim_parm(), get_parmf(), main(), ModExperim_test(), open_debug_outFile(), open_point_lists(), PTSL_ReadLists(), PTSL_test(), rain_data_wmm(), read_header(), read_map_dims(), Read_schedule(), ReadChanStruct(), readMap(), readOutlist(), ReadStructFlow_PtSer(), ReadStructTP_PtSer(), ReadStructTS_PtSer(), ReadStructures(), send_point_lists2(), SensiParm_list(), set_env_vars(), stage_data_wmm(), write_map_file(), and writeSeries().