dump_netcdf
Write the atomic positions (coordinates) and (optionally) velocities to a user-specified NetCDF trajectory file based on the AMBER 1.0 conventions.
Syntax
This keyword has the following format:
dump_netcdf <grouping_method> <group_id> <interval> <has_velocity> <filename> [{optional_args}]
The grouping_method parameter selects one of the grouping methods defined by
group:I:number_of_grouping_methods in the simulation model file.
Grouping methods are numbered from 0. When grouping_method is non-negative,
group_id selects a group label within that grouping method, and only the atoms
belonging to that group are written. Both values must identify an existing, non-empty
group. When grouping_method is negative, group_id is ignored and all atoms
in the system are written. These selection rules are the same as for
dump_xyz.
The interval parameter is the output interval (number of steps) of the atom positions. has_velocity can be 1 or 0, which means the velocities will or will not be included in the output. filename is the relative or absolute path of the output file.
The optional arguments (optional_args) provide additional functionality.
Currently, the following optional arguments are accepted:
precisionIf
valueissingle, the output data are 32-bit floating point numbers.If
valueisdouble, the output data are 64-bit floating point numbers.
The default value is
single.compression none|deflatenonewrites an uncompressed NetCDF file in the 64-bit-offset (CDF-2) format and is the default. Here, 64-bit offset refers to the file layout, not the precision of the coordinates and velocities; these data use 32-bit floating point numbers when the defaultprecision singleis used.deflatewrites a NetCDF4/HDF5 file using lossless compression and requires NetCDF-C built with NetCDF4/HDF5 and zlib support.levelmust be an integer from 0 to 9. Level 0 applies no compression. For large, frequently written trajectories, usenonefor maximum write speed,deflate 1for a practical balance, ordeflate 9when minimizing file size is more important than write speed.
Requirements and specifications
This keyword requires an external package to operate. Instructions for how to set up the NetCDF package can be found here.
The
singleoption is good for saving space and is the default.NetCDF output files can be read for example by VMD or OVITO for visualization.
The NetCDF files also contain atom types, cell lengths, and angles, which can be used in visualization and analysis software.
The atomic positions are always included in the output. For periodic MD, the wrapped positions are written.
AMBER NetCDF represents a periodic cell using lengths and angles in a standard orientation. If the GPUMD cell has a different orientation, the output positions and velocities are rigidly transformed with the cell so that periodic geometry is preserved.
Examples
Single precision without velocities
To dump the whole-system positions every 1000 steps using the default single precision and no compression, one can add:
dump_netcdf -1 0 1000 0 movie.nc
before the run command.
Double precision with velocities
To dump the whole-system positions and velocities every 1000 steps with 64-bit floating point values, one can add:
dump_netcdf -1 0 1000 1 movie.nc precision double
before the run command.
Group output with compression
To dump group 0 from grouping method 1 with lossless deflate compression, one can add:
dump_netcdf 1 0 15 1 group.nc compression deflate 1
before the run command.
Caveats
Length is in units of Ångström and velocity is in units of Ångström/picosecond.
This keyword is not propagating. That means, its effect will not be passed from one run to the next.
An existing output file is overwritten the first time its name is used in a GPUMD execution.
Repeating the keyword with the same filename in later runs of the same GPUMD execution appends to that file. A different filename creates a separate trajectory file.
Group, precision, velocity, and compression settings cannot change while appending to the same file.
The new syntax is not compatible with the former
dump_netcdf <interval> <has_velocity>syntax.