Reads Eulerian data with LEAP's HDF5.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(eulerian_set), | intent(inout) | :: | this |
an eulerian set |
||
| integer, | intent(out) | :: | iter |
iteration in file |
||
| real(kind=wp), | intent(out) | :: | time |
time in file |
||
| character(len=str8), | intent(in), | optional | :: | list(:) |
names of fields to read |
|
| integer, | intent(in), | optional | :: | step |
User supplied step to open |
impure subroutine eulerian_set_ReadHDF5(this,iter,time,list,step) !> Reads Eulerian data with LEAP's HDF5. use leapUtils, only: stringtool_obj implicit none class(eulerian_set), intent(inout):: this !! an eulerian set integer, intent(out) :: iter !! iteration in file real(wp), intent(out) :: time !! time in file character(str8), intent(in), & optional :: list(:) !! names of fields to read integer, intent(in), & optional :: step !! User supplied step to open ! Work variables type(stringtool_obj):: stringtool character(len=:), & allocatable :: filename type(hdf5_obj) :: hdf5 integer :: n,ind ! Nothing to read, if empty if (.not.allocated(this%field)) return filename = stringtool%RemoveExtension(this%read_file) if (present(step)) & call this%parallel%Stop("The step parameter is ignored by ReadHDF5") ! Initialize HDF5 call hdf5%Initialize(this%parallel) ! Open file call hdf5%Open(trim(adjustl(filename)),'R') ! Read time and iter call hdf5%ReadAttributes("/","time",time) call hdf5%ReadAttributes("/","iter",iter) if (.not.present(list)) then ! Read all fields do n=1,size(this%field) call this%ReadSingle(hdf5,n) end do else do n=1,size(list) ! Get index of this Eulerian_obj ind = this%GetIndex(list(n)) if (ind.lt.1) call this%parallel%Stop('Unable to find '//list(n)//' in Eulerian_set') call this%ReadSingle(hdf5,ind) end do end if ! Close file call hdf5%Close() ! Finalize HDF5 call hdf5%Finalize() return end subroutine eulerian_set_ReadHDF5