The issues stems from the routine Sources/Initialization_Cleanup/load_xc_from_wout.f. Specifically the code references sm and sp but these arrays are only defined over the communicator (from profile1d.f):
nsmin = MAX(2, t1lglob)
nsmax = t1rglob
DO i = nsmin, nsmax
sm(i) = pshalf(1,i)/psqrts(1,i)
IF (i .LT. ns) THEN
sp(i) = pshalf(1,i + 1)/psqrts(1,i)
ELSE
sp(i)=one/psqrts(1,i)
END IF
END DO
The fix seems to be to just recalculate sm and sp over the whole ns array in the load_xc_from_wout.f routine, like:
!
! CONVERT lambda TO INTERNAL FULL MESH REPRESENTATION
!
! START ITERATION AT JS=1
! SM AND SP ARRAYS NEED TO BE MADE LOCALY SO THEY EXIST OVER THE
! WHOLE DOMAIN
!
ALLOCATE(sm_local(ns),sp_local(0:ns)) ! See allocate_ns
DO js = 2, ns
t1 = hs*ABS(js-1.5_rprec)
t2 = hs*ABS(js-2.5_rprec)
sm_local(js) = SQRT(t1)/SQRT(hs*ABS(js-1))
sp_local(js) = SQRT(t2)/SQRT(hs*ABS(js-1))
END DO
sm_local(1) = zero
sp_local(0) = zero
sp_local(1) = sm_local(2)
lmn(1,:,0,:) = lmn(2,:,0,:)
lmn(1,:,1,:) = 2*lmn(2,:,1,:)/(sm_local(2) + sp_local(1))
lmn(1,:,2:,:) = 0
DO m = 0, mpol1, 2
DO js = 2, ns
lmn(js,:,m,:) = 2*lmn(js,:,m,:) - lmn(js-1,:,m,:)
END DO
END DO
DO m = 1, mpol1, 2
DO js = 2, ns
lmn(js,:,m,:) = (2*lmn(js,:,m,:)
1 - sp_local(js-1)*lmn(js-1,:,m,:))/sm_local(js)
END DO
END DO
DO js = 2, ns
lmn(js,:,:,:) = phipf(js)*lmn(js,:,:,:)
END DO
DEALLOCATE(sm_local,sp_local)
There may be a more elegant fix but this seems to work.
Currently the code crashes if you attempt to run with the reset feature:
However if you run with only one processor the restart feature works:
The issues stems from the routine
Sources/Initialization_Cleanup/load_xc_from_wout.f
. Specifically the code referencessm
andsp
but these arrays are only defined over the communicator (fromprofile1d.f
):The fix seems to be to just recalculate sm and sp over the whole
ns
array in theload_xc_from_wout.f
routine, like:There may be a more elegant fix but this seems to work.