Error 5082
Contents |
searching for something, such as a library or routine to perform a particular task, feel free to ask here. Q: Hi! I’m quite new in Fortran, and I’m using Microsoft Visual 2008 as
Syntax Error Found End-of-statement When Expecting One Of Fortran
IDE and Intel Fortran as compiler. I’d like to know how I can create a fortran error #5082 syntax error found end of statement when expecting one of fortran library using them and how I can link my code to the library. Thanks. Q: Hi! I have a quite simple question: if I have an array of integers as A = (/1,2,3,4,5/), how do I convert this array in the number 12345? Thank you very much in advanced for your help Regards A: There are a number of ways you could go about doing this. Perhaps the simplest is to create a loop over the array index and use integer arithmatic operations. number = 0 DO i=1,SIZE(A) number = number + A(i)*10**(SIZE(A)-i) END DO Note that I have not tested this to confirm it’s correctness, but it should be correct. If not, you could easily figure out where I made a typo or went wrong. One could also write the array elements to a character variable and then read the character variable back as an integer. Q: Does anyone know how to overload intrinsic functions? Preeferably using f95 comnpliant syntax if possible. Thanks. A: It’s actually simple. You just overload the function you want. For example, you can overload ABS: module myabs implicit none type vector real :: x, y, z end type vector interface ABS module procedure absvector end interface ABS contains real function absvector(vec) type(vector), intent(in) :: vec absvector = sqrt(vec%x ** 2 + vec%y ** 2 + vec%z ** 2) end function absvector end module myabs If you test this, you’ll see that you can now call ABS with REAL, INTEGER, COMPLEX, and even vector. Q: I am new to Fortran and want to compile a source file. But it gives me a lot of errors: evfit.f90(47): error #5082: Syntax error, found IDENTIFIER 'UNIT' when expecting one of: ( % [ : . = => C unit conversion ----------^ evfit.f90(47): error #6404: This name does not have a type, and must have an explicit type. [C] C unit conversion ^ evfit.f90(47): error #6404: This name does not have a type, and must have an explicit type. [CONVERSION] C unit conversion ---------------^ evfit.f90(134): error #5120: Unterminated character constant c emin = energia all'equilibrio, ottenuta minimizza
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 of 4.7 million programmers, just like you, helping each other. Join them; it only http://fortranwiki.org/fortran/show/Questions takes a minute: Sign up How to fix errors in my Fortran code up vote -4 down vote favorite I am not familiar with errors in Fortran. Could you please explain what are these errors? int.f90(18): error #5082: Syntax error, found IDENTIFIER 'K' when expecting one of: ( % : . = => do k=0.0 to m ---^ int.f90(19): error #5082: http://stackoverflow.com/questions/33478310/how-to-fix-errors-in-my-fortran-code Syntax error, found IDENTIFIER 'Q' when expecting one of: ( % : . = => do q=1 to m-1 ----^ int.f90(20): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ) , f1=1/(2*pi)*(sqrt((k**2)+(Q**2)-(2*k*cos(t))) ----------------------------------------------^ int.f90(24): error #5082: Syntax error, found IDENTIFIER 'I' when expecting one of: ( % : . = => do i=1 to m-1 ----^ int.f90(4): error #6406: Conflicting attributes or multiple declaration of name. [INT] function int(f,a,b,int,m) -------------------^ int.f90(9): error #6418: This name has already been assigned a data type. [M] integer:: i,m ------------^ int.f90(10): error #6557: An =initialization-expr is missing; an initialization expression is required when using the PARAMETER attribute. [PI] real,parameter:: pi,pi=3.14 -----------------^ int.f90(10): error #6418: This name has already been assigned a data type. [PI] real,parameter:: pi,pi=3.14 --------------------^ int.f90(11): error #6557: An =initialization-expr is missing; an initialization expression is required when using the PARAMETER attribute. [EPS] real,parameter:: eps,eps=1.89 -----------------^ int.f90(11): error #6418: This name has already been assigned a data type. [EPS] real,parameter:: eps,eps=1.89 ---------------------^ int.f90(12): error #6557: An =initialization-expr is missing; an initialization expression is required when using the PARAMETER attribute. [
board cookies • All times are UTC + 1 hour Powered by phpBB Forum Software © phpBB Group
team • Delete all board cookies • All times are UTC - 5 hours [ DST ] Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group