From 9bed1466eee5d02ca087ce4aa4618506a3d608a8 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Mon, 9 Jan 2023 08:53:12 -0500 Subject: [PATCH] Fixed issue where when a string was overwritten by a shorter string in NetCDF, the trailing characters of the older string remained. --- src/swiftest/swiftest_io.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/swiftest/swiftest_io.f90 b/src/swiftest/swiftest_io.f90 index 0c3c02a10..f288f9107 100644 --- a/src/swiftest/swiftest_io.f90 +++ b/src/swiftest/swiftest_io.f90 @@ -1699,7 +1699,7 @@ module subroutine swiftest_io_netcdf_write_info_body(self, nc, param) ! Internals integer(I4B) :: i, j, idslot, old_mode integer(I4B), dimension(:), allocatable :: ind - character(len=:), allocatable :: charstring + character(len=NAMELEN) :: charstring ! This string of spaces of length NAMELEN is used to clear out any old data left behind inside the string variables call netcdf_io_check( nf90_set_fill(nc%id, NF90_NOFILL, old_mode), "netcdf_io_write_info_body nf90_set_fill NF90_NOFILL" )