﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
133	udunits crashes with efc	Dave Offiler	Dave Offiler	"On tx01 with efc/ecc compilers, ROPP_IO tool ucar2ropp crashes with:

bash-2.05$ ../tools/ucar2ropp ../data/ucar_test1.nc
Reading ../data/ucar_test1.nc...
ucar2ropp(24215): unaligned access to 0x60000fffffff4d84, ip=0x40000000007464b0
forrtl: severe (174): SIGSEGV, segmentation fault occurred

I have tracked this down to the low-level udunits interface utcvt()
called by Chris' udunits F90 library in utcvt90(). The crash happens whenever udunits is called upon to do a real conversion; conversions involving like units are trapped and do not call the low-level library. A possible work-around could be to hard-wire conversions to ROPP default units in the UCAR netCDF reader (part of ropp_io_read_netcdf_get.f90), thus by-passing the problem. NB the crash occurs whenever udunits is called, whether on read or write. The other *2ropp tests works because there are no true units conversions being done. Fixing ucar2ropp would not help e.g. ROPP_FM where unit conversions do take place.

Since this is clearly an efc/ecc problem (it doesn't occur on any other platform/compiler combo), it may well be related to the 64-bit architecture of the TX, so should be solved accordingly. 

Looking at the udunits documentation, the Fortran/C interface stores C-pointers in Fortran default INTEGERs; quite likely there is a mis-match between storage lengths. But so far, I've not found a combination of compiler switches which could be related which cure the problem but don't cause new problems elsewhere (e.g. using -i8 everywhere causes file open failures in the MetDB BUFR 'C' write routine).

Given the short remaining lifetime for the NEC SX supercomputers - and their TX front-ends - it may not be worthwhile spending too  much effort on this, and in any case not to bust a gut for v1.2. 
"	defect	closed	major	3.0	ropp_io	1.1	fixed	udunits, units conversion	Huw Lewis
