modify pendulum example for netcdf output