next up previous contents
Next: Notes Up: Accessing the mask from Previous: Setting and checking mask   Contents

Faster bitwise operators

As in the C interface, alternative bitwise operators have been defined in order to more quickly operate on the mask at a point. In order to use these functions, the bitmasks corresponding to the type and states in question must first be obtained using the following functions:

$\textstyle \parbox{\linewidth}{
\vspace{\baselineskip}\noindent\texttt{
SpaceM...
...item[\emph{type\_name}] A character string naming the type.
\end{description}}}$

$\textstyle \parbox{\linewidth}{
\vspace{\baselineskip}\noindent\texttt{
SpaceM...
...tem[\emph{type\_name}] A character string naming the state.
\end{description}}}$

Once the bitmasks for the type and state have been obtained, the following macros can be used directly:


SpaceMask_SetStateBitsF90(mask, i, j, k, type_bits, state_bits)

This macro sets the value of the mask at the index $(i,j,k)$ to the given state. It doesn't have a return value, and can be used directly inline (without a Fortran `call').


SpaceMask_CheckStateBitsF90(mask, i, j, k, type_bits, state_bits)

A value of `.true.' is returned if the given state has been set, or `.false.' otherwise. The macro can be used directly in Fortran boolean expressions, as in the examples in Appendix D19.6.2.


next up previous contents
Next: Notes Up: Accessing the mask from Previous: Setting and checking mask   Contents