MCIP v5.3.3 error when processing WRFchem output

Hello,
I am trying to compare spatial-temporal patterns of some target species simulated by CMAQ and WRFchem, I tried to use MCIP (v5.3.3) to process WRFchem (v4.3.3) outputs in order to get the same meteorology input to CMAQ. I then got trouble due to the following errors:


*** SUBROUTINE: SETUP
*** UNKNOWN OR UNSUPPORTED WRF OUTPUT VERSION
*** VERSION = OUTPUT FROM * PROGRAM:WRF-Chem V4.3.3 MODEL


I checked the routine where the error comes from and commented out two lines with

CALL graceful_stop (pname)

and let MCIP keep going but I failed to realize to process WRFchem with MCIP due to more errors as below:


*** SUBROUTINE: SETUP
*** UNKNOWN WRF OUTPUT VERSION
*** IVERSION = 0
*** GRIDTYPE = C



*** SUBROUTINE: SETGRIDDEFS
*** MCIP lower-left corner is not in met domain
*** X0, Y0 = 5 5
*** NX, NY = 0 0


 *** ERROR ABORT in subroutine SETGRIDDEFS
 ABNORMAL TERMINATION IN SETGRIDDEFS
 Date and time  0:00:00   July 3, 2018    (2018184:000000)

My questions are:

Is MCIP set up to run from WRFchem outputs?

If YES, what is wrong for my case?

If NO, how to get same meteorology fields from WRFchem to feed CMAQ?

Do we need to run WRF without chemistry after we ran WRFchem already? If this is answer, we never have the completely same meteorology for both CAMQ and WRFchem because WRF w/o chemistry will be different because gas and aerosol chemistry processes will update meteorological conditions. Then it becomes difficulty and challenge to compare CMAQ and WRFchem under the the same meteorology.

I would highly appreciate if you could have comments and suggestions to help.

F. Liu

@FengLiu

I did not make the effort to explicitly allow MCIP to handle data from WRF-Chem, but I did not explicitly stop it either. In some ways, I figured that it made little sense to want to use data from WRF-Chem to run CMAQ, largely because the WRF-Chem output has already been influenced by interactions with chemistry through the coupled model in that system. I’m not sure I follow the scientific merit of using WRF-Chem output in CMAQ.

If you want to proceed, there are probably a few changes that will need to be made to MCIP. From the error messages that you provided, the internal variables IVERSION, NX, and NY were not set properly.

To set IVERSION correctly, you will need to insert some code in MCIP setup.f90 near line 127 to account for the global attribute, TITLE, to include “WRF-Chem”. Because of the way the TITLE variable is populated in WRF with a lot of blank spaces (in the the WRF routine, chem/chemics.F), to do this correctly, please consider using the Fortran intrinsic, SCAN, to locate whether “Chem” appears in the internal string loaded from TITLE into the MCIP variable, “wrfversion”. You will want to set the internal MCIP variable for met_iversion to 2. For simplicity and to see if you encounter other errors, consider (temporarily) commenting out MCIP setup.f90 lines 127 and 129-132. If that works, then I can help you with the syntax for the SCAN function, if you want.

Assuming that setting met_iversion also messed up NX and NY, we can see whether you encounter other errors. The variables NX and NY should be the domain dimensions (west-east and south-north) from your WRF domain.

Please keep me posted.

–Tanya

That needs to be INDEX, not SCAN: see https://gcc.gnu.org/onlinedocs/gfortran/SCAN.html:

RESULT = SCAN(STRING, SET[, BACK [, KIND]])
Scans a STRING for any of the characters in a SET of characters.

whereas see https://gcc.gnu.org/onlinedocs/gfortran/INDEX-intrinsic.html

RESULT = INDEX(STRING, SUBSTRING [, BACK [, KIND]])
Returns the position of the start of the first occurrence of string SUBSTRING as a substring in STRING…

@cjcoats

I really meant SCAN, not INDEX. In this case, I don’t care where “WRF-Chem” appears in the string. Instead, I just want to know whether it is part of the string. If SCAN is case-sensitive, then my suggestion is correct. Otherwise, I appreciate the correction.

–Tanya

No. Read the references (maybe Intel does a better explanation here: https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/language-reference/a-to-z-reference/s-1/scan-function.html)

SCAN does not ask whether “WRF-Chem” appears in the string. That is the question INDEX answers (it returns a positive result in that case, zero otherwise.

Instead, SCAN asks whether any one of the characters 'W', 'R', 'F', '-', 'C', 'h', 'e', 'm' occurs within the string and if so, what is the first location at which any of them occurs.

@cjcoats

You are correct. Thank you for the clarification.

–Tanya

@tlspero -
Hi Tanya,

Thank you very much for your response.

YES, “…the WRF-Chem output has already been influenced by interactions with chemistry through the coupled model in that system”, you are right. However, meteorology is never influenced by chemistry processes and has no feedback from atmospheric chemistry if driving CMAQ by offline WRF outputs. But in fact it is not true. I need meteorology from WRF-Chem to drive CMAQ and see how meteorology already adjusted by interactions with chemistry to influence chemistry because offline CMAQ is not able to realize chemical feedback effects on meteorology. The key issue here for the comparison is that the chemistry mechanism may be different from CMAQ and WRF-Chem that provide different feedbacks to meteorology. But comparison between CMAQ driven by meteorology from outputs of WRF and WRF-Chem is scientifically meaningful to understand interactions between meteorology and chemistry in one way offline model.

BTW, The comparison between online coupled models like CMAQ-WRF and WRF-chem is also conducted at the same time.

@tlspero @cjcoats
I will make some changes in routine setup.f90 according to your suggestions and try make MCIP is suitable for processing data from WRF-Chem.

Thank you very much for your time and comments.

Feng

Feng,
Are you aware that there exists a coupled version of WRF-CMAQ?
It sounds like you are interested in comparing two runs of that model, one with feedbacks turned on and one without the feedbacks. Or, if you’re interested specifically in the influence of different chemical mechanisms on the meteorology, perhaps you should compare coupled WRF-CMAQ with WRF-Chem?

@cgnolte ,

Thanks you for your reply and comments.

I am more interested in comparing chemistry results between online and offline models using the same chemistry mechanism.

Feng

In that case, it seems to me you should use either WRF-CMAQ or WRF-Chem, rather than a hybrid between the two.

@cgnolte,

Thank you for your suggestion, I do work on model performance evaluation for both WRF-CMAQ and WRF-Chem. In order not to mislead and confuse CMAQ users, you can close this post. I am no longer replying any questions about this topic.

BTW, I can now process WRF-Chem outputs by using updated MCIP.

Thanks,

Feng