GRIDDESC to Namelist.wps conversion

Hello all,

I have following GRIDDESC file (with available 4km and 12km spatial surrogates by CMAS):

! coords --line: name; type, P-alpha, P-beta, P-gamma, xcent, ycent
‘LAM_40N97W’
2, 33.0D0, 45.D0, -97.D0, -97.D0, 40.D0
’ ’ ! end coords. grids: name; xorig,yorig,xcell,ycell,ncols,nrows,nthik
‘12US1_459X299’, ! Continental 12km grid
‘LAM_40N97W’, -2556000, -1728000, 12.D3, 12.D3, 459, 299, 1
‘4MIDFLA1_83X85’, ! 4 km for Central Florida domain
‘LAM_40N97W’, 1380000.0, -1380000.0, 4000.000, 4000.000, 83, 85, 1
’ ’ ! end grids.

I need to generate meteorology data for these 2 domains (12km and 4km) by WRF. I prepared the following namelist.wps geogrid portion:

For 12 km domain:
&geogrid
parent_id = 1, 1,
parent_grid_ratio = 1, 3,
i_parent_start = 1, 31,
j_parent_start = 1, 17,
e_we = 462, 112,
e_sn = 302, 97,
geog_data_res = ‘default’,‘default’,
dx = 12000,
dy = 12000,
map_proj = ‘lambert’,
ref_lat = ?
ref_lon = ?
truelat1 = 33.0,
truelat2 = 45.0,
stand_lon = -97.0,
geog_data_path = ‘/lustre/fs0/home/mhasan/Parallel/wrf/GEOG/WPS_GEOG/’
/
For 4km domain:

&geogrid
parent_id = 1, 1,
parent_grid_ratio = 1, 3,
i_parent_start = 1, 31,
j_parent_start = 1, 17,
e_we = 86, 112,
e_sn = 88, 97,
geog_data_res = ‘default’,‘default’,
dx = 4000,
dy = 4000,
map_proj = ‘lambert’,
ref_lat = ?
ref_lon = ?
truelat1 = 33.0,
truelat2 = 45.0,
stand_lon = -97.0,
geog_data_path = ‘/lustre/fs0/home/mhasan/Parallel/wrf/GEOG/WPS_GEOG/’
/
How can I get the ref_lat and ref_lon for my domains?

Hasibul

Yeah, it’s not typical to generate a WRF/WPS domain config from MCIP files, but sometimes a need.

You could also just contact the dataset custodian and ask for the WRF namelist.

ref_lat/ref_lon are by default set to the center of the domain so you could use the lat-lon grids in the GRIDCRO2D file to get those values.

You can also pick any grid point like the lower left corner of the domain and change the default location of ref lat/lon from the center of the grid to the corner. Either way you need to look at the GRIDCRO file for the lat-lon values.

ref_lat = ?
ref_lon = ?
ref_x = 1
ref_y = 1

EDIT: The 12 km domain is our standard CONUS12. These are the settings and an example. In this case the WRF domain is not quite centered on 40 N/-97W so ref_x/y are not the center of the grid.

ref_lat = 40.00,
ref_lon = -97.00,
ref_x = 219.5,
ref_y = 150.5,

I’ll dig around to see if I can find information about this 4 km domain.

1 Like

I cannot find information about this MID FL 4 km domain. Suggest you set ref_x/y to 1 and use the lower left lat/lon values from a GRIDCRO2D. You may not have a GRIDCRO2D. In that case. CMAS may have to help here if you only have the GRIDDESC file. They should have more information. I don’t see that particular domain in the archive of domains here at the US EPA.

Here is the CMAS provided GRIDDESC for all the domains for where the spatial surrogates are available.
griddesc_lambertonly_18jan2019_v7.txt (11.8 KB)
Here is the link of CMAS data forum to find this file:
Index of /Air/emismod/2017/ancillary_data (epa.gov)
CMAS did not provide the WRF namelists for all of those domains. Also, there is no GRIDCRO2D file available for any of these domains (except 12km CONUS).
I tried to use the namelist for the 12km resolution domain that you provided. Here is my namelist.
namelist.wps.txt (805 Bytes)
When I try to run MCIP I got the following error:
Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0 0x7FB7FF773697
#1 0x7FB7FF773CDE
#2 0x7FB7FE82C3FF
#3 0x4C8FBD in resistcalc_ at resistcalc.f90:281
#4 0x49F47C in pblsup_ at pblsup.f90:331
#5 0x448D31 in dynflds_ at dynflds.f90:67
#6 0x403E45 in MAIN__ at mcip.f90:169
Floating exception (core dumped)
Error running mcip

Here is my MCIP run file and run log:
run_mcip.csh (20.9 KB)
run_mcip.log.txt (13.6 KB)

from the MCIP log files I/O API variables, you can see that the XORIG and YORIG are not same as our desired 12CONUS GRIDDESC. I am using WRF 4.1.5 to generate wrfout data. I did run some test cases with WRF-4.1.5 and MCIP-5.1 and MCIP produced results. But for this 12km domain, MCIP is not providing outputs.

I will be thankful if you can help me on this issue.

Hasibul

The differences of XORIG and YORIG is attributed to the following settings in your mcip. You may need to test some X0 and Y0 values for getting the desired outputs consistent with the MCIP files which you already got.

set X0 = 285
set Y0 = 60
set NCOLS = 100
set NROWS = 80

So one obvious issue with the run_mcip.csh settings for this 12 km domain is the BTRIM setting.

These are the lower left corner coordinates from your failed MCIP run.
XORIG3D -2616000.000
YORIG3D -1788000.000

These are the coordinates from the CMAS GRIDDESC file (xorig, yorig).
-2556000, -1728000

In both cases the difference is 60000 m, 60 km which = 5 x 12 grid cells.

If you run with BTRIM = 5 instead of 0, it will reduce the xorig and yorig by 60 km.

SO this leaves two other issues:

  1. This 4 km Florida domain. I’ll dig a little more, but did not see a domain in our archive like that. I can contact one of our long-time modelers who has worked on Florida modeling in the past. She may know.

  2. MCIP fails. This is a completely different issue. May need to open a separate ticket specific to that issue. The log file does not tell me anything. Typically when there is a problem with the WRF inputs or the like, MCIP provides an error message. There is no error message here. I wonder if this MCIP compile has been used successfully on other WRF outputs? Or is this a new compile. I’d be willing to try a verson of MCIP on our machine if you could provide a small sample of WRF output. You can contact me via email. I’d just need to figure out how to download as we’ve moved to a different method to share large datasets that I’ve not used yet.

1 Like

I’m reaching out for more possible information on this 4 km Florida domain. I looked again at a large archive of MCIP that we have at the US EPA and did not find this Florida domain. Will respond when I get a response from this other modeler I know has run some Fl sims in the past.

With that said, with a bit of experimentation or careful calculations one can backtrack the WRF settings.

i.e.,

Since the 12 km CONUS and 4 km FL domains share the same projection, the 4 km can be configured as nested in the 12 km domain. The key is knowing what 12 km grid point the 4 km domains lower-left corner lies.

This is the GRIDDESC.
‘4MIDFLA1_83X85’, ! 4 km for Central Florida domain
‘LAM_40N97W’, 1380000.0, -1380000.0, 4000.000, 4000.000, 83, 85, 1

1380000.0 m is the distance from the projection center (40N97W). A grid spacing of 12 km yields
1380000/12000 = 115 12 km grid points to the east of this projection center.

-1380000/12000 = -115 grid point where the negative indicates south of the center obviously.

So we know the 12 km domain is anchored to 40 N and -97W center of the projection at grid point 219.5 (x) and 150.5 (y). from the ref_lat/lon and ref_x/y I provided above.

This implies the 4 km is nested within the 12 km at approx.

219.5+115 = 334.5
150.5-115 = 35.5

The issue is the 4 km MCIP domain likely has a BTRIM = 5 as well. So this would expand the 4 km WRF domain from this GRIDDESC xorig/yorig setting by 5 grid points. It would be +5 grid points to the west and south, so the index where this 4 km domain is anchored within the 12 km domain would be close to:

329.5
30.5

I’m just not sure about the decimal here. It probably does not matter because you can run the 4 km domain larger because the domain would still lie on the same projection. Below would be very close if not work, but it would take WRF processing and a quick run through MCIP to make sure.

&geogrid
parent_id = 1, 1
parent_grid_ratio = 1, 3
i_parent_start = 1,329
j_parent_start = 1, 30
s_we = 1, 1, 1
e_we = 472, 96
s_sn = 1, 1, 1
e_sn = 312, 98

1 Like

Lara Reynolds helped find an old FL domain that had files archived in a different spot.

My estimate above was close and would work as I indicated as long as the WRF domain is larger than the windowed MCIP subset. But this is original nested config of this 4 km MID FL domain. What you may have to mess around with is the BTRIM setting to get the exact domain as the GRIDDEC, but that is a simple quick iteration of running MCIP. It may be smaller than 5 here. I’d start with 5 and look at the resulting xorig/yorig and adjust until it matches. Best of luck. Guess the remaining issue is running MCIP. I’d start a new problem ticket.

&geogrid
parent_id = 1, 1,
parent_grid_ratio = 1, 3,
i_parent_start = 1, 333,
j_parent_start = 1, 34,
s_we = 1, 1,
e_we = 472, 100,
s_sn = 1, 1,
e_sn = 312, 94,
geog_data_res = ‘5m’,‘30s’,
dx = 12000,
dy = 12000,
map_proj = ‘lambert’,
ref_lat = 40.00,
ref_lon = -97.00,
ref_x = 219.5,
ref_y = 150.5,
truelat1 = 33.0,
truelat2 = 45.0,
stand_lon = -97.0,
geog_data_path = ‘/asm/jlx/GEOG/geog’
opt_geogrid_tbl_path = ‘geogrid/’
/

2 Likes