Skip to content
Snippets Groups Projects
Commit 41362c10 authored by Roy Fabrice's avatar Roy Fabrice
Browse files

add write procedure

parent 40f840bc
Branches
Tags
No related merge requests found
......@@ -57,6 +57,7 @@ module cell_m
procedure :: Is_eq
procedure :: Is_sup
procedure :: Print => Print_cell
procedure :: Write => Write_hdf5_cell
end type cell_t
contains
......@@ -260,4 +261,55 @@ contains
end subroutine Print_cell
!------------------------------------------------------------------------------------------------------------------------------------
subroutine Write_hdf5_cell(this, hdf5_id)
use char_utils_m, only : Int_to_char12, Int_to_char5
use fortran_hdf5_constants_m
use fortran_hdf5_manage_groups_m
use fortran_hdf5_write_attribute_m
use fortran_hdf5_write_data_m
use hdf5
class(cell_t(*,*)),intent(in) :: this
integer(kind=hid_t),intent(in) :: hdf5_id
character(len=H5_STR_LEN) :: attr_name
character(len=H5_STR_LEN) :: groupname
integer(kind=hid_t) :: cell_gr_id
integer :: idim
#ifdef DEBUG
write(ERROR_UNIT,'(a,i0)') 'Write_hdf5_cell begins on process', mpi_process%rank
#endif
attr_name = 'identity'
call Hdf5_Write_data(hdf5_id, attr_name, this%identity)
attr_name = 'level'
call Hdf5_Write_attr(hdf5_id, attr_name, this%level)
attr_name = 'position'
call Hdf5_Write_attr(hdf5_id, attr_name, 3, this%position)
attr_name = 'velocity field'
call Hdf5_Write_attr(hdf5_id, attr_name, 3, this%velocity_field)
attr_name = 'density'
call Hdf5_Write_attr(hdf5_id, attr_name, this%density)
attr_name = 'thermal pressure'
call Hdf5_Write_attr(hdf5_id, attr_name, this%thermal_pressure)
if ( this%n_non_thermal_pressures /= 0 ) then
attr_name = 'non thermal pressures'
call Hdf5_Write_attr(hdf5_id, attr_name, this%n_non_thermal_pressures, this%non_thermal_pressures)
end if
if( this%n_passive_scalars /= 0 ) then
attr_name = 'passive scalars'
call Hdf5_Write_attr(hdf5_id, attr_name, this%n_passive_scalars, this%passive_scalars)
end if
#ifdef DEBUG
write(ERROR_UNIT,'(a,i0)') 'Write_hdf5_cell ends on process', mpi_process%rank
#endif
end subroutine Write_hdf5_cell
end module cell_m
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment