CMAQ 5.4 combine program fails to compile on gcc 13.3.0

Hi there:

I am attempting to compile the combine post-processing program for CMAQ 5.4, and have ran into an error. I am using gcc 13.3.0 on Ubuntu 24.04, which is running as a parallel cluster on Amazon Web Services. These are the modulefiles I am using:

  1. openmpi/4.1.7
  2. netcdf-4.8.1/gcc-9.5
  3. ioapi-3.2/gcc-9.5-netcdf
  4. libfabric-aws/2.4.0amzn1.0

I am able to generate a makefile, but the make command fails with this error:

I have very little experiencing writing or compiling Fortran, so I can’t say for sure if there is a problem in the source files, but I did look up the particular error that it generated and found a UCAR forum post by someone talking about this exact error in regards to WRF ( How to Fix: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1) | WRF & MPAS-A Support Forum ).

Apparently there are some Fortran commands that have been deprecated starting at gcc 9.0, and the post goes into the fixes one could do. I don’t know what datatypes VGTOP3D, VGLVS3D, or specValue are, but it stands to reason that if they are indeed different as the error message seems to suggest, those operations that were kosher in gcc <9.0 can no longer compile. I’m wondering if there is any merit to the fixes suggested, and if so, which environment variables in config_cmaq.csh need to be edited in order to make the compiler play nice. For further context, these are the bash commands that are suggested.

export fallow_argument=-fallow-argument-mismatch
export boz_argument=-fallow-invalid-boz

export FFLAGS="$fallow_argument $boz_argument -m64"
export FCFLAGS="$fallow_argument $boz_argument -m64"

Hello @anders.carlson ,

the combine post-processing program was updated in 2024 to address this issue by removing the portions of the code in module_file.F that caused this issue since it was determined that these portions of the code were unused in the first place.

Please see this commit message in the public CMAQ code repository for a bit of extra discussion and update to the latest version of the combine code to solve this issue.

Thanks! I removed those lines manually and it compiled okay. The executable ran as well, so looks like that fixed everything.