Keywords: class-user

Next: User hook for command Up: User hook for command Previous: Example Contents

### API

The following subroutines have to be used in order to instantiate SIC variables in the structure R%USER%.

- Declare the user's subroutine for variables instantiation:

      subroutine class_user_setvar(usersetvar)
        external :: usersetvar

- Instantiate a SIC variable in `R%USER%OWNER%` (numeric types, respectively integer*4, real*4 and real*8). Only scalars (ndim=0), 1D (ndim=1), and 2D-arrays (ndim=2) are currently supported.

      subroutine class_user_def_inte(suffix,ndim,dims,error)
        character(len=*), intent(in)    :: suffix   ! Component name
        integer(kind=4),  intent(in)    :: ndim     ! Number of dimensions (0=scalar)
        integer(kind=4),  intent(in)    :: dims(4)  ! Dimensions (unused if scalar)
        logical,          intent(inout) :: error    ! Logical error flag

      subroutine class_user_def_real(suffix,ndim,dims,error)
        character(len=*), intent(in)    :: suffix   ! Component name
        integer(kind=4),  intent(in)    :: ndim     ! Number of dimensions (0=scalar)
        integer(kind=4),  intent(in)    :: dims(4)  ! Dimensions (unused if scalar)
        logical,          intent(inout) :: error    ! Logical error flag

      subroutine class_user_def_dble(suffix,ndim,dims,error)
        character(len=*), intent(in)    :: suffix   ! Component name
        integer(kind=4),  intent(in)    :: ndim     ! Number of dimensions (0=scalar)
        integer(kind=4),  intent(in)    :: dims(4)  ! Dimensions (unused if scalar)
        logical,          intent(inout) :: error    ! Logical error flag

- Instantiate a SIC variable in `R%USER%OWNER%` (scalar character strings).

      subroutine class_user_def_char(suffix,lstring,error)
        character(len=*), intent(in)    :: suffix   ! Component name
        integer(kind=4),  intent(in)    :: lstring  ! String length
        logical,          intent(inout) :: error    ! Logical error flag

The calling sequence of the user's instantiation routine must be of the following form:

    subroutine mysetvar(version,error)
      integer(kind=4), intent(in)    :: version  ! The version of the data
      logical,         intent(inout) :: error    ! Logical error flag

The name of this subroutine is free.