User hook for command SET VARIABLE USER
Keywords: class-user

Next: Example Up: Adding hooks to the Previous: API Contents

## User hook for command `SET VARIABLE USER`

If CLASS knows about a User Subsection owner and title when `SET VARIABLE USER` is invoked, it can instantiate the SIC variables which describe the data of this subsection. This is be done if the associated hook has been defined and declared to CLASS. The steps to do so are, as usual:

1. tell CLASS which subsection it owns with `class_user_owner`. This is optional if it has been done elsewhere.
2. declare to CLASS with `class_user_setvar` a subroutine which is able to instantiate the SIC variables associated to the User Subsection.

The subroutines `class_user_def_inte`, `class_user_def_real` and `class_user_def_dble` and `class_user_def_char` will create respectively an integer*4, real*4 and real*8 and character string in `R%USER%OWNER%` (where `OWNER` is the owner previously declared). The subroutines order must match the order the data was written in the User Section buffer.

The calling sequence of these subroutines is described in the following sections. The suffix name of the SIC variable is given as first argument, e.g. `FOO` for `R%USER%OWNER%FOO`. The arguments 'ndim' and 'dims' describe the variable dimensions, but only scalars, 1D, and 2D-arrays are currently supported (ndim=0, 1, or 2). For the character variables, 'strlen' is the string length which has to be read from the buffer.

Note that once it has been instantiated, the SIC structure `R%USER%OWNER%` will be updated each time the data changes (e.g. after a `GET NEXT`).

Subsections

- Example
- API

Next: Example Up: Adding hooks to the Previous: API Contents