Ioapi error installation

Hi team.
I have compiled accordingly but still no success.
FYI, i’m using CentOS7 with gcc.

(cd /usr/local/ioapi/ioapi ; make fixed_src)
make[1]: Entering directory /usr/local/ioapi/ioapi' make[1]: Nothing to be done for fixed_src’.
make[1]: Leaving directory /usr/local/ioapi/ioapi' (cd /usr/local/ioapi/ioapi ; sed -e 's|IOAPI_BASE|/usr/local/ioapi|' -e 's|LIBINSTALL|/home/ikhsan/CMAQ/ioapi/lib|' -e 's|BININSTALL|/home/ikhsan/CMAQ/ioapi/bin|' -e 's|IOAPI_DEFS||' -e 's|NCFLIBS|-L/usr/local/netcdf4/lib -lnetcdf -lnetcdff|' -e 's|MAKEINCLUDE|include /usr/local/ioapi/ioapi/Makeinclude|' -e 's|PVMINCLUDE|include /dev/null|' < Makefile.nocpl.sed > Makefile ) (cd /usr/local/ioapi/m3tools ; sed -e 's|IOAPI_BASE|/usr/local/ioapi|' -e 's|LIBINSTALL|/home/ikhsan/CMAQ/ioapi/lib|' -e 's|BININSTALL|/home/ikhsan/CMAQ/ioapi/bin|' -e 's|IOAPI_DEFS||' -e 's|NCFLIBS|-L/usr/local/netcdf4/lib -lnetcdf -lnetcdff|' -e 's|MAKEINCLUDE|include /usr/local/ioapi/ioapi/Makeinclude|' -e 's|PVMINCLUDE|include /dev/null|' < Makefile.nocpl.sed > Makefile ) (cd /usr/local/ioapi/ioapi ; make BIN=Linux2_x86_64 all) make[1]: Entering directory /usr/local/ioapi/ioapi’
cd /usr/local/ioapi/Linux2_x86_64; ar rsv libioapi.a m3utilio.o modgctp.o modwrfio.o modmpasfio.o modatts3.o modncfio.o modpdata.o
r - m3utilio.o
r - modgctp.o
r - modwrfio.o
r - modmpasfio.o
r - modatts3.o
r - modncfio.o
r - modpdata.o
cd /usr/local/ioapi/Linux2_x86_64; ar rsv libioapi.a bilin.o bmatvec.o chkbuf3.o ckdesc3.o ckfile3.o ckgeom.o ckname.o crtbuf3.o currstep.o dble2real.o dbllist.o dmatvec.o dscgrid.o dt2str.o filchk3.o find1.o find2.o find3.o find4.o findc.o findr1.o findr2.o findr3.o findr4.o flush3.o gcd.o gctp.o getdble.o getmenu.o getnum.o getreal.o getstr.o getyn.o grdchk3.o gridops.o hhmmss.o index1.o initblk3.o intg2real.o intlist.o ioparms3.o lambert.o lblank.o len2.o ll2utm.o locat1.o locat2.o locat3.o locat4.o locatc.o locatr1.o locatr2.o locatr3.o locatr4.o lustr.o m3warn.o name2fid.o pcoef.o pgrdsum.o pmatvec.o poly.o promptdfile.o promptffile.o promptgrid.o promptmfile.o rdbndary.o rdbuf3.o rdcustom.o rdgrdded.o readsmet.o realist.o scanint.o setsphere.o sec2time.o str2dble.o skipl.o smatvec.o splitline.o str2int.o str2real.o strlist.o synchtao.o time2sec.o trimlen.o ungridb.o ungridi.o upcase.o utm2ll.o wrbndary.o wrbuf3.o wrcustom.o wrgrdded.o xtbuf3.o year4.o chkfil3.o cktflag3.o crdict3.o crtkf.o kfindx.o kfopen.o m3abort.o modgctp.o opnlist3.o rddict3.o rdiddata.o rdsmatrx.o runspec.o sync3.o wrdict3.o wriddata.o wrsmatrx.o xtract3.o
r - bilin.o
r - bmatvec.o
r - chkbuf3.o
r - ckdesc3.o
r - ckfile3.o
r - ckgeom.o
r - ckname.o
r - crtbuf3.o
r - currstep.o
r - dble2real.o
r - dbllist.o
r - dmatvec.o
r - dscgrid.o
r - dt2str.o
r - filchk3.o
r - find1.o
r - find2.o
r - find3.o
r - find4.o
r - findc.o
r - findr1.o
r - findr2.o
r - findr3.o
r - findr4.o
r - flush3.o
r - gcd.o
r - gctp.o
r - getdble.o
r - getmenu.o
r - getnum.o
r - getreal.o
r - getstr.o
r - getyn.o
r - grdchk3.o
r - gridops.o
r - hhmmss.o
r - index1.o
r - initblk3.o
r - intg2real.o
r - intlist.o
r - ioparms3.o
r - lambert.o
r - lblank.o
r - len2.o
r - ll2utm.o
r - locat1.o
r - locat2.o
r - locat3.o
r - locat4.o
r - locatc.o
r - locatr1.o
r - locatr2.o
r - locatr3.o
r - locatr4.o
r - lustr.o
r - m3warn.o
r - name2fid.o
r - pcoef.o
r - pgrdsum.o
r - pmatvec.o
r - poly.o
r - promptdfile.o
r - promptffile.o
r - promptgrid.o
r - promptmfile.o
r - rdbndary.o
r - rdbuf3.o
r - rdcustom.o
r - rdgrdded.o
r - readsmet.o
r - realist.o
r - scanint.o
r - setsphere.o
r - sec2time.o
r - str2dble.o
r - skipl.o
r - smatvec.o
r - splitline.o
r - str2int.o
r - str2real.o
r - strlist.o
r - synchtao.o
r - time2sec.o
r - trimlen.o
r - ungridb.o
r - ungridi.o
r - upcase.o
r - utm2ll.o
r - wrbndary.o
r - wrbuf3.o
r - wrcustom.o
r - wrgrdded.o
r - xtbuf3.o
r - year4.o
r - chkfil3.o
r - cktflag3.o
r - crdict3.o
r - crtkf.o
r - kfindx.o
r - kfopen.o
r - m3abort.o
r - modgctp.o
r - opnlist3.o
r - rddict3.o
r - rdiddata.o
r - rdsmatrx.o
r - runspec.o
r - sync3.o
r - wrdict3.o
r - wriddata.o
r - wrsmatrx.o
r - xtract3.o
cd /usr/local/ioapi/Linux2_x86_64; ar rsv libioapi.a cbarnes1.o cbarnesN.o check3.o crlf.o currec.o daymon.o ddtvar3.o ddtvar3v.o getdate.o getdfile.o getefile.o getffile.o initlog3.o interp3.o isdstime.o jstep3.o julian.o junit.o m3err.o m3exit.o m3msg2.o mmddyy.o nextime.o read3.o read4d.o secsdiff.o wkday.o write3.o write4d.o yr2day.o close3.o crtfil3.o desc3.o init3.o inqatt3.o kfread.o kfwrite.o open3.o opnfil3.o opnkf.o opnlog3.o pn_crtfil3.o pn_opnfil3.o pn_wrvars.o rdatt3.o rdgrnest.o rdprofil.o rdtflag.o rdvars.o shut3.o syncfid.o wratt3.o wrgrnest.o wrmpigrd.o wrpatch.o wrprofil.o wrtflag.o wrvars.o
r - cbarnes1.o
r - cbarnesN.o
r - check3.o
r - crlf.o
r - currec.o
r - daymon.o
r - ddtvar3.o
r - ddtvar3v.o
r - getdate.o
r - getdfile.o
r - getefile.o
r - getffile.o
r - initlog3.o
r - interp3.o
r - isdstime.o
r - jstep3.o
r - julian.o
r - junit.o
r - m3err.o
r - m3exit.o
r - m3msg2.o
r - mmddyy.o
r - nextime.o
r - read3.o
r - read4d.o
r - secsdiff.o
r - wkday.o
r - write3.o
r - write4d.o
r - yr2day.o
r - close3.o
r - crtfil3.o
r - desc3.o
r - init3.o
r - inqatt3.o
r - kfread.o
r - kfwrite.o
r - open3.o
r - opnfil3.o
r - opnkf.o
r - opnlog3.o
r - pn_crtfil3.o
r - pn_opnfil3.o
r - pn_wrvars.o
r - rdatt3.o
r - rdgrnest.o
r - rdprofil.o
r - rdtflag.o
r - rdvars.o
r - shut3.o
r - syncfid.o
r - wratt3.o
r - wrgrnest.o
r - wrmpigrd.o
r - wrpatch.o
r - wrprofil.o
r - wrtflag.o
r - wrvars.o
cd /usr/local/ioapi/Linux2_x86_64; ar rsv libioapi.a bufint3.o check3c.o close3c.o currstepc.o daymonc.o ddtvar3c.o desc3c.o dscgridc.o dt2strc.o envgets.o filchk3c.o findsc.o get_endian.o getdfilec.o getdttime.o getefilec.o hhmmssc.o init3c.o inqatt3c.o interp3c.o iobin3.o julianc.o locatsc.o m3errc.o m3exitc.o m3mesgc.o m3warnc.o mmddyyc.o nameval.o nextimec.o open3c.o rdatt3c.o read3c.o read4dc.o rmfile.o sec2timec.o secsdiffc.o shut3c.o sleep3.o sortic.o sortir.o sortis.o sync3c.o systemf.o time2secc.o wkdayc.o wratt3c.o write3c.o write4dc.o xtract3c.o iocpl.o iocplf2c.o
r - bufint3.o
r - check3c.o
r - close3c.o
r - currstepc.o
r - daymonc.o
r - ddtvar3c.o
r - desc3c.o
r - dscgridc.o
r - dt2strc.o
r - envgets.o
r - filchk3c.o
r - findsc.o
r - get_endian.o
r - getdfilec.o
r - getdttime.o
r - getefilec.o
r - hhmmssc.o
r - init3c.o
r - inqatt3c.o
r - interp3c.o
r - iobin3.o
r - julianc.o
r - locatsc.o
r - m3errc.o
r - m3exitc.o
r - m3mesgc.o
r - m3warnc.o
r - mmddyyc.o
r - nameval.o
r - nextimec.o
r - open3c.o
r - rdatt3c.o
r - read3c.o
r - read4dc.o
r - rmfile.o
r - sec2timec.o
r - secsdiffc.o
r - shut3c.o
r - sleep3.o
r - sortic.o
r - sortir.o
r - sortis.o
r - sync3c.o
r - systemf.o
r - time2secc.o
r - wkdayc.o
r - wratt3c.o
r - write3c.o
r - write4dc.o
r - xtract3c.o
r - iocpl.o
r - iocplf2c.o
make[1]: Leaving directory /usr/local/ioapi/ioapi' (cd /usr/local/ioapi/m3tools ; make BIN=Linux2_x86_64 all) make[1]: Entering directory /usr/local/ioapi/m3tools’
cd /usr/local/ioapi/Linux2_x86_64; gfortran /usr/local/ioapi/Linux2_x86_64/datshift.o -L/usr/local/ioapi/Linux2_x86_64 -lioapi -L/usr/local/netcdf4/lib -lnetcdf -lnetcdff -fopenmp -dynamic -L/usr/local/netcdf4/lib -lm -lpthread -lc -o datshift
/usr/local/ioapi/Linux2_x86_64/datshift.o: In function MAIN__': datshift.f90:(.text+0x1f): undefined reference to iargc_’
collect2: error: ld returned 1 exit status
make[1]: *** [datshift] Error 1
make[1]: Leaving directory `/usr/local/ioapi/m3tools’
make: *** [all] Error 2

Regards,
ikhsan

Welcome to the joys of how gfortran fails to be compatible with itself, from version to version.

For your version of gfortran, go to ioapi/Makeinclude.Linux2_x86 and make sure NEED_ARGS=1 is active in ARCHFLAGS: it now should be
ARCHFLAGS =
-DAUTO_ARRAYS=1
-DF90=1 -DFLDMN=1
-DFSTR_L=int
-DIOAPI_NO_STDOUT=1
-DNEED_ARGS=1

Then do make clean; make first in the ioapi directory, then in the m3tools directory.