vic/vic_run/src/alloc_and_free.c
void
free_3d_double(size_t   *shape,
               double ***array)
{
    size_t i;
    size_t j;

    for (i = 0; i < shape[0]; i++) {
        for (j = 0; j < shape[1]; j++) {
            free(array[i][j]);
        }
        free(array[i]);
    }
    free(array);
}
/******************************************************************************
 * @brief    This subroutine frees memory for a 3-dimensional double array
 *****************************************************************************/
@brief    This subroutine frees memory for a 3-dimensional double array
@brief This subroutine frees memory for a 3 - dimensional double array
void
free_3d_double(size_t   *shape,
               double ***array)
{
    size_t i;
    size_t j;
    for (i = 0; i < shape[0]; i++) {
        for (j = 0; j < shape[1]; j++) {
            free(array[i][j]);
        }
        free(array[i]);
    }
    free(array);
}
void free_3d_double ( size_t * shape , double * * * array ) { size_t i ; size_t j ; for ( i = 0 ; i < shape [ 0 ] ; i ++ ) { for ( j = 0 ; j < shape [ 1 ] ; j ++ ) { free ( array [ i ] [ j ] ) ; } free ( array [ i ] ) ; } free ( array ) ; }
@brief    This subroutine frees memory for a 3-dimensional double array
@brief This subroutine frees memory for a 3 - dimensional double array