break netcdf into functions