diff --git a/src/CPFEM2.f90 b/src/CPFEM2.f90 index 52b96cf70..6b4479b89 100644 --- a/src/CPFEM2.f90 +++ b/src/CPFEM2.f90 @@ -17,7 +17,6 @@ module CPFEM2 use DAMASK_interface use results use discretization - use HDF5 use HDF5_utilities use homogenization use constitutive diff --git a/src/constitutive.f90 b/src/constitutive.f90 index 977c80337..697275367 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -11,7 +11,6 @@ module constitutive use config use material use results - use HDF5_utilities use lattice use discretization use plastic_none @@ -587,11 +586,11 @@ subroutine constitutive_results character(len=pStringLen) :: group do p=1,size(config_name_phase) group = trim('current/constituent')//'/'//trim(config_name_phase(p)) - call HDF5_closeGroup(results_addGroup(group)) + call results_closeGroup(results_addGroup(group)) group = trim(group)//'/plastic' - call HDF5_closeGroup(results_addGroup(group)) + call results_closeGroup(results_addGroup(group)) select case(phase_plasticity(p)) case(PLASTICITY_ISOTROPIC_ID) diff --git a/src/quit.f90 b/src/quit.f90 index bc4987c2d..5c421c86a 100644 --- a/src/quit.f90 +++ b/src/quit.f90 @@ -10,7 +10,7 @@ subroutine quit(stop_id) #ifdef _OPENMP use MPI #endif - use hdf5 + use HDF5 implicit none integer, intent(in) :: stop_id diff --git a/src/results.f90 b/src/results.f90 index d38e629ec..73c5d7dbb 100644 --- a/src/results.f90 +++ b/src/results.f90 @@ -68,14 +68,14 @@ subroutine results_init write(6,'(a)') ' https://doi.org/10.1007/s40192-017-0084-5' resultsFile = HDF5_openFile(trim(getSolverJobName())//'.hdf5','w',.true.) - call HDF5_addAttribute(resultsFile,'DADF5_version_major',0) - call HDF5_addAttribute(resultsFile,'DADF5_version_minor',5) - call HDF5_addAttribute(resultsFile,'DAMASK_version',DAMASKVERSION) + call results_addAttribute('DADF5_version_major',0) + call results_addAttribute('DADF5_version_minor',5) + call results_addAttribute('DAMASK_version',DAMASKVERSION) call get_command(commandLine) - call HDF5_addAttribute(resultsFile,'call',trim(commandLine)) - call HDF5_closeGroup(results_addGroup('mapping')) - call HDF5_closeGroup(results_addGroup('mapping/cellResults')) - call HDF5_closeFile(resultsFile) + call results_addAttribute('call',trim(commandLine)) + call results_closeGroup(results_addGroup('mapping')) + call results_closeGroup(results_addGroup('mapping/cellResults')) + call results_closeJobFile end subroutine results_init @@ -110,12 +110,11 @@ subroutine results_addIncrement(inc,time) character(len=pStringLen) :: incChar write(incChar,'(i10)') inc - call HDF5_closeGroup(results_addGroup(trim('inc'//trim(adjustl(incChar))))) + call results_closeGroup(results_addGroup(trim('inc'//trim(adjustl(incChar))))) call results_setLink(trim('inc'//trim(adjustl(incChar))),'current') - call HDF5_addAttribute(resultsFile,'time/s',time,trim('inc'//trim(adjustl(incChar)))) - - call HDF5_closeGroup(results_addGroup('current/constituent')) - call HDF5_closeGroup(results_addGroup('current/materialpoint')) + call results_addAttribute('time/s',time,trim('inc'//trim(adjustl(incChar)))) + call results_closeGroup(results_addGroup('current/constituent')) + call results_closeGroup(results_addGroup('current/materialpoint')) end subroutine results_addIncrement @@ -173,9 +172,14 @@ end subroutine results_setLink !-------------------------------------------------------------------------------------------------- subroutine results_addAttribute_str(attrLabel,attrValue,path) - character(len=*), intent(in) :: attrLabel, attrValue, path + character(len=*), intent(in) :: attrLabel, attrValue + character(len=*), intent(in), optional :: path - call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path) + if (present(path)) then + call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path) + else + call HDF5_addAttribute(resultsFile,attrLabel, attrValue) + endif end subroutine results_addAttribute_str @@ -185,10 +189,15 @@ end subroutine results_addAttribute_str !-------------------------------------------------------------------------------------------------- subroutine results_addAttribute_int(attrLabel,attrValue,path) - character(len=*), intent(in) :: attrLabel, path - integer, intent(in) :: attrValue + character(len=*), intent(in) :: attrLabel + integer, intent(in) :: attrValue + character(len=*), intent(in), optional :: path - call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path) + if (present(path)) then + call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path) + else + call HDF5_addAttribute(resultsFile,attrLabel, attrValue) + endif end subroutine results_addAttribute_int @@ -198,10 +207,15 @@ end subroutine results_addAttribute_int !-------------------------------------------------------------------------------------------------- subroutine results_addAttribute_real(attrLabel,attrValue,path) - character(len=*), intent(in) :: attrLabel, path - real(pReal), intent(in) :: attrValue + character(len=*), intent(in) :: attrLabel + real(pReal), intent(in) :: attrValue + character(len=*), intent(in), optional :: path - call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path) + if (present(path)) then + call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path) + else + call HDF5_addAttribute(resultsFile,attrLabel, attrValue) + endif end subroutine results_addAttribute_real @@ -211,10 +225,15 @@ end subroutine results_addAttribute_real !-------------------------------------------------------------------------------------------------- subroutine results_addAttribute_int_array(attrLabel,attrValue,path) - character(len=*), intent(in) :: attrLabel, path + character(len=*), intent(in) :: attrLabel integer, intent(in), dimension(:) :: attrValue + character(len=*), intent(in), optional :: path - call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path) + if (present(path)) then + call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path) + else + call HDF5_addAttribute(resultsFile,attrLabel, attrValue) + endif end subroutine results_addAttribute_int_array @@ -224,10 +243,15 @@ end subroutine results_addAttribute_int_array !-------------------------------------------------------------------------------------------------- subroutine results_addAttribute_real_array(attrLabel,attrValue,path) - character(len=*), intent(in) :: attrLabel, path + character(len=*), intent(in) :: attrLabel real(pReal), intent(in), dimension(:) :: attrValue + character(len=*), intent(in), optional :: path - call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path) + if (present(path)) then + call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path) + else + call HDF5_addAttribute(resultsFile,attrLabel, attrValue) + endif end subroutine results_addAttribute_real_array @@ -720,7 +744,6 @@ end subroutine results_mapping_materialpoint !!> @brief adds the backward mapping from spatial position and constituent ID to results !!-------------------------------------------------------------------------------------------------- !subroutine HDF5_backwardMappingPhase(material_phase,phasememberat,phase_name,dataspace_size,mpiOffset,mpiOffset_phase) -! use hdf5 ! integer(pInt), intent(in), dimension(:,:,:) :: material_phase, phasememberat ! character(len=*), intent(in), dimension(:) :: phase_name @@ -834,7 +857,6 @@ end subroutine results_mapping_materialpoint !!> @brief adds the backward mapping from spatial position and constituent ID to results !!-------------------------------------------------------------------------------------------------- !subroutine HDF5_backwardMappingHomog(material_homog,homogmemberat,homogenization_name,dataspace_size,mpiOffset,mpiOffset_homog) -! use hdf5 ! integer(pInt), intent(in), dimension(:,:) :: material_homog, homogmemberat ! character(len=*), intent(in), dimension(:) :: homogenization_name @@ -941,7 +963,6 @@ end subroutine results_mapping_materialpoint !!> @brief adds the unique cell to node mapping !!-------------------------------------------------------------------------------------------------- !subroutine HDF5_mappingCells(mapping) -! use hdf5 ! integer(pInt), intent(in), dimension(:) :: mapping