producer refactoring and netcdf revamping to avoid race condition.

Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>