CUSTOM_GRID
This is part of the gridtools module

Calculate a function of the grid or grids that are input and return a new grid

Examples
Glossary of keywords and components
Description of components

By default the value of the calculated quantity can be referenced elsewhere in the input file by using the label of the action. Alternatively this Action can be used to calculate the following quantities by employing the keywords listed below. These quantities can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the quantity required from the list below.

Quantity Description
.#!value the grid obtained by doing an element-wise application of an arbitrary function to the input grid
Compulsory keywords
PERIODIC if the output of your function is periodic then you should specify the periodicity of the function. If the output is not periodic you must state this using PERIODIC=NO
FUNC the function you wish to evaluate
ARG the labels of the scalars and functions on a grid that we are using to compute the required function
Options
SERIAL

( default=off ) do the calculation in serial. Do not parallelize

VAR the names to give each of the arguments in the function. If you have up to three arguments in your function you can use x, y and z to refer to them. Otherwise you must use this flag to give your variables names.