gfortran

Evaluating a specific letter of a string defined in a derived type in Fortran90 [duplicate]

走远了吗. 提交于 2021-02-17 06:27:25
问题 This question already has answers here : Extract substring of Fortran string array (3 answers) Extract a single character from a Fortran string (1 answer) Access character at specific index in a string in Fortran (1 answer) Closed 1 year ago . I would like to evaluate if the 3rd letter of variable myline is 'C' or not. I try this: program main implicit none type line integer :: count = 5 character(len=48) :: list = 'ABCDE' end type type(line) :: myline character(len=1) :: letter = 'C' write(*

Compiling using gfortran in Mac

╄→尐↘猪︶ㄣ 提交于 2021-02-17 06:10:03
问题 So bear with me as I am very new to coding. I'm trying to compile a Fortran file but I keep getting this issue in my terminal. I am using GNU Fortran (GCC) 9.2.0 and I believe I have all other prerequisites updated Xcode and atom. Appreciate any and all help spent went way too long just to say hello world. % gfortran -o myprog hello.f90 ld: library not found for -lSystem collect2: error: ld returned 1 exit status 来源: https://stackoverflow.com/questions/63032579/compiling-using-gfortran-in-mac

Compiling using gfortran in Mac

寵の児 提交于 2021-02-17 06:09:09
问题 So bear with me as I am very new to coding. I'm trying to compile a Fortran file but I keep getting this issue in my terminal. I am using GNU Fortran (GCC) 9.2.0 and I believe I have all other prerequisites updated Xcode and atom. Appreciate any and all help spent went way too long just to say hello world. % gfortran -o myprog hello.f90 ld: library not found for -lSystem collect2: error: ld returned 1 exit status 来源: https://stackoverflow.com/questions/63032579/compiling-using-gfortran-in-mac

Compiling using gfortran in Mac

房东的猫 提交于 2021-02-17 06:08:51
问题 So bear with me as I am very new to coding. I'm trying to compile a Fortran file but I keep getting this issue in my terminal. I am using GNU Fortran (GCC) 9.2.0 and I believe I have all other prerequisites updated Xcode and atom. Appreciate any and all help spent went way too long just to say hello world. % gfortran -o myprog hello.f90 ld: library not found for -lSystem collect2: error: ld returned 1 exit status 来源: https://stackoverflow.com/questions/63032579/compiling-using-gfortran-in-mac

Compiling using gfortran in Mac

橙三吉。 提交于 2021-02-17 06:08:02
问题 So bear with me as I am very new to coding. I'm trying to compile a Fortran file but I keep getting this issue in my terminal. I am using GNU Fortran (GCC) 9.2.0 and I believe I have all other prerequisites updated Xcode and atom. Appreciate any and all help spent went way too long just to say hello world. % gfortran -o myprog hello.f90 ld: library not found for -lSystem collect2: error: ld returned 1 exit status 来源: https://stackoverflow.com/questions/63032579/compiling-using-gfortran-in-mac

Compilation error: Invalid character in name at (1)

吃可爱长大的小学妹 提交于 2021-02-17 03:54:07
问题 I wrote program test implicit none integer, parameter :: N = 3 real(8), parameter :: & A(N,N) = reshape( (/1.5d0,1d0,1d0,1d0,1.5d0,2d0,1d0,1d0,3d0/), shape(A) ) & b(N) = (/ 5d0,-3d0,8d0 /) print *, A end program saved as test.f, and got compilation error with gfortran -ffree-form -Wall -Werror -ffree-line-length-none test.f . test.f:6:24: A(N,N) = reshape( (/1.5d0,1d0,1d0,1d0,1.5d0,2d0,1d0,1d0,3d0/), shape(A) ) & 1 Error: Invalid character in name at (1) test.f:9:12: print *, A 1 Error:

Fortran DO loop, warning to use integer only

删除回忆录丶 提交于 2021-02-15 11:08:55
问题 I installed gfortran on my Ubuntu 15.04 system. While compiling Fortran code, the DO loop asks to take integer parameters only and not real values or variables. That includes the loop variable and the step expression. Why can't it take real values too? The following is a program taken from here, exercise 3.5 of the section nested do loops . program xytab implicit none !constructs a table of z=x/y for values of x from 1 to 2 and !y from 1 to 4 in steps of .5 real :: x, y, z print *, ' x y z'

Unable to compile .f (fortran file) in codeblocks 13.12

安稳与你 提交于 2021-02-15 07:14:53
问题 I am trying to execute give fortran code in Code::Blocks on Windows 8 program main write (*,*) "hi" stop end The error I am getting is G:\Study\Programs\bairstow.o:bairstow.f undefined reference to `_gfortran_st_write' G:\Study\Programs\bairstow.o:bairstow.f undefined reference to `_gfortran_transfer_character_write' G:\Study\Programs\bairstow.o:bairstow.f undefined reference to `_gfortran_st_write_done' G:\Study\Programs\bairstow.o:bairstow.f undefined reference to `_gfortran_stop_string' G:

Huge fort.# files when running gfortran

自闭症网瘾萝莉.ら 提交于 2021-02-15 03:13:46
问题 I am using gfortran for an application and running the Fortran through a Matlab mex file. I have noticed that in the current directory when I run the Fortran file, on my mac, it creates a fort.9 or fort.16 file, where the 9 or 16 are some arbitrary number. Recently, I have noticed that these fort. files can be GBs big! Generally they are quite small, like a few kBs. I was just wondering what purpose these files have? And second, is there some error I have in my code that is causing them to be

Old fortran code and getting an OPEN statement error using GNU

五迷三道 提交于 2021-02-13 17:30:31
问题 I'm trying to compile a very old code but I get this error while compiling the code Error: Syntax error in OPEN statement at (1) The code: WRITE(LUTTO,'('' TYPE NAME OF FILE CONTAINING INPUT : '',$)') C READ (LUTTI,'(Q,A)') NCHAR,FILNAM READ (LUTTI,'(A)') FILNAM NCHAR = len_trim(FILNAM) C ----- OPEN DATA FILE ----- print *, "NCHAR" OPEN( UNIT = LUINP, NAME = FILNAM(1:NCHAR), $ STATUS = 'OLD', RECL = 80 , $ CARRIAGECONTROL= 'LIST', ERR = 9900 ) 回答1: name=... in the open statement is invalid