EQUATES Domain definition for WRF and MCIP

Thank @foley.kristen for the valuable WRF namelist for EQUATES (EQUATES WRF namelist)

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!

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.

1 Like

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,

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

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

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,

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.

1 Like

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,

That’s crucial to set your center point.

2 Likes

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?

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.