From 8be472217f67053b9620578f2802303dca74a0be Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Thu, 11 Apr 2024 15:06:11 +0200
Subject: [PATCH] Philippe 11/04/2024: Fill_tfieldmetadata: populate ndimlist
 if CDIR=XY for 4D fields (4th dimension set to NMNHDIM_NOTLISTED)

---
 src/LIB/SURCOUCHE/src/modd_field.f90 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/LIB/SURCOUCHE/src/modd_field.f90 b/src/LIB/SURCOUCHE/src/modd_field.f90
index aabe37203..7f44477b9 100644
--- a/src/LIB/SURCOUCHE/src/modd_field.f90
+++ b/src/LIB/SURCOUCHE/src/modd_field.f90
@@ -425,6 +425,9 @@ type(tfieldmetadata) function Fill_tfieldmetadata( cmnhname, cstdname, clongname
           tpfield%ndimlist(1:2) = NMNHDIM_ARAKAWA(tpfield%ngrid,1:2)
         else if ( tpfield%ndims == 3 .and. tpfield%ngrid /= NGRIDUNKNOWN ) then
           tpfield%ndimlist(1:3) = NMNHDIM_ARAKAWA(tpfield%ngrid,1:3)
+        else if ( tpfield%ndims == 4 .and. tpfield%ngrid /= NGRIDUNKNOWN ) then
+          tpfield%ndimlist(1:3) = NMNHDIM_ARAKAWA(tpfield%ngrid,1:3)
+          tpfield%ndimlist(4) = NMNHDIM_NOTLISTED
         else
           call Print_msg( NVERB_DEBUG, 'GEN', 'Fill_tfielddata', 'ndimlist not filled for variable ' // Trim( ymnhname ) )
         end if
-- 
GitLab