From a9dd3f1854a9ce1a7e7cd0304d269d660f6e0dce Mon Sep 17 00:00:00 2001 From: 7schroet Date: Mon, 6 Jan 2025 17:08:14 +0100 Subject: [PATCH] adjust HDF5 file access rights --- src/cloudsc_c/cloudsc/load_state.c | 6 +++--- src/cloudsc_cuda/cloudsc/load_state.cu | 6 +++--- src/cloudsc_hip/cloudsc/load_state.cpp | 6 +++--- src/cloudsc_sycl/cloudsc/load_state.cpp | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/cloudsc_c/cloudsc/load_state.c b/src/cloudsc_c/cloudsc/load_state.c index ea3cecc1..3657a4f8 100644 --- a/src/cloudsc_c/cloudsc/load_state.c +++ b/src/cloudsc_c/cloudsc/load_state.c @@ -57,7 +57,7 @@ void query_state(int *klon, int *klev) #ifdef HAVE_HDF5 hid_t file_id, dataset_id; herr_t status; - file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); read_hdf5_int(file_id, "/KLEV", klev); read_hdf5_int(file_id, "/KLON", klon); @@ -496,7 +496,7 @@ void load_state(const int nlon, const int nlev, const int nclv, const int ngptot hid_t file_id, dataset_id; herr_t status; - file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); load_and_expand_2d(file_id, "PLCRIT_AER", nlon, nlev, nproma, ngptot, nblocks, plcrit_aer); load_and_expand_2d(file_id, "PICRIT_AER", nlon, nlev, nproma, ngptot, nblocks, picrit_aer); @@ -743,7 +743,7 @@ void load_reference(const int nlon, const int nlev, const int nclv, const int ng hid_t file_id, dataset_id; herr_t status; - file_id = H5Fopen(REFERENCE_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + file_id = H5Fopen(REFERENCE_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); load_and_expand_2d(file_id, "PLUDE", nlon, nlev, nproma, ngptot, nblocks, plude); load_and_expand_2d(file_id, "PCOVPTOT", nlon, nlev, nproma, ngptot, nblocks, pcovptot); diff --git a/src/cloudsc_cuda/cloudsc/load_state.cu b/src/cloudsc_cuda/cloudsc/load_state.cu index 6c402db9..f596381a 100644 --- a/src/cloudsc_cuda/cloudsc/load_state.cu +++ b/src/cloudsc_cuda/cloudsc/load_state.cu @@ -59,7 +59,7 @@ void query_state(int *klon, int *klev) #ifdef HAVE_HDF5 hid_t file_id, dataset_id; herr_t status; - file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); read_hdf5_int(file_id, "/KLEV", klev); read_hdf5_int(file_id, "/KLON", klon); @@ -492,7 +492,7 @@ void load_state(const int nlon, const int nlev, const int nclv, const int ngptot hid_t file_id, dataset_id; herr_t status; - file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); load_and_expand_2d(file_id, "PLCRIT_AER", nlon, nlev, nproma, ngptot, nblocks, plcrit_aer); load_and_expand_2d(file_id, "PICRIT_AER", nlon, nlev, nproma, ngptot, nblocks, picrit_aer); @@ -739,7 +739,7 @@ void load_reference(const int nlon, const int nlev, const int nclv, const int ng hid_t file_id, dataset_id; herr_t status; - file_id = H5Fopen(REFERENCE_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + file_id = H5Fopen(REFERENCE_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); load_and_expand_2d(file_id, "PLUDE", nlon, nlev, nproma, ngptot, nblocks, plude); load_and_expand_2d(file_id, "PCOVPTOT", nlon, nlev, nproma, ngptot, nblocks, pcovptot); diff --git a/src/cloudsc_hip/cloudsc/load_state.cpp b/src/cloudsc_hip/cloudsc/load_state.cpp index 2614ec7f..a2c636ba 100644 --- a/src/cloudsc_hip/cloudsc/load_state.cpp +++ b/src/cloudsc_hip/cloudsc/load_state.cpp @@ -60,7 +60,7 @@ void query_state(int *klon, int *klev) #ifdef HAVE_HDF5 hid_t file_id, dataset_id; herr_t status; - file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); read_hdf5_int(file_id, "/KLEV", klev); read_hdf5_int(file_id, "/KLON", klon); @@ -490,7 +490,7 @@ void load_state(const int nlon, const int nlev, const int nclv, const int ngptot hid_t file_id, dataset_id; herr_t status; - file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); load_and_expand_2d(file_id, "PLCRIT_AER", nlon, nlev, nproma, ngptot, nblocks, plcrit_aer); load_and_expand_2d(file_id, "PICRIT_AER", nlon, nlev, nproma, ngptot, nblocks, picrit_aer); @@ -733,7 +733,7 @@ void load_reference(const int nlon, const int nlev, const int nclv, const int ng hid_t file_id, dataset_id; herr_t status; - file_id = H5Fopen(REFERENCE_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + file_id = H5Fopen(REFERENCE_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); load_and_expand_2d(file_id, "PLUDE", nlon, nlev, nproma, ngptot, nblocks, plude); load_and_expand_2d(file_id, "PCOVPTOT", nlon, nlev, nproma, ngptot, nblocks, pcovptot); diff --git a/src/cloudsc_sycl/cloudsc/load_state.cpp b/src/cloudsc_sycl/cloudsc/load_state.cpp index 4fb7da79..4fe8baab 100644 --- a/src/cloudsc_sycl/cloudsc/load_state.cpp +++ b/src/cloudsc_sycl/cloudsc/load_state.cpp @@ -60,7 +60,7 @@ void query_state(int *klon, int *klev) #ifdef HAVE_HDF5 hid_t file_id, dataset_id; herr_t status; - file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); read_hdf5_int(file_id, "/KLEV", klev); read_hdf5_int(file_id, "/KLON", klon); @@ -490,7 +490,7 @@ void load_state(const int nlon, const int nlev, const int nclv, const int ngptot hid_t file_id, dataset_id; herr_t status; - file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + file_id = H5Fopen(INPUT_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); load_and_expand_2d(file_id, "PLCRIT_AER", nlon, nlev, nproma, ngptot, nblocks, plcrit_aer); load_and_expand_2d(file_id, "PICRIT_AER", nlon, nlev, nproma, ngptot, nblocks, picrit_aer); @@ -733,7 +733,7 @@ void load_reference(const int nlon, const int nlev, const int nclv, const int ng hid_t file_id, dataset_id; herr_t status; - file_id = H5Fopen(REFERENCE_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + file_id = H5Fopen(REFERENCE_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); load_and_expand_2d(file_id, "PLUDE", nlon, nlev, nproma, ngptot, nblocks, plude); load_and_expand_2d(file_id, "PCOVPTOT", nlon, nlev, nproma, ngptot, nblocks, pcovptot);