Time Stamp Issue to use MOZART output as CMAQ5.3 ICBC

CMAQ can use boundary conditions derived from global chemistry models (GCMs) like MOZART. I use mozart2camx to process mozart output and get CMAQ v5.3 IC, BC. However, CMAQ complains 1) IC is not time-dependent, and 2) BC has wrong time stamp. It is easy to fix the first issue by updating IC netcdf file TFLAG using NCO tool. For the 2nd, CMAQ requires hourly BC, but mozart2camx provides 6-hourly outputs only based on MOZART 6-hourly output time step. I wonder if anyone has the same issue or already has a fixation. I want to know how to update the processor or change CMAQ IC BC fortran codes to realize that CMAQ is able to read 6-hourly ICBC from MOZART successfully, otherwise.
For the MOZART processor for CAMx ICBC, please see http://www.camx.com/download/support-software.aspx.
THank you very much.

Use M3Tools program m3interp thttps://www.cmascenter.org/ioapi/documentation/all_versions/html/M3CPLE.html to interpolate 6-hour BC’s into 1-hour BC’s.

IMNHO as the original systems architect for CMAQ, I feel that it is improper for the input time steps to be hard-coded the way you describe. The original would work perfectly well with virtually any mix of time steps and/or time independence for its input files (e.g., 17 minute TSTEP for METCRO3d, 23 minutes for METDOT3D, time independent IC, 99 minute BC)

Hi cjcoats,
Thank you for your response. Using m3tools may be a good idea. But I need to look at how.
IC file should be time-independent in CMAQ v5.3. Otherwise it crashes with the following error messages:
I updated the TFLAG and changed TIME STEP into 0 in the proper time point input IC file. It worked and the error message is gone.
But CAMQ could not automatically deal with 6-hourly BC files. We do need to convert 6-hourly into hourly.
It is easy to figure out what is wrong by comparing log files with those from CMAQ v5.3 benchemark run.
Error for non time-independent IC file:
>>—>> WARNING in subroutine RDTFLAG
Error reading netCDF time step flag for INIT_CONC_1
M3WARN: DTBUF 0:00:00 Jan. 1, 2014 (2014001:000000)

 >>--->> WARNING in subroutine XTRACT3
 Time step not available for file:  INIT_CONC_1
 M3WARN:  DTBUF 0:00:00   Jan. 1, 2014  (2014001:000000)

 *** ERROR ABORT in subroutine retrieve_time_de on PE 006
 Could not extract INIT_CONC_1                              file

Error message for BC file

File name “.//Inp/icbc_36km/bc.36km.cmaq.cb62r.20140101.ncf”
File type BNDARY3
Execution ID “???”
Grid name “MCIP_36km_CROSS”
Dimensions: 79 rows, 92 cols, 23 lays, 66 vbles, 1 cells thick
NetCDF ID: 655360 opened as READONLY
Starting date and time 2014001:000000 (0:00:00 Jan. 1, 2014)
Timestep 060000 (6:00:00 hh:mm:ss)
Maximum current record number 5

>>—>> WARNING in subroutine RDTFLAG
Error reading netCDF time step flag for INIT_CONC_1
M3WARN: DTBUF 0:00:00 Jan. 1, 2014 (2014001:000000)

 >>--->> WARNING in subroutine XTRACT3
 Time step not available for file:  INIT_CONC_1
 M3WARN:  DTBUF 0:00:00   Jan. 1, 2014  (2014001:000000)

 *** ERROR ABORT in subroutine retrieve_time_de on PE 110
 Could not extract INIT_CONC_1                              file

PM3EXIT: DTBUF 0:00:00 Jan. 1, 2014

Hi fliu,

  1. Regarding the ability of CMAQ to handle boundary condition files with time steps other than 1 hour, we have posted a code update here. This code update will also be included with the next minor CMAQ release.

  2. Regarding the issue your reported with your IC file, CMAQv5.3 can handle both time-dependent files (e.g. CGRID files written out at the end of each simulation day which are used as initial conditions / restart file for the next simulation day) and time-independent files (e.g. initial conditions created by ICON in “profile” mode). The error you were encountering likely points to a mismatch between the time stamp in your time-dependent file created by mozart2camx and the time stamp expected by your CMAQ simulation, i.e. the requested date and time of Jan. 1, 2014 0:00:00 (2014001:000000) is not present in that IC file.

Thank you very much for the great updates. I replace the file with the new one according to the README - CMAQv5.3 Know Issues. But I get following errors when I recompile the CCTM. I have no idea and wonder if this code is still uncompleted. Thank you very much for taking the time to check.

PGF90-F-0004-Unable to open MODULE file centralized_io_module.mod (ASX_DATA_MOD.F: 86)
PGF90/x86-64 Linux 19.3-0: compilation aborted
make: *** [ASX_DATA_MOD.o] Error 2
ERROR while running make command

Christian Hogrefe,
I fixed the problem by re-downloading the code file. Now it works now. Thank you very much.


I want to compile and run mozart2camx. Could you help me on how to do that, please?
Thank you

Best regards,

Hello Ensiyeh,

please see our response to your duplicate question in a different thread. In the future, please do not post the same question in more than one thread.

The mozart2camx program is not part of the CMAQ suite of tools and is not supported by the CMAS center or the CMAQ development team. For questions regarding the program, we suggest following the instructions on the page where you downloaded the tar file:

"Support Software

This page contains links to CAMx pre- and post-processors and other tools. These source codes are distributed by Ramboll as free software, and they contain notices like this:

Copyright © 2016-2019 Ramboll
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Ramboll occasionally posts updates for certain widely-used programs when necessary, but does not actively support or maintain every one. Users can e-mail questions, comments, suggestions or improvements to CAMx."

1 Like

Hi cjcoats

I want to convert BC file with 6-hours time step to 1-hours time step. The BC file is Netcdf and I want to use m3interp from I/O API to do this work. Should we convert Netcdf to i/o api first? If yes, could you guide me on how to convert netcdf to i/o api, please?
Thank you

m3interp need I/O API input, so you need to do that conversion first.

Does CMAQ now require that the BC files have an hourly time-step? The original prototype did not care; it would time-interpolate from whatever timestep the BC’s had…


Thank you. I start a project with CMAQv5.2 and now I must work with it. Could you guide me how to convert netcdf file to I/O API file, please? I must interpolate BC file with m3interp and merge some data with m3cple. Could you help me, pleaese?

Thank you

Unfortunately, because of the complexity and lack of file-structure definition, “convert netcdf file to I/O API file” is almost an artificial- (or human-)intelligence problem: you don’t really know what to expect in the file, and you can’t always even use ncdump -h to tell you everything you need to know about the file; there may well be hidden (possibly un-documented) assumptions.


I can point you to several pieces of code that may help:

M3Tools programs camxtom3, wrftom3, and mpastom3 are examples of programs that read “foreign” input (CAMx-format binary, WRF-format netCDF, and MPAS-format netCDF (which, btw, is quite complicated)) and generate I/O API results. You can “borrow” the process of creating an I/O API file-definition, creating the corresponding output-file, and then writing the data to it from them.

There are three I/O API MODULEs that may be helpful for the netCDF input:

MODULE MODNCFIO has quite powerful high level facilities for reading (and writing) general gridded data to/from netCDF. It’s still a bit complicated and tedious, but much less so than doing the equivalent “raw” netCDF code.

MODULE MODWRFIO has (much simpler) routines for reading and writing gridded WRF-format netCDF; it is used by wrftom3 (above).

MODULE MODMPASFIO has the (complicated!) data structures needed for MPAS-format netCDF files, together with routines for reading and writing it, as well as unstructured-MPAS-grid utility routines; it is used by mpastom3 (above). Because MPAS uses unstructured (general-polygon, finite-element style) grids, all of this is rather more complicated than the rectangular-grid coding that we are accustomed to.

Incidentally, mpastom3 shows off some of the grid-to-grid transform and interpolation capabilities of MODULE MODGCTP

In your particular case, I’m afraid you’re a bit on your own but I hope these examples and codes help, and that you can find out enough about the format/structure of your particular netCDF files to work.

I hope that helps – Carlie

…and of course you have access both to documents and to source code for all these…

Thank you Carli
I used mozart2cmaq to produce ICBC, so if I use mozart2camx I can use camxtom3.
And I have emissions for camx (bin file) , so I can use camxtom3 again.
And finally, I use m3interp for interpolation and m3cple for merging. Is that right???
But there is a problem. There isn’t aero6 mechanism for aerosol in camx. So What do you think about MODULE MODNCFIO ? Could you guide me, please?
Thank you

That mozart2camx-camxtom3-m3interp sequence sounds rather a bit easier than what I was afraid you’d have to do (assuming “raw” netCDF).

For the aero6 mechanism problem, I don’t know; you’ll probably have to consult one of the aerosol chemistry people. you might try bringing it in as a new CMAS FORUM issue.

– Carlie

1 Like

Does CMAQ now require that the BC files have an hourly time-step? The original prototype did not care; it would time-interpolate from whatever timestep the BC’s had…

No, any CMAQ version other than CMAQv5.3 does not require BC files to have hourly time steps. CMAQv5.3 did have that limitation but it was addressed in CMAQv5.3.1. The CMAQv5.3 limitation was documented here, the code fix was posted here, and the CMAQv5.3.1 release notes also mention the fix. Also see posts 1 - 4 above for additional discussion.

@esm, unless you are using CMAQv5.3, you should not have to interpolate your BC files from 6-hourly to hourly time steps. If you are using CMAQv5.3, you probably want to switch to CMAQv5.3.1.

1 Like

Maybe a question I posed elsewhere in the forum would also be relevant here: