From 4df3c665b5f1412f6c6dbcc9f036989106949143 Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Tue, 20 Mar 2018 10:15:59 +0100
Subject: [PATCH] Philippe 20/03/2018: IO: IO_GUESS_DIMIDS_NC4: work correctly
 with strings

---
 src/LIB/SURCOUCHE/src/mode_netcdf.f90 | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/LIB/SURCOUCHE/src/mode_netcdf.f90 b/src/LIB/SURCOUCHE/src/mode_netcdf.f90
index f82579274..bee688fff 100644
--- a/src/LIB/SURCOUCHE/src/mode_netcdf.f90
+++ b/src/LIB/SURCOUCHE/src/mode_netcdf.f90
@@ -955,6 +955,9 @@ END SUBROUTINE FILLVDIMS
 
 
 SUBROUTINE IO_GUESS_DIMIDS_NC4(TPFILE, TPFIELD, KLEN, TPDIMS, KRESP)
+!
+USE MODE_FIELD, ONLY: TYPECHAR
+!
 !Used by LFI2CDF
 TYPE(TFILEDATA),                      INTENT(IN)  :: TPFILE
 TYPE(TFIELDDATA),                     INTENT(IN)  :: TPFIELD
@@ -991,7 +994,11 @@ END IF
 IF (IGRID==0) THEN
   SELECT CASE(TPFIELD%NDIMS)
     CASE (0)
-      ILEN = 1
+      IF (TPFIELD%NTYPE == TYPECHAR) THEN
+        ILEN = KLEN
+      ELSE
+        ILEN = 1
+      END IF
     CASE (1)
       PTDIM => GETDIMCDF(TPFILE,KLEN)
       TPDIMS(1) = PTDIM
-- 
GitLab