Page 1 of 1

Metgrid for domain over the North Pole

PostPosted: Wed Dec 05, 2012 4:32 pm
by Louise
Hi,

I'm trying to run WRF over a domain centred on the North Pole, but it is crashing in metgrid.exe. Geogrid.exe and ungrib.exe run fine.

I'm running with polar stereographic coordinates and dx = 30km. I've tried with both CFSR and FNL data for my initial conditions and boundary conditions, but get the same error:

Processing 2010-01-01_00
FILE
WARNING: Field PRES has missing values at level 200100 at (i,j)=(5,180)
WARNING: Field GHT has missing values at level 200100 at (i,j)=(5,180)
WARNING: Field SOILHGT has missing values at level 200100 at (i,j)=(5,180)
WARNING: Field PSFC has missing values at level 200100 at (i,j)=(5,180)
WARNING: Field PMSL has missing values at level 201300 at (i,j)=(5,180)
ERROR: Missing values encountered in interpolated fields. Stopping.

If I keep all other settings the same, but move the domain southwards away from the pole, then everything runs perfectly. I've printed out the gridpoint (5,180) (as well as the point (180,5) in case of i,j confusion) from the intermediate files, and can't see any problem. If I try adjusting the size of the domain slightly, but still centred over the pole, then I get the same error but with missing data reported at different gridpoints. I can't see any pattern.

Is there something special that I need to do to get WPS to run over the North Pole? Any help would be greatly appreciated.

Re: Metgrid for domain over the North Pole

PostPosted: Thu Dec 06, 2012 4:24 am
by AchternDiek
Hi Louise,

What does your namelist.wps look like for the domain over the North Pole?

--AchternDiek

Re: Metgrid for domain over the North Pole

PostPosted: Thu Sep 06, 2018 5:30 pm
by peterb
In trying to run metgrid.exe on a domain over Antarctica, I ran into a similar problem where metgrid.exe found a missing value for PRES somewhere in the middle of the domain, rather than for i=1,j=1, as with most errors of this type. I was puzzled, but while looking at the geo_em.d03.nc file, I found some missing values for longitude along 90W, 90E.

It appears that geogrid has trouble with converting grid indices into longitude along 90W/90E for grids around the pole. The trouble appears to be in geogrid/src/module_map_utils.F, where an arc cosine is used to compute longitude in radians, which is then converted to degrees:

Code: Select all
         arccos = ACOS(xx/SQRT(r2))
         IF (yy .GT. 0) THEN
            lon = reflon + deg_per_rad * arccos
         ELSE
            lon = reflon - deg_per_rad * arccos
         ENDIF

To avoid this issue, I would suggest replacing the above code with:

Code: Select all
        lon = reflon + deg_per_rad * atan2(yy,xx)

which will behave more smoothly when xx is close to zero.

With the longitude well defined in geo_em.d03.nc, metgrid.exe seems to run fine now.

While the reply is six years too late, I hope that someone finds it helpful.

- Peter

Re: Metgrid for domain over the North Pole

PostPosted: Wed Sep 12, 2018 2:24 am
by dcvz
FYI, this problem occurred for certain compilers and for certain polar projection parameters.
It was fixed in V4 by changing

arccos = ACOS(xx/SQRT(r2))

to

arccos = ACOS(MIN(MAX(xx/SQRT(r2),-1.0),1.0))

That change could be made to earlier versions, too. Thanks for posting another workaround.