ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
ets_wrapper_bdseq.f90
Go to the documentation of this file.
1 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
7 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
9 
10  use euitm_schemas
11  use itm_types
12  implicit none
13 
14 contains
15 
16  subroutine bdseq_wrapper(euitm_equilibrium_in, euitm_equilibrium_out)
17 
18  use xml_file_reader
19 
20  implicit none
21 
22  type (type_equilibrium), pointer :: euitm_equilibrium_in(:)
23  type (type_equilibrium), pointer :: euitm_equilibrium_out(:)
24  type (type_param), save :: code_parameters
25  REAL (R8) :: maxabs
26  logical, save :: first = .true.
27 
28  interface
29  SUBROUTINE bdseq (euitm_equilibrium_in, euitm_equilibrium_out, code_parameters)
30  use euitm_schemas
31  IMPLICIT NONE
32  type (type_equilibrium), pointer :: euitm_equilibrium_in(:)
33  type (type_equilibrium), pointer :: euitm_equilibrium_out(:)
34  type (type_param) :: code_parameters
35  end SUBROUTINE bdseq
36  end interface
37 
38  if(first) then
39  call fill_param(code_parameters, 'XML/bdseq.xml', '', 'XML/bdseq.xsd')
40  first=.false.
41  endif
42 
43  if(associated(euitm_equilibrium_in(1)%profiles_1d%jparallel)) then
44  maxabs = maxval(abs(euitm_equilibrium_in(1)%profiles_1d%jphi))
45  write(*,*) 'max( | jphi | ) = ', maxabs
46  if(maxabs .EQ. 0.0_r8) then
47  write(*,*) 'bdseq_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  endif
53 
54  CALL bdseq(euitm_equilibrium_in, euitm_equilibrium_out, code_parameters)
55 
56  if(.not.associated(euitm_equilibrium_out(1)%profiles_1d%jparallel)) then
57  write(*,*) 'bdseq_wrapper copied jphi to jparallel [ERROR]'
58  allocate(euitm_equilibrium_out(1)%profiles_1d%jparallel(size(euitm_equilibrium_out(1)%profiles_1d%jphi)))
59  euitm_equilibrium_out(1)%profiles_1d%jparallel = euitm_equilibrium_out(1)%profiles_1d%jphi
60  else
61  maxabs = maxval(abs(euitm_equilibrium_out(1)%profiles_1d%jparallel))
62  write(*,*) 'max( | jparallel | ) = ', maxabs
63  if(maxabs .EQ. 0.0_r8) then
64  write(*,*) 'bdseq_wrapper copied jphi to jparallel [ERROR]'
65  euitm_equilibrium_out(1)%profiles_1d%jparallel = euitm_equilibrium_out(1)%profiles_1d%jphi
66  endif
67  endif
68 
69  return
70 
71  end subroutine bdseq_wrapper
72 
73 end module ets_wrapper_bdseq
subroutine bdseq(eq_in, eq_out, code_parameters)
Module implementing a simple equilibrium using CPOs.
Definition: bdseq.F90:6
wrapper for BDSEQ
program bdseq_wrapper
Definition: wrapper.F90:208