   int cache_nelems = nelems;
   double cache_preemption = 0.9;
   file::NC_Error_Handle err_out;
-  int ncid_out, dim_t_x_y_id[3], tvar_id, etvar_id;
+  int ncid_out, dim_t_x_y_id[3], tvar_id, etvar_w_id, etdim_w_id;
   err_out = nc_create(argv[2], NC_NETCDF4|NC_CLOBBER, &ncid_out);
   err_out = nc_put_att_text(ncid_out, NC_GLOBAL, "inputfile",
                             input.size(), input.data());
   err_out = file::define_limtime_xy(ncid_out, dim_t_x_y_id, p.maxout+1,
                                     &tvar_id, g2d);
   err_out = file::define_limited_time(ncid_out, "etime", num_etime,
-                                      &dim_et_id, &etvar_id);
+                                      &etdim_w_id, &etvar_w_id);
   int k = 0;
   for (unsigned i = 0; i < num_species; i++)
-  { err_in = nc_inq_varid(ncid_in, species_name[i].data(), &species_rgyro_id[i]);;
+  { err_in = nc_inq_varid(ncid_in, species_name[i].data(), &species_rgyro_id[i]);
     err_out = nc_def_var(ncid_out, species_name[i].data(), NC_DOUBLE, 3, dim_t_x_y_id, &species_wphys_id[i]);
     err_out = nc_def_var_deflate(ncid_out, species_wphys_id[i], shuffle_flag, compress_flag, compress_level);
     err_out = nc_set_var_chunk_cache(ncid_out, species_wphys_id[i], cache_size, cache_nelems, cache_preemption);

  reader.parse(input, js, false);
  const imp::Parameters p(js);
  p.display(std::cout);
  //.nc parameter: etime not found in .json file
  int dim_et_id;
  size_t num_etime;
  err_in = nc_inq_dimid(ncid_in, "energy_time", &dim_et_id);
  err_in = nc_inq_dimlen(ncid_in, dim_et_id, &num_etime);
  ////////compose data////////
  const size_t num_species = 3, num_fields = 2;
  const size_t num_spatial = 14;

      { gamma_s.alpha() = -0.5*p.tau[j]*p.mu[j];
        invert_invgamma(gamma_s, gamma_n, ntilde[j]);
        dg::blas1::axpby(p.a[j]*p.mu[j], ntilde[j], 0., chi);
        dg::blas1::plus( chi, p.a[j]*p.mu[j]);
        dg::blas1::pointwiseDot(chi, binv, chi);
        dg::blas1::pointwiseDot(chi, binv, chi);
        pol.set_chi(chi);
