You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 IFEND 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:,:) =0DO m =0, mpol1, 2DO js =2, ns
lmn(js,:,m,:) =2*lmn(js,:,m,:) - lmn(js-1,:,m,:)
END DOEND DODO m =1, mpol1, 2DO js =2, ns
lmn(js,:,m,:) = (2*lmn(js,:,m,:)
1- sp_local(js-1)*lmn(js-1,:,m,:))/sm_local(js)
END DOEND DODO 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.
The text was updated successfully, but these errors were encountered:
Currently the code crashes if you attempt to run with the reset feature:
mpirun -np 2 ~/bin/xvmec2000 input.test reset=wout_old_run.nc
However if you run with only one processor the restart feature works:
mpirun -np 1 ~/bin/xvmec2000 input.test reset=wout_old_run.nc
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.
The text was updated successfully, but these errors were encountered: