FORTRAN: Getting Consecutive DIST Values


 
Thread Tools Search this Thread
Top Forums Programming FORTRAN: Getting Consecutive DIST Values
# 1  
Old 11-12-2010
FORTRAN: Getting Consecutive DIST Values

I have this code and I want to get the first two consecutive distances (obtained by calling GET_TH(IT, 'DIST', DIST) at index IT, the result stored in DIST) for which (ITFLG(IT) .NE. 1). L_FIRST get the first DIST for which ITFLG(IT) .NE. 1. Getting a bit confused on how to achieve this.


Code:
    L_FIRST = .TRUE.
    DO IT = 1, NT

      IF (ITFLG(IT) .NE. 1) THEN          ! Trace is live
        IF (L_FIRST) THEN
          CALL GET_TH(IT, 'DIST', DIST1)  ! Offset of first live trace
          IT1 = IT
          L_FIRST = .FALSE.
          ITN = IT1
        ELSE
          CALL GET_TH(IT, 'DIST', DISTN)  ! Offset of last live trace
          ITN = IT
        ENDIF
      ENDIF

    ENDDO


Last edited by kristinu; 11-12-2010 at 12:20 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting consecutive equal values in a file

Hello everyone, I have a requirement as shown below. I need to delete consecutive same values from the source file and give it as output file. Source: a,b,c,d,e,e,f,g Target: a,b,c,d,f,g The repeating value "e" should be deleted from the file completely. How can I achieve this... (14 Replies)
Discussion started by: vamsikrishna928
14 Replies

2. Shell Programming and Scripting

awk print values between consecutive lines

I have a file in below format: file01.txt TERM TERM TERM ABC 12315 68.53 12042013 165144 ABC 12315 62.12 12042013 165145 ABC 12315 122.36 12052013 165146 ABC 12315 582.18 12052013 165147 ABC 12316 2.36 12052013 165141 ABC 12316 ... (8 Replies)
Discussion started by: alex2005
8 Replies

3. Shell Programming and Scripting

Adding the corresponding values for every 5th consecutive numbers

Dear All, I have a file which is as follows: Input File: 231 100.1 233 99 235 200.9 238 80.1 239 90.2 240 77.0 243 99.5 245 16.20 246 13.55 247 11.8 249 13.7 250 99.6 (1 Reply)
Discussion started by: NamS
1 Replies

4. Shell Programming and Scripting

How to compare the values of a column in awk in a same file and consecutive lines..

I would like to compare the values of 2nd column of consecutive lines of same file in such a way so that if the difference between first value and second value is more than 100 it should print complete line else ignore line. Input File ========== PDB 2500 RTDB 123 RTDB-EAGLE 122 VSCCP 2565... (4 Replies)
Discussion started by: manuswami
4 Replies

5. Shell Programming and Scripting

AWK: combining consecutive values in a field

Hi, Here is my sample input X 2 AAA Y 3 BBB Y 2 CCC Z 4 DDD In field 1, if the value of one line is same as that of next line, I want to concatenate the corresponding value of the second line in the third field with the value of the third field of first line. And I dont need the third... (2 Replies)
Discussion started by: polsum
2 Replies

6. Programming

FORTRAN -Returning index fir which values fall in a region

I have an 10 element array containing numbers, I want the start and end index in the array for which the values lie between DIST1 and DIST2. It is not working quite right. I also might want a value of 0 if I cannot find an index. V=(/10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0/) ... (4 Replies)
Discussion started by: kristinu
4 Replies

7. Shell Programming and Scripting

concatenate consecutive field values

Hi, I have a file like this A Bob A Sam A John B David C Paul C Sandra If the consecutive field values in column one is same, then concatenate the corresponding strings. So, I need an output like this, A Bob_Sam_John B David C Paul_Sandra I usually work with excel but... (3 Replies)
Discussion started by: polsum
3 Replies

8. Linux

Secondary linux dist WITHIN primary one

Hi New here so forgive my ignorance and inability to express myself in an informative manner ;) I have a Fedora distribution installed on my development computer. The system we build is meant to run on a slackware dist which is all fine and well. But due to our flow of deployment I would have... (2 Replies)
Discussion started by: inquam
2 Replies

9. UNIX for Dummies Questions & Answers

Which Linux dist?

I'm working from what I believe is a server based implementation of Unix and Linux. I access terminals and a Red Hat desktop through Sun Global Desktop from a windows PC. Recently I have been doing much more complicated activities (than usual). I needed to use cmake, make and gcc (version 4.0.3... (1 Reply)
Discussion started by: seroppi
1 Replies
Login or Register to Ask a Question
PBUILDER-DIST-SIMPLE(1) 				      General Commands Manual					   PBUILDER-DIST-SIMPLE(1)

NAME
pbuilder-dist-simple - simple multi-release pbuilder wrapper SYNOPSIS
pbuilder-<dist> operation [...] DESCRIPTION
pbuilder-dist-simple is a wrapper that makes it easy to use pbuilder with chroots for many different Ubuntu distributions. If you need more features than pbuilder-dist-simple provides, have a look at pbuilder-dist(1). USAGE
Create one symlink to pbuilder-dist-simple for each distribution for which you want a build environment, naming them like "pbuilder-lucid", "pbuilder-natty", etc. Replace operation with the action you want pbuilder-dist-simple to do (create, update, build, clean, login or execute). EXAMPLES
pbuilder-natty create Creates a pbuilder environment for Ubuntu Natty. pbuilder-lucid update Updates an existing Ubuntu Lucid environment. pbuilder-lucid build ./sample_1.0-0ubuntu1.dsc Builds the specified package on an already existing Ubuntu Lucid environment. FILES
By default, pbuilder-dist-simple will store all the files it generates in ~/pbuilder/. This can be changed by modifying the BASE_DIR value on the top of the script to any other directory you want. If the directory doesn't exit, it will be created at runtime. SEE ALSO
pbuilder(1), pbuilderrc(5), pbuilder-dist(1) AUTHORS
pbuilder-dist was originally written by Jamin W. Collins <jcollins@asgardsrealm.net> and Jordan Mantha <mantha@ubuntu.com>, and this man- page by Siegfried-A. Gevatter <rainct@ubuntu.com>. Both are released under the GNU General Public License, version 2 or later. ubuntu-dev-tools February 25, 2008 PBUILDER-DIST-SIMPLE(1)