tem_variable_out_single Subroutine

public subroutine tem_variable_out_single(me, conf, level)

Allows the output of the single variable to lua out.

The data is written into the file, the lunit is connected to. It is formatted as a Lua table.

Arguments

Type IntentOptional Attributes Name
type(tem_variable_type), intent(in) :: me

variable to write into the lua file

type(aot_out_type), intent(inout) :: conf

aotus type handling the output to the file in lua format

integer, intent(in), optional :: level

to dump variable with key or without key


Calls

proc~~tem_variable_out_single~~CallsGraph proc~tem_variable_out_single tem_variable_out_single proc~aot_out_open_table aot_out_open_table proc~tem_variable_out_single->proc~aot_out_open_table proc~aot_out_val aot_out_val proc~tem_variable_out_single->proc~aot_out_val proc~aot_out_close_table aot_out_close_table proc~tem_variable_out_single->proc~aot_out_close_table

Called by

proc~~tem_variable_out_single~~CalledByGraph proc~tem_variable_out_single tem_variable_out_single proc~tem_variable_out_vector tem_variable_out_vector proc~tem_variable_out_vector->proc~tem_variable_out_single interface~tem_variable_out tem_variable_out interface~tem_variable_out->proc~tem_variable_out_single interface~tem_variable_out->proc~tem_variable_out_vector proc~tem_variable_dump_single tem_variable_dump_single proc~tem_variable_dump_single->proc~tem_variable_out_single proc~tem_variable_dump_vector tem_variable_dump_vector proc~tem_variable_dump_vector->proc~tem_variable_out_vector interface~tem_variable_dump tem_variable_dump interface~tem_variable_dump->proc~tem_variable_dump_single interface~tem_variable_dump->proc~tem_variable_dump_vector

Contents


Source Code

  subroutine tem_variable_out_single(me, conf, level)
    ! ---------------------------------------------------------------------------
    !> variable to write into the lua file
    type(tem_variable_type), intent(in) :: me
    !> aotus type handling the output to the file in lua format
    type(aot_out_type), intent(inout) :: conf
    !> to dump variable with key or without key
    integer, optional, intent(in) :: level
    ! ---------------------------------------------------------------------------
    integer :: level_loc
    ! ---------------------------------------------------------------------------
    if (present(level)) then
      level_loc = level
    else
      level_loc = 0
    end if

    if( level_loc == 0) then
      call aot_out_open_table( put_conf = conf, tname = 'variable' )
    else
      call aot_out_open_table( put_conf = conf )
    end if

    call aot_out_val( put_conf = conf,                                         &
      &               val      = trim(me%label),                               &
      &               vname    = 'name' )
    call aot_out_val( put_conf = conf,                                         &
      &               val      = me%nComponents,                               &
      &               vname    = 'ncomponents' )

    if (trim(me%varType) /= '') then
      call aot_out_val( put_conf = conf,                                       &
        &               val      = me%varType,                                 &
        &               vname    = 'vartype' )

      if( trim(me%varType) == 'operation' ) then
        ! write the operation kind and dependent variables
        call aot_out_open_table( put_conf = conf, tname='operation' )
        call aot_out_val( put_conf = conf,        &
          &               val      = me%operType, &
          &               vname    = 'kind'       )
        call aot_out_val( put_conf = conf,             &
          &               val      = me%input_varName, &
          &               vname    = 'input_varname'   )
        if (allocated(me%input_varIndex)) then
          call aot_out_val( put_conf = conf,              &
            &               val      = me%input_varIndex, &
            &               vname    = 'input_varindex'   )
        end if
        call aot_out_close_table( put_conf = conf )
      end if
    end if
    call aot_out_close_table( put_conf = conf )

  end subroutine tem_variable_out_single