15 USE vmec_input,
Only: raxis_cc, raxis_cs, zaxis_cc, zaxis_cs
33 REAL (rprec),
DIMENSION(:),
POINTER :: xc => null()
36 REAL (rprec),
DIMENSION(:),
POINTER :: raxis_cc => null()
38 REAL (rprec),
DIMENSION(:),
POINTER :: raxis_cs => null()
40 REAL (rprec),
DIMENSION(:),
POINTER :: zaxis_cc => null()
42 REAL (rprec),
DIMENSION(:),
POINTER :: zaxis_cs => null()
46 REAL (rprec) :: vvc_smaleli
48 REAL (rprec) :: vvc_kappa_p
70 REAL (rprec) :: start_time
104 TYPE (vmec_context_class),
POINTER :: this
107 IF (
ASSOCIATED(this%xc))
THEN
112 IF (
ASSOCIATED(this%raxis_cc))
THEN
113 DEALLOCATE(this%raxis_cc)
114 this%raxis_cc => null()
117 IF (
ASSOCIATED(this%raxis_cs))
THEN
118 DEALLOCATE(this%raxis_cs)
119 this%raxis_cs => null()
122 IF (
ASSOCIATED(this%zaxis_cc))
THEN
123 DEALLOCATE(this%zaxis_cc)
124 this%zaxis_cc => null()
127 IF (
ASSOCIATED(this%zaxis_cs))
THEN
128 DEALLOCATE(this%zaxis_cs)
129 this%zaxis_cs => null()
152 TYPE (vmec_context_class),
INTENT(in) :: this
155 REAL (rprec) :: start_time
160 CALL assert_eq(
SIZE(this%xc),
SIZE(xc),
"xc size change. " //
161 &
"Cannot set context.")
164 raxis_cc = this%raxis_cc
165 raxis_cs = this%raxis_cs
166 zaxis_cc = this%zaxis_cc
167 zaxis_cs = this%zaxis_cs
169 vvc_smaleli = this%vvc_smaleli
170 vvc_kappa_p = this%vvc_kappa_p
192 TYPE (vmec_context_class),
INTENT(inout) :: this
195 REAL (rprec) :: start_time
200 IF(
SIZE(this%xc) .ne.
SIZE(xc))
THEN
202 ALLOCATE(this%xc(
SIZE(xc)))
206 this%raxis_cc = raxis_cc
207 this%raxis_cs = raxis_cs
208 this%zaxis_cc = zaxis_cc
209 this%zaxis_cs = zaxis_cs
211 this%vvc_smaleli = vvc_smaleli
212 this%vvc_kappa_p = vvc_kappa_p
238 TYPE (vmec_context_class),
INTENT(inout) :: this
239 INTEGER,
INTENT(in) :: recon_comm
248 CALL mpi_comm_rank(recon_comm, mpi_rank, error)
252 CALL mpi_bcast(temp_size, 1, mpi_integer, 0, recon_comm, error)
254 IF (mpi_rank .gt. 0)
THEN
256 &
'Cannot sync xc arrays. Arrays changed size.')
258 CALL mpi_bcast(xc, temp_size, mpi_real8, 0, recon_comm, error)
260 CALL mpi_bcast(raxis_cc,
SIZE(raxis_cc), mpi_real8, 0, recon_comm,
262 CALL mpi_bcast(raxis_cs,
SIZE(raxis_cs), mpi_real8, 0, recon_comm,
264 CALL mpi_bcast(zaxis_cc,
SIZE(zaxis_cc), mpi_real8, 0, recon_comm,
266 CALL mpi_bcast(zaxis_cs,
SIZE(zaxis_cs), mpi_real8, 0, recon_comm,
269 CALL mpi_bcast(vvc_smaleli, 1, mpi_real8, 0, recon_comm, error)
270 CALL mpi_bcast(vvc_kappa_p, 1, mpi_real8, 0, recon_comm, error)
292 TYPE (vmec_context_class),
INTENT(inout) :: this
293 INTEGER,
INTENT(in) :: index
294 INTEGER,
INTENT(in) :: recon_comm
303 CALL mpi_comm_rank(recon_comm, mpi_rank, error)
307 IF (mpi_rank .eq. index)
THEN
308 CALL mpi_ssend(temp_size, 1, mpi_integer, 0, mpi_rank,
311 CALL mpi_ssend(xc, temp_size, mpi_real8, 0, mpi_rank,
314 CALL mpi_ssend(raxis_cc,
SIZE(raxis_cc), mpi_real8, 0,
315 & mpi_rank, recon_comm, error)
316 CALL mpi_ssend(raxis_cs,
SIZE(raxis_cs), mpi_real8, 0,
317 & mpi_rank, recon_comm, error)
318 CALL mpi_ssend(zaxis_cc,
SIZE(zaxis_cc), mpi_real8, 0,
319 & mpi_rank, recon_comm, error)
320 CALL mpi_ssend(zaxis_cs,
SIZE(zaxis_cs), mpi_real8, 0,
321 & mpi_rank, recon_comm, error)
323 CALL mpi_ssend(vvc_smaleli, 1, mpi_real8, 0, mpi_rank,
325 CALL mpi_ssend(vvc_kappa_p, 1, mpi_real8, 0, mpi_rank,
328 ELSE IF (mpi_rank .eq. 0)
THEN
329 CALL mpi_recv(temp_size, 1, mpi_integer, index, index,
330 & recon_comm, mpi_status_ignore, error)
332 &
'Cannot sync xc arrays. Arrays changed size.')
334 CALL mpi_recv(xc, temp_size, mpi_real8, index, index,
335 & recon_comm, mpi_status_ignore, error)
337 CALL mpi_recv(raxis_cc,
SIZE(raxis_cc), mpi_real8, index,
338 & index, recon_comm, mpi_status_ignore, error)
339 CALL mpi_recv(raxis_cs,
SIZE(raxis_cs), mpi_real8, index,
340 & index, recon_comm, mpi_status_ignore, error)
341 CALL mpi_recv(zaxis_cc,
SIZE(zaxis_cc), mpi_real8, index,
342 & index, recon_comm, mpi_status_ignore, error)
343 CALL mpi_recv(zaxis_cs,
SIZE(zaxis_cs), mpi_real8, index,
344 & index, recon_comm, mpi_status_ignore, error)
346 CALL mpi_recv(vvc_smaleli, 1, mpi_real8, index, index,
347 & recon_comm, mpi_status_ignore, error)
348 CALL mpi_recv(vvc_kappa_p, 1, mpi_real8, index, index,
349 & recon_comm, mpi_status_ignore, error)