xdmf_obj_AddField Subroutine

private pure subroutine xdmf_obj_AddField(this, name, type, precision, path)

Adds field information to the xdmf object.

Type Bound

xdmf_obj

Arguments

Type IntentOptional Attributes Name
class(xdmf_obj), intent(inout) :: this

XDMF object

character(len=*), intent(in) :: name

Field name in the HDF5 dataset

character(len=*), intent(in) :: type

Type is 'Float' or 'Int"

character(len=*), intent(in) :: precision

8 or 4 depending on type and working precision

character(len=*), intent(in) :: path

Path to the HDF5 dataset


Calls

proc~~xdmf_obj_addfield~~CallsGraph proc~xdmf_obj_addfield xdmf_obj%xdmf_obj_AddField proc~xdmf_obj_resize xdmf_obj%xdmf_obj_Resize proc~xdmf_obj_addfield->proc~xdmf_obj_resize

Called by

proc~~xdmf_obj_addfield~~CalledByGraph proc~xdmf_obj_addfield xdmf_obj%xdmf_obj_AddField proc~eulerian_set_readhdf5 eulerian_set%eulerian_set_ReadHDF5 proc~eulerian_set_readhdf5->proc~xdmf_obj_addfield

Source Code

    pure subroutine xdmf_obj_AddField(this,name,type,precision,path)
      !> Adds field information to the xdmf object.
      implicit none
      class(xdmf_obj),  intent(inout) :: this                                  !! XDMF object
      character(len=*), intent(in)    :: name                                  !! Field name in the HDF5 dataset
      character(len=*), intent(in)    :: type                                  !! Type is 'Float' or 'Int"
      character(len=*), intent(in)    :: precision                             !! 8 or 4 depending on type and working precision
      character(len=*), intent(in)    :: path                                  !! Path to the HDF5 dataset
      character(len=str8) :: tmp(3)

      call this%Resize(this%fields_count + 1)

      associate (last => this%fields_count)
        this%fields(last)%name       = trim(adjustl(name))
        this%fields(last)%type       = trim(adjustl(type))
        this%fields(last)%precision  = trim(adjustl(precision))
        this%fields(last)%format     = 'HDF'
        this%fields(last)%path       = trim(adjustl(path))//':/'//trim(adjustl(name))

        write(tmp(1), fmt='(i8)') this%grid%dims(1)
        write(tmp(2), fmt='(i8)') this%grid%dims(2)
        write(tmp(3), fmt='(i8)') this%grid%dims(3)
        this%fields(last)%dimensions = trim(adjustl(tmp(1)))//' '//trim(adjustl(tmp(2)))//' '//trim(adjustl(tmp(3)))
      end associate

      return
    end subroutine xdmf_obj_AddField