RFOF - RF Library for Orbit Following Codes
RFOF_resonance_memory Module Reference

Module handling the time memory of the resonance condition along the orbit, which allows time derivatives to be evaluated. More...

+ Collaboration diagram for RFOF_resonance_memory:

List of all members.

Data Types

type  resonance_memory
 Storage structure for for the memory of the resonance function. It has two purposes within RFOF: More...

Public Member Functions

subroutine constructor_rf_resonance_memory (mem, nStoreTimes)
 Constructor for the type resonance_memory. Allocates memory and initialises counters and state variables.
subroutine destructor_rf_resonance_memory (mem)
 Destructor for the type resonance_memory. Deallocates memory.
subroutine reset_rf_resonance_memory (mem)
 Reset the resonance memory.
subroutine reset_rf_resonance_memory_matrix (mem)
 Reset a matrix of resonance memories.
subroutine constructor_rf_resonance_memory_matrix (mem, nWaves1, nWaves2)
 Constructor of a matrix of the type resonance_memory. Allocates memory and initialises counters and state variables.
subroutine destructor_rf_resonance_memory_matrix (mem)
 Destructor for a matrix of the type resonance_memory. Deallocates memory.
subroutine storeNewPointResonanceMemorySort (mem, time_at_resonance, time, nharm, NACC, R, phi, z, omega_res, omega_c, was_stored)
 Stores a new point in the memory. The memory is kept sorted in time, always keeping the latest times first. In case the the new point is earlier in time than all points already in the memory, then the point is not stored and the output was_stored=.FALSE.
subroutine storeNewPointResonanceMemory (mem, time_at_resonance, time, nharm, NACC, R, phi, z, omega_res, omega_c, was_stored)
 Stores a new point in the memory mem. The new point is stored in the first element. All other points are moved one place in the memory list, except the last point which is removed from the list.
subroutine storeNewPointResonanceMemoryLocationJ (mem, j, time, R, phi, z, omega_res, omega_c, nharm, NACC)
 subroutine storeNewPointResonanceMemory
subroutine estimate_resonance_location (mem, time, R, phi, z, omega_res, nharm, NACC, time_previous_step, time_at_resonance, R_at_resonance, phi_at_resonance, z_at_resonance, Dot_omega_res, DotDot_omega_res, MPI_node_Id, errorFlag)
 Estimate the time and position of the nearby wave-particle resonances. Using the time history of the resonance function a quadratic extrapolation of the future position is performed.
subroutine calc_non_accelerated_orbit_time_vec (timeACC, NACC, timeORBIT)
 Estimate the time and position of the nearby wave-particle resonances. Using the time history of the resonance function a quadratic extrapolation of the future position is performed.

Public Attributes

type(resonance_memory),
dimension(:,:), allocatable,
save 
resonanceMemoryAllWaves

Detailed Description

Module handling the time memory of the resonance condition along the orbit, which allows time derivatives to be evaluated.

Author:
T. Johnson
Date:
2010.06.06
Version:
"$Id: RFOF_resonance_memory.F90 188 2011-09-12 11:50:22Z tjohnson $"

Definition at line 10 of file RFOF_resonance_memory.F90.


Member Function/Subroutine Documentation

subroutine RFOF_resonance_memory::constructor_rf_resonance_memory ( type(resonance_memory), intent(inout)  mem,
integer, intent(inout)  nStoreTimes 
)

Constructor for the type resonance_memory. Allocates memory and initialises counters and state variables.

Parameters:
memResonance memory information to be initialised
nStoreTimesNumber of time points to be stored in the resonance memory

Definition at line 58 of file RFOF_resonance_memory.F90.

subroutine RFOF_resonance_memory::destructor_rf_resonance_memory ( type(resonance_memory), intent(inout)  mem)

Destructor for the type resonance_memory. Deallocates memory.

Parameters:
memResonance memory information to be deallocated

Definition at line 89 of file RFOF_resonance_memory.F90.

subroutine RFOF_resonance_memory::reset_rf_resonance_memory ( type(resonance_memory), intent(inout)  mem)

Reset the resonance memory.

Parameters:
memResonance memory to be reset

Definition at line 140 of file RFOF_resonance_memory.F90.

subroutine RFOF_resonance_memory::reset_rf_resonance_memory_matrix ( type(resonance_memory), dimension(:,:), intent(inout), pointer  mem)

Reset a matrix of resonance memories.

Parameters:
memResonance memory matrix to be reset

Definition at line 156 of file RFOF_resonance_memory.F90.

subroutine RFOF_resonance_memory::constructor_rf_resonance_memory_matrix ( type(resonance_memory), dimension(:,:), intent(out), pointer  mem,
integer, intent(in)  nWaves1,
integer, intent(in)  nWaves2 
)

Constructor of a matrix of the type resonance_memory. Allocates memory and initialises counters and state variables.

Parameters:
memResonance memory information to be initialised
nWaves1Size of matrix in first dimension
nWaves2Size of matrix in second dimension

Definition at line 183 of file RFOF_resonance_memory.F90.

subroutine RFOF_resonance_memory::destructor_rf_resonance_memory_matrix ( type(resonance_memory), dimension(:,:), intent(inout), pointer  mem)

Destructor for a matrix of the type resonance_memory. Deallocates memory.

Parameters:
memResonance memory information to be deallocated

Definition at line 220 of file RFOF_resonance_memory.F90.

subroutine RFOF_resonance_memory::storeNewPointResonanceMemorySort ( type(resonance_memory), intent(inout)  mem,
real(8), intent(in)  time_at_resonance,
real(8), intent(in)  time,
integer, intent(in)  nharm,
real(8), intent(in)  NACC,
real(8), intent(in)  R,
real(8), intent(in)  phi,
real(8), intent(in)  z,
real(8), intent(in)  omega_res,
real(8), intent(in)  omega_c,
logical, intent(out)  was_stored 
)

Stores a new point in the memory. The memory is kept sorted in time, always keeping the latest times first. In case the the new point is earlier in time than all points already in the memory, then the point is not stored and the output was_stored=.FALSE.

INPUT

Parameters:
time_at_resonanceEstimated time of the resonance [s]
timePresent time [s]
nharmHarmonic number of the cyclotron resonance
NACCTime-acceleration factor
RMajor radius [m]
phiToroidal angle [rad]
zVertical position [m]
omega_resResonance function
omega_cCyclotron frequency

INPUT & OUTPUT

Parameters:
memResonance memory

OUTPUT

Parameters:
was_storedTRUE if the new point was successfully stored in mem

Definition at line 266 of file RFOF_resonance_memory.F90.

subroutine RFOF_resonance_memory::storeNewPointResonanceMemory ( type(resonance_memory), intent(inout)  mem,
real(8), intent(in)  time_at_resonance,
real(8), intent(in)  time,
integer, intent(in)  nharm,
real(8), intent(in)  NACC,
real(8), intent(in)  R,
real(8), intent(in)  phi,
real(8), intent(in)  z,
real(8), intent(in)  omega_res,
real(8), intent(in)  omega_c,
logical, intent(out)  was_stored 
)

Stores a new point in the memory mem. The new point is stored in the first element. All other points are moved one place in the memory list, except the last point which is removed from the list.

INPUT

Parameters:
time_at_resonanceEstimated time of the resonance [s]
timePresent time [s]
nharmHarmonic number of the cyclotron resonance
NACCTime-acceleration factor
RMajor radius [m]
phiToroidal angle [rad]
zVertical position [m]
omega_resResonance function
omega_cCyclotron frequency

INPUT & OUTPUT

Parameters:
memResonance memory

OUTPUT

Parameters:
was_storedTRUE if the new point was successfully stored in mem

Definition at line 345 of file RFOF_resonance_memory.F90.

subroutine RFOF_resonance_memory::storeNewPointResonanceMemoryLocationJ ( type(resonance_memory), intent(inout)  mem,
integer, intent(in)  j,
real(8), intent(in)  time,
real(8), intent(in)  R,
real(8), intent(in)  phi,
real(8), intent(in)  z,
real(8), intent(in)  omega_res,
real(8), intent(in)  omega_c,
integer, intent(in)  nharm,
real(8), intent(in)  NACC 
)

subroutine storeNewPointResonanceMemory

Store to the resonance memory mem, data for point along the orbit (time, R, phi, z) and the local resonance function omega_res and the harmonic resonance number nharm.

INPUT

Parameters:
jIndex at which the point should be stored in mem
timeTime [s]
nharmHarmonic number of the cyclotron resonance
NACCTime-acceleration factor
RMajor radius [m]
phiToroidal angle [rad]
zVertical position [m]
omega_resResonance function
omega_cCyclotron frequency

INPUT & OUTPUT

Parameters:
memResonance memory

Definition at line 414 of file RFOF_resonance_memory.F90.

subroutine RFOF_resonance_memory::estimate_resonance_location ( type(resonance_memory), intent(in)  mem,
real(8), intent(in)  time,
real(8), intent(in)  R,
real(8), intent(in)  phi,
real(8), intent(in)  z,
real(8), intent(in)  omega_res,
integer, intent(in)  nharm,
real(8), intent(in)  NACC,
real(8), intent(in)  time_previous_step,
real(8), intent(out)  time_at_resonance,
real(8), intent(out)  R_at_resonance,
real(8), intent(out)  phi_at_resonance,
real(8), intent(out)  z_at_resonance,
real(8), intent(out)  Dot_omega_res,
real(8), intent(out)  DotDot_omega_res,
integer, intent(in)  MPI_node_Id,
integer, intent(out)  errorFlag 
)

Estimate the time and position of the nearby wave-particle resonances. Using the time history of the resonance function a quadratic extrapolation of the future position is performed.

INPUT

Parameters:
memResonance memory
timeTime [s]
time_previous_stepTime of previous step; i.e. resonance before this time should be ignored [s]
RMajor radius [m]
phiToroidal angle [rad]
zVertical position [m]
omega_resResonance function
nharmHarmonic number of the cyclotron resonance
NACCTime-acceleration factor

OUTPUT

Parameters:
time_at_resonanceEstimated time at the resonance [s]
R_at_resonanceEstimated major radius at the resonance [s]
phi_at_resonanceEstimated toroidal angle at the resonance [s]
z_at_resonanceEstimated vertical position at the resonance [s]
Dot_omega_resEstimated time derivative of resonance function at the resonance [s]
DotDot_omega_resEstimated second time derivative of resonance function at the resonance [s]
MPI_node_IdNumber to identify the MPI node
errorFlagError flag in case the resonance position was not found

Definition at line 479 of file RFOF_resonance_memory.F90.

References polycoef_3points(), and wrap_save2file_resonace_predictions().

+ Here is the call graph for this function:

subroutine RFOF_resonance_memory::calc_non_accelerated_orbit_time_vec ( real(8), dimension(:), intent(in)  timeACC,
real(8), dimension(:), intent(in)  NACC,
real(8), dimension(:), intent(inout)  timeORBIT 
)

Estimate the time and position of the nearby wave-particle resonances. Using the time history of the resonance function a quadratic extrapolation of the future position is performed.

Input

Parameters:
timeACCAccelerated time; differentials of this time is enhanced by a factor NACC
NACCTime accelration factor

Output

Parameters:
timeORBITTime as experiencd by a real orbit as it moves in the devise

Definition at line 685 of file RFOF_resonance_memory.F90.


Member Data Documentation

type(resonance_memory), dimension(:,:), allocatable, save RFOF_resonance_memory::resonanceMemoryAllWaves

Definition at line 44 of file RFOF_resonance_memory.F90.


The documentation for this module was generated from the following file: