Airs2m3 compiling error / ioapi-3.2

Hi all,

I have enconuntered a problem compiling ioapi-3.2. The errro code shows:

cd /hpcfs/home/ca.moreno12/CMAQ_v5.3.1/LIBRARIES/ioapi-3.2/Linux2_x86_64ifort_intel20.2; mpiifort -auto -warn notruncated_source  airs2m3.o -L/hpcfs/home/ca.moreno12/CMAQ_v5.3.1/LIBRARIES/ioapi-3.2/Linux2_x86_64ifort_intel20.2 -lioapi -lnetcdff -lnetcdf -qopenmp   -o airs2m3
/hpcfs/home/ca.moreno12/CMAQ_v5.3.1/LIBRARIES/ioapi-3.2/Linux2_x86_64ifort_intel20.2/libioapi.a(getnum.o): In function `getnum_':
getnum.f:(.text+0x12e): undefined reference to `adjustl_'
getnum.f:(.text+0x18e): undefined reference to `adjustl_'
getnum.f:(.text+0x518): undefined reference to `adjustl_'
/hpcfs/home/ca.moreno12/CMAQ_v5.3.1/LIBRARIES/ioapi-3.2/Linux2_x86_64ifort_intel20.2/libioapi.a(getnum.o): In function `getint8_':
getnum.f:(.text+0x7d6): undefined reference to `adjustl_'
getnum.f:(.text+0x836): undefined reference to `adjustl_'
/hpcfs/home/ca.moreno12/CMAQ_v5.3.1/LIBRARIES/ioapi-3.2/Linux2_x86_64ifort_intel20.2/libioapi.a(getnum.o):getnum.f:(.text+0xbc4): more undefined references to `adjustl_' follow
make[1]: *** [airs2m3] Error 1
make[1]: Leaving directory `/hpcfs/home/ca.moreno12/CMAQ_v5.3.1/LIBRARIES/ioapi-3.2/m3tools'
make: *** [all] Error 2

Mi instalation is set on a CentOS 7.4 and uses Intel mpi compilers and mpi libraries.
The netcdf c (4.7.2) and fortran (4.5.2) whith --disable-netcdf-4 and --disable-dap options.

Other considerations that I had used in previous installations (I already had ioapi compiled but for an error I deleted it) are the -DIOAPI_NCF4=1 option in the Makeinclude file for ioapi and putting the mpiiccc, mpiicpc, and mpiifort variables in the same Makeinclude file.

These where the same options that I used on the installation that I accidentally deleted.

Does anyone knows what could be the problem?

Thaks!

See https://software.intel.com/content/www/us/en/develop/documentation/fortran-compiler-developer-guide-and-reference/top/language-reference/a-to-z-reference/a-to-b/adjustl.html:

ADJUSTL is a Fortran-90-Standard elemental intrinsic function. If your mpiifort compiler can’t find it, that would argue either a mis-installed compiler, or else something in the command-line which is preventing the compiler from looking in its standard (internal) library-path. And looking at your quoted text, that last is not happening.

Well, I think the source code getnum.f should be revised a little bit. ADJUSTL is an Intrinsic Procedures.
therefore, you need to change all CALL ADJUSTL( DEFSTR ) to DEFSTR = ADJUSTL( DEFSTR )

114c114
< CALL ADJUSTL( DEFSTR )

     DEFSTR = ADJUSTL( DEFSTR )

130c130
< CALL ADJUSTL( DEFSTR )

    DEFSTR = ADJUSTL( DEFSTR )

155c155
< CALL ADJUSTL( DEFSTR )

        DEFSTR = ADJUSTL( DEFSTR )

288c288
< CALL ADJUSTL( DEFSTR )

    DEFSTR = ADJUSTL( DEFSTR )

304c304
< CALL ADJUSTL( DEFSTR )

    DEFSTR = ADJUSTL( DEFSTR )

330c330
< CALL ADJUSTL( DEFSTR )

        DEFSTR = ADJUSTL( DEFSTR )

=========================================================

Hope this helps.

ZHUANSHI HE

1 Like

Thanks. – Carlie

Now fixed on GitHub; credited you in the Change-Log for reporting this. Will update the CMAS repository soon.

Thank you so much, now it works whith the code actualization!!!

Literally you saved my magister work!! :smile: