Holds current state and handles its I/O via netcdf
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | tstep |
Current time-step of state |
|||
| real(kind=GP), | public | :: | tau |
Current time of state |
|||
| integer, | protected | :: | isnaps | = | 0 |
Current snapshot number |
|
| integer, | protected | :: | np_max |
Maximum number of points per plane, across all planes and stag/cano |
|||
| real(kind=GP), | public, | allocatable, dimension(:), target | :: | dens |
Density |
||
| real(kind=GP), | public, | allocatable, dimension(:) | :: | parmom |
Parallel momentum |
||
| real(kind=GP), | public, | allocatable, dimension(:) | :: | upar |
Parallel ion velocity Derived field: upar = parmom / dens (on staggered mesh) |
||
| real(kind=GP), | public, | allocatable, dimension(:) | :: | pion |
Ion pressure |
||
| real(kind=GP), | public, | allocatable, dimension(:) | :: | tion |
Ion temperature Derived field: tion = pion / dens |
Writes state to netcdf file
If filename is not present, it increases isnaps by one and writes to snaps_<isnaps>.nc
If filename is present, it writes to filename, without increasing isnaps.
This is useful for writing e.g. error states
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communication handler |
||
| character(len=*), | intent(in), | optional | :: | dirname |
Directory, where snapshots files will be written |
|
| character(len=*), | intent(in), | optional | :: | filename |
Filename, where state is written. The filename excludes the directory name, i.e. the final path is dirname/filename |
Reads state from netcdf file
If filename is not present, it reads last from snaps_<isnaps>.nc with last available isnaps
and sets isnaps to this value
If filename is present it reads from this file and sets isnaps to 0
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communication handler |
||
| character(len=*), | intent(in), | optional | :: | dirname |
Directory, where snapshots files will be read |
|
| character(len=*), | intent(in), | optional | :: | filename |
Filename, where state is read. The filename excludes the directory name, i.e. the final path is dirname/filename |
Allocates memory for state fields
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communication handler |
Updates derived fields upar = parmom /dens_(stag) tion = pion / dens_(cano)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communication handler |