From 6030903bcf4a122567cbccb77bc9f9f5d9317b84 Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Tue, 11 Feb 2020 10:28:55 +0100
Subject: [PATCH] Philippe 11/02/2020: IO: add 'dims' attribute in
 IO_Write_field_header_split_nc4

---
 src/LIB/SURCOUCHE/src/mode_io_write_nc4.f90 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/LIB/SURCOUCHE/src/mode_io_write_nc4.f90 b/src/LIB/SURCOUCHE/src/mode_io_write_nc4.f90
index 682c41c19..5441ca495 100644
--- a/src/LIB/SURCOUCHE/src/mode_io_write_nc4.f90
+++ b/src/LIB/SURCOUCHE/src/mode_io_write_nc4.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.
@@ -13,6 +13,7 @@
 !  P. Wautelet 01/02/2019: IO_WRITE_COORDVAR_NC4: bug: use of non-associated pointers (PIOCDF%DIM_Nx_y)
 !  P. Wautelet 18/09/2019: correct support of 64bit integers (MNH_INT=8)
 !  P. Wautelet 19/09/2019: temporary workaround for netCDF bug if MNH_INT=8 (if netCDF fortran < 4.4.5)
+!  P. Wautelet 11/02/2020: add 'dims' attribute in IO_Write_field_header_split_nc4
 !-----------------------------------------------------------------
 #if defined(MNH_IOCDF4)
 module mode_io_write_nc4
@@ -132,6 +133,10 @@ if ( istatus /= NF90_NOERR ) then
   if ( istatus /= NF90_NOERR ) call IO_HANDLE_ERR_NC4( istatus, 'IO_Write_field_header_split_nc4', 'NF90_PUT_ATT', &
                                                      'ndims for '//trim( tpfield%cmnhname ) )
 
+  istatus = NF90_PUT_ATT( incid, ivarid,'dims', ishape )
+  if ( istatus /= NF90_NOERR ) call IO_HANDLE_ERR_NC4( istatus, 'IO_Write_field_header_split_nc4', 'NF90_PUT_ATT', &
+                                                     'dims for '//trim( tpfield%cmnhname ) )
+
   if ( tpfield%ltimedep ) then
     istatus = NF90_PUT_ATT( incid, ivarid,'time_dependent', 'yes' )
   else
-- 
GitLab