1 SUBROUTINE database_profiles(USER, MACHINE, VERSION, SHOT, RUN, INTERPOL, TIME, COREPROF, COREPROF_OUT, RHO_INTERPOL)
4 USE deallocate_structures
21 TYPE (type_coreprof
),
POINTER :: coreprof(:)
22 TYPE (type_coreprof
),
POINTER :: coreprof_out(:)
23 TYPE (type_coreprof
),
POINTER :: coreprof_db(:)
25 INTEGER,
PARAMETER :: nslice = 1
26 INTEGER :: nrho1, nrho2
28 INTEGER :: nion1, iion1
30 INTEGER,
ALLOCATABLE :: nzimp1(:)
32 INTEGER,
ALLOCATABLE :: ncomp1(:)
33 INTEGER,
ALLOCATABLE :: ntype1(:)
39 INTEGER :: rho_interpol
41 CHARACTER(len=10) :: cpopath
42 CHARACTER(len=5),
PARAMETER :: treename =
'euitm'
44 CHARACTER(*) :: machine
45 CHARACTER(*) :: version
50 nrho1 =
SIZE(coreprof(1)%rho_tor, dim=1)
51 CALL
get_comp_dimensions(coreprof(1)%COMPOSITIONS, nnucl1, nion1, nimp1, nzimp1, nneut1, ntype1, ncomp1)
52 CALL
allocate_coreprof_cpo(nslice, nrho1, nnucl1, nion1, nimp1, nzimp1, nneut1, ntype1, ncomp1, coreprof_out)
53 CALL copy_cpo(coreprof(1), coreprof_out(1))
54 coreprof_out(1)%rho_tor = coreprof(1)%rho_tor
60 ALLOCATE (coreprof_db(1))
63 CALL
euitm_open_env(treename, shot, run, idx, user, machine, version)
64 CALL euitm_get_slice(idx, cpopath, coreprof_db(1), time, interpol)
66 WRITE (6,*)
'ERROR>>> NO COREPROF CPO IN THE DATABASE FOR SELECTED SHOT:', shot, run
67 CALL
allocate_coreprof_cpo(nslice, nrho1, nnucl1, nion1, nimp1, nzimp1, nneut1, ntype1, ncomp1, coreprof_db)
68 call deallocate_cpo(coreprof_db(1)%COMPOSITIONS)
69 CALL copy_cpo(coreprof(1)%COMPOSITIONS, coreprof_db(1)%COMPOSITIONS)
70 coreprof_db(1)%rho_tor = coreprof(1)%rho_tor
76 nrho2 =
SIZE (coreprof_db(1)%rho_tor, dim=1)
78 IF (rho_interpol.NE.0) &
79 coreprof_db(1)%rho_tor = coreprof_db(1)%rho_tor &
80 / coreprof_db(1)%rho_tor(nrho2) &
81 * coreprof_out(1)%rho_tor(nrho1)
92 IF (coreprof_out(1)%psi%flag .EQ. 1) &
93 coreprof_out(1)%psi%value = coreprof(1)%psi%value
94 IF (coreprof_out(1)%ne%flag .EQ. 1) &
95 coreprof_out(1)%ne%value = coreprof(1)%ne%value
96 IF (coreprof_out(1)%te%flag .EQ. 1) &
97 coreprof_out(1)%te%value = coreprof(1)%te%value
101 IF (coreprof_out(1)%ni%flag(iion1) .EQ. 1) &
102 coreprof_out(1)%ni%value(:,iion1) = coreprof(1)%ni%value(:,iion1)
103 IF (coreprof_out(1)%ti%flag(iion1) .EQ. 1) &
104 coreprof_out(1)%ti%value(:,iion1) = coreprof(1)%ti%value(:,iion1)
105 IF (coreprof_out(1)%vtor%flag(iion1) .EQ. 1) &
106 coreprof_out(1)%vtor%value(:,iion1) = coreprof(1)%vtor%value(:,iion1)
110 IF (coreprof_out(1)%ne%flag .EQ. 3)
THEN
111 coreprof_out(1)%ne%boundary%value(1) = coreprof(1)%ne%value(nrho1)
112 coreprof_out(1)%ne%boundary%value(2) = 0.0_r8
113 coreprof_out(1)%ne%boundary%value(3) = 0.0_r8
114 coreprof_out(1)%ne%boundary%type = 1
116 IF (coreprof_out(1)%te%flag .EQ. 3)
THEN
117 coreprof_out(1)%te%boundary%value(1) = coreprof(1)%te%value(nrho1)
118 coreprof_out(1)%te%boundary%value(2) = 0.0_r8
119 coreprof_out(1)%te%boundary%value(3) = 0.0_r8
120 coreprof_out(1)%te%boundary%type = 1
125 IF (coreprof_out(1)%ni%flag(iion1) .EQ. 3)
THEN
126 coreprof_out(1)%ni%boundary%value(1,iion1) = coreprof(1)%ni%value(nrho1,iion1)
127 coreprof_out(1)%ni%boundary%value(2,iion1) = 0.0_r8
128 coreprof_out(1)%ni%boundary%value(3,iion1) = 0.0_r8
129 coreprof_out(1)%ni%boundary%type(iion1) = 1
132 IF (coreprof_out(1)%ti%flag(iion1) .EQ. 3)
THEN
133 coreprof_out(1)%ti%boundary%value(1,iion1) = coreprof(1)%ti%value(nrho1,iion1)
134 coreprof_out(1)%ti%boundary%value(2,iion1) = 0.0_r8
135 coreprof_out(1)%ti%boundary%value(3,iion1) = 0.0_r8
136 coreprof_out(1)%ti%boundary%type(iion1) = 1
139 IF (coreprof_out(1)%vtor%flag(iion1) .EQ. 3)
THEN
140 coreprof_out(1)%vtor%boundary%value(1,iion1) = coreprof(1)%vtor%value(nrho1,iion1)
141 coreprof_out(1)%vtor%boundary%value(2,iion1) = 0.0_r8
142 coreprof_out(1)%vtor%boundary%value(3,iion1) = 0.0_r8
143 coreprof_out(1)%vtor%boundary%type(iion1) = 1
152 CALL deallocate_cpo(coreprof_db)
153 IF (
ALLOCATED(nzimp1))
DEALLOCATE (nzimp1)
154 IF (
ALLOCATED(ncomp1))
DEALLOCATE (ncomp1)
155 IF (
ALLOCATED(ntype1))
DEALLOCATE (ntype1)
subroutine euitm_open_env(name, shot, run, retIdx, user, tokamak, version)
subroutine allocate_coreprof_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, COREPROF)
This routine allocates COREPROF CPO.
subroutine get_comp_dimensions(COMPOSITIONS, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP)
subroutine interpolate_prof(COREPROF_IN, COREPROF_OUT)
subroutine database_profiles(USER, MACHINE, VERSION, SHOT, RUN, INTERPOL, TIME, COREPROF, COREPROF_OUT, RHO_INTERPOL)
This module contains routines for allocation/deallocation if CPOs used in ETS.
subroutine euitm_close(idx)