How to output one nc file with MEGANv3.2

Hi everyone
I run MEGANv3.2 to get input for CMAQv5.4, but the result of MEGANv3.2 is daily.


I want to combine these nc files into one. I used “cdo mergetime *.nc result.nc” but it will change the “TSTEP” dimension name to “time”. I also used “ncrcat .nc result.nc” and the result will have NaN which causes abort in CMAQ.
Any suggestions will be welcomed.
Li

This is a frequently asked question.

See https://cjcoats.github.io/ioapi/M3CPLE.html:

Note that repeated copy-operations may be used to concatenate multiple files that have the same grid and set of variables: for example, if FILE1 has hourly data from 2018017:00 through 2018018:00 and FILE2 has hourly data from 2018018:00 through 2018019:00, a M3CPLE using FILE2 as infile and FILE1 as outfile may be used to copy the 2018018:01-2018019:00 data from FILE2 to FILE1. Repeated runs of this sort may be used to construct month-, year-, or even decade-long files from a (large) set of single-day files…

Another option is to run MEGAN 3.2 inline, which will give (almost) the exact same result as running offline. In other words, you can pass CMAQ the time independent MEGAN inputs instead of those daily MEGAN emission outputs.

See: CMAQ/DOCS/Users_Guide/CMAQ_UG_ch04_model_inputs.md at main · USEPA/CMAQ · GitHub

Environment Variable Name for File File Type Time-Dependence Spatial Dimensions Source Required
MEGAN_CTS GRDDED3 Time-invariant XYZ MEGAN preprocessor required for running CMAQ with online MEGAN biogenics
MEGAN_LDF GRDDED3 Time-invariant XY MEGAN preprocessor required for running CMAQ with online MEGAN biogenics
MEGAN_EFS GRDDED3 Time-invariant XY MEGAN preprocessor required for running CMAQ with online MEGAN biogenics
MEGAN_LAI GRDDED3 Time-invariant XY MEGAN preprocessor optional for running CMAQ with online MEGAN biogenics
BDSNP_AFILE GRDDED3 Time-invariant XY MEGAN preprocessor required for BDSNP soil NO
BDSNP_NAFILE GRDDED3 Time-invariant XY MEGAN preprocessor required for BDSNP soil NO model
BDSNP_LFILE GRDDED3 Time-invariant XY MEGAN preprocessor required for BDSNP soil NO model
BDSNP_FFILE GRDDED3 Time-invariant XY MEGAN preprocessor required for BDSNP soil NO model
BDSNP_NFILE GRDDED3 Time-invariant XY MEGAN preprocessor required for BDSNP soil NO model

Then set these in the run script:

setenv CTM_BIOGEMIS_MG Y #> turns on MEGAN biogenic emission [ default: N ]
setenv BDSNP_MEGAN Y #> turns on BDSNP soil NO emissions [ default: N ]
setenv USE_MEGAN_LAI Y #> Uses MEGAN LAI input (only compatible with 8-daily)

Hi cjcoats
Thank you very much for your help.

Hi Willison.jeff
Thank you very much for your help. I will try this version in the future.