Converting WRF data to ARL

Post questions and find resources to convert meteorological data into a format HYSPLIT can read.
Post Reply
bastiene
Posts: 3
Joined: May 10th, 2013, 10:55 am
Registered HYSPLIT User: Yes

Converting WRF data to ARL

Post 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!
ariel.stein
Posts: 660
Joined: November 7th, 2012, 3:14 pm
Registered HYSPLIT User: Yes

Re: Converting WRF data to ARL

Post 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.
bastiene
Posts: 3
Joined: May 10th, 2013, 10:55 am
Registered HYSPLIT User: Yes

Re: Converting WRF data to ARL

Post 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!
bastiene
Posts: 3
Joined: May 10th, 2013, 10:55 am
Registered HYSPLIT User: Yes

Re: Converting WRF data to ARL

Post 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.
ariel.stein
Posts: 660
Joined: November 7th, 2012, 3:14 pm
Registered HYSPLIT User: Yes

Re: Converting WRF data to ARL

Post 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.
pfinocchio
Posts: 1
Joined: July 26th, 2013, 9:45 am
Registered HYSPLIT User: No

Re: Converting WRF data to ARL

Post 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,
-P
Fantine
Posts: 150
Joined: November 8th, 2012, 3:41 pm

Re: Converting WRF data to ARL

Post 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.
eowynb
Posts: 1
Joined: August 20th, 2013, 1:57 pm
Registered HYSPLIT User: Yes

Re: Converting WRF data to ARL

Post 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/wrfout_test.nc
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:

! FOR ALL PROJECTIONS
! grid orientation
GRIDS(6)=0.0
! delta=x grid size in km
GRIDS(5)=0.5*(dxkm+dykm)
! synch point in x,y coordintes
GRIDS(8)=0.5*(NXP+1)
GRIDS(9)=0.5*(NYP+1)
! synch point in lat/lon coordinates
GRIDS(10)=CLAT
GRIDS(11)=CLON

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.
Fantine
Posts: 150
Joined: November 8th, 2012, 3:41 pm

Re: Converting WRF data to ARL

Post 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
GRIDS(10)= CLAT
GRIDS(11)= CLON

! grid should be defined on a 0->360 coordinate
IF(GRIDS(11).LT.0.0)GRIDS(11)=360.0+GRIDS(11)

IF(RLAT.EQ.0.0.AND.RLON.EQ.0.0)THEN
! defines a regular lat-lon grid
! Pole lat/lon is used to identify the latlon point of the max index
GRIDS(1)=GRIDS(10)+DLAT*(NYP-1)
GRIDS(2)=GRIDS(11)+DLON*(NXP-1)
GRIDS(2)=AMOD(GRIDS(2),360.0)

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

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

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
END IF

! sync x,y defines lower left grid point
GRIDS(8)=1.0
GRIDS(9)=1.0

! variable reserved for future use
GRIDS(12)=0.0
Smaug
Posts: 55
Joined: July 1st, 2017, 8:28 am
Registered HYSPLIT User: No

Re: Converting WRF data to ARL

Post by Smaug »

Should this be copied into setmap.f? If so which part of the file should it go into ?
Post Reply

Return to “Conversion programs”