Sponsored Content
Full Discussion: Nonsense error in FORTRAN
Top Forums UNIX for Beginners Questions & Answers Nonsense error in FORTRAN Post 303045973 by AkaAlteir on Monday 20th of April 2020 04:18:33 PM
Old 04-20-2020
Nonsense error in FORTRAN

Hello, I've been trying to set up a code for fortran, it's about integration, the problem comes when I try to compile the program, the log shows 2 errors: "Error: Expected a right parenthesis in expression " 2 times, and only in 1 shows the line in which it's apparently located (32), I'm going crazy cause i can't find the problem, does anyone know what's wrong?, the code is:

Code:
program main
  implicit none
  integer :: n,i,k
  real*8 :: a,b,x,trapecio,s,suma1,suma2,x2,formula1,formula2,eps,div,h

  !variables
  n=3
  a=0d8
  b=4d8


  !calculate the additions 1 a n-1 y 2 a n-2

  suma1=0d0
  suma2=0d0
  do n=3,300,2*n
   h=(b-a)/dble(n)

        do i=1,n-1,2
            x=a+dble(i)*h
            formula1= 1/(1+(x^2))
            suma1=  suma1 + formula1
        end do

        do k= 2,n-2,2
            x2=a+dble(k)*h
            formula2 =1/(1 + (x2^2)
            suma2= suma2+ formula2
        end do

     trapecio= h/3* &
     (1+ 4*suma1 + 2*suma2 + 1(1/n^2))
     div= trapecio/(trapecio/2)
            if (div < 1d-6) then
                exit
            end if

    write(*,*), trapecio
   end do
  end

 

4 More Discussions You Might Find Interesting

1. Programming

Error running FORTRAN code

Hi, I am new to this forum and do not know whether this is the appropriate place to post this question. Anyway am trying my luck. I have a fortran program swanhcat.ftn, which is part of a wave modelling system. There is also a file hcat.nml which is required to run this program. The program's... (9 Replies)
Discussion started by: sandhyakg
9 Replies

2. Programming

Fortran runtime error: Insufficient data descriptors in format after reversion

Hello, I have some Fortran code that is providing the following error: At line 1165 of lapc_shells_2.f Fortran runtime error: Insufficient data descriptors in format after reversion Here are the lines just above and including 1165: WRITE (*,"('ATTEMPTING TO READ PLATE... (1 Reply)
Discussion started by: jm4smtddd
1 Replies

3. Homework & Coursework Questions

FORTRAN error *** glibc detected ***

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I'm doing aproximation of derivative called five-point stencil. For every value of x, in interval , in step... (0 Replies)
Discussion started by: antonija
0 Replies

4. Programming

Error in my FORTRAN program

I have a Fortran program and I am writing out to logical unit 7. The program is reading from a text file and writing to the new file formatted. It gets through the read and writes some to the file but then stops with the following error: 1525-013 The sequential WRITE statement cannot be... (5 Replies)
Discussion started by: KathyB148
5 Replies
GLBLENDEQUATIONSEPAR(3G)					    OpenGL 3.3						  GLBLENDEQUATIONSEPAR(3G)

NAME
glBlendEquationSeparate - set the RGB blend equation and the alpha blend equation separately C SPECIFICATION
void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); PARAMETERS
modeRGB specifies the RGB blend equation, how the red, green, and blue components of the source and destination colors are combined. It must be GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MIN, GL_MAX. modeAlpha specifies the alpha blend equation, how the alpha component of the source and destination colors are combined. It must be GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MIN, GL_MAX. DESCRIPTION
The blend equations determines how a new pixel (the ''source'' color) is combined with a pixel already in the framebuffer (the ''destination'' color). This function specifies one blend equation for the RGB-color components and one blend equation for the alpha component. The blend equations use the source and destination blend factors specified by either glBlendFunc() or glBlendFuncSeparate(). See glBlendFunc() or glBlendFuncSeparate() for a description of the various blend factors. In the equations that follow, source and destination color components are referred to as R s G s B s A s and R d G d B d A d, respectively. The result color is referred to as R r G r B r A r. The source and destination blend factors are denoted s R s G s B s A and d R d G d B d A, respectively. For these equations all color components are understood to have values in the range 0 1. +-----------------------------+-----------------------------------------------------+-----------------------------------------------------+ | | | | | Mode | RGB | Alpha | | | Components | Component | | | | | +-----------------------------+-----------------------------------------------------+-----------------------------------------------------+ |GL_FUNC_ADD | <div> | <div> | | | | | | | | | | | Rr | Ar | | | = | = | | | | | | | R | A | | | s | s | | | | | | | | | | | s | s | | | R | A | | | | | | | + | + | | | R | A | | | d | d | | | | | | | | | | | d | d | | | R | A | | | | | | | | | | | | | | | </div> | </div> | | | <div> | | | | | | | | | | | | Gr | | | | = | | | | | | | | G | | | | s | | | | | | | | | | | | s | | | | G | | | | | | | | + | | | | G | | | | d | | | | | | | | | | | | d | | | | G | | | | | | | | | | | | | | | | </div> | | | | <div> | | | | | | | | | | | | Br | | | | = | | | | | | | | B | | | | s | | | | | | | | | | | | s | | | | B | | | | | | | | + | | | | B | | | | d | | | | | | | | | | | | d | | | | B | | | | | | | | | | | | | | | | </div> | | +-----------------------------+-----------------------------------------------------+-----------------------------------------------------+ |GL_FUNC_SUBTRACT | <div> | <div> | | | | | | | | | | | Rr | Ar | | | = | = | | | | | | | R | A | | | s | s | | | | | | | | | | | s | s | | | R | A | | | | | | | - | - | | | R | A | | | d | d | | | | | | | | | | | d | d | | | R | A | | | | | | | | | | | | | | | </div> | </div> | | | <div> | | | | | | | | | | | | Gr | | | | = | | | | | | | | G | | | | s | | | | | | | | | | | | s | | | | G | | | | | | | | - | | | | G | | | | d | | | | | | | | | | | | d | | | | G | | | | | | | | | | | | | | | | </div> | | | | <div> | | | | | | | | | | | | Br | | | | = | | | | | | | | B | | | | s | | | | | | | | | | | | s | | | | B | | | | | | | | - | | | | B | | | | d | | | | | | | | | | | | d | | | | B | | | | | | | | | | | | | | | | </div> | | +-----------------------------+-----------------------------------------------------+-----------------------------------------------------+ |GL_FUNC_REVERSE_SUBTRACT | <div> | <div> | | | | | | | | | | | Rr | Ar | | | = | = | | | | | | | R | A | | | d | d | | | | | | | | | | | d | d | | | R | A | | | | | | | - | - | | | R | A | | | s | s | | | | | | | | | | | s | s | | | R | A | | | | | | | | | | | | | | | </div> | </div> | | | <div> | | | | | | | | | | | | Gr | | | | = | | | | | | | | G | | | | d | | | | | | | | | | | | d | | | | G | | | | | | | | - | | | | G | | | | s | | | | | | | | | | | | s | | | | G | | | | | | | | | | | | | | | | </div> | | | | <div> | | | | | | | | | | | | Br | | | | = | | | | | | | | B | | | | d | | | | | | | | | | | | d | | | | B | | | | | | | | - | | | | B | | | | s | | | | | | | | | | | | s | | | | B | | | | | | | | | | | | | | | | </div> | | +-----------------------------+-----------------------------------------------------+-----------------------------------------------------+ |GL_MIN | <div> | <div> | | | | | | | | | | | Rr | Ar | | | = | = | | | | | | | min | min | | | | | | | | | | | | | | | R | A | | | s | s | | | | | | | | | | | | | | | R | A | | | d | d | | | | | | | | | | | | | | | | | | | | | | | </div> | </div> | | | <div> | | | | | | | | | | | | Gr | | | | = | | | | | | | | min | | | | | | | | | | | | | | | | G | | | | s | | | | | | | | | | | | | | | | G | | | | d | | | | | | | | | | | | | | | | | | | | | | | | </div> | | | | <div> | | | | | | | | | | | | Br | | | | = | | | | | | | | min | | | | | | | | | | | | | | | | B | | | | s | | | | | | | | | | | | | | | | B | | | | d | | | | | | | | | | | | | | | | | | | | | | | | </div> | | +-----------------------------+-----------------------------------------------------+-----------------------------------------------------+ |GL_MAX | <div> | <div> | | | | | | | | | | | Rr | Ar | | | = | = | | | | | | | max | max | | | | | | | | | | | | | | | R | A | | | s | s | | | | | | | | | | | | | | | R | A | | | d | d | | | | | | | | | | | | | | | | | | | | | | | </div> | </div> | | | <div> | | | | | | | | | | | | Gr | | | | = | | | | | | | | max | | | | | | | | | | | | | | | | G | | | | s | | | | | | | | | | | | | | | | G | | | | d | | | | | | | | | | | | | | | | | | | | | | | | </div> | | | | <div> | | | | | | | | | | | | Br | | | | = | | | | | | | | max | | | | | | | | | | | | | | | | B | | | | s | | | | | | | | | | | | | | | | B | | | | d | | | | | | | | | | | | | | | | | | | | | | | | </div> | | +-----------------------------+-----------------------------------------------------+-----------------------------------------------------+ The results of these equations are clamped to the range 0 1. The GL_MIN and GL_MAX equations are useful for applications that analyze image data (image thresholding against a constant color, for example). The GL_FUNC_ADD equation is useful for antialiasing and transparency, among other things. Initially, both the RGB blend equation and the alpha blend equation are set to GL_FUNC_ADD. NOTES
The GL_MIN, and GL_MAX equations do not use the source or destination factors, only the source and destination colors. ERRORS
GL_INVALID_ENUM is generated if either modeRGB or modeAlpha is not one of GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX, or GL_MIN. ASSOCIATED GETS
glGet() with an argument of GL_BLEND_EQUATION_RGB glGet() with an argument of GL_BLEND_EQUATION_ALPHA SEE ALSO
glGetString(), glBlendColor(), glBlendFunc(), glBlendFuncSeparate() COPYRIGHT
Copyright (C) 2006 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/. OpenGL 3.3 03/08/2011 GLBLENDEQUATIONSEPAR(3G)
All times are GMT -4. The time now is 11:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy