Reads one Eulerian object based on name using LEAP's HDF5.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(eulerian_set), | intent(inout) | :: | this |
An Eulerian Set |
||
| type(hdf5_obj), | intent(inout) | :: | hdf5 | |||
| integer, | intent(in) | :: | ind |
Index of Eulerian object |
impure subroutine eulerian_set_ReadSingleHDF5(this,hdf5,ind) !> Reads one Eulerian object based on name using LEAP's HDF5. implicit none class(eulerian_set), intent(inout) :: this !! An Eulerian Set type(hdf5_obj), intent(inout) :: hdf5 integer, intent(in) :: ind !! Index of Eulerian object ! Work variable real(wp),allocatable :: buff_r(:,:,:) !! Buffer to write integer, allocatable :: buff_i(:,:,:) !! Buffer to write associate (lo => this%block%lo, hi => this%block%hi) select type (my_field => this%field(ind)%p) type is (eulerian_obj_r) ! Allocate buffer allocate(buff_r(lo(1):hi(1), lo(2):hi(2), lo(3):hi(3))) ! Read field call hdf5%Read('/',trim(adjustl(my_field%name)),buff_r,this%block%lo,this%block%hi) my_field%cell(lo(1):hi(1), lo(2):hi(2), lo(3):hi(3))=buff_r ! Clean deallocate(buff_r) type is (eulerian_obj_i) ! Allocate buffer allocate(buff_i(lo(1):hi(1), lo(2):hi(2), lo(3):hi(3))) ! Read field call hdf5%Read('/',trim(adjustl(my_field%name)),buff_i,lo,hi) my_field%cell(lo(1):hi(1), lo(2):hi(2), lo(3):hi(3))=buff_i ! Clean deallocate(buff_i) end select ! Update ghost cells call this%field(ind)%p%UpdateGhostCells end associate return end subroutine eulerian_set_ReadSingleHDF5