|
15 | 15 |
|
16 | 16 |
|
17 | 17 | !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! |
18 | | -subroutine bfield( RpZ, itangent, dBRpZ, ibfield ) |
19 | | - |
20 | | -! DATE : April 2016 |
21 | | -! using bs00aa in oculus ( actually NAG adaptive integration routines ) calculating magnetic field; |
22 | | -! only be used at the beginning stage; may be deleted later. |
23 | | - |
24 | | -!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! |
25 | | - |
26 | | - use kmodule, only : zero, one, pi2, vsmall, myid, ounit, Ncoils, coil, icoil, bsfield |
27 | | - |
28 | | - use oculus , only : bs00aa |
29 | | - |
30 | | -!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! |
31 | | - |
32 | | - implicit none |
33 | | - |
34 | | - include "mpif.h" |
35 | | - |
36 | | - INTEGER :: itangent, ibfield |
37 | | - REAL :: RpZ(1:3), dBRpZ(1:3,0:3) |
38 | | - |
39 | | - INTEGER :: ierr, ibs00aa |
40 | | - REAL :: zeta, Bx, By, Bz, czeta, szeta |
41 | | - |
42 | | -!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! |
43 | | - |
44 | | - dBRpZ(1:3,0:3) = zero ! set default intent(out) ; 11 Oct 15; |
45 | | - |
46 | | -!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! |
47 | | - |
48 | | - zeta = modulo( RpZ(2), pi2) |
49 | | - |
50 | | - czeta = cos(zeta) |
51 | | - szeta = sin(zeta) |
52 | | - |
53 | | - bsfield%x = RpZ(1) * czeta |
54 | | - bsfield%y = RpZ(1) * szeta |
55 | | - bsfield%z = RpZ(3) |
56 | | - |
57 | | - Bx = zero |
58 | | - By = zero |
59 | | - Bz = zero |
60 | | - |
61 | | - do icoil = 1, Ncoils ! icoil is a global variable which is passed through to auxiliary.h; 11 Oct 15; |
62 | | - |
63 | | - ibs00aa = 0 ; bsfield%LB = .true. ; bsfield%LA = .false. ; bsfield%LL = .false. ; call bs00aa( bsfield, ibs00aa ) |
64 | | - |
65 | | - Bx = Bx + bsfield%Bx * coil(icoil)%I |
66 | | - By = By + bsfield%By * coil(icoil)%I |
67 | | - Bz = Bz + bsfield%Bz * coil(icoil)%I |
68 | | - |
69 | | - enddo ! end of do icoil; 11 Oct 15; |
70 | | - |
71 | | - dBRpZ(1,0) = ( Bx * czeta + By * szeta ) |
72 | | - dBRpZ(2,0) = ( - Bx * szeta + By * czeta ) / RpZ(1) |
73 | | - dBRpZ(3,0) = Bz |
74 | | - |
75 | | - ibfield = 0 |
76 | | - |
77 | | - return |
78 | | - |
79 | | -end subroutine bfield |
| 18 | +!!$subroutine bfield( RpZ, itangent, dBRpZ, ibfield ) |
| 19 | +!!$ |
| 20 | +!!$! DATE : April 2016 |
| 21 | +!!$! using bs00aa in oculus ( actually NAG adaptive integration routines ) calculating magnetic field; |
| 22 | +!!$! only be used at the beginning stage; may be deleted later. |
| 23 | +!!$ |
| 24 | +!!$!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! |
| 25 | +!!$ |
| 26 | +!!$ use kmodule, only : zero, one, pi2, vsmall, myid, ounit, Ncoils, coil, icoil, bsfield |
| 27 | +!!$ |
| 28 | +!!$ use oculus , only : bs00aa |
| 29 | +!!$ |
| 30 | +!!$!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! |
| 31 | +!!$ |
| 32 | +!!$ implicit none |
| 33 | +!!$ |
| 34 | +!!$ include "mpif.h" |
| 35 | +!!$ |
| 36 | +!!$ INTEGER :: itangent, ibfield |
| 37 | +!!$ REAL :: RpZ(1:3), dBRpZ(1:3,0:3) |
| 38 | +!!$ |
| 39 | +!!$ INTEGER :: ierr, ibs00aa |
| 40 | +!!$ REAL :: zeta, Bx, By, Bz, czeta, szeta |
| 41 | +!!$ |
| 42 | +!!$!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! |
| 43 | +!!$ |
| 44 | +!!$ dBRpZ(1:3,0:3) = zero ! set default intent(out) ; 11 Oct 15; |
| 45 | +!!$ |
| 46 | +!!$!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! |
| 47 | +!!$ |
| 48 | +!!$ zeta = modulo( RpZ(2), pi2) |
| 49 | +!!$ |
| 50 | +!!$ czeta = cos(zeta) |
| 51 | +!!$ szeta = sin(zeta) |
| 52 | +!!$ |
| 53 | +!!$ bsfield%x = RpZ(1) * czeta |
| 54 | +!!$ bsfield%y = RpZ(1) * szeta |
| 55 | +!!$ bsfield%z = RpZ(3) |
| 56 | +!!$ |
| 57 | +!!$ Bx = zero |
| 58 | +!!$ By = zero |
| 59 | +!!$ Bz = zero |
| 60 | +!!$ |
| 61 | +!!$ do icoil = 1, Ncoils ! icoil is a global variable which is passed through to auxiliary.h; 11 Oct 15; |
| 62 | +!!$ |
| 63 | +!!$ ibs00aa = 0 ; bsfield%LB = .true. ; bsfield%LA = .false. ; bsfield%LL = .false. ; call bs00aa( bsfield, ibs00aa ) |
| 64 | +!!$ |
| 65 | +!!$ Bx = Bx + bsfield%Bx * coil(icoil)%I |
| 66 | +!!$ By = By + bsfield%By * coil(icoil)%I |
| 67 | +!!$ Bz = Bz + bsfield%Bz * coil(icoil)%I |
| 68 | +!!$ |
| 69 | +!!$ enddo ! end of do icoil; 11 Oct 15; |
| 70 | +!!$ |
| 71 | +!!$ dBRpZ(1,0) = ( Bx * czeta + By * szeta ) |
| 72 | +!!$ dBRpZ(2,0) = ( - Bx * szeta + By * czeta ) / RpZ(1) |
| 73 | +!!$ dBRpZ(3,0) = Bz |
| 74 | +!!$ |
| 75 | +!!$ ibfield = 0 |
| 76 | +!!$ |
| 77 | +!!$ return |
| 78 | +!!$ |
| 79 | +!!$end subroutine bfield |
80 | 80 |
|
81 | 81 | !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! |
82 | 82 | ! DATE: 06/15/2016 |
|
0 commit comments