diff --git a/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_history_write.F90 b/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_history_write.F90 index f39183954..92df8dad8 100644 --- a/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_history_write.F90 +++ b/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_history_write.F90 @@ -153,20 +153,25 @@ subroutine ice_write_hist (ns) iflag = nf90_clobber elseif (history_format == 'cdf2') then #ifdef NO_CDF2 - call abort_ice(subname//' ERROR: history_format cdf2 not available '//trim(history_format), & + call abort_ice(subname//' ERROR: history_format cdf2 not available ', & file=__FILE__, line=__LINE__) #else iflag = ior(nf90_clobber,nf90_64bit_offset) #endif elseif (history_format == 'cdf5') then #ifdef NO_CDF5 - call abort_ice(subname//' ERROR: history_format cdf5 not available '//trim(history_format), & + call abort_ice(subname//' ERROR: history_format cdf5 not available ', & file=__FILE__, line=__LINE__) #else iflag = ior(nf90_clobber,nf90_64bit_data) #endif elseif (history_format == 'hdf5') then +#ifdef NO_HDF5 + call abort_ice(subname//' ERROR: history_format hdf5 not available ', & + file=__FILE__, line=__LINE__) +#else iflag = ior(nf90_clobber,nf90_netcdf4) +#endif else call abort_ice(subname//' ERROR: history_format not allowed for '//trim(history_format), & file=__FILE__, line=__LINE__) @@ -1202,6 +1207,12 @@ subroutine ice_hist_field_def(ncid, hfield, lprecision, dimids, ns) status = nf90_def_var(ncid, hfield%vname, lprecision, dimids, varid) call ice_check_nc(status, subname//' ERROR: defining var '//trim(hfield%vname),file=__FILE__,line=__LINE__) +#ifdef NO_HDF5 + if (history_format=='hdf5') then + call abort_ice(subname//' ERROR: history_format hdf5 not available ', & + file=__FILE__, line=__LINE__) + endif +#else if (history_format=='hdf5' .and. size(dimids)>1) then if (dimids(1)==imtid .and. dimids(2)==jmtid) then chunks(1)=history_chunksize(1) @@ -1218,6 +1229,7 @@ subroutine ice_hist_field_def(ncid, hfield, lprecision, dimids, ns) status = nf90_def_var_deflate(ncid, varid, shuffle=0, deflate=1, deflate_level=history_deflate) call ice_check_nc(status, subname//' ERROR deflating var '//trim(hfield%vname), file=__FILE__, line=__LINE__) endif +#endif ! add attributes status = nf90_put_att(ncid,varid,'units', hfield%vunit) @@ -1345,6 +1357,12 @@ subroutine ice_hist_coord_def(ncid, coord, lprecision, dimids, varid) status = nf90_def_var(ncid, coord%short_name, lprecision, dimids, varid) call ice_check_nc(status, subname//' ERROR: defining coord '//coord%short_name,file=__FILE__,line=__LINE__) +#ifdef NO_HDF5 + if (history_format=='hdf5') then + call abort_ice(subname//' ERROR: history_format hdf5 not available ', & + file=__FILE__, line=__LINE__) + endif +#else if (history_format=='hdf5' .and. size(dimids)>1) then if (dimids(1)==imtid .and. dimids(2)==jmtid) then chunks(1)=history_chunksize(1) @@ -1361,6 +1379,7 @@ subroutine ice_hist_coord_def(ncid, coord, lprecision, dimids, varid) status=nf90_def_var_deflate(ncid, varid, shuffle=0, deflate=1, deflate_level=history_deflate) call ice_check_nc(status, subname//' ERROR deflating var '//trim(coord%short_name), file=__FILE__, line=__LINE__) endif +#endif status = nf90_put_att(ncid,varid,'long_name',trim(coord%long_name)) call ice_check_nc(status, subname// ' ERROR: defining long_name for '//coord%short_name, & diff --git a/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_restart.F90 b/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_restart.F90 index 3624d4931..9bf3b1d8a 100644 --- a/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_restart.F90 +++ b/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_restart.F90 @@ -222,20 +222,25 @@ subroutine init_restart_write(filename_spec) iflag = nf90_clobber elseif (restart_format == 'cdf2') then #ifdef NO_CDF2 - call abort_ice(subname//' ERROR: restart_format cdf2 not available '//trim(restart_format), & + call abort_ice(subname//' ERROR: restart_format cdf2 not available ', & file=__FILE__, line=__LINE__) #else iflag = ior(nf90_clobber,nf90_64bit_offset) #endif elseif (restart_format == 'cdf5') then #ifdef NO_CDF5 - call abort_ice(subname//' ERROR: restart_format cdf5 not available '//trim(restart_format), & + call abort_ice(subname//' ERROR: restart_format cdf5 not available ', & file=__FILE__, line=__LINE__) #else iflag = ior(nf90_clobber,nf90_64bit_data) #endif elseif (restart_format == 'hdf5') then +#ifdef NO_HDF5 + call abort_ice(subname//' ERROR: restart_format hdf5 not available ', & + file=__FILE__, line=__LINE__) +#else iflag = ior(nf90_clobber,nf90_netcdf4) +#endif else call abort_ice(subname//' ERROR: restart_format not allowed for '//trim(restart_format), & file=__FILE__, line=__LINE__) @@ -904,6 +909,12 @@ subroutine define_rest_field(ncid, vname, dims) status = nf90_def_var(ncid,trim(vname),nf90_double,dims,varid) call ice_check_nc(status, subname//' ERROR: def var '//trim(vname), file=__FILE__, line=__LINE__) +#ifdef NO_HDF5 + if (restart_format=='hdf5') then + call abort_ice(subname//' ERROR: restart_format hdf5 not available ', & + file=__FILE__, line=__LINE__) + endif +#else if (restart_format=='hdf5' .and. size(dims)>1) then if (dims(1)==dimid_ni .and. dims(2)==dimid_nj) then chunks(1)=restart_chunksize(1) @@ -920,6 +931,7 @@ subroutine define_rest_field(ncid, vname, dims) status=nf90_def_var_deflate(ncid, varid, shuffle=0, deflate=1, deflate_level=restart_deflate) call ice_check_nc(status, subname//' ERROR deflating var '//trim(vname), file=__FILE__, line=__LINE__) endif +#endif #else call abort_ice(subname//' ERROR: USE_NETCDF cpp not defined', & diff --git a/configuration/scripts/machines/Macros.compy_intel b/configuration/scripts/machines/Macros.compy_intel index 604337f59..eabdbc00a 100644 --- a/configuration/scripts/machines/Macros.compy_intel +++ b/configuration/scripts/machines/Macros.compy_intel @@ -3,7 +3,7 @@ #============================================================================== CPP := fpp -CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS} +CPPDEFS := -DFORTRANUNDERSCORE -DNO_HDF5 ${ICE_CPPDEFS} CFLAGS := -c -O2 -fp-model precise -xHost FIXEDFLAGS := -132