76 INTEGER :: nbnd, nstep, key_equil
77 INTEGER :: neql, nteta
79 REAL (R8) :: cc(na1), cubs(na1), cd(na1),cu(na1)
80 REAL (R8) :: te(na1), pres(na1)
81 REAL (R8) :: cu_out(na1)
82 REAL (R8) :: pres_s(na1)
83 REAL (R8) :: ymu(na1),yfp(na1)
84 REAL (R8) :: rzbnd(2*nbnd),eqpf(na1),eqff(na1),fp(na1),ipl,ybetpl
85 REAL (R8) :: yli3,rtor,ztor,btor,rho(na1),roc, ftrap(na1)
86 REAL (R8) :: g11(na1),g22(na1),g33(na1)
87 REAL (R8) :: vr(na1),vrs(na1),slat(na1),gradro(na1),rocnew
88 REAL (R8) :: mu(na1),ipol(na1),bmaxt(na1),bmint(na1),bdb02(na1)
89 REAL (R8) :: bdb0(na1),b0db2(na1),droda(na1)
90 REAL (R8) :: shafr_shift(na1),elong(na1),elong_u(na1),elong_l(na1),triang_l(na1),triang_u(na1),amid(na1)
91 REAL (R8) :: roc_input
92 REAL (R8) :: rout(neql,nteta), zout(neql,nteta)
96 REAL (R8) :: hro, yreler, platok,time, dt
105 CALL
input2spider2(neql,nteta,nbnd,rzbnd,na1,eqpf,eqff,fp,ipl, &
106 rtor,btor,rho,pres,cu, &
115 neql,nteta,rtor,ztor,btor,rho,roc,na1, &
116 g11,g22,g33,vr,vrs,slat,gradro,rocnew, &
117 ymu,ipol,bmaxt,bmint,bdb02,b0db2,bdb0,droda, &
118 yreler,yli3,platok,cu_out,yfp, &
119 pres_s,rout,zout,shafr_shift,elong,elong_u,elong_l, &
120 triang_l,triang_u,amid,ftrap)
138 rtor,btor,rho,pres,cu, &
149 INTEGER :: nbnd, key_equil, na1, nstep
150 INTEGER :: neql, nteta
151 REAL (R8) :: dt,time,dpsdt,yreler
152 REAL (R8) :: ipl, rtor, btor,roc
153 REAL (R8) :: rzbnd(1:2*nbnd)
154 REAL (R8) :: eqpf(na1), eqff(na1), fp(na1)
155 REAL (R8) :: rho(na1), pres(na1), cu(na1)
159 INTEGER :: kpr,k_con,kname
160 INTEGER :: k_fixfree,key_ini,key_start,key_0stp,key_pres,key_dmf
161 INTEGER :: k_grid,k_auto
162 REAL (R8),
ALLOCATABLE :: mu(:), cc(:),te(:),cubc(:),cd(:)
164 CHARACTER*40 :: prename
165 CHARACTER*40 :: eqdfn
171 ALLOCATE ( mu(na1), cc(na1), te(na1), cubc(na1), cd(na1) )
182 parameters_spider%nstep = nstep
185 IF (nstep .NE. 0)
THEN
186 parameters_spider%key_dmf = key_equil
188 IF(key_equil .eq. 0)
THEN
189 parameters_spider%key_0stp = key_equil
190 ELSE IF (key_equil .eq. -10)
THEN
191 parameters_spider%key_0stp = 1
193 parameters_spider%key_0stp = key_equil
200 IF (key_equil .eq. 0)
THEN
201 parameters_spider%key_pres = 0
204 kpr = parameters_spider%kpr
206 prename = parameters_spider%prename
207 kname = parameters_spider%kname
214 nstep = parameters_spider%nstep
215 time = parameters_spider%time
216 dt = parameters_spider%dt
217 key_dmf = parameters_spider%key_dmf
218 k_grid = parameters_spider%k_grid
219 k_auto = parameters_spider%k_auto
220 k_fixfree = parameters_spider%k_fixfree
221 dpsdt = parameters_spider%dpsdt
222 key_ini = parameters_spider%key_ini
223 key_start = parameters_spider%key_start
224 eqdfn = parameters_spider%eqdfn
225 key_0stp = parameters_spider%key_0stp
226 key_pres = parameters_spider%key_pres
232 parameters_spider%neql = neql
233 parameters_spider%nteta = nteta
243 na1,eqpf,eqff,fp,ipl, &
244 rtor,btor,rho,roc,nstep,yreler,mu, &
245 cc,te,cubc,cd,key_ini,eqdfn,pres,cu, &
251 DEALLOCATE ( mu, cc, te, cubc, cd )
274 INTEGER :: nstep, key_dmf, k_grid, k_auto, k_fixfree, key_ini
275 INTEGER :: kpr, kname
276 REAL (R8) :: time, dt, dpsdt
279 REAL (R8),
ALLOCATABLE :: voltpf(:), phi(:)
285 ALLOCATE ( voltpf(100) )
289 nstep = parameters_spider%nstep
290 time = parameters_spider%time
291 dt = parameters_spider%dt
292 key_dmf = parameters_spider%key_dmf
293 k_grid = parameters_spider%k_grid
294 k_auto = parameters_spider%k_auto
295 k_fixfree = parameters_spider%k_fixfree
296 dpsdt = parameters_spider%dpsdt
297 key_ini = parameters_spider%key_ini
298 kpr = parameters_spider%kpr
299 kname = parameters_spider%kname
304 CALL
put_name(parameters_spider%prename,kname)
309 CALL
spider(nstep,time,dt,key_dmf,k_grid,k_auto,k_fixfree, &
310 dpsdt,key_ini,voltpf)
318 DEALLOCATE ( voltpf )
332 neql,nteta,rtor,ztor,btor,rho,roc,na1, &
333 g11,g22,g33,vr,vrs,slat,gradro,rocnew, &
334 mu,ipol,bmaxt,bmint,bdb02,b0db2,bdb0,droda, &
335 yreler,yli3,platok,cu_out,fp,pres_s, &
336 rout,zout,shafr_shift,elong,elong_u,elong_l,&
337 triang_l, triang_u,amid,ftrap)
345 INTEGER :: na1,ni_p,nj_p
346 INTEGER :: i, j, neql, nteta, ndim2
349 REAL (R8) :: rtor,ztor,btor, platok,yli3,roc,rocnew,yreler
350 REAL (R8) :: g11(na1), g22(na1), g33(na1)
351 REAL (R8) :: rho(na1), pres_s(na1), cu_out(na1),fp(na1),ftrap(na1)
352 REAL (R8) :: vr(na1),vrs(na1),slat(na1)
353 REAL (R8) :: gradro(na1),droda(na1),mu(na1)
354 REAL (R8) :: ipol(na1),bmaxt(na1),bmint(na1)
355 REAL (R8) :: bdb02(na1),b0db2(na1),bdb0(na1)
356 REAL (R8) :: rout(neql,nteta), zout(neql,nteta)
357 REAL (R8) :: shafr_shift(na1),elong(na1),elong_u(na1),elong_l(na1),triang_l(na1),triang_u(na1),amid(na1)
358 REAL (R8) :: r_in, r_out, z_min, z_max, rz_min, rz_max
359 REAL (R8) :: r1,
r2,r3,z1,z2,z3,a,b
362 REAL (R8),
ALLOCATABLE :: w_dj(:), yfofb(:)
367 ALLOCATE ( w_dj(na1), yfofb(na1) )
374 ni_p = parameters_spider%neql
375 nj_p = parameters_spider%nteta
385 g11,g22,g33,vr,vrs,slat,gradro,rocnew, &
386 mu,ipol,bmaxt,bmint,bdb02,b0db2,bdb0,droda, &
387 yreler,yli3,ni_p,nj_p,platok,cu_out,fp, &
393 CALL
output2d(neql,nteta,na1,rtor,ztor,rout,zout,shafr_shift,elong,elong_u,elong_l,triang_l,triang_u,amid)
396 DEALLOCATE ( w_dj, yfofb )
410 SUBROUTINE output2d (neql,nteta,na1,rtor,ztor,rout,zout,shafr_shift,elong,elong_u,elong_l,triang_l,triang_u,amid)
417 INTEGER :: na1, neql, nteta
418 INTEGER :: i, j, ndim2
421 REAL (R8) :: rout(neql,nteta), zout(neql,nteta), rtor,ztor
422 REAL (R8) :: shafr_shift(na1),elong(na1),elong_u(na1),elong_l(na1),triang_l(na1),triang_u(na1),amid(na1)
423 REAL (R8) :: r_in, r_out, z_in, z_out, z_min, z_max, rz_min, rz_max
424 REAL (R8) :: r1,
r2,r3,z1,z2,z3,a,b
427 ndim2 =
SIZE(rout, dim=2)
430 r_in = minval(rout(i,1:ndim2))
431 r_out = maxval(rout(i,1:ndim2))
432 z_min = minval(zout(i,1:ndim2))
433 z_max = maxval(zout(i,1:ndim2))
435 rz_min = 0.5d0*(r_in+r_out)
436 rz_max = 0.5d0*(r_in+r_out)
439 IF (zout(i,j).EQ.z_min)
THEN
442 IF (ndim2-j.LT.2) k2 = 2 - ndim2
443 IF (j.LT.2) k1 = 2 - ndim2
451 a = ((z2-z3)/(
r2-r3)-(z1-z2)/(r1-
r2))/(r3-r1)
452 b = (z1-z2)/(r1-
r2) - a*(r1+
r2)
455 z_min = a*(rz_min**2-
r2**2) + b*(rz_min -
r2)+ z2
457 IF (abs(1.d0-rz_min/rout(i,j)).ge.abs(1.d0-rout(i,1)/rout(i,2))) rz_min = rout(i,j)
459 IF (zout(i,j).EQ.z_max)
THEN
462 IF (ndim2-j.LT.2) k2 = 2 - ndim2
463 IF (j.LT.2) k1 = 2 - ndim2
471 a = ((z2-z3)/(
r2-r3)-(z1-z2)/(r1-
r2))/(r3-r1)
472 b = (z1-z2)/(r1-
r2) - a*(r1+
r2)
475 z_max = a*(rz_max**2-
r2**2) + b*(rz_max -
r2)+ z2
476 IF (abs(1.d0-rz_max/rout(i,j)).ge.abs(1.d0-rout(i,1)/rout(i,2))) rz_max = rout(i,j)
478 IF (rout(i,j).EQ.r_out)
THEN
481 IF (ndim2-j.LT.2) k2 = 2 - ndim2
482 IF (j.LT.2) k1 = 2 - ndim2
490 a = ((
r2-r3)/(z2-z3)-(r1-
r2)/(z1-z2))/(z3-z1)
491 b = (r1-
r2)/(z1-z2) - a*(z1+z2)
494 r_out = a*(z_out**2-z2**2) + b*(z_out-z2)+
r2
495 IF (abs(1.d0-z_out/zout(i,j)).ge.abs(1.d0-zout(i,1)/zout(i,2))) z_out = zout(i,j)
497 IF (rout(i,j).EQ.r_in)
THEN
500 IF (ndim2-j.LT.2) k2 = 2 - ndim2
501 IF (j.LT.2) k1 = 2 - ndim2
509 a = ((
r2-r3)/(z2-z3)-(r1-
r2)/(z1-z2))/(z3-z1)
510 b = (r1-
r2)/(z1-z2) - a*(z1+z2)
513 r_in = a*(z_in**2-z2**2) + b*(z_in-z2)+
r2
514 IF (abs(1.d0-z_in/zout(i,j)).ge.abs(1.d0-zout(i,1)/zout(i,2))) z_in = zout(i,j)
518 amid(i) = 0.5d0*(r_out-r_in)
519 shafr_shift(i) = 0.5d0*(r_in+r_out)-rtor
520 elong(i) = (z_max-z_min)/(r_out-r_in)
521 elong_u(i) = 2.d0*abs(z_max-ztor)/(r_out-r_in)
522 elong_l(i) = 2.d0*abs(ztor-z_min)/(r_out-r_in)
523 triang_l(i) = (0.5d0*(r_in+r_out)-rz_min)/amid(i)
524 triang_u(i) = (0.5d0*(r_in+r_out)-rz_max)/amid(i)
526 shafr_shift(1) = rout(1,1)-rtor
531 shafr_shift(na1) = 0.d0
subroutine input2spider2(neql, nteta, nbnd, rzbnd, na1, eqpf, eqff, fp, ipl, rtor, btor, rho, pres, cu, nstep, key_equil, PARAMETERS_SPIDER)
subroutine put_tim(dt, time)
subroutine output2d(neql, nteta, na1, rtor, ztor, rout, zout, shafr_shift, elong, elong_u, elong_l, triang_l, triang_u, amid)
subroutine kpr_calc(kpr_xx)
subroutine spider2output2(PARAMETERS_SPIDER, neql, nteta, rtor, ztor, btor, rho, roc, na1, g11, g22, g33, vr, vrs, slat, gradro, rocnew, mu, ipol, bmaxt, bmint, bdb02, b0db2, bdb0, droda, yreler, yli3, platok, cu_out, fp, pres_s, rout, zout, shafr_shift, elong, elong_u, elong_l, triang_l, triang_u, amid, ftrap)
subroutine spider_run2(PARAMETERS_SPIDER)
subroutine astra2spider(neql, nteta, nbnd, rzbnd, key_dmf,
subroutine put_key_con(k)
real(r8) function r2(a, x, xr, xs, yr, ys, psi, psir, F_dia)
subroutine spider(nstep, time, dt, key_dmf, k_grid, k_auto, k_fixfree,
subroutine put_name(name, ksym)
subroutine spider2astra(rout, zout, rtor, btor, rho, roc, na1,