ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
ets_wrapper_spider.f90
Go to the documentation of this file.
1 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
7 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
9 
10  use euitm_schemas
11  implicit none
12 
13 contains
14 
15  subroutine spider_wrapper(euitm_equilibrium_in, coreprof, euitm_equilibrium_out)
16 
17  use xml_file_reader
18  use write_structures
19 
20  implicit none
21 
22  type (type_equilibrium), pointer :: euitm_equilibrium_in(:)
23  type (type_equilibrium), pointer :: euitm_equilibrium_out(:)
24  TYPE (type_coreprof), POINTER :: coreprof(:)
25  type (type_param), save :: code_parameters
26  logical, save :: first = .true.
27  integer, save :: ncall = 0
28  character*32 :: filename = 'EQ_######'
29 
30  interface
31  SUBROUTINE equilibrium_spider (EQ_IN, COREPROF_IN, EQ_OUT, code_parameters)
32  USE euitm_schemas
33  IMPLICIT NONE
34  TYPE (type_equilibrium), POINTER :: eq_in(:) !input CPO with geometry quantities from previous time
35  TYPE (type_equilibrium), POINTER :: eq_out(:) !output CPO with geometry quantities from previous iteration
36  TYPE (type_coreprof), POINTER :: coreprof_in(:) !input CPO with plasma profiles
37  TYPE (type_param) :: code_parameters
38  end SUBROUTINE equilibrium_spider
39  end interface
40 
41  if(first) then
42  call fill_param(code_parameters, 'XML/SPIDER.xml', '', 'XML/SPIDER.xsd')
43  first=.false.
44  endif
45 
46  if(associated(euitm_equilibrium_in(1)%profiles_1d%jparallel)) then
47  write(*,*) 'spider_wrapper copied jparallel to jphi [ERROR]'
48  if(.not.associated(euitm_equilibrium_in(1)%profiles_1d%jphi)) &
49  allocate(euitm_equilibrium_in(1)%profiles_1d%jphi(size(euitm_equilibrium_in(1)%profiles_1d%jparallel)))
50  euitm_equilibrium_in(1)%profiles_1d%jphi=euitm_equilibrium_in(1)%profiles_1d%jparallel ! -? ToDo
51  endif
52  if(associated(euitm_equilibrium_in(1)%profiles_1d%psi)) then
53  write(*,*) 'spider_wrapper set psi_bound and psi_ax [ERROR]'
54  euitm_equilibrium_in(1)%global_param%psi_ax = euitm_equilibrium_in(1)%profiles_1d%psi(1)
55  euitm_equilibrium_in(1)%global_param%psi_bound = &
56  euitm_equilibrium_in(1)%profiles_1d%psi(size(euitm_equilibrium_in(1)%profiles_1d%psi))
57  endif
58 
59 ! the following is experimental
60  call f_par_axis(size(euitm_equilibrium_in(1)%profiles_1d%rho_tor), &
61  euitm_equilibrium_in(1)%profiles_1d%rho_tor,euitm_equilibrium_in(1)%profiles_1d%pressure)
62 ! end of the experiment
63 
64 
65 ! write(filename(4:9),'(I6.6)') ncall
66 ! call open_write_file(1, trim(filename)//'.IN')
67 ! call write_cpo(euitm_equilibrium_in(1), 'equilibrium')
68 ! call close_write_file
69 ! write(*,*) 'associated(euitm_equilibrium_out) ', associated(euitm_equilibrium_out)
70 
71  CALL equilibrium_spider(euitm_equilibrium_in, coreprof, euitm_equilibrium_out, code_parameters)
72 
73 ! if(.not.associated(euitm_equilibrium_out(1)%profiles_1d%jparallel)) then
74 ! write(*,*) 'spider_wrapper copied jphi to jparallel [ERROR]'
75 ! allocate(euitm_equilibrium_out(1)%profiles_1d%jparallel(size(euitm_equilibrium_out(1)%profiles_1d%jphi)))
76 ! euitm_equilibrium_out(1)%profiles_1d%jparallel=euitm_equilibrium_out(1)%profiles_1d%jphi
77 ! endif
78 ! call open_write_file(1, trim(filename)//'.OUT')
79 ! call write_cpo(euitm_equilibrium_out(1), 'equilibrium')
80 ! call close_write_file
81  ncall=ncall+1
82 
83  return
84 
85  end subroutine spider_wrapper
86 
87 end module ets_wrapper_spider
subroutine equilibrium_spider(EQUILIBRIUM_IN, COREPROF_IN, EQUILIBRIUM_OUT, code_parameters)
wrapper for SPIDER
subroutine f_par_axis(n, r, f)
This subroutine finds f(r_1=0) from f(r_2), f(r_3) d/dr f(r_1)=0.
subroutine spider_wrapper(euitm_equilibrium_in, coreprof, euitm_equilibrium_out)