I’ve successfully created an empty NetcdfFile but I’m having some
difficulty writing data to the file. Just for a bit of context, I’m
trying to write data from a list of particles – each of which has an id,
lat, lon and concentration – to the nc file one timestep at a time.

In other words, I have a loop where a new list of particles is generated
each cycle. After they are generated, they need to be written to the nc
file as a “new” timestep.

Basically, I’d like to have a method that accepts the list of particles
(which contain lat, lon, conc) and a time and simply write a new time
record with all of the particles in the list. Is that possible??

I’m completely lost as to how I can do this efficiently. All of the
examples I can find show writing all of the variables for all times at
once – which doesn’t help (too much data to hold in memory until the end).