Skip to content

adam_prism_fnl_coil_object ​

ADAM, PRISM coil source definition, FNL backend.

Source: src/app/prism/fnl/adam_prism_fnl_coil_object.F90

Dependencies

Contents ​

Derived Types ​

prism_fnl_coil_object ​

Components

NameTypeAttributesDescription
A_gpureal(kind=R8P)pointerCurrent amplitude (A)
f_gpureal(kind=R8P)pointerCurrent frequency, if AC (Hz)
phase_gpureal(kind=R8P)pointerCurrent initial phase, if AC
J_vec_gpureal(kind=R8P)pointerMatrice contenente versori corrente spire (se assente = 0)
support_gpuinteger(kind=I4P)pointerCells (b,i,j,k) with J_vec /= 0, interior first, (4,n).
plasma_j_gpureal(kind=R8P)pointerPlasma current on the support, (3,n,slot).
support_numberinteger(kind=I4P)Number of support cells.
support_interiorinteger(kind=I4P)Number of interior support cells (the first ones).
support_hostinteger(kind=I4P)allocatableHost copy of the device support (to detect a change).
plasma_j_activelogicalSlot holds a plasma current.

Type-Bound Procedures

NameAttributesDescription
copy_cpu_gpupass(self)Copy data from CPU to GPU.
copy_gpu_cpupass(self)Copy data from GPU to CPU.
destroypass(self)Free device data owned by this object.
initializepass(self)Initialize class from global singletons.
capture_plasma_devpass(self)Keep the plasma current of the coil support.
detect_plasma_devpass(self)Plasma on the interior coil support.
restore_plasma_devpass(self)Write the kept plasma current back (inside the coil stamp).
free_supportpass(self)Free the device support and its plasma slots.
push_supportpass(self)Push the support of the host J_vec and its committed slot.

Subroutines ​

destroy ​

Free device data owned by the coil FNL object.

fortran
subroutine destroy(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_coil_object)inoutCoils.

Call graph

copy_cpu_gpu ​

Copy data from CPU to GPU.

fortran
subroutine copy_cpu_gpu(self, coil, grid, blocks_number, buf6D, db6, hb6, verbose)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_coil_object)inoutThe field.
coilclass(prism_coil_object)inCoils on host.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
blocks_numberinteger(kind=I4P)inNumber of blocks in use.
buf6Dreal(kind=R8P)inoutoptionalBuffer (host memory, device shape), rank 6D.
db6integer(kind=I4P)inoptionalDevice data bounds, rank 6.
hb6integer(kind=I4P)inoptionalHost data bounds, rank 6.
verboselogicalinoptionalFlag to activate verbose mode.

Call graph

copy_gpu_cpu ​

Copy data from GPU to CPU.

fortran
subroutine copy_gpu_cpu(self, coil, grid, buf6D, db6, hb6, verbose)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_coil_object)inoutThe field.
coilclass(prism_coil_object)inoutCoils on host.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
buf6Dreal(kind=R8P)inoutoptionalBuffer (host memory, device shape), rank 6D.
db6integer(kind=I4P)inoptionalDevice data bounds, rank 6.
hb6integer(kind=I4P)inoptionalHost data bounds, rank 6.
verboselogicalinoptionalFlag to activate verbose mode.

Call graph

initialize ​

Initialize class from program-scope field (adam_field_global) and grid (adam_grid_global) singletons. Requires mpih_fnl (adam_fnl_mpih_global), field and grid singletons to be ready.

fortran
subroutine initialize(self, coil, field, grid, buf6D, db6, hb6)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_coil_object)inoutCoils.
coilclass(prism_coil_object)intargetCoils on host.
fieldtype(field_object)inField (sibling realm component, threaded in).
gridtype(grid_object)inGrid (sibling realm component, threaded in).
buf6Dreal(kind=R8P)inoutoptionalBuffer (host memory, device shape), rank 6D.
db6integer(kind=I4P)inoptionalDevice data bounds, rank 6.
hb6integer(kind=I4P)inoptionalHost data bounds, rank 6.

Call graph

detect_plasma_dev ​

Device twin of prism_coil_object%detect_plasma: plasma current (and charge) on the interior support cells right after a PIC deposit into q_gpu. Local to this rank.

fortran
subroutine detect_plasma_dev(self, ngc, q_gpu, var_jx, var_jy, var_jz, check_current, check_charge, overlap_current, overlap_charge)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_coil_object)inCoils, device data.
ngcinteger(kind=I4P)inNumber of ghost cells.
q_gpureal(kind=R8P)inDeposited field (device).
var_jxinteger(kind=I4P)inIndex of Jx.
var_jyinteger(kind=I4P)inIndex of Jy.
var_jzinteger(kind=I4P)inIndex of Jz.
check_currentlogicalinThe J rows hold a fresh deposit.
check_chargelogicalinThe charge row holds a fresh deposit.
overlap_currentlogicaloutPlasma current on the support.
overlap_chargelogicaloutPlasma charge on the support.

Call graph

capture_plasma_dev ​

Device twin of prism_coil_object%capture_plasma: keep the J rows of the support cells (interior and ghost, the ghosts refreshed by the caller) in slot, or empty the slot (no plasma current on the support: the stamp is unchanged).

fortran
subroutine capture_plasma_dev(self, ngc, q_gpu, slot, var_jx, var_jy, var_jz, active)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_coil_object)inoutCoils, device data.
ngcinteger(kind=I4P)inNumber of ghost cells.
q_gpureal(kind=R8P)inDeposited field (device).
slotinteger(kind=I4P)inCOIL_SLOT_COMMITTED or COIL_SLOT_STAGE.
var_jxinteger(kind=I4P)inIndex of Jx.
var_jyinteger(kind=I4P)inIndex of Jy.
var_jzinteger(kind=I4P)inIndex of Jz.
activelogicalinPlasma current on the support (of some rank).

Call graph

restore_plasma_dev ​

Device twin of prism_coil_object%restore_plasma: inside the coil stamp, after the support was cleared, write back the plasma current kept in slot (nothing when the slot is empty); the coil current is then added on top.

fortran
subroutine restore_plasma_dev(self, ngc, q_gpu, slot, var_jx, var_jy, var_jz)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_coil_object)inCoils, device data.
ngcinteger(kind=I4P)inNumber of ghost cells.
q_gpureal(kind=R8P)inoutField (device).
slotinteger(kind=I4P)inCOIL_SLOT_COMMITTED or COIL_SLOT_STAGE.
var_jxinteger(kind=I4P)inIndex of Jx.
var_jyinteger(kind=I4P)inIndex of Jy.
var_jzinteger(kind=I4P)inIndex of Jz.

Call graph

free_support ​

Free the device support and its plasma slots.

fortran
subroutine free_support(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_coil_object)inoutCoils, device data.

Call graph

push_support ​

Push the support of the host J_vec (the list prism_coil_object%support_cells builds, in the host order). An unchanged support keeps the device slots (a re-push of the same J_vec); a changed one (AMR) starts with empty slots, filled again by the next deposit. The committed slot of the host is uploaded when it was kept on this same support (the t0 deposit, registered on the host by compute_coils_current_time_zero): the caller then invalidates the host support, so a later push cannot upload it again.

fortran
subroutine push_support(self, coil, blocks_number)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_coil_object)inoutCoils, device data.
coilclass(prism_coil_object)inCoils on host.
blocks_numberinteger(kind=I4P)inNumber of blocks in use.

Call graph