1 SUBROUTINE database_source(USER, MACHINE, VERSION, SHOT, RUN, INTERPOL, TIME, COREPROF, CORESOURCE_OUT, RHO_INTERPOL)
4 USE deallocate_structures
21 TYPE (type_coreprof
),
POINTER :: coreprof(:)
22 TYPE (type_coresource
),
POINTER :: coresource_out(:)
23 TYPE (type_coresource
),
POINTER :: coresource_db(:)
24 TYPE (type_coresource
),
POINTER :: coresource_tmp(:)
26 INTEGER,
PARAMETER :: nslice = 1
27 INTEGER :: nrho1, nrho2
31 INTEGER,
ALLOCATABLE :: nzimp1(:)
33 INTEGER,
ALLOCATABLE :: ncomp1(:)
34 INTEGER,
ALLOCATABLE :: ntype1(:)
40 INTEGER :: rho_interpol
42 CHARACTER(len=10) :: cpopath
43 CHARACTER(len=5),
PARAMETER :: treename =
'euitm'
45 CHARACTER(*) :: machine
46 CHARACTER(*) :: version
51 nrho1 =
SIZE(coreprof(1)%rho_tor, dim=1)
52 CALL
get_comp_dimensions(coreprof(1)%COMPOSITIONS, nnucl1, nion1, nimp1, nzimp1, nneut1, ntype1, ncomp1)
53 CALL
allocate_coresource_cpo(nslice, nrho1, nnucl1, nion1, nimp1, nzimp1, nneut1, ntype1, ncomp1, coresource_out)
54 call deallocate_cpo(coresource_out(1)%COMPOSITIONS)
55 CALL copy_cpo(coreprof(1)%COMPOSITIONS, coresource_out(1)%COMPOSITIONS)
56 coresource_out(1)%VALUES(1)%rho_tor = coreprof(1)%rho_tor
61 cpopath =
'coresource'
62 ALLOCATE (coresource_db(1))
64 CALL
euitm_open_env(treename, shot, run, idx, user, machine, version)
65 CALL euitm_get_slice(idx, cpopath, coresource_db(1), time, interpol)
67 WRITE (6,*)
'ERROR>>> NO CORESOURCE CPO IN THE DATABASE FOR SELECTED SHOT:', shot, run
68 CALL
allocate_coresource_cpo(nslice, nrho1, nnucl1, nion1, nimp1, nzimp1, nneut1, ntype1, ncomp1, coresource_db)
69 call deallocate_cpo(coresource_db(1)%COMPOSITIONS)
70 CALL copy_cpo(coreprof(1)%COMPOSITIONS, coresource_db(1)%COMPOSITIONS)
71 coresource_db(1)%VALUES(1)%rho_tor = coreprof(1)%rho_tor
77 nrho2 =
SIZE (coresource_db(1)%VALUES(1)%rho_tor, dim=1)
79 IF (rho_interpol.NE.0) &
80 coresource_db(1)%VALUES(1)%rho_tor = coresource_db(1)%VALUES(1)%rho_tor &
81 / coresource_db(1)%VALUES(1)%rho_tor(nrho2) &
82 * coresource_out(1)%VALUES(1)%rho_tor(nrho1)
85 IF (
SIZE(coresource_db(1)%VALUES).GT.1)
THEN
86 ALLOCATE (coresource_tmp(1))
87 ALLOCATE (coresource_tmp(1)%VALUES(1))
88 CALL copy_cpo(coresource_db(1)%VALUES(1), coresource_tmp(1)%VALUES(1))
89 CALL deallocate_cpo(coresource_db(1)%VALUES)
90 ALLOCATE (coresource_db(1)%VALUES(1))
91 CALL copy_cpo(coresource_tmp(1)%VALUES(1), coresource_db(1)%VALUES(1))
101 ALLOCATE (coresource_out(1)%VALUES(1)%sourceid%id(1))
102 ALLOCATE (coresource_out(1)%VALUES(1)%sourceid%description(1))
104 coresource_out(1)%VALUES(1)%sourceid%id =
'database'
105 coresource_out(1)%VALUES(1)%sourceid%flag = 27
106 coresource_out(1)%VALUES(1)%sourceid%description =
'Source from database entry'
111 CALL deallocate_cpo(coresource_db)
112 IF (
ALLOCATED(nzimp1))
DEALLOCATE (nzimp1)
113 IF (
ALLOCATED(ncomp1))
DEALLOCATE (ncomp1)
114 IF (
ALLOCATED(ntype1))
DEALLOCATE (ntype1)
subroutine euitm_open_env(name, shot, run, retIdx, user, tokamak, version)
subroutine get_comp_dimensions(COMPOSITIONS, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP)
This module contains routines for allocation/deallocation if CPOs used in ETS.
subroutine allocate_coresource_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, CORESOURCE)
This routine allocates CORESOURCE CPO.
subroutine database_source(USER, MACHINE, VERSION, SHOT, RUN, INTERPOL, TIME, COREPROF, CORESOURCE_OUT, RHO_INTERPOL)
subroutine interpolate_source(CORESOURCE_IN, CORESOURCE_OUT)
subroutine euitm_close(idx)