Skip to content

Commit

Permalink
Enable control the preconditoner iterations.
Browse files Browse the repository at this point in the history
  • Loading branch information
cianciosa committed Jun 14, 2024
1 parent 915faf4 commit ac629f5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
29 changes: 22 additions & 7 deletions Sources/TimeStep/evolve.f
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,24 @@ SUBROUTINE evolve(time_step, ier_flag, liter_flag, lscreen)
! INITIATES 2D PRECONDITIONER CALCULATION
!
IF (iter_on .EQ. -1) THEN
IF (lqmr) THEN
nstep = 5
niter = iter2+100 !Limit # preconditioner steps
ELSE
nstep = 20
niter = iter2+400
IF (pre_niter .eq. -1) THEN
IF (lqmr) THEN
nstep = 5
niter = iter2+100 !Limit # preconditioner steps
ELSE
nstep = 20
niter = iter2+400
END IF

WRITE (6,1000) niter
WRITE (nthreed,1000) niter
ELSE IF (pre_niter .eq. 0) THEN
niter = iter2 + pre_niter

WRITE (6,1000) niter
WRITE (nthreed,1000) niter
END IF

iter_on = iter2 !Flag to monitor progress of preconditioner
ELSE
iter_on = iter2-11
Expand All @@ -84,7 +95,9 @@ SUBROUTINE evolve(time_step, ier_flag, liter_flag, lscreen)
!SPH022111: ADD NEW CONTROL PARAMETER, l_comp_prec2D, TO FORCE RECALCULATION
! OF PRECONDITIONING BLOCKS IN V3FIT, FOR EXAMPLE
IF (lfirst .OR. l_comp_prec2D) THEN
IF (l_v3fit) WRITE(*,*) 'VMEC Evolve:compute_blocks'
IF (l_v3fit) THEN
WRITE(*,*) 'VMEC Evolve:compute_blocks'
END IF
IF (PARVMEC) THEN
CALL compute_blocks_par (pxc,pxcdot,pgc)
ELSE
Expand Down Expand Up @@ -218,6 +231,8 @@ SUBROUTINE evolve(time_step, ier_flag, liter_flag, lscreen)
CALL second0(tevoff)
evolve_time = evolve_time + (tevoff - tevon)

1000 FORMAT('Resetting the number of niter to ',i6)

END SUBROUTINE evolve


Expand Down
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=4.5E-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=5.1E-7)
set_tests_properties (vmec_free_boundary_check_jcuru_test
PROPERTIES
DEPENDS "vmec_free_boundary_serial_test;vmec_free_boundary_parallel_test")
Expand Down

0 comments on commit ac629f5

Please sign in to comment.