Sponsored Content
Top Forums Programming Removing goto statements in FORTRAN code Post 302792635 by kristinu on Wednesday 10th of April 2013 05:58:24 PM
Old 04-10-2013
Removing goto statements in FORTRAN code

I have the code below and I want to remove the "go to" statements. Any idea how I can do it?

Code:
 if (iorder == 0) then

    tmincurrent = 1.0e11
    if(ireverse == 0 .or. istop /= 1) then
      do i = 1, 6
        if ((side(i) /= sidelimit(i)) .and. (tminside(i) < tmincurrent)) then
          tmincurrent = tminside(i)
          iside = i
        end if
      end do
    else
      do i = 1, 6
        if(side(i) /= sidestop(i) .and. tminside(i) < tmincurrent) then
          tmincurrent = tminside(i)
          iside = i
        end if
      end do
    end if

  else

    if ((ireverse == 0) .or. (istop /= 1)) then
      2120 ioc = ioc + 1
      if (ioc < 7) then
        iside = order(ioc)
        if (side(iside) /= sidelimit(iside)) go to 2130
      else
        ioc = 0
      end if
      go to 2120
    else
      2140 ioc = ioc + 1
      if (ioc < 7) then
        iside = order(ioc)
        if (side(iside) /= sidestop(iside)) go to 2130
      else
        ioc = 0
      end if
      go to 2140
    end if

  end if

2130  continue

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Question on variable inheritance & code statements

1) I have the below code in concattxnrecords.sh shell script and it is calling the genericVars.sh shell script which is mentioned as below has some code inside it which would intialize some variables in it, now my question is will this shell script would inherit those variable definitions or not... (3 Replies)
Discussion started by: Ariean
3 Replies

2. Programming

Making FORTRAN code more efficient

Hi, I have a very large, very old FORTRAN code that I work with. The code is quite messy and I was wondering if I can speed up execution time by finding subroutines that code execution spends the most time in. Is there any kind of software I can use to see where the code spends most of the... (1 Reply)
Discussion started by: rks171
1 Replies

3. 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

4. Programming

Help with make this Fortran code more efficient (in HPC manner)

Hi there, I had run into some fortran code to modify. Obviously, it was written without thinking of high performance computing and not parallelized... Now I would like to make the code "on track" and parallel. After a whole afternoon thinking, I still cannot find where to start. Can any one... (3 Replies)
Discussion started by: P_E_M_Lee
3 Replies

5. Programming

Using Doxygen on Fortran code

I am using doxygen for documenting my fortran code. I want to write some notes after the header in different parts of the subroutine. Any idea what the tags should be as anything I write after the header is not displayed ... (0 Replies)
Discussion started by: kristinu
0 Replies

6. Programming

Using tops command to update NSLog statements in objective-c code

In my objective-c code base I have several NSLog statements. eg. NSLog(@"Here is the message without arguments"); NSLog(@"Here is the message with arguments: %s, %s","argument1","argument2"); Now I want to do two things: First to do: updating NSLog statements with... (0 Replies)
Discussion started by: Miraaj
0 Replies

7. Programming

Strange characters in FORTRAN code output

Hi guys, After compiling a .f90 code and executing it, i get strange characters in the output file like : ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ Are these windows characters? how can i get rid of this? Much appreciated. Paul (1 Reply)
Discussion started by: Paul Moghadam
1 Replies

8. Programming

Problem with IF ELSEIF and GOTO statements in FORTRAN

Hi I am reading a book about Fortran 90 and I write the following code, to test my understanding of the first chapter. I have a problem with the last section of the code with deals with an IF, ELSEIF, and GOTO statements. Here is my Code PROGRAM sim ! This code is used to solve two... (3 Replies)
Discussion started by: faizlo
3 Replies

9. Shell Programming and Scripting

A dash to GOTO or a dash from GOTO, that is the question...

Well, guys I saw a question about GOTO for Python. So this gave me the inspiration to attempt a GOTO function for 'dash', (bash and ksh too). Machine: MBP OSX 10.14.3, default bash terminal, calling '#!/usr/local/bin/dash'... This is purely a fun project to see if it is possible in PURE... (3 Replies)
Discussion started by: wisecracker
3 Replies
ppmtosixel(1)                                                 General Commands Manual                                                ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 02:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy