diff --git a/src/HDF5_utilities.f90 b/src/HDF5_utilities.f90 index f976ad106..6f45516e6 100644 --- a/src/HDF5_utilities.f90 +++ b/src/HDF5_utilities.f90 @@ -12,7 +12,6 @@ module HDF5_utilities use prec use parallelization - use rotations implicit none public @@ -37,7 +36,6 @@ module HDF5_utilities module procedure HDF5_read_int5 module procedure HDF5_read_int6 module procedure HDF5_read_int7 - end interface HDF5_read !-------------------------------------------------------------------------------------------------- @@ -60,9 +58,6 @@ module HDF5_utilities module procedure HDF5_write_int5 module procedure HDF5_write_int6 module procedure HDF5_write_int7 - - module procedure HDF5_write_rotation - end interface HDF5_write !-------------------------------------------------------------------------------------------------- @@ -1663,82 +1658,6 @@ subroutine HDF5_write_int7(loc_id,dataset,datasetName,parallel) end subroutine HDF5_write_int7 -!-------------------------------------------------------------------------------------------------- -!> @brief writes a scalar orientation dataset -! ToDo: It might be possible to write the dataset as a whole -! ToDo: We could optionally write out other representations (axis angle, euler, ...) -!-------------------------------------------------------------------------------------------------- -subroutine HDF5_write_rotation(loc_id,dataset,datasetName,parallel) - - type(rotation), intent(in), dimension(:) :: dataset !< data written to file - integer(HID_T), intent(in) :: loc_id !< file or group handle - character(len=*), intent(in) :: datasetName !< name of the dataset in the file - logical, intent(in), optional :: parallel - - integer :: hdferr - real(pReal), dimension(4,size(dataset)) :: dataset_asArray - integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id,dtype_id,w_id,x_id,y_id,z_id - integer(HSIZE_T), dimension(size(shape(dataset))) :: & - myStart, & - myShape, & !< shape of the dataset (this process) - totalShape !< shape of the dataset (all processes) - integer(SIZE_T) :: type_size_real - integer :: i - - do i = 1, size(dataset) - dataset_asArray(1:4,i) = dataset(i)%asQuaternion() - enddo - -!--------------------------------------------------------------------------------------------------- -! determine shape of dataset - myShape = int(shape(dataset),HSIZE_T) - -!--------------------------------------------------------------------------------------------------- -! compound type: name of each quaternion component - call h5tget_size_f(H5T_NATIVE_DOUBLE, type_size_real, hdferr) - - call h5tcreate_f(H5T_COMPOUND_F, type_size_real*4_SIZE_T, dtype_id, hdferr) - call h5tinsert_f(dtype_id, "w", type_size_real*0_SIZE_T, H5T_NATIVE_DOUBLE, hdferr) - call h5tinsert_f(dtype_id, "x", type_size_real*1_SIZE_T, H5T_NATIVE_DOUBLE, hdferr) - call h5tinsert_f(dtype_id, "y", type_size_real*2_SIZE_T, H5T_NATIVE_DOUBLE, hdferr) - call h5tinsert_f(dtype_id, "z", type_size_real*3_SIZE_T, H5T_NATIVE_DOUBLE, hdferr) - - if (present(parallel)) then - call initialize_write(dset_id, filespace_id, memspace_id, plist_id, & - myStart, totalShape, loc_id,myShape,datasetName,dtype_id,parallel) - else - call initialize_write(dset_id, filespace_id, memspace_id, plist_id, & - myStart, totalShape, loc_id,myShape,datasetName,dtype_id,.false.) - endif - - call h5pset_preserve_f(plist_id, .TRUE., hdferr) - - if (product(totalShape) /= 0) then - call h5tcreate_f(H5T_COMPOUND_F, type_size_real, x_id, hdferr) - call h5tinsert_f(x_id, "x", 0_SIZE_T, H5T_NATIVE_DOUBLE, hdferr) - call h5tcreate_f(H5T_COMPOUND_F, type_size_real, w_id, hdferr) - call h5tinsert_f(w_id, "w", 0_SIZE_T, H5T_NATIVE_DOUBLE, hdferr) - call h5tcreate_f(H5T_COMPOUND_F, type_size_real, y_id, hdferr) - call h5tinsert_f(y_id, "y", 0_SIZE_T, H5T_NATIVE_DOUBLE, hdferr) - call h5tcreate_f(H5T_COMPOUND_F, type_size_real, z_id, hdferr) - call h5tinsert_f(z_id, "z", 0_SIZE_T, H5T_NATIVE_DOUBLE, hdferr) - - call h5dwrite_f(dset_id, w_id,dataset_asArray(1,:),int(totalShape,HSIZE_T), hdferr,& - file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id) - call h5dwrite_f(dset_id, x_id,dataset_asArray(2,:),int(totalShape,HSIZE_T), hdferr,& - file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id) - call h5dwrite_f(dset_id, y_id,dataset_asArray(3,:),int(totalShape,HSIZE_T), hdferr,& - file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id) - call h5dwrite_f(dset_id, z_id,dataset_asArray(4,:),int(totalShape,HSIZE_T), hdferr,& - file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id) - if(hdferr < 0) error stop 'HDF5 error' - endif - - call finalize_write(plist_id, dset_id, filespace_id, memspace_id) - -end subroutine HDF5_write_rotation - - !-------------------------------------------------------------------------------------------------- !> @brief initialize HDF5 handles, determines global shape and start for parallel read !-------------------------------------------------------------------------------------------------- diff --git a/src/crystallite.f90 b/src/crystallite.f90 index 273d5397b..66c1df607 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -794,7 +794,7 @@ subroutine crystallite_results end select selected_rotations = select_rotations(crystallite_orientation,p) call results_writeDataset(group,selected_rotations,output_constituent(p)%label(o),& - 'crystal orientation as quaternion') + 'crystal orientation as quaternion','q_0 ') call results_addAttribute('Lattice',structureLabel,group//'/'//output_constituent(p)%label(o)) end select enddo diff --git a/src/grid/grid_mech_FEM.f90 b/src/grid/grid_mech_FEM.f90 index 7d0830f67..4394b6f81 100644 --- a/src/grid/grid_mech_FEM.f90 +++ b/src/grid/grid_mech_FEM.f90 @@ -16,6 +16,7 @@ module grid_mech_FEM use IO use HDF5_utilities use math + use rotations use spectral_utilities use FEsolving use config diff --git a/src/grid/grid_mech_spectral_basic.f90 b/src/grid/grid_mech_spectral_basic.f90 index 8677a998f..563b25162 100644 --- a/src/grid/grid_mech_spectral_basic.f90 +++ b/src/grid/grid_mech_spectral_basic.f90 @@ -16,6 +16,7 @@ module grid_mech_spectral_basic use IO use HDF5_utilities use math + use rotations use spectral_utilities use FEsolving use config diff --git a/src/grid/grid_mech_spectral_polarisation.f90 b/src/grid/grid_mech_spectral_polarisation.f90 index 053d958ad..03780f2e0 100644 --- a/src/grid/grid_mech_spectral_polarisation.f90 +++ b/src/grid/grid_mech_spectral_polarisation.f90 @@ -16,6 +16,7 @@ module grid_mech_spectral_polarisation use IO use HDF5_utilities use math + use rotations use spectral_utilities use FEsolving use config diff --git a/src/results.f90 b/src/results.f90 index 8b097179b..f15ad4e4a 100644 --- a/src/results.f90 +++ b/src/results.f90 @@ -8,7 +8,6 @@ module results use DAMASK_interface use parallelization use IO - use rotations use HDF5_utilities #ifdef PETSc use PETSC @@ -20,27 +19,21 @@ module results integer(HID_T) :: resultsFile interface results_writeDataset - module procedure results_writeTensorDataset_real module procedure results_writeVectorDataset_real module procedure results_writeScalarDataset_real module procedure results_writeTensorDataset_int module procedure results_writeVectorDataset_int - - module procedure results_writeScalarDataset_rotation - end interface results_writeDataset interface results_addAttribute - module procedure results_addAttribute_real module procedure results_addAttribute_int module procedure results_addAttribute_str module procedure results_addAttribute_int_array module procedure results_addAttribute_real_array - end interface results_addAttribute public :: & @@ -465,38 +458,6 @@ subroutine results_writeTensorDataset_int(group,dataset,label,description,SIunit end subroutine results_writeTensorDataset_int -!-------------------------------------------------------------------------------------------------- -!> @brief stores a scalar dataset in a group -!-------------------------------------------------------------------------------------------------- -subroutine results_writeScalarDataset_rotation(group,dataset,label,description,lattice_structure) - - character(len=*), intent(in) :: label,group,description - character(len=*), intent(in), optional :: lattice_structure - type(rotation), intent(inout), dimension(:) :: dataset - - integer(HID_T) :: groupHandle - - groupHandle = results_openGroup(group) - -#ifdef PETSc - call HDF5_write(groupHandle,dataset,label,.true.) -#else - call HDF5_write(groupHandle,dataset,label,.false.) -#endif - - if (HDF5_objectExists(groupHandle,label)) & - call HDF5_addAttribute(groupHandle,'Description',description,label) - if (HDF5_objectExists(groupHandle,label) .and. present(lattice_structure)) & - call HDF5_addAttribute(groupHandle,'Lattice',lattice_structure,label) - if (HDF5_objectExists(groupHandle,label)) & - call HDF5_addAttribute(groupHandle,'Creator','DAMASK '//DAMASKVERSION,label) - if (HDF5_objectExists(groupHandle,label)) & - call HDF5_addAttribute(groupHandle,'Created',now(),label) - call HDF5_closeGroup(groupHandle) - -end subroutine results_writeScalarDataset_rotation - - !-------------------------------------------------------------------------------------------------- !> @brief adds the unique mapping from spatial position and constituent ID to results !--------------------------------------------------------------------------------------------------