ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
run_helena_cpo.F90
Go to the documentation of this file.
1 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
7 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
9 
10  USE euitm_routines
11  use itm_types
12  use euitm_schemas
13  use xml_file_reader
14  use read_structures
15  use write_structures
16  use deallocate_structures
17  implicit none
18 
19  type (type_equilibrium), pointer :: euitm_equilibrium_in(:)
20  type (type_equilibrium), pointer :: euitm_equilibrium_out(:)
21  type (type_param), save :: code_parameters
22  logical, save :: first = .true.
23  integer, save :: ncall = 0
24  character*32 :: filename = 'EQ_######'
25  integer(itm_i4) :: i, iargc
26  integer, save :: idx
27  character*256 :: arg
28  integer :: shot, run_in, run_out
29  real(R8) :: time
30 
31  interface
32  subroutine helena (euitm_equilibrium_in, euitm_equilibrium_out, in_path, code_parameters)
33  use euitm_schemas
34  IMPLICIT NONE
35  type (type_equilibrium), pointer :: euitm_equilibrium_in(:)
36  type (type_equilibrium), pointer :: euitm_equilibrium_out(:)
37  character(len = 132), optional :: in_path
38  type (type_param) :: code_parameters
39  end SUBROUTINE helena
40  end interface
41 
42  if(iargc().lt.4) then
43  write(*,*) 'shot, run_in, run_out and time missing'
44  stop 'error: missing filename'
45  endif
46 
47 
48  call fill_param(code_parameters, 'XML/helena.xml', '', 'XML/helena.xsd')
49 
50  call getarg(1,arg)
51  read(arg,*) shot
52  call getarg(2,arg)
53  read(arg,*) run_in
54  call getarg(3,arg)
55  read(arg,*) run_out
56  call getarg(4,arg)
57  read(arg,*) time
58 
59  write(*,*) 'Processing ',shot,run_in,run_out,time
60 
61  allocate(euitm_equilibrium_in(1))
62 
63 #ifdef UAL
64  CALL euitm_open('euitm', shot, run_in, idx)
65  CALL euitm_get_slice(idx, 'equilibrium', euitm_equilibrium_in(1), time, 1)
66 #else
67  stop 'Error: no UAL'
68 #endif
69 
70  CALL helena(euitm_equilibrium_in, euitm_equilibrium_out, code_parameters=code_parameters)
71 
72 #ifdef UAL
73  CALL euitm_create('euitm', shot, run_out, shot, run_in, idx)
74  euitm_equilibrium_out(1)%time = time
75  write(*,*) 'euitm_put_non_timed: equilibrium', euitm_equilibrium_out(1)%time
76  call euitm_put_non_timed(idx,"equilibrium",euitm_equilibrium_out(1))
77  write(*,*) 'euitm_put_slice: equilibrium', euitm_equilibrium_out(1)%time
78  call euitm_put_slice(idx,"equilibrium",euitm_equilibrium_out(1))
79 #else
80  stop 'Error: no UAL'
81 #endif
82 
83  filename='EQ_######'
84  write(filename(4:9),'(I6.6)') 1
85  call open_write_file(1, trim(filename)//'.OUT2')
86  call write_cpo(euitm_equilibrium_out(1), 'equilibrium')
87  call close_write_file
88 
89  call deallocate_cpo(euitm_equilibrium_in)
90  call deallocate_cpo(euitm_equilibrium_out)
91 
92 end program run_helena_cpo
subroutine helena(equilibrium_in, equilibrium_out, in_path, code_parameters)
Definition: helena.f90:1
program run_helena_cpo
Run helena based on a CPO stored in ascii format.