From 729c4fc0ef73b6a87b0f10ece5859251f78c87d0 Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Thu, 4 Mar 2021 12:03:55 +0100
Subject: [PATCH] Philippe 04/03/2021: budgets: reduce checks in comparison of
 ndimlists to prevent false error detections (if series)

---
 src/MNH/write_diachro.f90 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/MNH/write_diachro.f90 b/src/MNH/write_diachro.f90
index 3bc4f38ca..8236c6c76 100644
--- a/src/MNH/write_diachro.f90
+++ b/src/MNH/write_diachro.f90
@@ -766,8 +766,10 @@ end do
 do jp = 2, Size( tpfields )
   do ji = 1, NMNHMAXDIMS
     if ( tpfields(jp)%ndimlist(ji) /= tpfields(1)%ndimlist(ji) ) then
+      !For SERIES: it is possible to have NMNHDIM_NI and NMNHDIM_NI_U in the different tpfields
       !For SERIES: it is possible to have NMNHDIM_SERIES_LEVEL and NMNHDIM_SERIES_LEVEL_W in the different tpfields
-      if ( tpfields(jp)%ndimlist(ji) /= NMNHDIM_SERIES_LEVEL .and. tpfields(jp)%ndimlist(ji) /= NMNHDIM_SERIES_LEVEL_W ) then
+      if ( tpfields(jp)%ndimlist(ji) /= NMNHDIM_NI           .and. tpfields(jp)%ndimlist(ji) /= NMNHDIM_NI_U .and.     &
+           tpfields(jp)%ndimlist(ji) /= NMNHDIM_SERIES_LEVEL .and. tpfields(jp)%ndimlist(ji) /= NMNHDIM_SERIES_LEVEL_W ) then
         call Print_msg( NVERB_ERROR, 'IO', 'Write_diachro_nc4', &
                         'some dimensions are not the same for all tpfields entries for variable '//trim(tpfields(jp)%cmnhname) )
       end if
-- 
GitLab