ioos / comt

IOOS Coastal and Ocean Modeling Testbed. See:
https://github.com/ioos/comt/wiki
MIT License
1 stars 7 forks source link

rex2nc does not work with all rex files #37

Open donatellapasqualini opened 9 years ago

donatellapasqualini commented 9 years ago

Rex2nc works correctly when I use one of the rex files included in the test directory Rich committed. When I use one of the rex files included in the SLOSH package or one that I created using SLOSH, in the ReadRexHeader function the code stops with Abort (signal 6). I am working on a MacBook Pro with Intel Core processor. The version of SLOSH I am using is dated 1/20/2012. Any idea?
Thank you

JRDavisUF commented 9 years ago

Can you confirm that SLOSH was compiled using a 32-bit compiler?
something like the following should tell you that: file (slosh exec name)

donatellapasqualini commented 9 years ago

I used 64 bit gcc with the option -DSIZEOF_LONG_INT=4.

donatellapasqualini commented 9 years ago

... and I compiled rex2nc with gcc -m32

donatellapasqualini commented 9 years ago

I compiled slosh with -m32, same problem ...

JRDavisUF commented 9 years ago

Just to be sure its not a Mac issue, I'd probably try compiling it on a Linux machine. If that still fails, then perhaps something might have changed in the rex header. The date I have on the last version of the converter (aka when it was originally developed) is Aug 2, 2011 which is a bit before your SLOSH code. I'd recommend talking with AT and see if he has updated his rexout porgram. This converter code was based on 1.3 of that. If he has a new version, then the header may have changed and the converter may need updating. However, in general AT was good about keeping backward compatible...so I'm still leaning toward a compiling, O/S, hardward-related issue...the rex stuff was very particular...

donatellapasqualini commented 9 years ago

I opened and animated without errors my rex file (created with SLOSH compiled under OSX with -m32) using the SLOSH display on a Windows machine. That makes me think that the problem I have in running rex2nc is not related to OS X. I emailed AT asking about updated rex headers. I haven't heard from him yet.

pwolfram commented 7 years ago

@donatellapasqualini has there been any progress on getting rex2nc to work?

pwolfram commented 7 years ago

@JRDavisUF, is this the most recent version of the code https://github.com/rsignell-usgs/rex2nc?

pwolfram commented 7 years ago

The key here is to build in 32 bit. The current code is completely incompatible if compiled in 64 bit. The netcdf library http://www.gfd-dennou.org/library/netcdf/unidata-mirror/netcdf-4.3.3.1.tar.gz used must also be compiled in 32-bit too and then linked to the code in order for the whole tool-chain to work properly.

I'll make a note on the readme that the code must be compiled in 32-bit mode.

JRDavisUF commented 7 years ago

Yes, 32 bit compilation is required. Someone asked about this several years ago, but I guess this piece of info never made it into the documenation. Specially, this is what I advised someone:

“Keep in mind that the rex format is a custom written "gif"-like compression. As such, so you have to be very careful with the byte sizes of your variables. I'm guessing it won't work, for example, if you try to use a 64-bit compiled version...at least in the sense of reading a rex file generated by a 32 bit executable. So make sure you are doing a 32-bit compile...”

jrd

From: Phillip Wolfram [mailto:notifications@github.com] Sent: Thursday, June 29, 2017 3:29 PM To: ioos/comt comt@noreply.github.com Cc: Justin R. Davis justin.r.davis@essie.ufl.edu; Mention mention@noreply.github.com Subject: Re: [ioos/comt] rex2nc does not work with all rex files (#37)

The key here is to build in 32 bit. The current code is completely incompatible if compiled in 64 bit. The netcdf library http://www.gfd-dennou.org/library/netcdf/unidata-mirror/netcdf-4.3.3.1.tar.gz used must also be compiled in 32-bit too and then linked to the code in order for the whole tool-chain to work properly.

I'll make a note on the readme that the code must be compiled in 32-bit mode.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/ioos/comt/issues/37#issuecomment-312074950, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGlJy6L-ZkkCph_pU2Ry-TCXJNXD8c8Gks5sI_rlgaJpZM4FS3MF.

pwolfram commented 7 years ago

Thanks a bunch for the confirmation @JRDavisUF! Your help is much appreciated and has been key to good progress over the last week.

ghost commented 6 years ago

Hi there good folks. So it appears that if I build SLOSH with BIT=64, that rex2nc cannot read it, correct? Or, perhaps, some compiler flag could do the trick?

pwolfram commented 6 years ago

@briane678, I think you only can really work in 32-bit mode. I wasn't able to get 64-bit to work.

JRDavisUF commented 6 years ago

Arthur Taylor (developer of the rex gif-like compression) was pretty adamant about 32-bit compilation. I'd stick with that.