Commit 8bd939c7 authored by Matthias Redies's avatar Matthias Redies

morre verbose memory messages

parent 87636901
......@@ -799,14 +799,15 @@ CONTAINS
COMPLEX, ALLOCATABLE :: vecin1(:, :, :), vecout1(:, :, :)
integer :: ok
character(len=300) :: errmsg
phase = cmplx_0
call timestart("bra trafo cmplx")
allocate (vecin1(hybdat%nbasm(ikpt), MAXVAL(hybdat%nobd(:, jsp)), nbands), stat=ok, source=cmplx_0)
IF (ok /= 0) call judft_error('bra_trafo: error allocating vecin1')
allocate (vecout1(hybdat%nbasm(ikpt), MAXVAL(hybdat%nobd(:, jsp)), nbands), stat=ok, source=cmplx_0)
IF (ok /= 0) call judft_error('bra_trafo: error allocating vecout1')
allocate (vecin1(hybdat%nbasm(ikpt), MAXVAL(hybdat%nobd(:, jsp)), nbands), errmsg=errmsg, stat=ok, source=cmplx_0)
IF (ok /= 0) call judft_error('bra_trafo: error allocating vecin1. Error: ' // trim(errmsg))
allocate (vecout1(hybdat%nbasm(ikpt), MAXVAL(hybdat%nobd(:, jsp)), nbands), errmsg=errmsg, stat=ok, source=cmplx_0)
IF (ok /= 0) call judft_error('bra_trafo: error allocating vecout1. Error: ' // trim(errmsg))
IF (maxval(fi%hybinp%lcutm1) > fi%atoms%lmaxd) call judft_error('bra_trafo: maxlcutm > fi%atoms%lmaxd') ! very improbable case
......
......@@ -288,6 +288,7 @@ CONTAINS
LOGICAL, INTENT(IN), OPTIONAL:: l_real
INTEGER, INTENT(IN), OPTIONAL:: matsize1, matsize2
REAL, INTENT(IN), OPTIONAL :: init
character(len=300) :: errmsg
INTEGER:: err
IF (present(l_real)) mat%l_real = l_real
......@@ -301,18 +302,20 @@ CONTAINS
IF (allocated(mat%data_c)) deallocate (mat%data_c)
IF (mat%l_real) THEN
ALLOCATE (mat%data_r(mat%matsize1, mat%matsize2), STAT=err)
ALLOCATE (mat%data_r(mat%matsize1, mat%matsize2), STAT=err, errmsg=errmsg)
ALLOCATE (mat%data_c(0, 0))
IF (err /= 0) CALL judft_error("Allocation of memmory failed for mat datatype", &
hint="Errormessage: " // trim(errmsg))
mat%data_r = 0.0
if (present(init)) mat%data_r = init
ELSE
ALLOCATE (mat%data_r(0, 0))
ALLOCATE (mat%data_c(mat%matsize1, mat%matsize2), STAT=err)
ALLOCATE (mat%data_c(mat%matsize1, mat%matsize2), STAT=err, errmsg=errmsg)
IF (err /= 0) CALL judft_error("Allocation of memmory failed for mat datatype", &
hint="Errormessage: " // trim(errmsg))
mat%data_c = 0.0
IF (PRESENT(init)) mat%data_c = init
ENDIF
IF (err > 0) CALL judft_error("Allocation of memmory failed for mat datatype", hint="You probably run out of memory")
END SUBROUTINE t_mat_alloc
SUBROUTINE t_mat_multiply(mat1, mat2, res)
......
Markdown is supported
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