awips2/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/dgdriv_c/dgfall.c
Steve Harris 7f90924706 12.4.1-10 baseline
Former-commit-id: 7fa9dbd5fb [formerly 4bfbdad17d] [formerly 9f8cb727a5] [formerly 7fa9dbd5fb [formerly 4bfbdad17d] [formerly 9f8cb727a5] [formerly 8485b90ff8 [formerly 9f8cb727a5 [formerly bf53d06834caa780226121334ac1bcf0534c3f16]]]]
Former-commit-id: 8485b90ff8
Former-commit-id: 40aa780b3d [formerly 33a67cdd82] [formerly 73930fb29d0c1e91204e76e6ebfdbe757414f319 [formerly a28d70b5c5]]
Former-commit-id: a16a1b4dd44fc344ee709abbe262aeed58a8339b [formerly e5543a0e86]
Former-commit-id: 0c25458510
2012-05-01 18:06:13 -05:00

54 lines
1.4 KiB
C

#include "dg.h"
void dg_fall ( int *iret )
/************************************************************************
* dg_fall *
* *
* This subroutine frees the actual memory for all internal grids, and *
* reset the grid information. *
* *
* dg_fall ( iret ) *
* *
* Input parameters: *
* *
* Output parameters: *
* *iret int Return code *
* 0 = normal return *
** *
* Log: *
* R. Tian/SAIC 3/06 *
* T. Piper/SAIC 03/08 Replaced cmm_free1d with G_FREE *
***********************************************************************/
{
int ii;
/*---------------------------------------------------------------------*/
*iret = 0;
for ( ii = 0; ii < _dggrid.maxdgg; ii++ ) {
/*
* Reset the grid information.
*/
_dggrid.iusesv[ii] = 0;
_dggrid.dttimd1[ii][0] = '\0';
_dggrid.dttimd2[ii][0] = '\0';
_dggrid.leveld1[ii] = 0;
_dggrid.leveld2[ii] = 0;
_dggrid.ivcrdd[ii] = 0;;
_dggrid.gparmd[ii][0] = '\0';
_dggrid.savflg[ii] = G_FALSE;
/*
* If grid exists, free its memory.
*/
if ( _dggrid.dgg[ii].grid ) {
#ifdef MEM_DEBUG
printf ( "Freed grid at %p with size: %d\n",
(void *)(_dggrid.dgg[ii].grid), _dggrid.dgg[ii].size );
#endif
G_FREE ( _dggrid.dgg[ii].grid, float );
_dggrid.dgg[ii].size = 0;
}
}
return;
}