Skip to content

Commit

Permalink
Merge pull request #64 from ORNL-Fusion/master_dev
Browse files Browse the repository at this point in the history
Master dev
  • Loading branch information
cianciosa authored Nov 27, 2024
2 parents 64ae384 + b99c09e commit d580700
Show file tree
Hide file tree
Showing 6 changed files with 380 additions and 7 deletions.
1 change: 1 addition & 0 deletions Sources/Initialization_Cleanup/initialize_radial.f
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ SUBROUTINE initialize_radial(nsval, ns_old, delt0,
& ntor, mpol1, ns, reset_file_name)
IF (PARVMEC) THEN
CALL Serial2Parallel4X(xc,pxc)
CALL Gather4XArray(pxc)
END IF
END IF
END IF
Expand Down
24 changes: 18 additions & 6 deletions Sources/Initialization_Cleanup/load_xc_from_wout.f
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SUBROUTINE load_xc_from_wout(rmn, zmn, lmn, lreset,
USE vparams, ONLY: one, zero, rprec
USE vmec_input, ONLY: lasym
USE vmec_main, ONLY: lthreed, p5 => cp5, sp, sm, phipf
USE parallel_include_module, ONLY: rank
USE parallel_include_module, ONLY: rank, t1lglob, t1rglob, PARVMEC
IMPLICIT NONE
C-----------------------------------------------
C D u m m y A r g u m e n t s
Expand All @@ -25,6 +25,8 @@ SUBROUTINE load_xc_from_wout(rmn, zmn, lmn, lreset,
INTEGER :: ierr, mn, m, n, n1, js
REAL(rprec) :: t1, t2
REAL(rprec), ALLOCATABLE :: temp(:,:)
INTEGER :: nsmin
INTEGER :: nsmax
C-----------------------------------------------

!
Expand All @@ -51,6 +53,14 @@ SUBROUTINE load_xc_from_wout(rmn, zmn, lmn, lreset,
IF (mpol1_in .ne. mpol1) STOP 'mpol1_in != mpol1 in load_xc'
IF (nfp .eq. 0) STOP 'nfp = 0 in load_xc'

IF (PARVMEC) THEN
nsmin = t1lglob
nsmax = t1rglob
ELSE
nsmin = 1
nsmax = ns
END IF

lreset = .false. !Signals profil3d NOT to overwrite axis values

rmn = zero
Expand Down Expand Up @@ -121,23 +131,25 @@ SUBROUTINE load_xc_from_wout(rmn, zmn, lmn, lreset,
! START ITERATION AT JS=1
!
lmn(1,:,0,:) = lmn(2,:,0,:)
lmn(1,:,1,:) = 2*lmn(2,:,1,:)/(sm(2) + sp(1))
IF (nsmin .eq. 1) THEN
lmn(1,:,1,:) = 2*lmn(2,:,1,:)/(sm(2) + sp(1))
END IF
lmn(1,:,2:,:) = 0

DO m = 0, mpol1, 2
DO js = 2, ns
DO js = nsmin + 1, nsmax
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,:)
DO js = nsmin + 1, nsmax
lmn(js,:,m,:) = (2*lmn(js,:,m,:)
1 - sp(js-1)*lmn(js-1,:,m,:))/sm(js)
END DO
END DO

DO js = 2, ns
DO js = nsmin + 1, nsmax
lmn(js,:,:,:) = phipf(js)*lmn(js,:,:,:)
END DO

Expand Down
2 changes: 2 additions & 0 deletions Testing/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ add_subdirectory (fixed_boundary_test)
add_subdirectory (free_boundary_test)
add_subdirectory (niter_test)
add_subdirectory (lasym_test)
add_subdirectory (reset_test)

2 changes: 1 addition & 1 deletion Testing/tests/free_boundary_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ set_tests_properties (vmec_free_boundary_check_iotaf_test
PROPERTIES
DEPENDS "vmec_free_boundary_serial_test;vmec_free_boundary_parallel_test")
add_test (NAME vmec_free_boundary_check_jcuru_test
COMMAND $<TARGET_PROPERTY:xvmec,BINARY_DIR>/xwout_diff -wout_file1=wout_test_serial.vmec.nc -wout_file2=wout_test_parallel.vmec.nc -quantity=jcuru -tol=5.1E-7)
COMMAND $<TARGET_PROPERTY:xvmec,BINARY_DIR>/xwout_diff -wout_file1=wout_test_serial.vmec.nc -wout_file2=wout_test_parallel.vmec.nc -quantity=jcuru -tol=6.4E-7)
set_tests_properties (vmec_free_boundary_check_jcuru_test
PROPERTIES
DEPENDS "vmec_free_boundary_serial_test;vmec_free_boundary_parallel_test")
Expand Down
Loading

0 comments on commit d580700

Please sign in to comment.