MPAS-CMAQ: gridded emissions do not seem to change after 01:00 UTC — missing NEXTIME in r_interpolate_var_3d_mpas?

Hello,

While checking the hourly emissions in CCTM_EMIS_DIAG from my MPAS-CMAQ runs, I noticed that the gridded emissions (GR_EMIS_xxx) did not seem to follow the diurnal cycle of the input files. I then ran the distributed 120 km benchmark and saw the same behaviour, so I looked into the code. I found a place that looks like it might be the cause, and a one-line change made the emissions follow the input in my tests. I would be grateful if you could check whether my understanding is correct.

I searched the forum, the USEPA/CMAQ issues and pull requests (PR #181 seems to be a different issue), and the USEPA/MPAS repository, but could not find this reported. Apologies if it is already known.

What I observed

The gridded emissions in CCTM_EMIS_DIAG match the input at 00:00 and 01:00 UTC, but from 02:00 onward they seem to stay at the 01:00 value until the end of the run. Since the run script restarts the model every day, this would mean that each day only the 00:00 and 01:00 records are used. Point sources (STK_EMIS) and inline emissions look fine. This is easy to miss with inventories that are constant within a day, but it would matter for emissions with a diurnal cycle.

Where I think it comes from

In r_interpolate_var_3d_mpas (centralized_io_module.F), when the model time passes the tail time stamp, the routine converts the tail time stamp and calls retrieve_time_dep_gridded_data with that same time, without advancing it with NEXTIME:

if (cio_mpas_grid_data_tstamp(loc_tail, var_loc) .lt. loc_mpas_time_stamp) then
   call mio_time_format_conversion (cio_mpas_grid_data_tstamp(loc_tail, var_loc), loc_jdate, loc_jtime)
   call retrieve_time_dep_gridded_data (loc_jdate, loc_jtime, loc_vname)

If I understand it correctly, this reads the 01:00 record again, so both buffers end up holding 01:00. The WRF counterparts (for example r_interpolate_var_3d) and the MPAS point-source routine call NEXTIME ( loc_jdate, loc_jtime, loc_tstep ) before the retrieve, and r_interpolate_var_3d_mpas declares use util_module, only : nextime but does not seem to call it.

What I tried

I added one line:

   call mio_time_format_conversion (cio_mpas_grid_data_tstamp(loc_tail, var_loc), loc_jdate, loc_jtime)
   call nextime (loc_jdate, loc_jtime, loc_tstep)
   call retrieve_time_dep_gridded_data (loc_jdate, loc_jtime, loc_vname)

To check it, I ran the distributed benchmark (2017-01-01) for 4 hours with two executables, keeping all inputs and settings unchanged; the only difference was this line. The table compares the global totals in CCTM_EMIS_DIAG (mol/s) with the change in the gridded emission input since 01:00:

Species Hour (UTC) without the line with the line (with − without) input[h] − input[01]
SO2 02 3.28271e4 3.36469e4 820 820
SO2 03 3.28089e4 3.58922e4 3083 3083
NO 02 7.39175e4 7.73690e4 3452 3451
NO 03 7.43705e4 7.91632e4 4793 4793
CO 02 6.90034e5 6.80402e5 −9632 −9632
CO 03 6.92829e5 6.71626e5 −21203 −21204

The difference between the two runs matches the hourly change in the gridded input, so without the line the gridded emissions appear to stay at their 01:00 values. The small changes that remain without the line seem to come from point sources and inline emissions, which go through other routines. With the line, my own runs also follow the diurnal cycle of the input for all 24 hours.

Versions

  • USEPA/MPAS MPAS7.0 branch (latest, commit 8828ff0a) + CMAQ MPAS_CMAQ branch (src/core_atmosphere/cmaq/centralized_io_module.F)
  • The same code appears to be in CMAQv6.0 (main, commit 13c473c8, 2026-10-09): CCTM/src/cio/centralized_io_module.F, r_interpolate_var_3d_mpas (starts at line 4797; the retrieve call is at line 4873)

Environment

  • Compiler: GNU Fortran 13.3.0 (Ubuntu 24.04) with MPICH 4.3.0, built with make gfortran CORE=atmosphere USE_PIO2=true
  • Run script: run_bench.csh (the benchmark run.csh adapted for a single workstation, 24 MPI tasks); for the test, only MPASEXE, RUNLEN=4, config_run_duration='0_04:00:00' and the output directory were changed
  • Application: the distributed 120 km uniform mesh (x1.40962), 2017-01-01, cracmm2_m3dry build, with the distributed benchmark inputs
  • I could not attach files as a new forum user; I am happy to share the comparison script and its full output (it also lists the DIAG/input ratios for every hour) if useful

Could you please let me know whether this change is correct, or whether I am misunderstanding how the emission files are meant to be read? I can share my run scripts as well.

Best regards,
Yuya Hasegawa

Thank you for reporting this issue and potential solution. Please try attaching files again, as your trust level has been updated.

Thank you very much for the quick reply and for updating my trust level.

I have attached:

  • nextime_fix.diff.txt: the one-line change in centralized_io_module.F (MPAS7.0 branch)
  • compare_bench_bug_fix.py.txt: the script I used to compare CCTM_EMIS_DIAG with the gridded emission input
  • compare_output.txt: its output for the 4-hour benchmark runs (SO2, NO, CO)
  • compare_distributed.txt: a cell-by-cell comparison of my runs with the distributed benchmark output

I also compared my runs with the distributed benchmark output on the mpas-cmaq S3 bucket (output/output_384_2x192_sycamore_one_day/CCTM_EMIS_DIAG_20170101.nc). Its hourly global totals match my run without the extra line, not the run with it:

Species Hour (UTC) distributed output my run without the line my run with the line
SO2 02 3.28271e4 3.28271e4 3.36469e4
SO2 03 3.28089e4 3.28089e4 3.58922e4
NO 02 7.39176e4 7.39175e4 7.73690e4
NO 03 7.43732e4 7.43705e4 7.91632e4
CO 02 6.89993e5 6.90034e5 6.80402e5
CO 03 6.92831e5 6.92829e5 6.71626e5

In the distributed output, SO2 also stays within 0.4% of its 01:00 value for the whole day.

A cell-by-cell comparison (compare_distributed.txt) gives the same picture. For SO2, the run without the line agrees with the distributed output to about 1e-8 at every hour, while the run with the line differs by 7–13% from 02:00 onward. NO and CO show small differences (up to about 1e-3) even without the line, which I think come from the inline soil NO and biogenic emissions with different numbers of MPI tasks (384 vs 24).

So the distributed benchmark output may be affected as well, unless I am missing something. Please let me know if you need anything else.

nextime_fix.diff.txt (679 Bytes)
compare_bench_bug_fix.py.txt (6.9 KB)
compare_output.txt (3.3 KB)
compare_distributed.txt (1.3 KB)