This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Ryo, It seems to me this bug could be fixed with a one-line addition to f90/netcdf_attributes.f90, setting values to a blank string before calling nf_get_att_text: function nf90_get_att_text(ncid, varid, name, values) integer, intent( in) :: ncid, varid character(len = *), intent( in) :: name character(len = *), intent(out) :: values integer :: nf90_get_att_text values = ' ' !! make sure result will be blank padded nf90_get_att_text = nf_get_att_text(ncid, varid, name, values) end function nf90_get_att_text Of course, this would not fix the problem for Fortran-77 calls to nf_get_att_text, but I'm unclear whether Fortran-77 programs make the same assumption about blank-padding char arrays. If so, fixing the problem in the Fortran-77 wrappers instead is more difficult. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: KJU-947913 Department: Support netCDF Priority: High Status: Closed