USEPA / CMAQ

Code for U.S. EPA’s Community Multiscale Air Quality Model (CMAQ) which helps in conducting air quality model simulations
https://epa.gov/CMAQ
MIT License
282 stars 202 forks source link

CMAQ will not work on macOS #169

Closed climbfuji closed 2 years ago

climbfuji commented 2 years ago

Description The existence of the following files permits building or even doing any git work on macOS:

UTIL/create_ebi/src_RXNSU/junit.f
UTIL/create_ebi/src_RXNSU/junit.F
UTIL/inline_phot_preproc/src/CSQY_DATA.f
UTIL/inline_phot_preproc/src/CSQY_DATA.F

It also breaks any build system that attempts to automatically update branches from the authoritative repositories, because there are always changes to these files that result in unresolvable conflicts. This is because macOS uses a pseudo case-sensitive filesystem and doesn't recognize that UTIL/create_ebi/src_RXNSU/junit.f and UTIL/create_ebi/src_RXNSU/junit.F are different files.

If the .f versions of the two files above are preprocessed from the .F files and were mistakenly added to the repository, then these should be removed.

Scope and Impact See above

Solution Remove the two .f files and do preprocessing on the fly (if a two-step approach = preprocessing+compiling is preferred, then the preprocessor must write to .tmp.f instead of .f, or another problem will be created).

climbfuji commented 2 years ago

@junwang-noaa @dusanjovic-noaa @briancurtis-noaa This will cause problems with the ufs-weather-model (it actually causes problems already if the ufs-weather-model is included in a bigger build system, for example as external package).

bhutzell commented 2 years ago

Please try the below two solutions.

For UTIL/create_ebi, I agree:

  1. Removing the UTIL/create_ebi/src/junit.f is fine and preferable because the Makefile does not require changes.
    Note that creating junit.o does not require FORTRAN preprocessing.

For UTIL/ inline_phot_preproc, try

  1. Deleting UTIL/inline_phot_preproc/src/CSQY_DATA.F, UTIL/inline_phot_preproc/src/CSQY_DATA.f, UTIL/inline_phot_preproc/src/CSQY_DATA_gen.f and UTIL/inline_phot_preproc/src/CSQY_DATA_old.f Why? Building this utility does not use the source code files.
climbfuji commented 2 years ago

Please try the below two solutions.

For UTIL/create_ebi, I agree:

  1. Removing the UTIL/create_ebi/src/junit.f is fine and preferable because the Makefile does not require changes. Note that creating junit.o does not require FORTRAN preprocessing.

For UTIL/ inline_phot_preproc, try

  1. Deleting UTIL/inline_phot_preproc/src/CSQY_DATA.F, UTIL/inline_phot_preproc/src/CSQY_DATA.f, UTIL/inline_phot_preproc/src/CSQY_DATA_gen.f and UTIL/inline_phot_preproc/src/CSQY_DATA_old.f Why? Building this utility does not use the source code files.

@bhutzell Thanks for the pointers, is this mean to be a solution that can be merged back into the repository?

I can always work around on my local machine, but the system has to work out of the box. For instance, after a recursive clone of the ufs-weather-model (where CMAQ is a nested submodule of), the user has to be able to compile the code without any manual intervention.

kmfoley commented 2 years ago

@climbfuji We are working to get this update merged into our v5.3.3+ branch. I will let you know when it is merged and ready to be used. The update will also be included in our next release, v5.4, this fall.

climbfuji commented 2 years ago

That sounds great, thanks a lot for doing this!

On Apr 20, 2022, at 8:13 AM, Kristen Foley @.***> wrote:

@climbfuji https://github.com/climbfuji We are working to get this update merged into our v5.3.3+ branch https://github.com/USEPA/CMAQ/tree/5.3.3+. I will let you know when it is merged and ready to be used. The update will also be included in our next release, v5.4, this fall.

— Reply to this email directly, view it on GitHub https://github.com/USEPA/CMAQ/issues/169#issuecomment-1103983962, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5C2RJTBQOBJ3ZF37LWARDVGAGKBANCNFSM5TFCOHYQ. You are receiving this because you were mentioned.

kmfoley commented 2 years ago

This issue is now resolved in the code on the v5.3.3+ branch. Tag: CMAQv5.3.3.2_7May2022

climbfuji commented 2 years ago

Thanks very much, @kmfoley !