Page 1 of 1

Converting WRF data to ARL

Posted: May 10th, 2013, 11:06 am
by bastiene
I'm attempting to use the Linux version of HYSPLIT with WRF data, and have been trying to use the WRF-ARW conversion tool through the Hysplit GUI.

When I load the menu, input which wrfout file I want to convert, and press "Process Data", the "simulation log" screen pops up, and in 1 or 2 seconds puts up four lines of text, the last of which is "Finished /mywrfout/path" where that path is the correct path to the data I wish to convert. However, at that point my cursor is stuck on a wheel-of-death thing like the tool is still trying to work, meanwhile no ARL conversion file has been created.

My question is, at this point is the tool really still working (how long does it take to convert one wrfout file of moderate size? On the order of minutes, hours, days)? And if it is, as I suspect, not working correctly, what do you think is the reason? How can I make it work, or is there any other way to convert these data files?

I am using HYSPLIT on NCAR CISL's GLADE file system, and I did have difficulties compiling due to the many different versions of NetCDF they have available, as far as which NetCDF lib/include directories to point to in the cmaq and arw2arl Makefiles, however the program did in the end compile completely without giving me an error. I'm not sure if this is related.

Thank you for any insight!

Re: Converting WRF data to ARL

Posted: May 16th, 2013, 1:45 pm
by ariel.stein
The conversion time depends on the size of the file you are trying to convert. However, for instance, for a domain that covers the eastern US with a horizontal resolution of ~ 10 km and 40 vertical levels it should take a few seconds for each model hour.
I would suggest that, instead of using the GUI, you use the executable (arw2arl) directly in the x-window and see how it responds.

Re: Converting WRF data to ARL

Posted: May 16th, 2013, 4:51 pm
by bastiene
Thank you for your helpful reply.

Running the executable directly reveals that I do not have the variable ZNT (roughness length) in my wrfout files that I am trying to convert. This may be why the program was hanging up in the GUI. I am recompiling and rerunning WRF to add ZNT and will try the conversion again after all of that finishes. Will make another post when I'm able to try the conversion again; hopefully it will be successful!

Re: Converting WRF data to ARL

Posted: May 17th, 2013, 4:51 pm
by bastiene
I have re-run WRF with the variable ZNT included in the wrfout files. arw2arl works on the command line for me.

However, I still am unable to use the GUI to convert my wrfout files. This isn't a problem, just a minor inconvenience I can deal with. Thanks for your help.

One further question: using arw2arl on the command line yields four output files: ARLDATA.BIN, ARLDATA.CFG, WRFRAIN.BIN and WRFDATA.CFG. I notice, when I go in to the Hysplit GUI, in the Trajectory Setup screen, I am only able to run HYSPLIT when I include only ARLDATA.BIN when clicking "Add Meteorology Files" (Trying to also load WRFRAIN.BIN gives this error when running HYSPLIT: "At line 138 of file metset.f Fortran runtime error: Bad value during integer read").

I understand that the .CFG files are short variable summary files of some sort and contain no data. But would I be correct to assume that there is some sort of data in WRFRAIN.BIN that HYSPLIT uses to calculate trajectories, and this error I get when I try to use it is a problem for me? Or is using ARLDATA.BIN as my only "meteorology file" when running HYSPLIT the proper thing to do?

Thanks again for any advice.

Re: Converting WRF data to ARL

Posted: May 21st, 2013, 4:02 pm
by ariel.stein
The meteorological data you need to run hysplit are in the ARLDATA.BIN file. It contains all the fields needed for the model to run.
ARLDATA.CFG and WRFDATA.CFG are the configuration files that can be modified to extract additional meteorological variables.

Re: Converting WRF data to ARL

Posted: July 26th, 2013, 4:11 pm
by pfinocchio
I'm attempting to run HYSPLIT using idealized WRF output files that do not have any particular map projection (MAP_PROJ = 0 in NetCDF global attributes, which is standard lat-lon). It's unclear whether HYSPLIT can be run on WRF files with lat-lon map projection and this seems to be causing issues when I try to run arw2arl. The code dumps out in setmap.f and returns the following error:

Undefined projection: 0

Has anyone had success converting un-projected WRF output? Any suggestions on how to circumvent this error and force conversion of un-projected WRF output data?

Thanks in advance,

Re: Converting WRF data to ARL

Posted: July 30th, 2013, 11:59 am
by Fantine
HYSPLIT can handle lat-lon grid. The "setmap.f" in arw2arl package takes care of the WRF projection. Extra coding will be needed for passing the corresponding grid information from WRF header to ARL format file.
But the question will be, do your idealized WRF output files provide geographic reference? HYSPLIT needs this information to compute the wind relative to grid cells.

Re: Converting WRF data to ARL

Posted: August 20th, 2013, 2:06 pm
by eowynb
fantine, would you please provide more details on how the code needs to be modified to handle a lat-lon projection in WRF? I'm getting, simply:

./arw2arl ../../working/
Using an existing decoding configuration: WRFDATA.CFG
Undefined projection: 6

You mentioned setmap.f. setmap.f first reads what the projection type is and then decides if it is allowed, or not. It defines projections in the following manner:

! grid orientation
! delta=x grid size in km
! synch point in x,y coordintes
! synch point in lat/lon coordinates

Then for each projection (currently polar stereographic, meractor, and lambert conformal) it sets GRIDS(1) which seems to be the pole position, GRIDS(2) which is labeled "pole longitude" but is set to ORIENT for the three projections, GRIDS(3) which is a reference lat (set in different ways), GRIDS(4) which is a reference lon (set to ORIENT for the 3 projections), and finally GRIDS(7) which is the "tangent" or "cone" latitude (set in different ways).

For lat-lon, do we just need to define GRIDS(1,2,3,4,7) or do we need to change other entries in GRIDS? What should they be set to? Any insight or help you can provide would be much appreciated. Thanks.

Re: Converting WRF data to ARL

Posted: August 29th, 2013, 3:02 pm
by Fantine
Please look at api2arl.f (should be in data2arl directory) which is a program to convert GRIB2 data into ARL format. Searching "lat-lon", you will see a section setting up GRIDS array for a regular lat-lon grid.
Copy below the portion I am referring to:

! Set lat/lon of lower left point

! grid should be defined on a 0->360 coordinate

! defines a regular lat-lon grid
! Pole lat/lon is used to identify the latlon point of the max index

GRIDS(3)=DLAT ! ref lat defines grid spacing
GRIDS(4)=DLON ! ref lon defines grid spacing

GRIDS(5)=0.0 ! grid size zero for lat/lom
GRIDS(6)=0.0 ! orientation
GRIDS(7)=0.0 ! tangent latitude

! defines a lmmbert conformal grid
GRIDS(1)=90.0 ! pole position

GRIDS(3)=RLAT ! resolution defined at this latitude
GRIDS(4)=RLON ! ref lon defines grid spacing

GRIDS(5)=SQRT(DLAT*DLON)/1000.0 ! grid size km
GRIDS(6)=0.0 ! grid orientation
GRIDS(7)=TLAT1 ! tangent latitude

! sync x,y defines lower left grid point

! variable reserved for future use

Re: Converting WRF data to ARL

Posted: October 16th, 2019, 5:23 am
by Smaug
Should this be copied into setmap.f? If so which part of the file should it go into ?