The following subroutines are part of the Class User Section API. The interface module named class_user_interfaces MUST be used in the calling program or subroutines:
subroutine class_user_owner(sowner,stitle) character(len=*), intent(in) :: sowner ! Section owner character(len=*), intent(in) :: stitle ! Section title
subroutine class_user_toclass(usertoclass) external :: usertoclass ! User's 'toclass' subroutine
subroutine class_user_datatoclass(var) integer(kind=4), intent(in) :: var OR real(kind=4), intent(in) :: var OR real(kind=8), intent(in) :: var OR character(len=*), intent(in) :: var
subroutine class_user_add(obs,sversion,sdata,error) type(observation), intent(inout) :: obs ! Observation integer(kind=4), intent(in) :: sversion ! Version number type( ), intent(in) :: sdata ! The user data logical, intent(inout) :: error ! Logical error flag
subroutine class_user_update(obs,sversion,sdata,error) type(observation), intent(inout) :: obs ! Observation integer(kind=4), intent(in) :: sversion ! Version number type( ), intent(in) :: sdata ! The user data logical, intent(inout) :: error ! Logical error flag
Finally, the calling sequence of the user's transfer routine must be of the following form:
subroutine toclass(data,version,error) type( ), intent(in) :: data ! The data to be transfered to Class integer(kind=4), intent(in) :: version ! The version of the data logical, intent(inout) :: error ! Logical error flagThe name of this subroutine is to be defined by the user. The data type can be of any kind provided by the user. The purpose of this routine is to send the data elements to CLASS in a given order. The advantage of this mechanism is to leave CLASS compute the whole data size and store it as its will. The counterpart is that the order must be then exactly respected in the other parts of the user code, e.g. in the reading subroutine fromclass defined hereafter. Furthermore, the CLASS API does not allow to read only one element in the data.