VTK_VAR_VECT_R4 Function

private function VTK_VAR_VECT_R4(vec_type, NC_NN, varname, varX, varY, varZ) result(E_IO)

Function for saving field of vectorial variable (R4P).

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: vec_type
integer(kind=I4P), intent(in) :: NC_NN
character(len=*), intent(in) :: varname
real(kind=R4P), intent(in) :: varX(1:NC_NN)
real(kind=R4P), intent(in) :: varY(1:NC_NN)
real(kind=R4P), intent(in) :: varZ(1:NC_NN)

Return Value integer(kind=I4P)


Calls

proc~~vtk_var_vect_r4~~CallsGraph proc~vtk_var_vect_r4 VTK_VAR_VECT_R4 proc~upper_case Upper_Case proc~vtk_var_vect_r4->proc~upper_case

Called by

proc~~vtk_var_vect_r4~~CalledByGraph proc~vtk_var_vect_r4 VTK_VAR_VECT_R4 interface~vtk_var VTK_VAR interface~vtk_var->proc~vtk_var_vect_r4 proc~save_fe_f_vtk save_fe_f_vtk proc~save_fe_f_vtk->interface~vtk_var

Contents

Source Code


Source Code

  function VTK_VAR_VECT_R4(vec_type,NC_NN,varname,varX,varY,varZ) result(E_IO)
  !---------------------------------------------------------------------------------------------------------------------------------
  !! Function for saving field of vectorial variable (R4P).
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  implicit none
  character(*), intent(IN):: vec_type      ! vector type: vect = generic vector , norm = normal vector
  integer(I4P), intent(IN):: NC_NN         ! number of nodes or cells
  character(*), intent(IN):: varname       ! variable name
  real(R4P),    intent(IN):: varX(1:NC_NN) ! x component of vector
  real(R4P),    intent(IN):: varY(1:NC_NN) ! y component of vector
  real(R4P),    intent(IN):: varZ(1:NC_NN) ! z component of vector
  integer(I4P)::             E_IO          ! Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done
  integer(I8P)::             n1            ! counter
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  select case(f_out)
  case(f_out_ascii)
    select case(Upper_Case(trim(vec_type)))
    case('vect')
      write(unit=Unit_VTK,fmt='(A)',          iostat=E_IO)'VECTORS '//trim(varname)//' float'
    case('norm')
      write(unit=Unit_VTK,fmt='(A)',          iostat=E_IO)'NORMALS '//trim(varname)//' float'
    endselect
    write(unit=Unit_VTK,fmt='(3'//FR4P//')',iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN)
  case(f_out_binary)
    select case(Upper_Case(trim(vec_type)))
    case('vect')
      write(unit=Unit_VTK,iostat=E_IO)'VECTORS '//trim(varname)//' float'//end_rec
    case('norm')
      write(unit=Unit_VTK,iostat=E_IO)'NORMALS '//trim(varname)//' float'//end_rec
    endselect
    write(unit=Unit_VTK,iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN)
    write(unit=Unit_VTK,iostat=E_IO)end_rec
  endselect
  return
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction VTK_VAR_VECT_R4