forked from landreman/regcoil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregcoil.f90
48 lines (35 loc) · 1.15 KB
/
regcoil.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
! Main program
program regcoil
use global_variables, only: totalTime, outputFilename, general_option
use init_plasma_mod
implicit none
integer :: tic, toc, countrate
print *,"This is REGCOIL,"
print *,"a regularized least-squares method for computing stellarator coils."
call system_clock(tic,countrate)
call read_input()
call validate_input()
call compute_lambda()
! Define the position vector and normal vector at each grid point for the surfaces:
call init_plasma()
call init_coil_surface()
! Initialize some of the vectors and matrices needed:
call read_bnorm()
call build_matrices()
select case (general_option)
case (1)
call solve()
case (2)
call compute_diagnostics_for_nescout_potential()
case (3)
call svd_scan()
case default
print *,"Invalid general_option:",general_option
stop
end select
call system_clock(toc)
totalTime = real(toc-tic)/countrate
call write_output()
print *,"REGCOIL complete. Total time=",totalTime,"sec."
print *,"You can run regcoilPlot ",trim(outputFilename)," to plot results."
end program regcoil