From 06a3518f5446750c26720cea2155c7d198a67c68 Mon Sep 17 00:00:00 2001
From: Uwe Schulzweida <uwe.schulzweida@mpimet.mpg.de>
Date: Wed, 29 Jun 2022 07:55:49 +0200
Subject: [PATCH] Preservation of global attributes Source.

---
 src/stream_cdf_i.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/stream_cdf_i.c b/src/stream_cdf_i.c
index 57f02e9e9..047d761f8 100644
--- a/src/stream_cdf_i.c
+++ b/src/stream_cdf_i.c
@@ -3655,7 +3655,7 @@ cdf_scan_global_attr(int fileID, int vlistID, int ngatts, int *instID, int *mode
         {
           cdfGetAttText(fileID, NC_GLOBAL, attname, sizeof(attstring), attstring);
 
-          size_t attstrlen = strlen(attstring);
+          const size_t attstrlen = strlen(attstring);
 
           if (attlen > 0 && attstring[0] != 0)
             {
@@ -3669,9 +3669,9 @@ cdf_scan_global_attr(int fileID, int vlistID, int ngatts, int *instID, int *mode
                   *modelID = modelInq(-1, 0, attstring);
                   if (*modelID == CDI_UNDEFID) *modelID = modelDef(-1, 0, attstring);
                 }
-              else if (strIsEqual(attname, "Source"))
+              else if (strIsEqual(attname, "Source") && strStartsWith(attstring, "UCLA-LES"))
                 {
-                  if (strStartsWith(attstring, "UCLA-LES")) *ucla_les = true;
+                  *ucla_les = true;
                 }
               /*
               else if ( strIsEqual(attname, "Conventions") )
-- 
GitLab