# EQUATES Domain definition for WRF and MCIP

**URL:** <https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461>\
**Category:** MCIP\
**Tags:** equates\
**Created:** [October 5, 2023, 5:33pm UTC](https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461 "2023-10-05T17:33:23Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [October 5, 2023, 5:33pm UTC](https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461/1 "2023-10-05T17:33:23Z")

</div>

Thank @foley.kristen for the valuable WRF namelist for EQUATES ([EQUATES WRF namelist](https://forum.cmascenter.org/t/equates-wrf-namelist/4271))

I was working with the shared information and noticed that the WRF domain is configured as 472x312. As a result, in MCIP, my setting of BTRIM=5 is used to generate the final grid of 459x299 (12US1). However, this leads to x\_orig=-2754000 and y\_orig=-1794000 in the GRIDDESC, which is inconsistent with the values ( x\_orig=–2556000 and y\_orig=-1728000) in the GRIDDESC file from EQUATES emission directory. Will this inconsistency potentially impact the execution of CMAQ?

Thank you for your time!

---

<div class="post-metadata">

**Author:** ![hogrefe.christian](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@hogrefe.christian](https://forum.cmascenter.org/u/hogrefe.christian)\
**Post date:** [October 5, 2023, 5:54pm UTC](https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461/2 "2023-10-05T17:54:36Z")

</div>

To answer your last question, yes, you will not be able to run CMAQ if both your MCIP and emission files have 459 x 299 grid cells but the former use ( x\_orig=-2754000 and y\_orig=-1794000) while the latter use (x\_orig=–2556000 and y\_orig=-1728000). Not only would the emissions not cover your entire domain, but the two domains are not even offset by an integer multiple of the 12 km grid spacing from each other.

I have no hands on experience with this, but looking at the discussion in the other thread you linked, I’m wondering if the setting of ref\_x = 219.5 and ref\_y = 150.5 in the WPS namelist file posted in that thread might be relevant here. Maybe @rgilliam or @kiarash_farzad could weigh in here.

---

<div class="post-metadata">

**Author:** ![kiarash\_farzad](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/kiarash_farzad/32/3371_2.png) [@kiarash\_farzad](https://forum.cmascenter.org/u/kiarash_farzad)\
**Post date:** [October 5, 2023, 5:54pm UTC](https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461/3 "2023-10-05T17:54:48Z")

</div>

Me testing the namelists, I was able to generate exact GRIDDESC as EQUATES using:

BTRIM = -1

set X0 = 6  
set Y0 = 6  
set NCOLS = 459  
set NROWS = 299

Best,

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [October 5, 2023, 6:30pm UTC](https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461/4 "2023-10-05T18:30:43Z")

</div>

Thanks! I try this setting, but the x\_orig keeps -2754000 and y\_orig is still -1794000. I have included my run\_mcip.csh script below since I’m unable to upload attachments.

> #!/bin/csh -f
> 
> set CMAQ\_HOME = /share/atmoschem/nwu3/CMAQv5.3.2.1  
> source $CMAQ\_HOME/config\_cmaq.csh
> 
> set APPL = US\_d01\_20230108  
> set CoordName = LamCon\_40N\_97W # 16-character maximum  
> set GridName = US\_d01 # 16-character maximum
> 
> set DataPath = /share/atmoschem/nwu3/CMAQv5.3.2.1/data  
> set InMetDir = $DataPath/wrf  
> set InGeoDir = $DataPath/wps  
> set OutDir = $DataPath/mcip  
> set ProgDir = $CMAQ\_HOME/PREP/mcip/src  
> set WorkDir = $OutDir  
> echo $CMAQ\_HOME  
> echo $DataPath  
> echo $InMetDir  
> echo $InGeoDir  
> echo $OutDir  
> echo $ProgDir  
> echo $WorkDir  
> #-----------------------------------------------------------------------
> 
> # Set name(s) of input meteorology file(s)
> 
> #-----------------------------------------------------------------------
> 
> set InMetFiles = ( $InMetDir/wrfout\_d01\_2023-01-08\_00:00:00   
> $InMetDir/wrfout\_d01\_2023-01-09\_00:00:00   
> $InMetDir/wrfout\_d01\_2023-01-10\_00:00:00 )
> 
> set IfGeo = “F”  
> set InGeoFile = $InGeoDir/geo\_em\_d01.nc
> 
> #-----------------------------------------------------------------------
> 
> # Set user control options.
> 
> #-----------------------------------------------------------------------
> 
> set LPV = 0  
> set LWOUT = 0  
> set LUVBOUT = 1
> 
> #-----------------------------------------------------------------------
> 
> # Set run start and end date. (YYYY-MO-DD-HH:MI:SS.SSSS)
> 
> #-----------------------------------------------------------------------
> 
> set MCIP\_START = 2023-01-09-00:00:00.0000 # [UTC]  
> set MCIP\_END = 2023-01-10-00:00:00.0000 # [UTC]
> 
> set INTVL = 60 # [min]
> 
> set CTMLAYS = “1.000,0.995,0.988,0.980,0.970,0.956,0.938,0.893,0.839,0.777,0.702,0.582,0.400,0.200,0.000” #added by Nana, 10032023  
> #-----------------------------------------------------------------------
> 
> # Choose output format.
> 
> #-----------------------------------------------------------------------
> 
> set IOFORM = 1
> 
> set BTRIM = -1
> 
> #-----------------------------------------------------------------------
> 
> # Define MCIP subset domain.
> 
> #-----------------------------------------------------------------------
> 
> set X0 = 6  
> set Y0 = 6  
> set NCOLS = 459  
> set NROWS = 299
> 
> #-----------------------------------------------------------------------
> 
> # Set coordinates for cell for diagnostic prints on output domain.
> 
> # If coordinate is set to 0, domain center cell will be used.
> 
> #-----------------------------------------------------------------------
> 
> set LPRT\_COL = 0  
> set LPRT\_ROW = 0  
> set WRF\_LC\_REF\_LAT = 40.0
> 
> #=======================================================================  
> #=======================================================================
> 
> # Set up and run MCIP.
> 
> # Should not need to change anything below here.
> 
> #=======================================================================  
> #=======================================================================
> 
> set PROG = mcip
> 
> date
> 
> #-----------------------------------------------------------------------
> 
> # Make sure directories exist.
> 
> #-----------------------------------------------------------------------
> 
> if ( ! -d $InMetDir ) then  
> echo “No such input directory $InMetDir”  
> exit 1  
> endif
> 
> if ( ! -d $OutDir ) then  
> echo “No such output directory…will try to create one”  
> mkdir -p $OutDir  
> if ( $status != 0 ) then  
> echo “Failed to make output directory, $OutDir”  
> exit 1  
> endif  
> endif
> 
> if ( ! -d $ProgDir ) then  
> echo “No such program directory $ProgDir”  
> exit 1  
> endif
> 
> #-----------------------------------------------------------------------
> 
> # Make sure the input files exist.
> 
> #-----------------------------------------------------------------------
> 
> if ( $IfGeo == “T” ) then  
> if ( ! -f $InGeoFile ) then  
> echo “No such input file $InGeoFile”  
> exit 1  
> endif  
> endif
> 
> foreach fil ( $InMetFiles )  
> if ( ! -f $fil ) then  
> echo “No such input file $fil”  
> exit 1  
> endif  
> end
> 
> #-----------------------------------------------------------------------
> 
> # Make sure the executable exists.
> 
> #-----------------------------------------------------------------------
> 
> if ( ! -f ProgDir/{PROG}.exe ) then  
> echo “Could not find ${PROG}.exe”  
> exit 1  
> endif
> 
> #-----------------------------------------------------------------------
> 
> # Create a work directory for this job.
> 
> #-----------------------------------------------------------------------
> 
> if ( ! -d $WorkDir ) then  
> mkdir -p $WorkDir  
> if ( $status != 0 ) then  
> echo “Failed to make work directory, $WorkDir”  
> exit 1  
> endif  
> endif
> 
> cd $WorkDir
> 
> #-----------------------------------------------------------------------
> 
> # Set up script variables for input files.
> 
> #-----------------------------------------------------------------------
> 
> if ( $IfGeo == “T” ) then  
> if ( -f $InGeoFile ) then  
> set InGeo = $InGeoFile  
> else  
> set InGeo = “no\_file”  
> endif  
> else  
> set InGeo = “no\_file”  
> endif
> 
> set FILE\_GD = $OutDir/GRIDDESC
> 
> #-----------------------------------------------------------------------
> 
> # Create namelist with user definitions.
> 
> #-----------------------------------------------------------------------
> 
> set MACHTYPE = `uname`  
> if ( ( $MACHTYPE == “AIX” ) || ( $MACHTYPE == “Darwin” ) ) then  
> set Marker = “/”  
> else  
> set Marker = “&END”  
> endif
> 
> cat \> WorkDir/namelist.{PROG} \<\< !
> 
> &FILENAMES  
> file\_gd = “$FILE\_GD”  
> file\_mm = “$InMetFiles[1]”,  
> !
> 
> if ( $#InMetFiles \> 1 ) then  
> @ nn = 2  
> while ( nn \<= #InMetFiles )  
> cat \>\> WorkDir/namelist.{PROG} \<\< !  
> “$InMetFiles[$nn]”,  
> !  
> @ nn ++  
> end  
> endif
> 
> if ( $IfGeo == “T” ) then  
> cat \>\> WorkDir/namelist.{PROG} \<\< !  
> file\_geo = “$InGeo”  
> !  
> endif
> 
> cat \>\> WorkDir/namelist.{PROG} \<\< !  
> ioform = $IOFORM  
> $Marker
> 
> &USERDEFS  
> lpv = $LPV  
> lwout = $LWOUT  
> luvbout = $LUVBOUT  
> mcip\_start = “$MCIP\_START”  
> mcip\_end = “$MCIP\_END”  
> intvl = $INTVL  
> coordnam = “$CoordName”  
> grdnam = “$GridName”  
> btrim = $BTRIM  
> lprt\_col = $LPRT\_COL  
> lprt\_row = $LPRT\_ROW  
> wrf\_lc\_ref\_lat = $WRF\_LC\_REF\_LAT  
> $Marker
> 
> &WINDOWDEFS  
> x0 = $X0  
> y0 = $Y0  
> ncolsin = $NCOLS  
> nrowsin = $NROWS  
> $Marker
> 
> !
> 
> #-----------------------------------------------------------------------
> 
> # Set links to FORTRAN units.
> 
> #-----------------------------------------------------------------------
> 
> rm fort.\*  
> if ( -f $FILE\_GD ) rm -f $FILE\_GD
> 
> ln -s $FILE\_GD fort.4  
> ln -s WorkDir/namelist.{PROG} fort.8
> 
> set NUMFIL = 0  
> foreach fil ( $InMetFiles )  
> @ NN = $NUMFIL + 10  
> ln -s $fil fort.$NN  
> @ NUMFIL ++  
> end
> 
> #-----------------------------------------------------------------------
> 
> # Set output file names and other miscellaneous environment variables.
> 
> #-----------------------------------------------------------------------
> 
> setenv IOAPI\_CHECK\_HEADERS T  
> setenv EXECUTION\_ID $PROG
> 
> setenv GRID\_BDY\_2D OutDir/GRIDBDY2D\_{APPL}.nc  
> setenv GRID\_CRO\_2D OutDir/GRIDCRO2D\_{APPL}.nc  
> setenv GRID\_DOT\_2D OutDir/GRIDDOT2D\_{APPL}.nc  
> setenv MET\_BDY\_3D OutDir/METBDY3D\_{APPL}.nc  
> setenv MET\_CRO\_2D OutDir/METCRO2D\_{APPL}.nc  
> setenv MET\_CRO\_3D OutDir/METCRO3D\_{APPL}.nc  
> setenv MET\_DOT\_3D OutDir/METDOT3D\_{APPL}.nc  
> setenv LUFRAC\_CRO OutDir/LUFRAC\_CRO\_{APPL}.nc  
> setenv SOI\_CRO OutDir/SOI\_CRO\_{APPL}.nc  
> setenv MOSAIC\_CRO OutDir/MOSAIC\_CRO\_{APPL}.nc
> 
> if ( -f $GRID\_BDY\_2D ) rm -f $GRID\_BDY\_2D  
> if ( -f $GRID\_CRO\_2D ) rm -f $GRID\_CRO\_2D  
> if ( -f $GRID\_DOT\_2D ) rm -f $GRID\_DOT\_2D  
> if ( -f $MET\_BDY\_3D ) rm -f $MET\_BDY\_3D  
> if ( -f $MET\_CRO\_2D ) rm -f $MET\_CRO\_2D  
> if ( -f $MET\_CRO\_3D ) rm -f $MET\_CRO\_3D  
> if ( -f $MET\_DOT\_3D ) rm -f $MET\_DOT\_3D  
> if ( -f $LUFRAC\_CRO ) rm -f $LUFRAC\_CRO  
> if ( -f $SOI\_CRO ) rm -f $SOI\_CRO  
> if ( -f $MOSAIC\_CRO ) rm -f $MOSAIC\_CRO
> 
> if ( -f $OutDir/mcip.nc ) rm -f $OutDir/mcip.nc  
> if ( -f $OutDir/mcip\_bdy.nc ) rm -f $OutDir/mcip\_bdy.nc
> 
> #-----------------------------------------------------------------------
> 
> # Execute MCIP.
> 
> #-----------------------------------------------------------------------
> 
> ProgDir/{PROG}.exe
> 
> if ( $status == 0 ) then  
> rm fort.\*  
> exit 0  
> else  
> echo “Error running $PROG”  
> exit 1  
> endif

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [October 5, 2023, 6:32pm UTC](https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461/5 "2023-10-05T18:32:42Z")

</div>

Thank you for your response. Your explanation regarding the grid cell misalignment between MCIP and emission files makes sense. I appreciate the insight.

---

<div class="post-metadata">

**Author:** ![kiarash\_farzad](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/kiarash_farzad/32/3371_2.png) [@kiarash\_farzad](https://forum.cmascenter.org/u/kiarash_farzad)\
**Post date:** [October 5, 2023, 6:59pm UTC](https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461/6 "2023-10-05T18:59:47Z")

</div>

Is your wps namlist identical to the following?

parent\_id = 1,  
parent\_grid\_ratio = 1,  
i\_parent\_start = 1,  
j\_parent\_start = 1,  
s\_we = 1,  
e\_we = 472,  
s\_sn = 1,  
e\_sn = 312,  
dx = 12000  
dy = 12000  
map\_proj = ‘lambert’,  
ref\_lat = 40  
ref\_lon = -97  
ref\_x = 219.5,  
ref\_y = 150.5,  
truelat1 = 33,  
truelat2 = 45,  
stand\_lon = -97,

---

<div class="post-metadata">

**Author:** ![kiarash\_farzad](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/kiarash_farzad/32/3371_2.png) [@kiarash\_farzad](https://forum.cmascenter.org/u/kiarash_farzad)\
**Post date:** [October 5, 2023, 7:02pm UTC](https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461/7 "2023-10-05T19:02:20Z")

</div>

Difference between the x\_origs and y\_origs by 12000 is suggesting your center does not include the 0.5s in 219.5 and 150.5.

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [October 5, 2023, 7:14pm UTC](https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461/8 "2023-10-05T19:14:54Z")

</div>

I’m using WRFv3.9.1. Here is my wps.namelist. It looks like I didn’t specify ref\_x and ref\_y in the namelist.

> parent\_id = 1,  
> parent\_grid\_ratio = 1,  
> i\_parent\_start = 1,  
> j\_parent\_start = 1,  
> e\_we = 472,  
> e\_sn = 312,  
> dx = 12000,  
> dy = 12000,  
> map\_proj = ‘lambert’,  
> ref\_lat = 40,  
> ref\_lon = -97,  
> truelat1 = 33.0,  
> truelat2 = 45.0,  
> stand\_lon = -97.0,

---

<div class="post-metadata">

**Author:** ![kiarash\_farzad](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/kiarash_farzad/32/3371_2.png) [@kiarash\_farzad](https://forum.cmascenter.org/u/kiarash_farzad)\
**Post date:** [October 5, 2023, 7:27pm UTC](https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461/9 "2023-10-05T19:27:55Z")

</div>

That’s crucial to set your center point.

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [October 5, 2023, 8:08pm UTC](https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461/10 "2023-10-05T20:08:23Z")

</div>

I’ll rerun WPS, WRF and MCIP to see if it works! Thank you so much for your help! By the way, if I plant to run WRF-CMAQ based on EQUATES’s model-ready emissions, must I use the same WRF version as EQUATES does?

---

<div class="post-metadata">

**Author:** ![foley.kristen](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@foley.kristen](https://forum.cmascenter.org/u/foley.kristen)\
**Post date:** [October 6, 2023, 2:21am UTC](https://forum.cmascenter.org/t/equates-domain-definition-for-wrf-and-mcip/4461/11 "2023-10-06T02:21:36Z")

</div>

If you are using the coupled WRF-CMAQ model (rather than running WRF first and then running CMAQ), the WRF version to use will depend on what version of WRF-CMAQ you are using. Starting from WRFv4.4 and CMAQv5.3.3, you can construct the coupled model with any version of WRF (v4.4 or later) and any version of CMAQ (v5.3.3 or later). The EQUATES emissions are compatible with CMAQv5.3.3 and CMAQv5.4. They are speciated based on the cb6r3 chemical mechanism.
