# converting instructions to proj4 string for WRF-NMM E-grid

I'm looking for proj4 string for the WRF-NMM weather model projection.

This gris is called Arakama rotated E-Grid.

I spent many time looking on the internet. Here's the only practical thing I found.

How to convert this to a proj4 string ?

Let all longitude be reckoned positive east.

Let lat_g and lon_g be the geographic lat/lon and lat_r and lon_r be the rotated lat/lon.

Let lat_0 and lon_0 be the geographic lat/lon of the E-grid's central point. This is where the grid's rotated equator and rotated prime meridian cross.

First find the rotated lat/lon of any point on the grid for which the geographic lat/lon is known.

Let X = cos(lat_0) cos(lat_e) cos(lon_e - lon_0) + sin(lat_0) sin(lat_e)

Let Y = cos(lat_e) sin(lon_e - lon_0)

Let Z = - sin(lat_0) cos(lat_e) cos(lon_e - lon_0) + cos(lat_0) sin(lat_e)

Then lat_r = atan [ Z / sqrt(X*2 + Y*2) ]

And lon_r = atan [ Y / X ] (if X < 0, add pi radians)

Now find the geographic lat/lon of any point for which the rotated lat/lon are known.

lat_e = asin [ sin(lat_r) cos(lat_0) + cos(lat_r) sin(lat_0) cos(lon_r) ]

lon_e = lon_0 ± acos [ cos(lat_r) cos(lon_r) / ( cos(lat_e) cos(lat_0) ) - tan(lat_e) tan(lat_0) ]

In the preceding eqn, use the "+" sign for lon_r > 0 and use the "-" sign for lon_r < 0.

-