diff --git a/doc/src/dump_netcdf.rst b/doc/src/dump_netcdf.rst index 9fac10dc99..c14ec02871 100644 --- a/doc/src/dump_netcdf.rst +++ b/doc/src/dump_netcdf.rst @@ -73,6 +73,9 @@ NETCDF package. They are only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. +The *netcdf* and *netcdf/mpiio* dump styles currently cannot dump +string properties or properties from variables. + ---------- Related commands diff --git a/src/NETCDF/dump_netcdf.cpp b/src/NETCDF/dump_netcdf.cpp index 28d9e35387..83e7d29f5f 100644 --- a/src/NETCDF/dump_netcdf.cpp +++ b/src/NETCDF/dump_netcdf.cpp @@ -147,6 +147,9 @@ DumpNetCDF::DumpNetCDF(LAMMPS *lmp, int narg, char **arg) : mangled = mangled.substr(0,found); ndims = THIS_IS_A_FIX; } + } else if (utils::strmatch(mangled, "^v_")) { + idim = 0; + ndims = THIS_IS_A_VARIABLE; } // find mangled name @@ -257,6 +260,8 @@ void DumpNetCDF::openfile() perat[i].dims = fix[j]->size_peratom_cols; if (perat[i].dims > DUMP_NC_MAX_DIMS) error->all(FLERR,"perat[i].dims > DUMP_NC_MAX_DIMS"); + } else if (perat[i].dims == THIS_IS_A_VARIABLE) { + error->all(FLERR,"Dump netcdf currently does not support dumping variables"); } } @@ -401,6 +406,8 @@ void DumpNetCDF::openfile() xtype = NC_INT; } else if (vtype[perat[i].field[0]] == Dump::BIGINT) { xtype = NC_INT64; + } else if (vtype[perat[i].field[0]] == Dump::STRING) { + error->all(FLERR,"Dump netcdf currently does not support dumping string properties"); } else { if (double_precision) xtype = NC_DOUBLE;