From c6b539c4dc78c37f433c3eff809a8843de14acb1 Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@cnrs.fr>
Date: Wed, 23 Oct 2024 11:22:55 +0200
Subject: [PATCH] Philippe 23/10/2024: OUTPUTS: disable lossy compression if
 algorithm is NONE

---
 src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90 b/src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90
index d475d5e2b..2a4c4d7ce 100644
--- a/src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90
+++ b/src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90
@@ -1529,7 +1529,10 @@ SELECT CASE(TPFILE%CTYPE)
 
       !Set lossy compression
       TPFILE%LNCCOMPRESS_LOSSY = LOUT_COMPRESS_LOSSY(IMI)
-      IF ( LOUT_COMPRESS_LOSSY(IMI) ) THEN
+      IF ( UPCASE( COUT_COMPRESS_LOSSY_ALGO(IMI) ) == 'NONE' ) THEN
+        ! Disable lossy compression if algorithm is 'NONE'
+        TPFILE%LNCCOMPRESS_LOSSY = .FALSE.
+      ELSE IF ( LOUT_COMPRESS_LOSSY(IMI) ) THEN
         !Force compression if lossy compression is enabled
         TPFILE%LNCCOMPRESS = .TRUE.
 
-- 
GitLab