VTK_VAR_XML_LIST_I1 Function

private function VTK_VAR_XML_LIST_I1(NC_NN, N_COL, varname, var) result(E_IO)

Function for saving list variable (I1P).

Arguments

Type IntentOptional AttributesName
integer(kind=I4P), intent(in) :: NC_NN
integer(kind=I4P), intent(in) :: N_COL
character(len=*), intent(in) :: varname
integer(kind=I1P), intent(in) :: var(1:NC_NN,1:N_COL)

Return Value integer(kind=I4P)


Calls

proc~~vtk_var_xml_list_i1~~CallsGraph proc~vtk_var_xml_list_i1 VTK_VAR_XML_LIST_I1 interface~str str proc~vtk_var_xml_list_i1->interface~str proc~str_i8p str_I8P interface~str->proc~str_i8p proc~str_r8p str_R8P interface~str->proc~str_r8p proc~str_i1p str_I1P interface~str->proc~str_i1p proc~str_i4p str_I4P interface~str->proc~str_i4p proc~str_r16p str_R16P interface~str->proc~str_r16p proc~str_i2p str_I2P interface~str->proc~str_i2p proc~str_r4p str_R4P interface~str->proc~str_r4p

Called by

proc~~vtk_var_xml_list_i1~~CalledByGraph proc~vtk_var_xml_list_i1 VTK_VAR_XML_LIST_I1 interface~vtk_var_xml VTK_VAR_XML interface~vtk_var_xml->proc~vtk_var_xml_list_i1

Contents

Source Code


Source Code

  function VTK_VAR_XML_LIST_I1(NC_NN,N_COL,varname,var) result(E_IO)
  !---------------------------------------------------------------------------------------------------------------------------------
  !! Function for saving list variable (I1P).
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  implicit none
  integer(I4P), intent(IN)::  NC_NN                ! number of cells or nodes
  integer(I4P), intent(IN)::  N_COL                ! number of columns
  character(*), intent(IN)::  varname              ! variable name
  integer(I1P),  intent(IN):: var(1:NC_NN,1:N_COL) ! components
  integer(I4P)::              E_IO                 ! Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done
  integer(I4P)::              n1,n2                ! counter
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  select case(f_out)
  case(f_out_ascii)
    write(unit=Unit_VTK,fmt='(A)',iostat=E_IO) repeat(' ',indent)//              &
                                               '<DataArray type="Int8" Name="'// &
                                               trim(varname)//                   &
                                               '" NumberOfComponents="'//        &
                                               trim(str(.true.,N_COL))//         &
                                               '" format="ascii">'
    do n1=1,NC_NN
      write(unit=Unit_VTK,fmt='('//FI1P//')',iostat=E_IO) (var(n1,n2),n2=1,N_COL)
    enddo
    write(unit=Unit_VTK,fmt='(A)',iostat=E_IO) repeat(' ',indent)//'</DataArray>'
  case(f_out_binary)
    write(unit=Unit_VTK,iostat=E_IO) repeat(' ',indent)//              &
                                     '<DataArray type="Int8" Name="'// &
                                     trim(varname)//                   &
                                     '" NumberOfComponents="'//        &
                                     trim(str(.true.,N_COL))//         &
                                     '" format="appended" offset="',   &
                                     trim(str(.true.,ioffset)),        &
                                     '">'//end_rec
    N_Byte  = N_COL*NC_NN*sizeof(Tipo_I1)
    ioffset = ioffset + sizeof(Tipo_I4) + N_Byte
    write(unit=Unit_VTK_Append,iostat=E_IO)N_Byte,'I1',N_COL*NC_NN
    do n1=1,NC_NN
      write(unit=Unit_VTK_Append,iostat=E_IO) var(n1,:)
    enddo
    write(unit=Unit_VTK,iostat=E_IO) repeat(' ',indent)//'</DataArray>'//end_rec
  endselect
  return
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction VTK_VAR_XML_LIST_I1