Preparing CMAQ inputs problem

Hello,

I have several problems preparing CMAQ inputs.

From the start, I’m revealing my base environments for this CMAQ compilation & usage.

Intel oneAPI - v2025.1.0

Netcdf-C - netcdf-c/4.9.3

Netcdf-F - netcdf-f/4.6.2

MPI - openmpi/5.0.7

  1. Initial conditions
    I obtained the initial condition from EQUATES, 2019, and I tried to run ICON, and it showed this problem.

    ...     "MET_CRO_3D_CRS" opened as OLD:READ-ONLY
         File name "/blue/mjang/ganghan.kim/CMAQ/CMAQ_UNIPAR_test/data/FIREX-AQ/met/METCRO3D_FNL_wrfout_20190615.00z.24hrs.nc"
         File type GRDDED3
         Execution ID "mcip"
         Grid name "US_WEST_CROSS"
         Dimensions: 117 rows, 117 cols, 44 lays, 16 vbles
         NetCDF ID:    196608  opened as READONLY
         Starting date and time  2019166:000000 (0:00:00   June 15, 2019)
         Timestep                          010000 (1:00:00 hh:mm:ss)
         Maximum current record number        25
              Differences found between files CTM_CONC_1       and MET_CRO_3D_CRS  :
              CTM_CONC_1 GDTYP =   6   MET_CRO_3D_CRS GDTYP =   2
              CTM_CONC_1 P_ALP =  1.00000E+00   MET_CRO_3D_CRS P_ALP =  3.00000E+01
              CTM_CONC_1 P_BET =  4.50000E+01   MET_CRO_3D_CRS P_BET =  6.00000E+01
              CTM_CONC_1 P_GAM = -9.80000E+01   MET_CRO_3D_CRS P_GAM = -1.20000E+02
              CTM_CONC_1 XORIG = -1.00980E+07   MET_CRO_3D_CRS XORIG = -8.77500E+05
              CTM_CONC_1 YORIG = -1.00980E+07   MET_CRO_3D_CRS YORIG = -1.09232E+06
              CTM_CONC_1 XCELL =  1.08000E+05   MET_CRO_3D_CRS XCELL =  1.50000E+04
              CTM_CONC_1 YCELL =  1.08000E+05   MET_CRO_3D_CRS YCELL =  1.50000E+04
              CTM_CONC_1 XCENT = -9.80000E+01   MET_CRO_3D_CRS XCENT = -1.20000E+02
              CTM_CONC_1 YCENT =  9.00000E+01   MET_CRO_3D_CRS YCENT =  4.50000E+01
              CTM_CONC_1 VGLVS( 2 ) =  9.97500E-01MET_CRO_3D_CRS VGLVS( 2 ) =  9.98000E-01
              CTM_CONC_1 VGLVS( 3 ) =  9.94600E-01MET_CRO_3D_CRS VGLVS( 3 ) =  9.96000E-01
              CTM_CONC_1 VGLVS( 4 ) =  9.91300E-01MET_CRO_3D_CRS VGLVS( 4 ) =  9.94000E-01
              CTM_CONC_1 VGLVS( 5 ) =  9.87500E-01MET_CRO_3D_CRS VGLVS( 5 ) =  9.91000E-01
              CTM_CONC_1 VGLVS( 6 ) =  9.83100E-01MET_CRO_3D_CRS VGLVS( 6 ) =  9.89000E-01
              CTM_CONC_1 VGLVS( 7 ) =  9.78100E-01MET_CRO_3D_CRS VGLVS( 7 ) =  9.86000E-01
              CTM_CONC_1 VGLVS( 8 ) =  9.72300E-01MET_CRO_3D_CRS VGLVS( 8 ) =  9.82000E-01
              CTM_CONC_1 VGLVS( 9 ) =  9.65700E-01MET_CRO_3D_CRS VGLVS( 9 ) =  9.77000E-01
              CTM_CONC_1 VGLVS(10 ) =  9.58000E-01MET_CRO_3D_CRS VGLVS(10 ) =  9.71000E-01
              CTM_CONC_1 VGLVS(11 ) =  9.49200E-01MET_CRO_3D_CRS VGLVS(11 ) =  9.65000E-01
              CTM_CONC_1 VGLVS(12 ) =  9.39100E-01MET_CRO_3D_CRS VGLVS(12 ) =  9.58000E-01
              CTM_CONC_1 VGLVS(13 ) =  9.27500E-01MET_CRO_3D_CRS VGLVS(13 ) =  9.51000E-01
              CTM_CONC_1 VGLVS(14 ) =  9.14100E-01MET_CRO_3D_CRS VGLVS(14 ) =  9.44000E-01
              CTM_CONC_1 VGLVS(15 ) =  8.98700E-01MET_CRO_3D_CRS VGLVS(15 ) =  9.36000E-01
              CTM_CONC_1 VGLVS(16 ) =  8.81000E-01MET_CRO_3D_CRS VGLVS(16 ) =  9.29000E-01
              CTM_CONC_1 VGLVS(17 ) =  8.60700E-01MET_CRO_3D_CRS VGLVS(17 ) =  9.22000E-01
              CTM_CONC_1 VGLVS(18 ) =  8.37300E-01MET_CRO_3D_CRS VGLVS(18 ) =  9.10000E-01
              CTM_CONC_1 VGLVS(19 ) =  8.10400E-01MET_CRO_3D_CRS VGLVS(19 ) =  8.99000E-01
              CTM_CONC_1 VGLVS(20 ) =  7.79500E-01MET_CRO_3D_CRS VGLVS(20 ) =  8.80000E-01
              CTM_CONC_1 VGLVS(21 ) =  7.43900E-01MET_CRO_3D_CRS VGLVS(21 ) =  8.65000E-01
              CTM_CONC_1 VGLVS(22 ) =  7.06600E-01MET_CRO_3D_CRS VGLVS(22 ) =  8.07000E-01
              CTM_CONC_1 VGLVS(23 ) =  6.69300E-01MET_CRO_3D_CRS VGLVS(23 ) =  7.65000E-01
              CTM_CONC_1 VGLVS(24 ) =  6.32000E-01MET_CRO_3D_CRS VGLVS(24 ) =  7.19000E-01
              CTM_CONC_1 VGLVS(25 ) =  5.94600E-01MET_CRO_3D_CRS VGLVS(25 ) =  6.72000E-01
              CTM_CONC_1 VGLVS(26 ) =  5.57300E-01MET_CRO_3D_CRS VGLVS(26 ) =  6.22000E-01
              CTM_CONC_1 VGLVS(27 ) =  5.20000E-01MET_CRO_3D_CRS VGLVS(27 ) =  5.71000E-01
              CTM_CONC_1 VGLVS(28 ) =  4.82700E-01MET_CRO_3D_CRS VGLVS(28 ) =  5.20000E-01
              CTM_CONC_1 VGLVS(29 ) =  4.45400E-01MET_CRO_3D_CRS VGLVS(29 ) =  4.68000E-01
              CTM_CONC_1 VGLVS(30 ) =  4.08100E-01MET_CRO_3D_CRS VGLVS(30 ) =  4.20000E-01
              CTM_CONC_1 VGLVS(31 ) =  3.70800E-01MET_CRO_3D_CRS VGLVS(31 ) =  3.76000E-01
              CTM_CONC_1 VGLVS(32 ) =  3.35200E-01MET_CRO_3D_CRS VGLVS(32 ) =  3.35000E-01
              CTM_CONC_1 VGLVS(33 ) =  3.01300E-01MET_CRO_3D_CRS VGLVS(33 ) =  2.98000E-01
              CTM_CONC_1 VGLVS(34 ) =  2.69000E-01MET_CRO_3D_CRS VGLVS(34 ) =  2.63000E-01
              CTM_CONC_1 VGLVS(35 ) =  2.38300E-01MET_CRO_3D_CRS VGLVS(35 ) =  2.31000E-01
              CTM_CONC_1 VGLVS(36 ) =  2.08900E-01MET_CRO_3D_CRS VGLVS(36 ) =  2.02000E-01
              CTM_CONC_1 VGLVS(37 ) =  1.81000E-01MET_CRO_3D_CRS VGLVS(37 ) =  1.75000E-01
              CTM_CONC_1 VGLVS(38 ) =  1.54300E-01MET_CRO_3D_CRS VGLVS(38 ) =  1.50000E-01
              CTM_CONC_1 VGLVS(39 ) =  1.28900E-01MET_CRO_3D_CRS VGLVS(39 ) =  1.27000E-01
              CTM_CONC_1 VGLVS(40 ) =  1.04700E-01MET_CRO_3D_CRS VGLVS(40 ) =  1.06000E-01
              CTM_CONC_1 VGLVS(41 ) =  8.16000E-02MET_CRO_3D_CRS VGLVS(41 ) =  8.80000E-02
              CTM_CONC_1 VGLVS(42 ) =  5.96000E-02MET_CRO_3D_CRS VGLVS(42 ) =  5.50000E-02
              CTM_CONC_1 VGLVS(43 ) =  3.86000E-02MET_CRO_3D_CRS VGLVS(43 ) =  4.00000E-02
              CTM_CONC_1 VGLVS(44 ) =  1.86000E-02MET_CRO_3D_CRS VGLVS(44 ) =  2.00000E-02
    
         *** ERROR ABORT in subroutine CK_CTMMET_FL
         MET_CRO_3D_CRS file inconsistent: stopping
    
    0.014u 0.175s 0:05.40 3.3%      0+0k 557064+0io 0pf+0w
    set progstat = 2
    if ( 2 ) then
    echo ERROR 2 in /blue/mjang/ganghan.kim/CMAQ/CMAQ_UNIPAR_test/PREP/icon/scripts/BLD_ICON_v55_intel/ICON_v55.exe
    ERROR 2 in /blue/mjang/ganghan.kim/CMAQ/CMAQ_UNIPAR_test/PREP/icon/scripts/BLD_ICON_v55_intel/ICON_v55.exe
    exit ( 2 )
    

    It seems that the map configuration is different, but at least my map domain is positioned inside the source file’s domain, which is 12US1. I’m not sure how to fix this. Rerun the WRF to modify the domain size?

  2. Boundary conditions
    Boundary conditions should be prepared based on my domain configuration, and I gathered CAM-chem data, but after I searched several topics, there are no other preprocessors supporting CAM-chem. Which preprocessor might be helpful?

  3. Emission domain?
    EQUATES have cmaq_ready emission data, which has a domain of 12US1. Can I use that directly in my simulation, which is a much smaller domain? Or do I need another regridding preprocessor to fit the emission into my domain?

Thank you.

Program ICON uses a totally-bogus means of checking the consistency between grid descriptions in these files: given a plethora of hardware, compilers, and optimization levels, it is totally unreasonable to expect exact equality between DOUBLE PRECISION grid-description parameters. The test should be more of a form that tests: are these parameters within reasonable round-off-error tolerances of each other?

The I/O API has provided a robust – and well-documented! – routine GRDCHK3()https://cjcoats.github.io/ioapi/GRDCHK3.html – for doing this kind of consistency checks, and has done so for almost a decade before ICON was written. That is what should have been used for these checks. And considering how many times this problem has come up, the ICON code should long since have been fixed.

Carlie J. Coats, Jr., Ph.D. I/O API Author/Maintainer.

Hello @ganghan2000 ,

The ICON crash is caused by a scripting error. When configuring the script to run ICON, environment variable MET_CRO_3D_CRS should be set to the METCRO3D file for the outer / coarse domain, i.e. the same domain for which CTM_CONC_1 is defined. The METCRO3D file for your inner / fine target domain (/blue/mjang/ganghan.kim/CMAQ/CMAQ_UNIPAR_test/data/FIREX-AQ/met/METCRO3D_FNL_wrfout_20190615.00z.24hrs.nc) should be specified as MET_CRO_3D_FIN. Based on your description and the partial log file you posted, you appear to be using a hemispheric CMAQ output file from EQUATES as CTM_CONC_1. If so, you could try setting MET_CRO_3D_CRS to the same physical file as CTM_CONC_1 since the custom-processed daily average hemispheric CMAQ output files from EQUATES may include the necessary meteorological fields ICON is looking for to set up the vertical mapping between the coarse and fine domains. If you give this a try and it fails, please post the full run script and log file.

For item 2). you may be able to work off of @barronh‘s aqmbc tool, but you’ll likely have to do some custom coding. Alternatively, you could also write code that converts CAM-chem data to files like the EQUATES hemispheric CMAQ data you have downloaded, then process these files through BCON, and then apply any necessary species mapping from CAM-Chem to CMAQ mechanism species using the combine tool with a custom species definition file that defines this mapping. In either case, some code development will be required.

For the emissions piece, the log file shows that the MCIP file for your domain (/blue/mjang/ganghan.kim/CMAQ/CMAQ_UNIPAR_test/data/FIREX-AQ/met/METCRO3D_FNL_wrfout_20190615.00z.24hrs.nc) is not a proper subset of the 12US1 domain. It has a grid spacing of 15 km and projection parameters that differ from those of the 12US1 domain. Therefore, you cannot directly use any of the existing gridded files or inline point source emissions in your simulations. While regridding of the existing gridded files may be possible (though you need to take care to conserve mass since your projections are changing), the inline point source emissions will require extra care because the relevant XLOCA and YLOCA locations are projection specific. For proper emissions allocation, you would want to create spatial surrogates on your custom domain and then run SMOKE on that domain. Alternatively, if you want to use existing 12US1 emissions, you should define a domain using the same projection and making sure that the domain is a proper subset of the 12US1 domain.

1 Like

Here’s what the bulk of the body of SUBROUTINE CK_CTMMET_FL (which, by the coding standards should have been in ck_ctmmet_fl.F, not m3_ck_ctmmet.F, btw) should have looked like”

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c  Open the MET_CRO_3D_CRS file
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
IF ( .NOT. OPEN3( MET_CRO_3D_CRS, FSREAD3, PNAME ) ) THEN
MSG = ‘Could not open ’ // MET_CRO_3D_CRS // ’ file’
CALL M3EXIT( PNAME, 0, 0, MSG, XSTAT1 )
ELSE IF ( .NOT. DESC3( MET_CRO_3D_CRS ) ) THEN
MSG = ‘Could not read DESC of  ’ // MET_CRO_3D_CRS
&            // ’ file’
CALL M3EXIT( PNAME, 0, 0, MSG, XSTAT2 )
ELSE IF ( .NOT.FILCHK3( MET_CRO_3D_CRS,  FTYPE1,
&                        NCOLS1, NROWS1, NLAYS1, NTHIK3D ) ) THEN
MESG = 'Inconsistent dimensions  for ’ // MET_CRO_3D_CRS
CALL M3EXIT( PNAME, 0, 0, MESG, 2 )
ELSE IF ( .NOT.GRDCHK3( MET_CRO_3D_CRS,
&                        P_ALP1, P_BET1, P_GAM1, XCENT1, YCENT1,
&                        XORIG1, YORIG1, XCELL1, YCELL1,
&                        NLAYS1, VGTYP1, VGTOP1, VGLEV1 ) ) THEN
MESG = 'Inconsistent coord/grid  for ’ // MET_CRO_3D_CRS
CALL M3EXIT( PNAME, 0, 0, MESG, 2 )
END IF
```
  RETURN

Apologies for the lack of indentation: this latest rev of the Forum software utterly violates the meaning of the pre-formtted-content markup.


Thank you for your help. I have passed through the projection problem, but I encountered another error.

 ###############################################################################
 #  Vertical Interpolation Section
 ###############################################################################


     Vertical interpolation method: Linear


     The COORD.EXT and CTM vertical grid types are different.
     Vertical interpolation using ZH from the MET_CRO_3D files
     Value for IOAPI_LOG_WRITE:  F returning FALSE
     netCDF error number  -40

     >>--->> WARNING in subroutine RDTFLAG
     Error reading netCDF time step flag for CTM_CONC_1
     M3WARN:  DTBUF 1:00:00   July 16, 2019 (2019197:010000)
     RDVARS:  netCDF error number   -40
     Error reading variable "NO              " from file "CTM_CONC_1      "
     netCDF error 0 reading file
     Timesteps:  LAST  2019197:000000; NEXT -0009999:******

     >>--->> WARNING in subroutine M3_ICOUT:INTERP3
     Error reading NO from CTM_CONC_1
     M3WARN:  DTBUF 0:00:00   July 16, 2019 (2019197:000000)

     *** ERROR ABORT in subroutine M3_ICOUT
     Could not read input CTM Conc file CTM_CONC_1
     Date and time  0:00:00   July 16, 2019   (2019197:000000)

After this, only NO2 is written in the ICON file, and others are not.

I don’t understand why it shows a time stamp problem. ICON should not modify any time configuration…

Thank you. For the emission part, could you show me any example scripts for the regridding? I cannot find any reference examples or related manuals, so I cannot follow this description.

No, I do not have any such scripts.

At last, I resolved all of the problems for preparing CMAQ input.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.