Page 1 of 1

Automate reading of files using conread

Posted: July 21st, 2017, 10:21 pm
by jacobkh
Thanks for all your work on HYSPLIT.

I am trying to write my own scripts (in MATLAB) to run HYSPLIT and analyze the results. However, I am having trouble reading in the binary files. I have the PC version of HYSPLIT (Windows, Feb 2016, svn:802). The executable conread would work, except it requires user inputs (filename, Extended diagnostics (0/1), Enter) after it has started, which makes it difficult to put in a script. Is there some way to use conread with just 1 command line, similar to con2asc? I would prefer not to have to convert to another format if possible.

Re: Automate reading of files using conread

Posted: July 27th, 2017, 11:26 pm
by jacobkh
It turns out the source code for this executable is already included in the downloadable version of HYSPLIT (data2arl/utilities/conread.f). Looking at the code, there is no option natively to include all the input arguments on one line. However, I was able to solve this myself by modifying the code to accept the filename and turn on/off "Extended diagnostics" from a single line. Now I can read the binary files into MATLAB without any direct intervention (with MATLAB's "system" command).

I compiled conread.f using gfortran after some format modifications. Also to anyone else who may attempt their own modifications, you may need to explicitly specify CONVERT='BIG_ENDIAN' as an argument when opening the file (line 87 in the original).

I've attached my version (note it's actually a fortran source code file and you may need to change the extension if you use it). After compiling you can run using the "-h" argument to see help.

conread.txt

Posted: June 13th, 2018, 5:09 pm
by prabalroy
Conread.txt file is automatically getting bigger (while working on Hysplit) on my working directory and already took 84 GB. Can I delete this file or clean up ? :?: :?: :?:

Re: Automate reading of files using conread

Posted: June 14th, 2018, 6:34 am
by glenn.rolph
conread.txt is created whenever you use the "Simple Listing" program of the GUI to look at the contents of a binary concentration file. It is a text file and can be opened to read it, however if you no longer need it, delete it.