0

compile using gfortran

I'm sorry to ask questions so many times, but I can count on only this forum.
I read 
https://tough.forumbee.com/t/80xxf4/install-of-tough2 ,
and I'm facing the same (Ana Avila 's compiler) problem.

I want to compile eos1.f and make xt2_eos1.exe using gfortran.
So I put eos1.f into "Source_Core" folder with some tough2 souce files(T2,t2cg22.f,etc.),
and according to user's guide , I wrote on cmd
"gfortran -o xt2_eos1 -g -fdefault-real-8 -falign-commons t2fm.f eos1.f t2cg22.f meshm.f t2f.f t2solv.f",
and then the same error occured as Ana's.

In reference to 
https://tough.forumbee.com/t/633bj3 ,

(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

but I don't understand this replace.
In t2cg22.f, there is no SUBROUTINE SECOND, but SUBROUTINE SEC(SS) is.

**********************************************************************
      SUBROUTINE SEC(SS)
**********************************************************************
* Returns CPU-time                                                   *
**********************************************************************
      IMPLICIT NONE
      INTEGER ICALL
      REAL*4  S,SOLD

SAVE SOLD

      DATA ICALL/0/

ICALL=ICALL+1
      IF(ICALL.EQ.1) WRITE(11,7999)
 7999 FORMAT(6X,'CPUSEC   1.0       5 APRIL     2000',6X,
     &       'RETURNS CPU-TIME (PC, DVF)')

      CALL CPU_TIME(S)
      IF (ICALL.EQ.1) SOLD=S
      SS=S-SOLD
      END

So I replaced this SUBROUTINE SEC(SS) with SUBROUTINE CPUSEC(SS),
and then replaced all CALL SEC(**) in t2f.f and t2fm.f with CALL CPUSEC(**) ,
but it didn't go well.

What is wrong?

Thanks

5 replies

null
    • Finsterle GeoConsulting
    • Stefan_Finsterle
    • 8 yrs ago
    • Reported - view

    Dear Yamamoto,

    You can essentially put in any suitable subroutine that returns the CPU time (or throw it all out, as it is not essential). But here's my real question:

    What do you mean by "it didn't go well"?

    Please understand that without an error message, there is simply no way I can speculate "what is wrong".

    Thanks,

    Stefan

    • Yamamoto
    • 8 yrs ago
    • Reported - view

    Stefan,
    Sorry for the late reply.

    OK, please see the attached files.

    error1.txt is  the result of
    "gfortran -o xt2_eos1 -g -fdefault-real-8 -falign-commons t2fm.f eos1.f t2cg22.f meshm.f t2f.f t2solv.f"

    error2.txt is  the result of
    "gfortran -o xt2_eos1 -g -fdefault-real-8 -fno-align-commons t2fm.f eos1.f t2cg22.f meshm.f t2f.f t2solv.f"

    Their SUBROUTINE SECOND(SS) were replaced with SUBROUTINE CPUSEC(SS).

    Thanks 

    • Finsterle GeoConsulting
    • Stefan_Finsterle
    • 8 yrs ago
    • Reported - view

    Yamamoto,

    I don't see any error messages (only warnings, which can be ignored if the reason is understood, which it is). None of the messages is related to CPUSEC or SECOND. Were you able to generate an executable file? If not, what was the error message during linking? If an executable was generated, did it run? If not, what was the error message?

    Stefan

    • Yamamoto
    • 8 yrs ago
    • Reported - view

    Stefan,

    Oh, am I a stupid man?

    xt2_eos1.exe was there!

    The output file was not changed when using new xt2_eos1.exe, 

    so I was certain that the compilation succeeded.

    However, the new xt2_eos1.exe is 678kb, and the old one(not compile) is 1560kb, so I'm a little worried.

     

    Anyway, thanks Stefan, and I'm sorry to trouble you.

    It was a great help.

     

    Yamamoto

    • Finsterle GeoConsulting
    • Stefan_Finsterle
    • 8 yrs ago
    • Reported - view

    Dear Yamamoto-san,

    I'm glad the issue was resolved. 

    The size of the executable depends on compiler used, compiler options, and array dimensions.

    Regards,

    Stefan

Content aside

  • 8 yrs agoLast active
  • 5Replies
  • 1263Views
  • 2 Following