NASA Logo
Ocean Color Science Software

ocssw V2022
allocate5d.c File Reference
#include "allocate5d.h"
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for allocate5d.c:

Go to the source code of this file.

Functions

float ***** allocate5d_float (size_t nq, size_t nr, size_t nz, size_t ny, size_t nx)
 
void free5d_float (float *****p)
 

Detailed Description

Utility functions for allocating and freeing five-dimensional arrays of various types.

This file was created by allocate5d.pl and should not be edited manually.

Definition in file allocate5d.c.

Function Documentation

◆ allocate5d_float()

float***** allocate5d_float ( size_t  nq,
size_t  nr,
size_t  nz,
size_t  ny,
size_t  nx 
)

Allocate a five-dimensional array of type float of a given size.

The order of the parameters are (now) the same as when the data is being accessed. E.g., this is valid (ignoring the printf type specifier):

float *****array = allocate5d_float(10,1,7,5,1); printf("%d\n", array[9][0][6][4][0]);

Parameters
[in]nqslowest incrimenting dimension of array in memory.
[in]nrreally slow incrimenting dimension of array in memory.
[in]nzslow incrimenting dimension of array in memory.
[in]nyfast dimension of array.
[in]nxfastest incrimenting dimension of array.
Returns
A malloc'd array or NULL if any malloc fails.

Definition at line 12 of file allocate5d.c.

◆ free5d_float()

void free5d_float ( float *****  p)

Free a five-dimensional array created by allocate5d_float.

Parameters
[in]pPointer to array created by allocate5d_float.

Definition at line 58 of file allocate5d.c.