Error when compile SMOKEv4.7

Hello everyone

I am trying to compile smokev4.7 on linux platform (ubuntu 16.04 x64) following the instructions at https://www.cmascenter.org/smoke/documentation/4.7/html/ch12.html.
When I execute make command, I get an error message like below (I’m not good at programming) and I don’t understand what happened.

Help me solve this problem.

I appreciate everyone’s help.

cd /home/hdong/SMOKEv4.7/subsys/smoke/src/../Linux2_x86_64gfort; gfortran -I/home/hdong/SMOKEv4.7/subsys/ioapi/ioapi/fixed_src -I/home/hdong/SMOKEv4.7/subsys/smoke/src/inc -I/home/hdong/SMOKEv4.7/subsys/ioapi/Linux2_x86_64gfort -ffixed-line-length-132 -fno-backslash -O3 -ffast-math -funroll-loops -m64 -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DNEED_ARGS=1 -c /home/hdong/SMOKEv4.7/subsys/smoke/src/biog/normbeis361.f

/home/hdong/SMOKEv4.7/subsys/smoke/src/biog/normbeis361.f:163:22:

INTEGER :: IS_AG, IS_TAG

1

Error: Return type mismatch of function ‘is_ag’ at (1) (INTEGER(4)/LOGICAL(4))

/home/hdong/SMOKEv4.7/subsys/smoke/src/biog/normbeis361.f:693:36:

IF (IS_AG( M, MODIS12 , MODIS14, NLCD81,

1

Error: IF clause at (1) requires a scalar LOGICAL expression

/home/hdong/SMOKEv4.7/subsys/smoke/src/biog/normbeis361.f:163:30: Error: Return type mismatch of function ‘is_tag’ at (1) (INTEGER(4)/LOGICAL(4))

/home/hdong/SMOKEv4.7/subsys/smoke/src/biog/normbeis361.f:719:40:

IF( IS_TAG (M,MODIS14) ) THEN

1

Error: IF clause at (1) requires a scalar LOGICAL expression

Makefile:348: recipe for target 'normbeis361.o' failed

make: *** [normbeis361.o] Error 1

this is a bug (about which (some versions of) gfortran is more stuffy than ifort or pgif90).
Replace

/home/hdong/SMOKEv4.7/subsys/smoke/src/biog/normbeis361.f:163:22:
    INTEGER :: IS_AG, IS_TAG

with
LOGICAL :: IS_AG, IS_TAG

Thanks for your help but I got another error like this:

*-L/home/hdong/SMOKEv4.7/subsys/smoke/src/…/Linux2_x86_64gfort -lfileset -lsmoke -lemmod -lfileset -lsmoke -L/home/hdong/SMOKEv4.7/subsys/ioapi/Linux2_x86_64gfort -lioapi -lnetcdff -lnetcdf -fopenmp -dynamic -L/usr/lib64 -lm -lpthread -lc *
rdinvsrcs.o: In function rdinvsrcs_':* *rdinvsrcs.f:(.text+0x3f6): undefined reference to getpid_’
collect2: error: ld returned 1 exit status
Makefile:717: recipe for target ‘smkinven’ failed
make: *** [smkinven] Error 1

I have learned and known this is the getpid function of IFPORT, but I use gfort.
How to solve this problem.

This is one of those places where gfortran fails to follow standards.

Short version: remove GETPID from smkinven/rdinvsrcs.f (at or about line 87).

Long version: the Fortran Standard specifies which functions are INTRINSIC (and built into the language itself); other functions should be declared EXTERNAL. gfortran takes it on itself to change this list, leading to the problem you see…

Many thanks for your comments.
I have successfully compiled.