Fortran Syntax Error In Argument List
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta
Syntax Error In Write Statement At (1)
Discuss the workings and policies of this site About Us Learn more fortran line length about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack
Error: Unclassifiable Statement At (1)
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, fortran unclassifiable statement helping each other. Join them; it only takes a minute: Sign up Syntax error in function arguments in fortran up vote 1 down vote favorite I have a sub routine file as follows subroutine grids(Ngrids,gridsize,boundx,boundy,boundz,occmatrix,myid) implicit NONE integer i,j,k,Ngrids, occmatrix(14,14,10) integer locx,locy,locz,myid double precision gridsize,boundx,boundy,boundz do i = 1, 14 do j = 1, 14 do k = fortran line continuation 1, 10 occmatrix(i,j,k) = 0 enddo enddo enddo open (13, file = 'grid_data.9deg') write(*,'(A,i2)'),' READING GRID FILE ON PROC.....',myid read(13,*) Ngrids,gridsize read(13,*) boundx,boundy,boundz do i = 1, Ngrids read(13,*) locx, locy, locz occmatrix(locx,locy,locz) = 1 enddo close(13) return end It gives the following syntax error in compiling subroutine grids(Ngrids,gridsize,boundx,boundy,boundz,occmatrix,my 1 Error: Unexpected junk in formal argument list at (1) It used to run well before fortran gfortran share|improve this question edited Sep 7 '15 at 12:45 haraldkl 2,7941337 asked Sep 7 '15 at 12:11 user3452351 165 How do you compile, what suffix does your file have? –haraldkl Sep 7 '15 at 12:19 What is the extension of your file? Depending on the extension, the compiler might ignore everything else after a certain column number. Please see: stackoverflow.com/questions/24335487/… –solalito Sep 7 '15 at 12:26 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted I would believe, your line is to long. Did you add a new argument? Your code looks lik
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community http://stackoverflow.com/questions/32438459/syntax-error-in-function-arguments-in-fortran of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Syntax error in argument list of a subroutine up vote 1 down vote favorite I am trying to compile a code using gfortran. The subroutine plumed_f_gcmd is where I am having some trouble. Here is http://stackoverflow.com/questions/36647396/syntax-error-in-argument-list-of-a-subroutine the piece of the code call plumed_f_gcmd("setMDTimeUnits"//char(0),timeUnits) call plumed_f_gcmd("setPlumedDat"//char(0),"plumed.dat"//char(0)) call plumed_f_gcmd("setLogFile"//char(0),"PLUMED.OUT"//char(0)) call plumed_f_gcmd("setNatoms"//char(0),natms) call plumed_f_gcmd("setMDEngine"//char(0),"dlpoly1.90"//char(0)) the compiler throws the following error: call plumed_f_gcmd("setPlumedDat"//char(0),"plumed.dat"//char(0 1 Error: Syntax error in argument list at (1) call plumed_f_gcmd("setMDEngine"//char(0),"dlpoly1.90"//char(0) 1 Error: Syntax error in argument list at (1) First of all I don't quite understand how in a subroutine, the second input can be once a number and once a string? does '//char(0)' somehow changes the string to another data type? Can someone please explain this to me? And my second question is why the error is not happening also for the case of the third line (PLUMED.OUT)? I don't know how but some C and C++ wrappers are also involved; this is the subroutine in C: void plumed_f_gcmd(char*key,void*val){ plumed_gcmd(key,val); } compiler-errors fortran share|improve this question edited Apr 17 at 14:01 Vladimir F 26k31852 asked Apr 15 at 12:39 Azade yazdan 84 3 To me that looks like you're exceeding the permitted line
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen