sub_F01_par_load.f90

直接用途

sub_F01_par_load 读取粒子数组 par,文件名由 label、it 和 MPI rank 或格式标签决定。

参数表

参数

方向

shape/范围

含义与局部约定

tag

in

scalar or caller-provided array

I/O 格式选择标签,调度到 dat/bin/h5 等具体读写例程。

label

in

scalar or caller-provided array

文件目录名和文件名前缀;通常是简单名字,不应包含路径分隔符。

it

in

scalar or caller-provided array

时间步或迭代编号,会按固定宽度编码到文件名中。

np

in

scalar or caller-provided array

粒子数;读写例程只处理 par(:,1:np),碰撞/交换例程可能更新它。

par

out

(:,:)

粒子数组;通常 1:3 为位置,4:6 为速度,列或第二维为粒子编号。

局部假设

I/O 例程不改变数据物理含义,只按约定文件名和数组内存顺序读写。raw .bin 文件使用默认 Fortran real 的 stream 数据;读写双方必须使用一致的实数精度、端序和数组 shape。HDF5 入口依赖 USE_HDF5 构建宏和 HDF5 模块。

实现逻辑

调度入口根据 tag 选择具体文件格式例程,不直接改变数组内容。

调用注意

本页只说明该例程本身的调用边界和实现事实;完整接口声明和源码级 API 仍以英文侧的 generated API 为准。

Direct Purpose

sub_F01_par_load dispatch particle loading to a format-specific reader.

Parameter Table

Parameter

Direction

Shape/range

Meaning and local convention

tag

in

scalar or caller-provided array

character(*), format selector string.

label

in

scalar or caller-provided array

character(*), input directory and file name prefix forwarded to the chosen load routine.

it

in

scalar or caller-provided array

integer, time step or iteration index forwarded to the chosen load routine.

np

in

scalar or caller-provided array

integer, number of particles or records to be loaded on this MPI rank.

par

out

(:,:)

real,dimension(:,:), particle phase-space array of the local MPI rank that receives loaded data.

Local Assumptions

I/O routines do not change the physical meaning of data; they only read or write arrays using the naming and memory-order conventions. Raw .bin files store default Fortran real stream data, so readers and writers must agree on real kind, endianness, and array shape. HDF5 entries depend on the USE_HDF5 build macro and HDF5 module.

Implementation Notes

The dispatch entry selects the concrete file-format routine from tag and does not otherwise transform the array content.

Generated API

Dispatch particle loading to a format-specific reader.

This routine selects a low-level particle load subroutine according to the format tag tag.

Supported tags are:

  • dat : ASCII text input

  • bin : raw binary stream input

  • h5 : HDF5 input

  • hdf5 : HDF5 input

If the tag is not recognized, the routine prints an error message and falls back to the ASCII dat reader.

The particle phase-space array par is always filled on the local MPI rank, and the caller is responsible for ensuring that its shape is compatible with the selected file format and the requested np.

Author

Zhe LIU (2025/12/03), Yinjian ZHAO (2026/02/28).

param tag:

[in] character(*), format selector string.

param label:

[in] character(*), input directory and file name prefix forwarded to the chosen load routine.

param it:

[in] integer, time step or iteration index forwarded to the chosen load routine.

param np:

[in] integer, number of particles or records to be loaded on this MPI rank.

param par:

[out] real,dimension(:,:), particle phase-space array of the local MPI rank that receives loaded data.

Functions

subroutine sub_f01_par_load(tag, label, it, np, par)