diff --git a/src/LIB/SURCOUCHE/src/fmwrit_ll.f90 b/src/LIB/SURCOUCHE/src/fmwrit_ll.f90
index cdabeba4f4c634bc508d4391dba3af42c9fcfc25..0eb1a0ed6458327089d241ef547dfbb96353b920 100644
--- a/src/LIB/SURCOUCHE/src/fmwrit_ll.f90
+++ b/src/LIB/SURCOUCHE/src/fmwrit_ll.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1994-2019 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1994-2020 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -812,6 +812,11 @@ CONTAINS
              RETURN
           END IF
           !
+          ! Write the variable attributes in the non-split file
+          !
+          if ( tpfile%nmaster_rank==isp .and. gnc4 ) &
+            call IO_Write_field_header_split_nc4( tpfile, tpfield, size( pfield, 3 ) )
+          !
           !JUAN BG Z SLICE
           !
           !
@@ -832,11 +837,6 @@ CONTAINS
          CALL SECOND_MNH2(T1)
          TIMEZ%T_WRIT3D_SEND=TIMEZ%T_WRIT3D_SEND + T1 - T0
          !
-         ! Write the variable attributes in the non-split file
-         !
-         if ( tpfile%nmaster_rank==isp .and. gnc4 ) &
-           call IO_Write_field_header_split_nc4( tpfile, tpfield, size( pfield, 3 ) )
-         !
          ! write the data
          !
          ALLOCATE(ZSLICE_ll(0,0)) ! to avoid bug on test of size
@@ -932,11 +932,6 @@ CONTAINS
                 END IF
              END DO
              !
-             ! Write the variable attributes in the non-split file
-             !
-             if ( tpfile%nmaster_rank==isp .and. gnc4 ) &
-               call IO_Write_field_header_split_nc4( tpfile, tpfield, size( pfield, 3 ) )
-             !
              ! write the data
              !
              DO JKK=JK,JK_MAX