Skip to content

Commit

Permalink
Merge pull request #108 from 7schroet/develop
Browse files Browse the repository at this point in the history
HDF5 file access rights
  • Loading branch information
MichaelSt98 authored Jan 7, 2025
2 parents 8cec441 + a9dd3f1 commit d82a892
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/cloudsc_c/cloudsc/load_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/cloudsc_cuda/cloudsc/load_state.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/cloudsc_hip/cloudsc/load_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/cloudsc_sycl/cloudsc/load_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d82a892

Please sign in to comment.