From e391183c7570d093b09c8fec9eab55fe0fd65576 Mon Sep 17 00:00:00 2001
From: Uwe Schulzweida <uwe.schulzweida@mpimet.mpg.de>
Date: Mon, 24 Mar 2025 10:15:04 +0100
Subject: [PATCH] Check netCDF filter

---
 src/cdf_filter.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/cdf_filter.c b/src/cdf_filter.c
index 615208ca3..4c4cea080 100644
--- a/src/cdf_filter.c
+++ b/src/cdf_filter.c
@@ -94,8 +94,9 @@ cdf_def_var_filter(int ncid, int ncvarID, const char *filterSpec)
           for (size_t i = 0; i < nfilters; i++)
             {
               unsigned int filterid = filters[i]->filterid;
-              // printf("filter %zu id:%d nparams:%zu param1 %d %d\n", i + 1, filterid, filters[i]->nparams, filters[i]->params[0],
-              // filters[i]->params[1]);
+              // printf("filter %zu id:%d nparams:%zu param1 %d\n", i + 1, filterid, filters[i]->nparams, filters[i]->params[0]);
+              status = nc_inq_filter_avail(ncid, filterid);
+              if (status != NC_NOERR) Error("%s", nc_strerror(status));
               status = nc_def_var_filter(ncid, ncvarID, filterid, filters[i]->nparams, filters[i]->params);
               if (status != NC_NOERR)
                 {
-- 
GitLab