Commit 1d18d9b0 authored by Roy Fabrice's avatar Roy Fabrice
Browse files

add some missing metadata and data

the hdf5 output still doesn't match output from pfof_snap
parent 58d5b5ed
......@@ -551,14 +551,19 @@ contains
use fortran_hdf5_constants_m, only : H5_FILENAME_LEN, H5_STR_LEN
use fortran_hdf5_manage_files_m
use fortran_hdf5_manage_groups_m
use fortran_hdf5_write_attribute_m
use fortran_hdf5_write_data_m
use hdf5, only : HID_T
class(halos_array_t), intent(in) :: this
character(H5_FILENAME_LEN), intent(in) :: filename
character(H5_STR_LEN) :: attribute_data
character(H5_STR_LEN) :: attribute_name
integer(HID_T) :: data_id
integer(HID_T) :: file_id
character(H5_STR_LEN) :: group_name
integer(HID_T) :: meta_id
integer :: ihalo
#ifdef DEBUG
......@@ -566,8 +571,47 @@ contains
#endif
call hdf5_create_file(filename, file_id)
group_name = 'metadata'
call hdf5_open_group(file_id,group_name, meta_id)
!! IN PROGRESS
!! il faut lire toutes les metadonnees en entree pour les reecrire
attribute_name = 'halo_finder'
attribute_data = 'pfof_snap' ! il faudra remplacer ca par l'attribut lu dans les fichiers d'entree
call hdf5_write_attr(meta_id, attribute_name, attribute_data)
! Write type as attribute
attribute_name = 'file_type'
attribute_data = 'halo_dm_cell_data'
call hdf5_write_attr(meta_id, attribute_name, attribute_data)
attribute_name = 'nfile'
call hdf5_write_attr(meta_id, attribute_name, mpi_process%comm%size)
! write the number of haloes as an attribute
attribute_name = 'nhalo_file'
call hdf5_write_attr(meta_id, attribute_name, this%halos_number)
! write the number of particles written in the file
!! JE COMMENTE PARCE QUE A PRIORI JE N AI PAS CETTE DONNEE MAIS JE POURRAI LA CALCULER
! dsetname = 'npart_file'
! npart8 = int(halopartNB,kind=8)
! call hdf5_write_data(meta_id, dsetname, npart8)
call hdf5_close_group(meta_id)
group_name = 'data'
call hdf5_create_group(file_id, group_name, data_id)
!! write the halo ID as data and not attribute
attribute_name = 'identity_halo'
call hdf5_write_data(data_id, attribute_name, this%halos_number, this%parameters%halo_ids)
attribute_name = 'identity_halo_minmax'
call hdf5_write_data(data_id, attribute_name, 2, (/this%parameters%halo_ids(1), this%parameters%halo_ids(this%halos_number)/))
do ihalo = this%first_halo_index, this%last_halo_index
call this%halos(ihalo)%Write_hdf5(data_id, this%properties)
end do
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment