ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
run_chease_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 chease (euitm_equilibrium_in, euitm_equilibrium_out, 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  type (type_param) :: code_parameters
38  end SUBROUTINE chease
39  end interface
40 
41  if(iargc().lt.4) then
42  write(*,*) 'shot, run_in, run_out and time missing'
43  stop 'error: missing filename'
44  endif
45 
46 
47  call fill_param(code_parameters, 'XML/chease.xml', '', 'XML/chease.xsd')
48 
49  call getarg(1,arg)
50  read(arg,*) shot
51  call getarg(2,arg)
52  read(arg,*) run_in
53  call getarg(3,arg)
54  read(arg,*) run_out
55  call getarg(4,arg)
56  read(arg,*) time
57 
58  write(*,*) 'Processing ',shot,run_in,run_out,time
59 
60  allocate(euitm_equilibrium_in(1))
61 
62 #ifdef UAL
63  CALL euitm_open('euitm', shot, run_in, idx)
64  CALL euitm_get_slice(idx, 'equilibrium', euitm_equilibrium_in(1), time, 1)
65 #else
66  stop 'Error: no UAL'
67 #endif
68 
69  CALL chease(euitm_equilibrium_in, euitm_equilibrium_out, code_parameters=code_parameters)
70 
71 #ifdef UAL
72  CALL euitm_create('euitm', shot, run_out, shot, run_in, idx)
73  euitm_equilibrium_out(1)%time = time
74  write(*,*) 'euitm_put_non_timed: equilibrium', euitm_equilibrium_out(1)%time
75  call euitm_put_non_timed(idx,"equilibrium",euitm_equilibrium_out(1))
76  write(*,*) 'euitm_put_slice: equilibrium', euitm_equilibrium_out(1)%time
77  call euitm_put_slice(idx,"equilibrium",euitm_equilibrium_out(1))
78 #else
79  stop 'Error: no UAL'
80 #endif
81 
82  filename='EQ_######'
83  write(filename(4:9),'(I6.6)') 1
84  call open_write_file(1, trim(filename)//'.OUT2')
85  call write_cpo(euitm_equilibrium_out(1), 'equilibrium')
86  call close_write_file
87 
88  call deallocate_cpo(euitm_equilibrium_in)
89  call deallocate_cpo(euitm_equilibrium_out)
90 
91 end program run_chease_cpo
program run_chease_cpo
Run chease based on a CPO stored in ascii format.