ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
check_transport_bound.f90
Go to the documentation of this file.
1 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
2 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
3  SUBROUTINE check_transport_bound(COREPROF, CORETRANSP_IN, CORETRANSP_OUT)
4  !-------------------------------------------------------!
5  ! This subroutine checks the boundary values of !
6  ! transport coeffients !
7  !-------------------------------------------------------!
8  ! Source: --- !
9  ! Developers: D.Kalupin !
10  ! Kontacts: Denis.Kalupin@efda.org !
11  ! !
12  ! Comments: created for use of GEM in ETS !
13  ! !
14  !-------------------------------------------------------!
15 
16  USE itm_types
17  USE itm_constants
18  USE euitm_schemas
19  USE copy_structures
21  USE deallocate_structures
22 
23  IMPLICIT NONE
24 
25 
26 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
27 ! +++ CPOs:
28  TYPE (type_coreprof), POINTER :: coreprof(:)
29  TYPE (type_coretransp), POINTER :: coretransp_in(:)
30  TYPE (type_coretransp), POINTER :: coretransp_out(:)
31 
32  INTEGER, PARAMETER :: nslice = 1
33  INTEGER :: nrho_prof
34  INTEGER :: nrho_tr
35  INTEGER :: nnucl_tr
36  INTEGER :: nion_tr
37  INTEGER :: nimp_tr, iimp
38  INTEGER, ALLOCATABLE :: nzimp_tr(:)
39  INTEGER :: nneut_tr
40  INTEGER, ALLOCATABLE :: ncomp_tr(:)
41  INTEGER, ALLOCATABLE :: ntype_tr(:)
42 
43  INTEGER :: flag_bnd(2)
44  INTEGER :: istart, iend
45  INTEGER :: irho
46 
47 
48 
49 
50 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
51 ! +++ OUTPUT TRANSPORT CPO:
52  nrho_prof = SIZE(coreprof(1)%rho_tor)
53  nrho_tr = SIZE(coretransp_in(1)%VALUES(1)%rho_tor)
54 
55 
56  CALL get_comp_dimensions(coretransp_in(1)%COMPOSITIONS, nnucl_tr, nion_tr, nimp_tr, nzimp_tr, nneut_tr, ntype_tr, ncomp_tr)
57 
58 
59 
60 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
61  flag_bnd(:) = 0
62  istart = 0
63  iend = 0
64 
65  IF ((coreprof(1)%rho_tor(1).GE.coretransp_in(1)%VALUES(1)%rho_tor(1)).AND. &
66  (coreprof(1)%rho_tor(nrho_prof).LE.coretransp_in(1)%VALUES(1)%rho_tor(nrho_tr))) THEN
67  ALLOCATE (coretransp_out(1))
68  CALL copy_cpo(coretransp_in(1), coretransp_out(1))
69  goto 100
70  END IF
71 
72 
73  IF ((coreprof(1)%rho_tor(nrho_prof).GT.coretransp_in(1)%VALUES(1)%rho_tor(nrho_tr))) THEN
74  nrho_tr = nrho_tr + 1
75  flag_bnd(2) = 1
76  END IF
77  IF ((coreprof(1)%rho_tor(1).LT.coretransp_in(1)%VALUES(1)%rho_tor(1))) THEN
78  nrho_tr = nrho_tr + 1
79  flag_bnd(1) = 1
80  END IF
81 
82 
83 
84  CALL allocate_coretransp_cpo(nslice, nrho_tr, nnucl_tr, nion_tr, nimp_tr, nzimp_tr, nneut_tr, ntype_tr, ncomp_tr, coretransp_out)
85  CALL copy_cpo(coretransp_in(1)%COMPOSITIONS, coretransp_out(1)%COMPOSITIONS)
86 
87 
88 
89 
90  IF (flag_bnd(1).EQ.1) THEN
91  istart = 1
92  coretransp_out(1)%VALUES(1)%rho_tor(1) = coreprof(1)%rho_tor(1)
93  coretransp_out(1)%VALUES(1)%rho_tor_norm(1) = coreprof(1)%rho_tor(1)/coreprof(1)%rho_tor(nrho_prof)
94  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ni_transp%diff_eff)) &
95  coretransp_out(1)%VALUES(1)%ni_transp%diff_eff(1,:,:) = coretransp_in(1)%VALUES(1)%ni_transp%diff_eff(1,:,:)
96  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ni_transp%vconv_eff)) &
97  coretransp_out(1)%VALUES(1)%ni_transp%vconv_eff(1,:,:) = coretransp_in(1)%VALUES(1)%ni_transp%vconv_eff(1,:,:)
98  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ne_transp%diff_eff)) &
99  coretransp_out(1)%VALUES(1)%ne_transp%diff_eff(1,:) = coretransp_in(1)%VALUES(1)%ne_transp%diff_eff(1,:)
100  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ne_transp%vconv_eff)) &
101  coretransp_out(1)%VALUES(1)%ne_transp%vconv_eff(1,:) = coretransp_in(1)%VALUES(1)%ne_transp%vconv_eff(1,:)
102  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ti_transp%diff_eff)) &
103  coretransp_out(1)%VALUES(1)%ti_transp%diff_eff(1,:) = coretransp_in(1)%VALUES(1)%ti_transp%diff_eff(1,:)
104  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ti_transp%vconv_eff)) &
105  coretransp_out(1)%VALUES(1)%ti_transp%vconv_eff(1,:) = coretransp_in(1)%VALUES(1)%ti_transp%vconv_eff(1,:)
106  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%te_transp%diff_eff)) &
107  coretransp_out(1)%VALUES(1)%te_transp%diff_eff(1) = coretransp_in(1)%VALUES(1)%te_transp%diff_eff(1)
108  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%te_transp%vconv_eff)) &
109  coretransp_out(1)%VALUES(1)%te_transp%vconv_eff(1) = coretransp_in(1)%VALUES(1)%te_transp%vconv_eff(1)
110  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%vtor_transp%diff_eff)) &
111  coretransp_out(1)%VALUES(1)%vtor_transp%diff_eff(1,:) = coretransp_in(1)%VALUES(1)%vtor_transp%diff_eff(1,:)
112  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%vtor_transp%vconv_eff)) &
113  coretransp_out(1)%VALUES(1)%vtor_transp%vconv_eff(1,:) = coretransp_in(1)%VALUES(1)%vtor_transp%vconv_eff(1,:)
114  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%sigma)) &
115  coretransp_out(1)%VALUES(1)%sigma(1) = coretransp_in(1)%VALUES(1)%sigma(1)
116 
117  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%NZ_TRANSP)) THEN
118  DO iimp=1, nimp_tr
119  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%diff_eff)) &
120  coretransp_out(1)%VALUES(1)%NZ_TRANSP(iimp)%diff_eff(1,:) = coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%diff_eff(1,:)
121  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%vconv_eff)) &
122  coretransp_out(1)%VALUES(1)%NZ_TRANSP(iimp)%vconv_eff(1,:) = coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%vconv_eff(1,:)
123  END DO
124  END IF
125 
126  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%TZ_TRANSP)) THEN
127  DO iimp=1, nimp_tr
128  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%TZ_TRANSP(iimp)%diff_eff)) &
129  coretransp_out(1)%VALUES(1)%NZ_TRANSP(iimp)%diff_eff(1,:) = coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%diff_eff(1,:)
130  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%TZ_TRANSP(iimp)%vconv_eff)) &
131  coretransp_out(1)%VALUES(1)%NZ_TRANSP(iimp)%vconv_eff(1,:) = coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%vconv_eff(1,:)
132  END DO
133  END IF
134 
135  END IF
136 
137 
138  IF (flag_bnd(2).EQ.1) THEN
139  iend = 1
140  coretransp_out(1)%VALUES(1)%rho_tor(nrho_tr) = coreprof(1)%rho_tor(nrho_prof)
141  coretransp_out(1)%VALUES(1)%rho_tor_norm(nrho_tr) = coreprof(1)%rho_tor(nrho_prof)/coreprof(1)%rho_tor(nrho_prof)
142  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ni_transp%diff_eff)) &
143  coretransp_out(1)%VALUES(1)%ni_transp%diff_eff(nrho_tr,:,:) = coretransp_in(1)%VALUES(1)%ni_transp%diff_eff(nrho_tr-istart-iend,:,:)
144  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ni_transp%vconv_eff)) &
145  coretransp_out(1)%VALUES(1)%ni_transp%vconv_eff(nrho_tr,:,:) = coretransp_in(1)%VALUES(1)%ni_transp%vconv_eff(nrho_tr-istart-iend,:,:)
146  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ne_transp%diff_eff)) &
147  coretransp_out(1)%VALUES(1)%ne_transp%diff_eff(nrho_tr,:) = coretransp_in(1)%VALUES(1)%ne_transp%diff_eff(nrho_tr-istart-iend,:)
148  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ne_transp%vconv_eff)) &
149  coretransp_out(1)%VALUES(1)%ne_transp%vconv_eff(nrho_tr,:) = coretransp_in(1)%VALUES(1)%ne_transp%vconv_eff(nrho_tr-istart-iend,:)
150  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ti_transp%diff_eff)) &
151  coretransp_out(1)%VALUES(1)%ti_transp%diff_eff(nrho_tr,:) = coretransp_in(1)%VALUES(1)%ti_transp%diff_eff(nrho_tr-istart-iend,:)
152  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ti_transp%vconv_eff)) &
153  coretransp_out(1)%VALUES(1)%ti_transp%vconv_eff(nrho_tr,:) = coretransp_in(1)%VALUES(1)%ti_transp%vconv_eff(nrho_tr-istart-iend,:)
154  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%te_transp%diff_eff)) &
155  coretransp_out(1)%VALUES(1)%te_transp%diff_eff(nrho_tr) = coretransp_in(1)%VALUES(1)%te_transp%diff_eff(nrho_tr-istart-iend)
156  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%te_transp%vconv_eff)) &
157  coretransp_out(1)%VALUES(1)%te_transp%vconv_eff(nrho_tr) = coretransp_in(1)%VALUES(1)%te_transp%vconv_eff(nrho_tr-istart-iend)
158  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%vtor_transp%diff_eff)) &
159  coretransp_out(1)%VALUES(1)%vtor_transp%diff_eff(nrho_tr,:) = coretransp_in(1)%VALUES(1)%vtor_transp%diff_eff(nrho_tr-istart-iend,:)
160  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%vtor_transp%vconv_eff)) &
161  coretransp_out(1)%VALUES(1)%vtor_transp%vconv_eff(nrho_tr,:) = coretransp_in(1)%VALUES(1)%vtor_transp%vconv_eff(nrho_tr-istart-iend,:)
162  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%sigma)) &
163  coretransp_out(1)%VALUES(1)%sigma(nrho_tr) = coretransp_in(1)%VALUES(1)%sigma(nrho_tr-istart-iend)
164 
165  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%NZ_TRANSP)) THEN
166  DO iimp=1, nimp_tr
167  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%diff_eff)) &
168  coretransp_out(1)%VALUES(1)%NZ_TRANSP(iimp)%diff_eff(nrho_tr,:) = coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%diff_eff(nrho_tr-istart-iend,:)
169  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%vconv_eff)) &
170  coretransp_out(1)%VALUES(1)%NZ_TRANSP(iimp)%vconv_eff(nrho_tr,:) = coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%vconv_eff(nrho_tr-istart-iend,:)
171  END DO
172  END IF
173 
174  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%TZ_TRANSP)) THEN
175  DO iimp=1, nimp_tr
176  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%TZ_TRANSP(iimp)%diff_eff)) &
177  coretransp_out(1)%VALUES(1)%TZ_TRANSP(iimp)%diff_eff(nrho_tr,:) = coretransp_in(1)%VALUES(1)%TZ_TRANSP(iimp)%diff_eff(nrho_tr-istart-iend,:)
178  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%TZ_TRANSP(iimp)%vconv_eff)) &
179  coretransp_out(1)%VALUES(1)%TZ_TRANSP(iimp)%vconv_eff(nrho_tr,:) = coretransp_in(1)%VALUES(1)%TZ_TRANSP(iimp)%vconv_eff(nrho_tr-istart-iend,:)
180  END DO
181  END IF
182 
183  END IF
184 
185  DO irho = istart+1, nrho_tr-iend
186  coretransp_out(1)%VALUES(1)%rho_tor(irho) = coretransp_in(1)%VALUES(1)%rho_tor(irho-istart)
187  coretransp_out(1)%VALUES(1)%rho_tor_norm(irho) = coretransp_in(1)%VALUES(1)%rho_tor(irho-istart)/coreprof(1)%rho_tor(nrho_prof)
188  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ni_transp%diff_eff)) &
189  coretransp_out(1)%VALUES(1)%ni_transp%diff_eff(irho,:,:) = coretransp_in(1)%VALUES(1)%ni_transp%diff_eff(irho-istart,:,:)
190  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ni_transp%vconv_eff)) &
191  coretransp_out(1)%VALUES(1)%ni_transp%vconv_eff(irho,:,:) = coretransp_in(1)%VALUES(1)%ni_transp%vconv_eff(irho-istart,:,:)
192  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ne_transp%diff_eff)) &
193  coretransp_out(1)%VALUES(1)%ne_transp%diff_eff(irho,:) = coretransp_in(1)%VALUES(1)%ne_transp%diff_eff(irho-istart,:)
194  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ne_transp%vconv_eff)) &
195  coretransp_out(1)%VALUES(1)%ne_transp%vconv_eff(irho,:) = coretransp_in(1)%VALUES(1)%ne_transp%vconv_eff(irho-istart,:)
196  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ti_transp%diff_eff)) &
197  coretransp_out(1)%VALUES(1)%ti_transp%diff_eff(irho,:) = coretransp_in(1)%VALUES(1)%ti_transp%diff_eff(irho-istart,:)
198  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%ti_transp%vconv_eff)) &
199  coretransp_out(1)%VALUES(1)%ti_transp%vconv_eff(irho,:) = coretransp_in(1)%VALUES(1)%ti_transp%vconv_eff(irho-istart,:)
200  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%te_transp%diff_eff)) &
201  coretransp_out(1)%VALUES(1)%te_transp%diff_eff(irho) = coretransp_in(1)%VALUES(1)%te_transp%diff_eff(irho-istart)
202  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%te_transp%vconv_eff)) &
203  coretransp_out(1)%VALUES(1)%te_transp%vconv_eff(irho) = coretransp_in(1)%VALUES(1)%te_transp%vconv_eff(irho-istart)
204  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%vtor_transp%diff_eff)) &
205  coretransp_out(1)%VALUES(1)%vtor_transp%diff_eff(irho,:) = coretransp_in(1)%VALUES(1)%vtor_transp%diff_eff(irho-istart,:)
206  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%vtor_transp%vconv_eff)) &
207  coretransp_out(1)%VALUES(1)%vtor_transp%vconv_eff(irho,:) = coretransp_in(1)%VALUES(1)%vtor_transp%vconv_eff(irho-istart,:)
208  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%sigma)) &
209  coretransp_out(1)%VALUES(1)%sigma(irho) = coretransp_in(1)%VALUES(1)%sigma(irho-istart)
210 
211  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%NZ_TRANSP)) THEN
212  DO iimp=1, nimp_tr
213  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%diff_eff)) &
214  coretransp_out(1)%VALUES(1)%NZ_TRANSP(iimp)%diff_eff(irho,:) = coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%diff_eff(irho-istart,:)
215  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%vconv_eff)) &
216  coretransp_out(1)%VALUES(1)%NZ_TRANSP(iimp)%vconv_eff(irho,:) = coretransp_in(1)%VALUES(1)%NZ_TRANSP(iimp)%vconv_eff(irho-istart,:)
217  END DO
218  END IF
219 
220  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%TZ_TRANSP)) THEN
221  DO iimp=1, nimp_tr
222  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%TZ_TRANSP(iimp)%diff_eff)) &
223  coretransp_out(1)%VALUES(1)%TZ_TRANSP(iimp)%diff_eff(irho,:) = coretransp_in(1)%VALUES(1)%TZ_TRANSP(iimp)%diff_eff(irho-istart,:)
224  IF(ASSOCIATED(coretransp_in(1)%VALUES(1)%TZ_TRANSP(iimp)%vconv_eff)) &
225  coretransp_out(1)%VALUES(1)%TZ_TRANSP(iimp)%vconv_eff(irho,:) = coretransp_in(1)%VALUES(1)%TZ_TRANSP(iimp)%vconv_eff(irho-istart,:)
226  END DO
227  END IF
228 
229  END DO
230 
231 
232 
233  IF(ALLOCATED (nzimp_tr)) THEN
234  DEALLOCATE (nzimp_tr)
235  END IF
236  IF(ALLOCATED (ncomp_tr)) THEN
237  DEALLOCATE (ncomp_tr)
238  END IF
239  IF(ALLOCATED (ntype_tr)) THEN
240  DEALLOCATE (ntype_tr)
241  END IF
242 
243 
244 
245 
246  100 RETURN
247 
248 
249  END SUBROUTINE check_transport_bound
250 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
251 ! + + + + + + + + + + + + + + + + + + + + + + + + + + + +
252 
253 
subroutine get_comp_dimensions(COMPOSITIONS, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP)
subroutine check_transport_bound(COREPROF, CORETRANSP_IN, CORETRANSP_OUT)
This module contains routines for allocation/deallocation if CPOs used in ETS.
subroutine allocate_coretransp_cpo(NSLICE, NRHO, NNUCL, NION, NIMP, NZIMP, NNEUT, NTYPE, NCOMP, CORETRANSP)
This routine allocates CORETRANSP CPO.