My legacy Fortran code uses the netCDF routine ncvgtc to read string arrays from netCDF files. With the most recent version of the netCDF library, this routine returns garbage for all but the first array element. The attached ftest_rev.F file (with include file nfconfig.inc) is based on ftest.F found in the netcdf-fortran/nf_test directory and has been modified to reproduce this behavior. The original test, starting on line 1110, calls ncvgtc to read the (2-D) character variable from test.nc into a 1-D string; this succeeds. My modification is to instead read the character data it into a string array, stringa. When this test fails, the first element of stringa is OK; the other elements are garbage. I'm presently seeing this behavior on two completely different systems, both using netCDF 4.4.1.1 and netCDF-Fortran 4.4.4. One system is running Mac OS 10.12.6 (netCDF built within the Fink system using gfortran 5.4.0). The other is a new high performance cluster at MIT (http://www1.psfc.mit.edu/computers/cluster/ ; netCDF built with Intel compilers). This test code works fine on another system with netCDF 4.2 and netCDF-Fortran 4.2. Any suggestions? Thanks, Daren Stotler -- _______________________________________________________________ Daren Stotler Principal Research Physicist http://w3.pppl.gov/~dstotler 609-243-2063 Princeton Plasma Physics Laboratory MS 27 P.O. Box 451 Princeton, NJ 08543
Attachment:
ftest_rev.F
Description: Binary data
Attachment:
nfconfig.inc
Description: Binary data
netcdfgroup
archives: