@@ -152,11 +152,26 @@ subroutine ice_write_hist (ns)
152152 if (history_format == ' cdf1' ) then
153153 iflag = nf90_clobber
154154 elseif (history_format == ' cdf2' ) then
155+ #ifdef NO_CDF2
156+ call abort_ice(subname// ' ERROR: history_format cdf2 not available ' , &
157+ file= __FILE__, line= __LINE__)
158+ #else
155159 iflag = ior (nf90_clobber,nf90_64bit_offset)
160+ #endif
156161 elseif (history_format == ' cdf5' ) then
162+ #ifdef NO_CDF5
163+ call abort_ice(subname// ' ERROR: history_format cdf5 not available ' , &
164+ file= __FILE__, line= __LINE__)
165+ #else
157166 iflag = ior (nf90_clobber,nf90_64bit_data)
167+ #endif
158168 elseif (history_format == ' hdf5' ) then
169+ #ifdef NO_HDF5
170+ call abort_ice(subname// ' ERROR: history_format hdf5 not available ' , &
171+ file= __FILE__, line= __LINE__)
172+ #else
159173 iflag = ior (nf90_clobber,nf90_netcdf4)
174+ #endif
160175 else
161176 call abort_ice(subname// ' ERROR: history_format not allowed for ' // trim (history_format), &
162177 file= __FILE__, line= __LINE__)
@@ -1192,6 +1207,12 @@ subroutine ice_hist_field_def(ncid, hfield, lprecision, dimids, ns)
11921207 status = nf90_def_var(ncid, hfield% vname, lprecision, dimids, varid)
11931208 call ice_check_nc(status, subname// ' ERROR: defining var ' // trim (hfield% vname),file= __FILE__,line= __LINE__)
11941209
1210+ #ifdef NO_HDF5
1211+ if (history_format==' hdf5' ) then
1212+ call abort_ice(subname// ' ERROR: history_format hdf5 not available ' , &
1213+ file= __FILE__, line= __LINE__)
1214+ endif
1215+ #else
11951216 if (history_format==' hdf5' .and. size (dimids)>1 ) then
11961217 if (dimids(1 )==imtid .and. dimids(2 )==jmtid) then
11971218 chunks(1 )= history_chunksize(1 )
@@ -1208,6 +1229,7 @@ subroutine ice_hist_field_def(ncid, hfield, lprecision, dimids, ns)
12081229 status = nf90_def_var_deflate(ncid, varid, shuffle= 0 , deflate= 1 , deflate_level= history_deflate)
12091230 call ice_check_nc(status, subname// ' ERROR deflating var ' // trim (hfield% vname), file= __FILE__, line= __LINE__)
12101231 endif
1232+ #endif
12111233
12121234 ! add attributes
12131235 status = nf90_put_att(ncid,varid,' units' , hfield% vunit)
@@ -1335,6 +1357,12 @@ subroutine ice_hist_coord_def(ncid, coord, lprecision, dimids, varid)
13351357 status = nf90_def_var(ncid, coord% short_name, lprecision, dimids, varid)
13361358 call ice_check_nc(status, subname// ' ERROR: defining coord ' // coord% short_name,file= __FILE__,line= __LINE__)
13371359
1360+ #ifdef NO_HDF5
1361+ if (history_format==' hdf5' ) then
1362+ call abort_ice(subname// ' ERROR: history_format hdf5 not available ' , &
1363+ file= __FILE__, line= __LINE__)
1364+ endif
1365+ #else
13381366 if (history_format==' hdf5' .and. size (dimids)>1 ) then
13391367 if (dimids(1 )==imtid .and. dimids(2 )==jmtid) then
13401368 chunks(1 )= history_chunksize(1 )
@@ -1351,6 +1379,7 @@ subroutine ice_hist_coord_def(ncid, coord, lprecision, dimids, varid)
13511379 status= nf90_def_var_deflate(ncid, varid, shuffle= 0 , deflate= 1 , deflate_level= history_deflate)
13521380 call ice_check_nc(status, subname// ' ERROR deflating var ' // trim (coord% short_name), file= __FILE__, line= __LINE__)
13531381 endif
1382+ #endif
13541383
13551384 status = nf90_put_att(ncid,varid,' long_name' ,trim (coord% long_name))
13561385 call ice_check_nc(status, subname// ' ERROR: defining long_name for ' // coord% short_name, &
0 commit comments