avoid checking of unitialized variables

This commit is contained in:
Martin Diehl 2019-04-04 11:49:23 +02:00
parent bc4b79a3a2
commit 280a11c4bc
2 changed files with 852 additions and 842 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5,9 +5,6 @@
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH !> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module results module results
use prec
use IO
use HDF5
use HDF5_utilities use HDF5_utilities
#ifdef PETSc #ifdef PETSc
use PETSC use PETSC
@ -18,13 +15,13 @@ module results
integer(HID_T), public, protected :: tempCoordinates, tempResults integer(HID_T), public, protected :: tempCoordinates, tempResults
integer(HID_T), private :: resultsFile, currentIncID, plist_id integer(HID_T), private :: resultsFile, currentIncID, plist_id
interface results_writeDataset interface results_writeDataset
module procedure results_writeTensorDataset_real module procedure results_writeTensorDataset_real
module procedure results_writeTensorDataset_int module procedure results_writeTensorDataset_int
module procedure results_writeVectorDataset_real module procedure results_writeVectorDataset_real
module procedure results_writeVectorDataset_int module procedure results_writeVectorDataset_int
module procedure results_writeScalarDataset_real module procedure results_writeScalarDataset_real
end interface results_writeDataset end interface results_writeDataset
public :: & public :: &
results_init, & results_init, &
@ -67,12 +64,12 @@ end subroutine results_init
!> @brief opens the results file to append data !> @brief opens the results file to append data
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine results_openJobFile subroutine results_openJobFile
use DAMASK_interface, only: & use DAMASK_interface, only: &
getSolverJobName getSolverJobName
implicit none implicit none
resultsFile = HDF5_openFile(trim(getSolverJobName())//'.hdf5','a',.true.) resultsFile = HDF5_openFile(trim(getSolverJobName())//'.hdf5','a',.true.)
end subroutine results_openJobFile end subroutine results_openJobFile
@ -81,9 +78,9 @@ end subroutine results_openJobFile
!> @brief closes the results file !> @brief closes the results file
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine results_closeJobFile subroutine results_closeJobFile
implicit none implicit none
call HDF5_closeFile(resultsFile) call HDF5_closeFile(resultsFile)
end subroutine results_closeJobFile end subroutine results_closeJobFile
@ -93,15 +90,15 @@ end subroutine results_closeJobFile
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine results_addIncrement(inc,time) subroutine results_addIncrement(inc,time)
implicit none implicit none
integer(pInt), intent(in) :: inc integer(pInt), intent(in) :: inc
real(pReal), intent(in) :: time real(pReal), intent(in) :: time
character(len=pStringLen) :: incChar character(len=pStringLen) :: incChar
write(incChar,'(i5.5)') inc ! allow up to 99999 increments write(incChar,'(i5.5)') inc ! allow up to 99999 increments
call HDF5_closeGroup(results_addGroup(trim('inc'//trim(adjustl(incChar))))) call HDF5_closeGroup(results_addGroup(trim('inc'//trim(adjustl(incChar)))))
call results_setLink(trim('inc'//trim(adjustl(incChar))),'current') call results_setLink(trim('inc'//trim(adjustl(incChar))),'current')
call HDF5_addAttribute(resultsFile,'time/s',time,trim('inc'//trim(adjustl(incChar)))) call HDF5_addAttribute(resultsFile,'time/s',time,trim('inc'//trim(adjustl(incChar))))
end subroutine results_addIncrement end subroutine results_addIncrement
@ -110,10 +107,10 @@ end subroutine results_addIncrement
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
integer(HID_T) function results_openGroup(groupName) integer(HID_T) function results_openGroup(groupName)
implicit none implicit none
character(len=*), intent(in) :: groupName character(len=*), intent(in) :: groupName
results_openGroup = HDF5_openGroup(resultsFile,groupName) results_openGroup = HDF5_openGroup(resultsFile,groupName)
end function results_openGroup end function results_openGroup
@ -123,10 +120,10 @@ end function results_openGroup
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
integer(HID_T) function results_addGroup(groupName) integer(HID_T) function results_addGroup(groupName)
implicit none implicit none
character(len=*), intent(in) :: groupName character(len=*), intent(in) :: groupName
results_addGroup = HDF5_addGroup(resultsFile,groupName) results_addGroup = HDF5_addGroup(resultsFile,groupName)
end function results_addGroup end function results_addGroup
@ -135,13 +132,11 @@ end function results_addGroup
!> @brief set link to object in results file !> @brief set link to object in results file
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine results_setLink(path,link) subroutine results_setLink(path,link)
use hdf5_utilities, only: &
HDF5_setLink
implicit none implicit none
character(len=*), intent(in) :: path, link character(len=*), intent(in) :: path, link
call HDF5_setLink(resultsFile,path,link) call HDF5_setLink(resultsFile,path,link)
end subroutine results_setLink end subroutine results_setLink
@ -151,10 +146,10 @@ end subroutine results_setLink
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine results_addAttribute(attrLabel,attrValue,path) subroutine results_addAttribute(attrLabel,attrValue,path)
implicit none implicit none
character(len=*), intent(in) :: attrLabel, attrValue, path character(len=*), intent(in) :: attrLabel, attrValue, path
call HDF5_addAttribute_str(resultsFile,attrLabel, attrValue, path) call HDF5_addAttribute_str(resultsFile,attrLabel, attrValue, path)
end subroutine results_addAttribute end subroutine results_addAttribute
@ -163,14 +158,13 @@ end subroutine results_addAttribute
!> @brief remove link to an object !> @brief remove link to an object
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine results_removeLink(link) subroutine results_removeLink(link)
use hdf5
implicit none implicit none
character(len=*), intent(in) :: link character(len=*), intent(in) :: link
integer :: hdferr integer :: hdferr
call h5ldelete_f(resultsFile,link, hdferr) call h5ldelete_f(resultsFile,link, hdferr)
if (hdferr < 0) call IO_error(1_pInt,ext_msg = 'results_removeLink: h5ldelete_soft_f ('//trim(link)//')') if (hdferr < 0) call IO_error(1_pInt,ext_msg = 'results_removeLink: h5ldelete_soft_f ('//trim(link)//')')
end subroutine results_removeLink end subroutine results_removeLink
@ -313,7 +307,6 @@ end subroutine results_writeTensorDataset_int
!> @brief adds the unique mapping from spatial position and constituent ID to results !> @brief adds the unique mapping from spatial position and constituent ID to results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine HDF5_mappingPhase(mapping,mapping2,Nconstituents,material_phase,phase_name,dataspace_size,mpiOffset,mpiOffset_phase) subroutine HDF5_mappingPhase(mapping,mapping2,Nconstituents,material_phase,phase_name,dataspace_size,mpiOffset,mpiOffset_phase)
use hdf5
implicit none implicit none
integer(pInt), intent(in) :: Nconstituents, dataspace_size, mpiOffset integer(pInt), intent(in) :: Nconstituents, dataspace_size, mpiOffset