28SUBROUTINE symforce(ars, brs, crs, azs, bzs, czs, bls, cls, rcs, zcs, &
29 ara, bra, cra, aza, bza, cza, bla, cla, rca, zca)
36 REAL(rprec),
DIMENSION(ns*nzeta,ntheta3,0:1),
INTENT(inout) :: &
37 ars, brs, crs, azs, bzs, czs, bls, cls, rcs, zcs
38 REAL(rprec),
DIMENSION(ns*nzeta,ntheta3,0:1),
INTENT(out) :: &
39 ara, bra, cra, aza, bza, cza, bla, cla, rca, zca
41 INTEGER :: mpar, ir, i, jk, jka, j, k
42 REAL(rprec),
DIMENSION(:),
ALLOCATABLE :: ars_0, brs_0, azs_0, &
43 bzs_0, bls_0, rcs_0, zcs_0, crs_0, czs_0, cls_0
45 logical :: dbg_symforce
48 ALLOCATE (ars_0(i), brs_0(i), azs_0(i), bzs_0(i), bls_0(i), &
49 rcs_0(i), zcs_0(i), crs_0(i), czs_0(i), cls_0(i), stat=ir)
52 if (dbg_symforce)
then
54 call add_real_4d(
"ars", ns, 2, nzeta, ntheta3, ars, order=(/ 1, 3, 4, 2 /) )
55 call add_real_4d(
"brs", ns, 2, nzeta, ntheta3, brs, order=(/ 1, 3, 4, 2 /) )
56 call add_real_4d(
"azs", ns, 2, nzeta, ntheta3, azs, order=(/ 1, 3, 4, 2 /) )
57 call add_real_4d(
"bzs", ns, 2, nzeta, ntheta3, bzs, order=(/ 1, 3, 4, 2 /) )
58 call add_real_4d(
"bls", ns, 2, nzeta, ntheta3, bls, order=(/ 1, 3, 4, 2 /) )
59 call add_real_4d(
"rcs", ns, 2, nzeta, ntheta3, rcs, order=(/ 1, 3, 4, 2 /) )
60 call add_real_4d(
"zcs", ns, 2, nzeta, ntheta3, zcs, order=(/ 1, 3, 4, 2 /) )
63 call add_real_4d(
"crs", ns, 2, nzeta, ntheta3, crs, order=(/ 1, 3, 4, 2 /) )
64 call add_real_4d(
"czs", ns, 2, nzeta, ntheta3, czs, order=(/ 1, 3, 4, 2 /) )
65 call add_real_4d(
"cls", ns, 2, nzeta, ntheta3, cls, order=(/ 1, 3, 4, 2 /) )
92 ara(jk,i,mpar) = p5*(ars(jk,i,mpar)-ars(jka,ir,mpar))
93 ars_0(jk) = p5*(ars(jk,i,mpar)+ars(jka,ir,mpar))
94 bra(jk,i,mpar) = p5*(brs(jk,i,mpar)+brs(jka,ir,mpar))
95 brs_0(jk) = p5*(brs(jk,i,mpar)-brs(jka,ir,mpar))
98 aza(jk,i,mpar) = p5*(azs(jk,i,mpar)+azs(jka,ir,mpar))
99 azs_0(jk) = p5*(azs(jk,i,mpar)-azs(jka,ir,mpar))
100 bza(jk,i,mpar) = p5*(bzs(jk,i,mpar)-bzs(jka,ir,mpar))
101 bzs_0(jk) = p5*(bzs(jk,i,mpar)+bzs(jka,ir,mpar))
104 bla(jk,i,mpar) = p5*(bls(jk,i,mpar)-bls(jka,ir,mpar))
105 bls_0(jk) = p5*(bls(jk,i,mpar)+bls(jka,ir,mpar))
108 rca(jk,i,mpar) = p5*(rcs(jk,i,mpar)-rcs(jka,ir,mpar))
109 rcs_0(jk) = p5*(rcs(jk,i,mpar)+rcs(jka,ir,mpar))
110 zca(jk,i,mpar) = p5*(zcs(jk,i,mpar)+zcs(jka,ir,mpar))
111 zcs_0(jk) = p5*(zcs(jk,i,mpar)-zcs(jka,ir,mpar))
116 ars(:,i,mpar) = ars_0(:)
117 brs(:,i,mpar) = brs_0(:)
118 azs(:,i,mpar) = azs_0(:)
119 bzs(:,i,mpar) = bzs_0(:)
120 bls(:,i,mpar) = bls_0(:)
121 rcs(:,i,mpar) = rcs_0(:)
122 zcs(:,i,mpar) = zcs_0(:)
128 cra(jk,i,mpar) = p5*(crs(jk,i,mpar)+crs(jka,ir,mpar))
129 crs_0(jk) = p5*(crs(jk,i,mpar)-crs(jka,ir,mpar))
131 cza(jk,i,mpar) = p5*(czs(jk,i,mpar)-czs(jka,ir,mpar))
132 czs_0(jk) = p5*(czs(jk,i,mpar)+czs(jka,ir,mpar))
134 cla(jk,i,mpar) = p5*(cls(jk,i,mpar)-cls(jka,ir,mpar))
135 cls_0(jk) = p5*(cls(jk,i,mpar)+cls(jka,ir,mpar))
138 crs(:,i,mpar) = crs_0(:)
139 czs(:,i,mpar) = czs_0(:)
140 cls(:,i,mpar) = cls_0(:)
146 DO i = ntheta2+1, ntheta3
147 ara(:,i,mpar) = 0.0_dp
148 bra(:,i,mpar) = 0.0_dp
149 aza(:,i,mpar) = 0.0_dp
150 bza(:,i,mpar) = 0.0_dp
151 bla(:,i,mpar) = 0.0_dp
152 rca(:,i,mpar) = 0.0_dp
153 zca(:,i,mpar) = 0.0_dp
155 cra(:,i,mpar) = 0.0_dp
156 cza(:,i,mpar) = 0.0_dp
157 cla(:,i,mpar) = 0.0_dp
162 DEALLOCATE (ars_0, brs_0, azs_0, bzs_0, bls_0, &
163 rcs_0, zcs_0, crs_0, czs_0, cls_0, stat=ir)
165 if (dbg_symforce)
then
166 call add_real_4d(
"ars_out", ns, 2, nzeta, ntheta3, ars, order=(/ 1, 3, 4, 2 /) )
167 call add_real_4d(
"ara_out", ns, 2, nzeta, ntheta3, ara, order=(/ 1, 3, 4, 2 /) )
168 call add_real_4d(
"brs_out", ns, 2, nzeta, ntheta3, brs, order=(/ 1, 3, 4, 2 /) )
169 call add_real_4d(
"bra_out", ns, 2, nzeta, ntheta3, bra, order=(/ 1, 3, 4, 2 /) )
171 call add_real_4d(
"azs_out", ns, 2, nzeta, ntheta3, azs, order=(/ 1, 3, 4, 2 /) )
172 call add_real_4d(
"aza_out", ns, 2, nzeta, ntheta3, aza, order=(/ 1, 3, 4, 2 /) )
173 call add_real_4d(
"bzs_out", ns, 2, nzeta, ntheta3, bzs, order=(/ 1, 3, 4, 2 /) )
174 call add_real_4d(
"bza_out", ns, 2, nzeta, ntheta3, bza, order=(/ 1, 3, 4, 2 /) )
176 call add_real_4d(
"bls_out", ns, 2, nzeta, ntheta3, bls, order=(/ 1, 3, 4, 2 /) )
177 call add_real_4d(
"bla_out", ns, 2, nzeta, ntheta3, bla, order=(/ 1, 3, 4, 2 /) )
179 call add_real_4d(
"rcs_out", ns, 2, nzeta, ntheta3, rcs, order=(/ 1, 3, 4, 2 /) )
180 call add_real_4d(
"rca_out", ns, 2, nzeta, ntheta3, rca, order=(/ 1, 3, 4, 2 /) )
181 call add_real_4d(
"zcs_out", ns, 2, nzeta, ntheta3, zcs, order=(/ 1, 3, 4, 2 /) )
182 call add_real_4d(
"zca_out", ns, 2, nzeta, ntheta3, zca, order=(/ 1, 3, 4, 2 /) )
185 call add_real_4d(
"crs_out", ns, 2, nzeta, ntheta3, crs, order=(/ 1, 3, 4, 2 /) )
186 call add_real_4d(
"cra_out", ns, 2, nzeta, ntheta3, cra, order=(/ 1, 3, 4, 2 /) )
187 call add_real_4d(
"czs_out", ns, 2, nzeta, ntheta3, czs, order=(/ 1, 3, 4, 2 /) )
188 call add_real_4d(
"cza_out", ns, 2, nzeta, ntheta3, cza, order=(/ 1, 3, 4, 2 /) )
189 call add_real_4d(
"cls_out", ns, 2, nzeta, ntheta3, cls, order=(/ 1, 3, 4, 2 /) )
190 call add_real_4d(
"cla_out", ns, 2, nzeta, ntheta3, cla, order=(/ 1, 3, 4, 2 /) )
192 call add_null(
"crs_out")
193 call add_null(
"cra_out")
194 call add_null(
"czs_out")
195 call add_null(
"cza_out")
196 call add_null(
"cls_out")
197 call add_null(
"cla_out")