Write a single Eulerian object to file 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_WriteSingleHDF5(this,hdf5,ind) !> Write a single Eulerian object to file 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 variables real(wp),allocatable :: buff_r(:,:,:) !! Buffer to write integer, allocatable :: buff_i(:,:,:) !! Buffer to write associate (lo => this%block%lo, hi => this%block%hi, ngc=> this%block%ngc) 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))) buff_r=my_field%cell(lo(1):hi(1), lo(2):hi(2), lo(3):hi(3)) ! Write data call hdf5%Write('/',trim(adjustl(my_field%name)),buff_r,lo,hi) ! Clean up 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))) buff_i=my_field%cell(lo(1):hi(1), lo(2):hi(2), lo(3):hi(3)) ! Write data call hdf5%Write('/',trim(adjustl(my_field%name)),buff_i,lo,hi) ! Clean up deallocate(buff_i) end select end associate return end subroutine eulerian_set_WriteSingleHDF5