0

Error on installation

I'm trying to install TOUGH2 for EOS2 and I'm having trouble in the compilation. I'm not sure if the code is right and when I type it, I receive this message. Do you know how I can correct it?

 

gfortran -o xt2_eos2 -g -freal-4-real-8 -fno-align-commons -std=legacy t2cg2.f meshm.f eos2.f t2f.f t2solv.f ma28.f

t2cg2.f:433.18:

      CALL SECOND(TZERO)
                  1
Error: 'time' argument of 'second' intrinsic at (1) must be of kind 4
t2cg2.f:475.18:

      CALL SECOND(ELT1)
                  1
Error: 'time' argument of 'second' intrinsic at (1) must be of kind 4
t2cg2.f:655.18:

      CALL SECOND(ELT)
                  1
Error: 'time' argument of 'second' intrinsic at (1) must be of kind 4
t2f.f:1998.18:

      CALL SECOND(TCUR)
                  1
Error: 'time' argument of 'second' intrinsic at (1) must be of kind 4
t2f.f:4506.18:

      CALL SECOND(T2)
                  1
Error: 'time' argument of 'second' intrinsic at (1) must be of kind 4

2replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Dear Jessica,

    Let me first give a general reply to this frequent question, and then give you very specific instructions for using gfortran.

    General:

    This issue is described in the read-me file that came with TOUGH2.

    Subroutine SECOND (see file t2cg22.f) is supposed to return the CPU time. It calls a system function that - unfortunately - is platform specific and/or compiler dependent. Typical system functions include etime(), second(), cpu_time(), mclock(), and timer(). You have to check your FORTRAN language reference to see what the CPU timing function is for your system, and what arguments it takes. Then customize subroutine SECOND accordingly. Since CPU time is not an essential part of a TOUGH simulation, you may also decide to return zero or simply comment it (and the few "CALL SECOND) out.

    Specific Instructions for gfortran

    In gfortran, SECOND is itself the intrinsic function that returns the elapsed CPU time. However, it requires a REAL*4 argument (not the REAL*8 variable used in TOUGH2; this is what your error message indicates). The easiest way to make it all work is therefore to:

    (1) Replace all "CALL SECOND" with "CALL CPUSEC"

    (2) In t2cg22.f, replace SUBROUTINE SECOND with the following:

    **********************************************************************
          SUBROUTINE CPUSEC(SS)
    **********************************************************************
          REAL*8  SS
          REAL*4  S
          S=SECOND()
          SS=S
          END

     

    Hope this helps!

     

    Stefan

    Like
  • Thank you, Stefan! It worked!

     

    Jessica

    Like
Like Follow
  • 6 yrs agoLast active
  • 2Replies
  • 957Views
  • 2 Following