diff --git a/src/diagnose.F90 b/src/diagnose.F90
index 06b4bbbd2136263645c152b075d758a25d3f17c6..f9b879fdda9e6bfa92845c154fd8a1d6236c380a 100644
--- a/src/diagnose.F90
+++ b/src/diagnose.F90
@@ -114,6 +114,8 @@ SUBROUTINE diagnose(kstep)
       IF (write_gamma) THEN
         CALL creatd(fidres, rank, dims, "/data/var0d/gflux_ri", "Radial gyro ion transport")
         CALL creatd(fidres, rank, dims, "/data/var0d/pflux_ri", "Radial part ion transport")
+      ENDIF
+      IF (write_hf) THEN
         CALL creatd(fidres, rank, dims, "/data/var0d/hflux_x", "Radial part ion heat flux")
       ENDIF
       IF (cstep==0) THEN
@@ -211,13 +213,14 @@ SUBROUTINE diagnose(kstep)
      CALL attach(fidres, TRIM(str),       "Nproc",   num_procs)
      CALL attach(fidres, TRIM(str),       "Np_p" , num_procs_p)
      CALL attach(fidres, TRIM(str),       "Np_kx",num_procs_kx)
-     CALL attach(fidres, TRIM(str), "write_gamma",write_gamma)
-     CALL attach(fidres, TRIM(str),   "write_phi",write_phi)
-     CALL attach(fidres, TRIM(str),  "write_Na00",write_Na00)
-     CALL attach(fidres, TRIM(str),  "write_Napj",write_Napj)
-     CALL attach(fidres, TRIM(str),  "write_Sapj",write_Sapj)
-     CALL attach(fidres, TRIM(str),  "write_dens",write_dens)
-     CALL attach(fidres, TRIM(str),  "write_temp",write_temp)
+     CALL attach(fidres, TRIM(str), "write_gamma", write_gamma)
+     CALL attach(fidres, TRIM(str),    "write_hf",    write_hf)
+     CALL attach(fidres, TRIM(str),   "write_phi",   write_phi)
+     CALL attach(fidres, TRIM(str),  "write_Na00",  write_Na00)
+     CALL attach(fidres, TRIM(str),  "write_Napj",  write_Napj)
+     CALL attach(fidres, TRIM(str),  "write_Sapj",  write_Sapj)
+     CALL attach(fidres, TRIM(str),  "write_dens",  write_dens)
+     CALL attach(fidres, TRIM(str),  "write_temp",  write_temp)
 
      CALL grid_outputinputs(fidres, str)
 
@@ -349,10 +352,11 @@ SUBROUTINE diagnose_0d
     CALL compute_radial_ion_transport
     CALL append(fidres, "/data/var0d/gflux_ri",gflux_ri,ionode=0)
     CALL append(fidres, "/data/var0d/pflux_ri",pflux_ri,ionode=0)
+  ENDIF
+  IF (write_hf) THEN
     CALL compute_radial_heatflux
     CALL append(fidres, "/data/var0d/hflux_x",hflux_x,ionode=0)
   ENDIF
-
 END SUBROUTINE diagnose_0d
 
 
diff --git a/src/diagnostics_par_mod.F90 b/src/diagnostics_par_mod.F90
index 3e48810e8331c9479c932772cf5246b641cdca86..3131f08883512fa70dcf195ee18a95fea4294cc2 100644
--- a/src/diagnostics_par_mod.F90
+++ b/src/diagnostics_par_mod.F90
@@ -6,12 +6,12 @@ MODULE diagnostics_par
   PRIVATE
 
   LOGICAL, PUBLIC, PROTECTED :: write_doubleprecision = .FALSE.
-  LOGICAL, PUBLIC, PROTECTED :: write_gamma
+  LOGICAL, PUBLIC, PROTECTED :: write_gamma, write_hf  ! output particle transport and heat flux
   LOGICAL, PUBLIC, PROTECTED :: write_phi,  write_Na00
   LOGICAL, PUBLIC, PROTECTED :: write_Napj, write_Sapj
   LOGICAL, PUBLIC, PROTECTED :: write_dens, write_temp
 
-  INTEGER, PUBLIC, PROTECTED :: nsave_0d, nsave_1d, nsave_2d, nsave_3d, nsave_5d, nsave_cp
+  INTEGER, PUBLIC, PROTECTED :: nsave_0d, nsave_1d, nsave_2d, nsave_3d, nsave_5d
 
   !  HDF5 file
   CHARACTER(len=256), PUBLIC :: resfile0 = "results"   ! Head of main result file name
@@ -34,8 +34,8 @@ CONTAINS
     USE prec_const
     IMPLICIT NONE
 
-    NAMELIST /OUTPUT_PAR/ nsave_0d, nsave_1d, nsave_2d, nsave_3d, nsave_5d, nsave_cp
-    NAMELIST /OUTPUT_PAR/ write_doubleprecision, write_gamma, write_phi
+    NAMELIST /OUTPUT_PAR/ nsave_0d, nsave_1d, nsave_2d, nsave_3d, nsave_5d
+    NAMELIST /OUTPUT_PAR/ write_doubleprecision, write_gamma, write_hf, write_phi
     NAMELIST /OUTPUT_PAR/ write_Na00, write_Napj, write_Sapj
     NAMELIST /OUTPUT_PAR/ write_dens, write_temp
     NAMELIST /OUTPUT_PAR/ resfile0, rstfile0, job2load