1 SUBROUTINE database_transport(USER, MACHINE, VERSION, SHOT, RUN, INTERPOL, TIME, COREPROF, CORETRANSP_OUT, RHO_INTERPOL)
4 USE deallocate_structures
21 TYPE (type_coreprof
),
POINTER :: coreprof(:)
22 TYPE (type_coretransp
),
POINTER :: coretransp_out(:)
23 TYPE (type_coretransp
),
POINTER :: coretransp_db(:)
24 TYPE (type_coretransp
),
POINTER :: coretransp_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_coretransp_cpo(nslice, nrho1, nnucl1, nion1, nimp1, nzimp1, nneut1, ntype1, ncomp1, coretransp_out)
54 call deallocate_cpo(coretransp_out(1)%COMPOSITIONS)
55 CALL copy_cpo(coreprof(1)%COMPOSITIONS, coretransp_out(1)%COMPOSITIONS)
56 coretransp_out(1)%VALUES(1)%rho_tor = coreprof(1)%rho_tor
61 cpopath =
'coretransp'
62 ALLOCATE (coretransp_db(1))
65 CALL
euitm_open_env(treename, shot, run, idx, user, machine, version)
66 CALL euitm_get_slice(idx, cpopath, coretransp_db(1), time, interpol)
68 WRITE (6,*)
'ERROR>>> NO CORETRANSP CPO IN THE DATABASE FOR SELECTED SHOT:', shot, run
69 CALL
allocate_coretransp_cpo(nslice, nrho1, nnucl1, nion1, nimp1, nzimp1, nneut1, ntype1, ncomp1, coretransp_db)
70 call deallocate_cpo(coretransp_db(1)%COMPOSITIONS)
71 CALL copy_cpo(coreprof(1)%COMPOSITIONS, coretransp_db(1)%COMPOSITIONS)
72 coretransp_db(1)%VALUES(1)%rho_tor = coreprof(1)%rho_tor
78 nrho2 =
SIZE (coretransp_db(1)%VALUES(1)%rho_tor, dim=1)
80 IF (rho_interpol.NE.0) &
81 coretransp_db(1)%VALUES(1)%rho_tor = coretransp_db(1)%VALUES(1)%rho_tor &
82 / coretransp_db(1)%VALUES(1)%rho_tor(nrho2) &
83 * coretransp_out(1)%VALUES(1)%rho_tor(nrho1)
88 IF (
SIZE(coretransp_db(1)%VALUES).GT.1)
THEN
89 ALLOCATE (coretransp_tmp(1))
90 ALLOCATE (coretransp_tmp(1)%VALUES(1))
91 CALL copy_cpo(coretransp_db(1)%VALUES(1), coretransp_tmp(1)%VALUES(1))
92 CALL deallocate_cpo(coretransp_db(1)%VALUES)
93 ALLOCATE (coretransp_db(1)%VALUES(1))
94 CALL copy_cpo(coretransp_tmp(1)%VALUES(1), coretransp_db(1)%VALUES(1))
104 ALLOCATE (coretransp_out(1)%VALUES(1)%transportid%id(1))
105 ALLOCATE (coretransp_out(1)%VALUES(1)%transportid%description(1))
106 coretransp_out(1)%VALUES(1)%transportid%id =
'database'
107 coretransp_out(1)%VALUES(1)%transportid%flag = 10
108 coretransp_out(1)%VALUES(1)%transportid%description =
'Transport specified by a database entry'
112 CALL deallocate_cpo(coretransp_db)
113 IF (
ALLOCATED(nzimp1))
DEALLOCATE (nzimp1)
114 IF (
ALLOCATED(ncomp1))
DEALLOCATE (ncomp1)
115 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)
subroutine interpolate_transp(CORETRANSP_IN, CORETRANSP_OUT, NEGATIVE_DIFF)
This module contains routines for allocation/deallocation if CPOs used in ETS.
subroutine database_transport(USER, MACHINE, VERSION, SHOT, RUN, INTERPOL, TIME, COREPROF, CORETRANSP_OUT, RHO_INTERPOL)
subroutine euitm_close(idx)
subroutine allocate_coretransp_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, CORETRANSP)
This routine allocates CORETRANSP CPO.