solid_set_WriteHDF5 Subroutine

private impure subroutine solid_set_WriteHDF5(this, iter, time)

Uses

  • proc~~solid_set_writehdf5~~UsesGraph proc~solid_set_writehdf5 solid_set%solid_set_WriteHDF5 module~leaputils leapUtils proc~solid_set_writehdf5->module~leaputils module~leapkinds leapKinds module~leaputils->module~leapkinds iso_fortran_env iso_fortran_env module~leapkinds->iso_fortran_env

Writes all solids to disk using HDF5. Add some attributes

Type Bound

solid_set

Arguments

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

A collection of solids

integer, intent(in) :: iter

Iteration at write

real(kind=wp), intent(in) :: time

Time at write


Calls

proc~~solid_set_writehdf5~~CallsGraph proc~solid_set_writehdf5 solid_set%solid_set_WriteHDF5 none~writeattributes hdf5_obj%WriteAttributes proc~solid_set_writehdf5->none~writeattributes proc~hdf5_obj_final hdf5_obj%hdf5_obj_Final proc~solid_set_writehdf5->proc~hdf5_obj_final proc~hdf5_obj_init hdf5_obj%hdf5_obj_Init proc~solid_set_writehdf5->proc~hdf5_obj_init proc~marker_set_writehdf5 marker_set%marker_set_WriteHDF5 proc~solid_set_writehdf5->proc~marker_set_writehdf5 proc~stringtool_obj_removeextension stringtool_obj%stringtool_obj_RemoveExtension proc~solid_set_writehdf5->proc~stringtool_obj_removeextension proc~hdf5_obj_writeattributes0d hdf5_obj%hdf5_obj_WriteAttributes0D none~writeattributes->proc~hdf5_obj_writeattributes0d proc~hdf5_obj_writeattributes1d hdf5_obj%hdf5_obj_WriteAttributes1D none~writeattributes->proc~hdf5_obj_writeattributes1d h5garbage_collect_f h5garbage_collect_f proc~hdf5_obj_final->h5garbage_collect_f proc~hashtbl_obj_final hashtbl_obj%hashtbl_obj_Final proc~hdf5_obj_final->proc~hashtbl_obj_final h5open_f h5open_f proc~hdf5_obj_init->h5open_f proc~hashtbl_obj_init hashtbl_obj%hashtbl_obj_Init proc~hdf5_obj_init->proc~hashtbl_obj_init proc~marker_set_writehdf5->none~writeattributes proc~marker_set_writehdf5->proc~hdf5_obj_final proc~marker_set_writehdf5->proc~hdf5_obj_init proc~marker_set_writehdf5->proc~stringtool_obj_removeextension c c proc~marker_set_writehdf5->c f f proc~marker_set_writehdf5->f markers markers proc~marker_set_writehdf5->markers n n proc~marker_set_writehdf5->n p p proc~marker_set_writehdf5->p proc~lagrangian_set_updatecount lagrangian_set%lagrangian_set_UpdateCount proc~marker_set_writehdf5->proc~lagrangian_set_updatecount proc~parallel_obj_rankisroot parallel_obj%parallel_obj_RankIsRoot proc~marker_set_writehdf5->proc~parallel_obj_rankisroot proc~sysutils_obj_createdirectory sysutils_obj%sysutils_obj_CreateDirectory proc~marker_set_writehdf5->proc~sysutils_obj_createdirectory v v proc~marker_set_writehdf5->v h5aclose_f h5aclose_f proc~hdf5_obj_writeattributes0d->h5aclose_f h5acreate_f h5acreate_f proc~hdf5_obj_writeattributes0d->h5acreate_f h5awrite_f h5awrite_f proc~hdf5_obj_writeattributes0d->h5awrite_f h5sclose_f h5sclose_f proc~hdf5_obj_writeattributes0d->h5sclose_f h5screate_simple_f h5screate_simple_f proc~hdf5_obj_writeattributes0d->h5screate_simple_f proc~hdf5_obj_closegroup hdf5_obj%hdf5_obj_CloseGroup proc~hdf5_obj_writeattributes0d->proc~hdf5_obj_closegroup proc~hdf5_obj_getgroupobject hdf5_obj%hdf5_obj_GetGroupObject proc~hdf5_obj_writeattributes0d->proc~hdf5_obj_getgroupobject proc~hdf5_obj_opengroup hdf5_obj%hdf5_obj_OpenGroup proc~hdf5_obj_writeattributes0d->proc~hdf5_obj_opengroup proc~hdf5_obj_writeattributes1d->h5aclose_f proc~hdf5_obj_writeattributes1d->h5acreate_f proc~hdf5_obj_writeattributes1d->h5awrite_f proc~hdf5_obj_writeattributes1d->h5sclose_f proc~hdf5_obj_writeattributes1d->h5screate_simple_f proc~hdf5_obj_writeattributes1d->proc~hdf5_obj_closegroup proc~hdf5_obj_writeattributes1d->proc~hdf5_obj_getgroupobject proc~hdf5_obj_writeattributes1d->proc~hdf5_obj_opengroup mpi_allgather mpi_allgather proc~lagrangian_set_updatecount->mpi_allgather proc~hdf5_obj_closegroup->proc~hdf5_obj_getgroupobject h5gclose_f h5gclose_f proc~hdf5_obj_closegroup->h5gclose_f proc~hashtbl_obj_hashstring hashtbl_obj%hashtbl_obj_HashString proc~hdf5_obj_closegroup->proc~hashtbl_obj_hashstring proc~hashtbl_obj_remove hashtbl_obj%hashtbl_obj_Remove proc~hdf5_obj_closegroup->proc~hashtbl_obj_remove proc~hdf5_obj_fixgroupname hdf5_obj%hdf5_obj_FixGroupName proc~hdf5_obj_closegroup->proc~hdf5_obj_fixgroupname none~get~3 hashtbl_obj%Get proc~hdf5_obj_getgroupobject->none~get~3 proc~hdf5_obj_getgroupobject->proc~hashtbl_obj_hashstring proc~hdf5_obj_getgroupobject->proc~hdf5_obj_fixgroupname proc~hdf5_obj_opengroup->proc~hdf5_obj_getgroupobject h5oopen_f h5oopen_f proc~hdf5_obj_opengroup->h5oopen_f proc~hdf5_obj_opengroup->proc~hashtbl_obj_hashstring proc~hashtbl_obj_put hashtbl_obj%hashtbl_obj_Put proc~hdf5_obj_opengroup->proc~hashtbl_obj_put proc~hdf5_obj_opengroup->proc~hdf5_obj_fixgroupname proc~hashtbl_obj_get_int4 hashtbl_obj%hashtbl_obj_Get_int4 none~get~3->proc~hashtbl_obj_get_int4 proc~hashtbl_obj_get_int8 hashtbl_obj%hashtbl_obj_Get_int8 none~get~3->proc~hashtbl_obj_get_int8 proc~hashtbl_obj_get_real_dp hashtbl_obj%hashtbl_obj_Get_real_dp none~get~3->proc~hashtbl_obj_get_real_dp proc~hashtbl_obj_get_real_sp hashtbl_obj%hashtbl_obj_Get_real_sp none~get~3->proc~hashtbl_obj_get_real_sp proc~sllist_obj_put sllist_obj%sllist_obj_Put proc~hashtbl_obj_put->proc~sllist_obj_put proc~sllist_obj_remove sllist_obj%sllist_obj_Remove proc~hashtbl_obj_remove->proc~sllist_obj_remove none~get~2 sllist_obj%Get proc~hashtbl_obj_get_int4->none~get~2 proc~hashtbl_obj_get_int8->none~get~2 proc~hashtbl_obj_get_real_dp->none~get~2 proc~hashtbl_obj_get_real_sp->none~get~2 proc~sllist_obj_put->proc~sllist_obj_put proc~sllist_obj_get_int4 sllist_obj%sllist_obj_Get_int4 none~get~2->proc~sllist_obj_get_int4 proc~sllist_obj_get_int8 sllist_obj%sllist_obj_Get_int8 none~get~2->proc~sllist_obj_get_int8 proc~sllist_obj_get_real_dp sllist_obj%sllist_obj_Get_real_dp none~get~2->proc~sllist_obj_get_real_dp proc~sllist_obj_get_real_sp sllist_obj%sllist_obj_Get_real_sp none~get~2->proc~sllist_obj_get_real_sp proc~sllist_obj_get_int4->proc~sllist_obj_get_int4 proc~sllist_obj_get_int8->proc~sllist_obj_get_int8 proc~sllist_obj_get_real_dp->proc~sllist_obj_get_real_dp proc~sllist_obj_get_real_sp->proc~sllist_obj_get_real_sp

Source Code

    impure subroutine solid_set_WriteHDF5(this,iter,time)
      use leapUtils, only: stringtool_obj
      !> Writes all solids to disk using HDF5.
      implicit none
      class(solid_set), intent(inout) :: this                                  !! A collection of solids
      integer,          intent(in)    :: iter                                  !! Iteration at write
      real(wp),         intent(in)    :: time                                  !! Time at write
      ! Work variables
      integer :: n
      type(stringtool_obj) :: stringtool
      character(len=str64) :: tmpC
      character(len=:),       &
            allocatable    :: filename
      type(hdf5_obj)       :: hdf5

      do n=1,this%count
        call this%p(n)%WriteHDF5(iter,time)

        ! Initialize HDF5
        call hdf5%Initialize(this%parallel)

        filename = 'HDF5/'//stringtool%RemoveExtension(this%p(n)%write_file)

        ! Open the file
        if (this%overwrite) then
          write(tmpC,'(ES12.4)') time

          filename = filename//"_"//trim(adjustl(tmpC))
          call hdf5%Open(filename,"W")
        else
          call hdf5%Open(filename,"RW")
        end if

        !> Add some attributes
        call hdf5%WriteAttributes("/","Motion",this%p(n)%motion)
        call hdf5%WriteAttributes("/","X_c",   this%p(n)%xc    )
        call hdf5%WriteAttributes("/","V_c",   this%p(n)%vc    )
        call hdf5%WriteAttributes("/","A_c",   this%p(n)%Ac    )
        call hdf5%WriteAttributes("/","Freq",  this%p(n)%fr    )

        call hdf5%Close()

        call hdf5%Finalize()
      end do

      return
    end subroutine solid_set_WriteHDF5