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
CYCLICTEST(1)							      Xenomai							     CYCLICTEST(1)

NAME
cyclictest - Xenomai high resolution timer test SYNOPSIS
cyclictest [options] DESCRIPTION
cyclictest is part of the Xenomai test suite and tests the POSIX skin of Xenomai with a cyclic timer test. For this program to work, you need to run a suitable Xenomai enabled kernel with the respective module (xeno_posix). OPTIONS
cyclictest accepts the following options: -b USEC, --breaktrace=USEC send break trace command when latency > USEC -c CLOCK, --clock=CLOCK select clock: 0 = CLOCK_MONOTONIC (default) 1 = CLOCK_REALTIME -d DIST, --distance=DIST distance of thread intervals in us default=500 -i INTV, --interval=INTV base interval of thread in us default=1000 -l LOOPS, --loops=LOOPS number of loops: default=0 (endless) -n, --nanosleep use clock_nanosleep -p PRIO, --prio=PRIO priority of highest prio thread -q, --quiet print only a summary on exit -r, --relative use relative timer instead of absolute -t NUM, --threads=NUM number of threads: default=1 -v, --verbose output values on stdout for statistics format: n:c:v n=tasknum c=count v=value in us AUTHOR
cyclictest was written by Thomas Gleixner <tglx@linutronix.de>. This man page was written by Roland Stigge <stigge@antcom.de>. 2.6.0 2008-04-01 CYCLICTEST(1)