awips2/ncep/gov.noaa.nws.ncep.viz.tools/AODTLIB/odtreadtopofile.c
root 9f19e3f712 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: 64fa9254b946eae7e61bbc3f513b7c3696c4f54f
2012-01-06 08:55:05 -06:00

31 lines
1 KiB
C

/* include file containing all AODT library global variables */
#include "../inc/odtlib.h"
/* include file containing all AODT library variable definitions */
#include "../inc/odtlibdefs-x.h"
extern int aodtv64_readtopo( char *, float, float, int * );
int aodtv64_readtopofile( char *tfile, float lat, float lon, int *topo )
/* read topography file and return topograph (land) value to application
Inputs : tfile - topography file name
mlat - latitude of data point in question
mlon - longitude of data point in question
Outputs : topo - <0=error,1=land,2=water
Return : -31 : error accessing topography file
-32 : error reading topography file
71 : cyclone is over land
0 : cyclone is over water
*/
{
int iret,itopo;
char *retstrng;
retstrng=(char *)calloc((size_t)100,sizeof(char));
iret=aodtv64_readtopo(tfile,lat,lon,&itopo);
strcpy(tfile,retstrng);
tfile[strlen(retstrng)]='\0';
*topo=itopo;
free(retstrng);
return iret;
}