Fortran runtime error when starting solver from ElmerGUI

Discussion about building and installing Elmer
Post Reply
sofia
Posts: 3
Joined: 03 Jan 2021, 07:20
Antispam: Yes

Fortran runtime error when starting solver from ElmerGUI

Post by sofia »

Hi all,
I encounter this Fortran runtime error when start solver from ElmerGUI:

Code: Select all

Fortran runtime error: Incorrect extent in VALUE argument to DATE_AND_TIME intrinsic: is 1, should be >=8

Error termination. Backtrace:
#0  0x7f88f513b38d in ???
#1  0x7f88f513bf25 in ???
#2  0x7f88f513c217 in ???
#3  0x7f88f535a0b2 in ???
#4  0x7f88f56bd663 in __generalutils_MOD_formatdate
	at /home/zhiy/Elmer/fem/src/GeneralUtils.F90:318
#5  0x5570050c6fe9 in solver
	at /home/zhiy/Elmer/fem/src/Solver.F90:52
#6  0x5570050c6dfe in main
	at /home/zhiy/Elmer/fem/src/Solver.F90:34
It seems that the function below defined in GeneralUtils.F90 goes wrong:

Code: Select all

 FUNCTION FormatDate() RESULT( date )
!------------------------------------------------------------------------------
    CHARACTER( LEN=20 ) :: date
    INTEGER :: dates(8)

    CALL DATE_AND_TIME( VALUES=dates )
    WRITE( date, &
     '(I4,"/",I2.2,"/",I2.2," ",I2.2,":",I2.2,":",I2.2)' ) &
                dates(1),dates(2),dates(3),dates(5),dates(6),dates(7)
!------------------------------------------------------------------------------
  END FUNCTION FormatDate
I have no experience with Fortran, could you give me any advice?
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Fortran runtime error when starting solver from ElmerGUI

Post by kevinarden »

it sounds like you might have a version of gfortran in your system which
is incompatible with the one used to compile, it is trying to get the time and date from the system clock.

Double check the version of your local gfortran (gfortran --version)

did you compile this yourself?
sofia
Posts: 3
Joined: 03 Jan 2021, 07:20
Antispam: Yes

Re: Fortran runtime error when starting solver from ElmerGUI

Post by sofia »

kevinarden wrote: 03 Jan 2021, 15:24 it sounds like you might have a version of gfortran in your system which
is incompatible with the one used to compile, it is trying to get the time and date from the system clock.

Double check the version of your local gfortran (gfortran --version)

did you compile this yourself?
Hi, kevinarden.
I cloned the source file from github and compiled Elmer with cmake-gui.
I think you are right. Cmake found /usr/bin/f95 as the fortran compiler when building Elmer, but my default fortran compiler should be /usr/local/bin/gfortran.
How could I specify fortran compiler used by cmake?
sofia
Posts: 3
Joined: 03 Jan 2021, 07:20
Antispam: Yes

Re: Fortran runtime error when starting solver from ElmerGUI

Post by sofia »

That fix the problem! Thanks, kevinarden.
Post Reply