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
ptsematest(8)															     ptsematest(8)

NAME
ptsematest - Start two threads and measure the latency of interprocess communication with POSIX mutex. SYNTAX
ptsematest [-a|-a PROC] [-b USEC] [-d DIST] [-i INTV] [-l loops] [-p PRIO] [-t|-t NUM] DESCRIPTION
The program ptsematest starts two threads that are synchronized via pthread_mutex_unlock()/pthread_mutex_lock() and measures the latency between releasing and getting the lock. OPTIONS
-a, --affinity[=PROC] Run on procesor number PROC. If PROC is not specified, run on current processor. -b, --breaktrace=USEC Send break trace command when latency > USEC. This is a debugging option to control the latency tracer in the realtime preemption patch. It is useful to track down unexpected large latencies of a system. -d, --distance=DIST Set the distance of thread intervals in microseconds (default is 500 us). When cylictest is called with the -t option and more than one thread is created, then this distance value is added to the interval of the threads: Interval(thread N) = Interval(thread N-1) + DIST -i, --interval=INTV Set the base interval of the thread(s) in microseconds (default is 1000 us). This sets the interval of the first thread. See also -d. -l, --loops=LOOPS Set the number of loops. The default is 0 (endless). This option is useful for automated tests with a given number of test cycles. ptsematest is stopped once the number of timer intervals has been reached. -p, --prio=PRIO Set the priority of the process. -t, --threads[=NUM] Set the number of test threads (default is 1, if this option is not given). If NUM is specified, create NUM test threads. If NUM is not specifed, NUM is set to the number of available CPUs. EXAMPLES
The following example was running on a 4-way processor: # ptsematest -a -t -p99 -i100 -d25 -l1000000 #0: ID8672, P99, CPU0, I100; #1: ID8673, P99, CPU0, Cycles 1000000 #2: ID8674, P98, CPU1, I125; #3: ID8675, P98, CPU1, Cycles 811035 #4: ID8676, P97, CPU2, I150; #5: ID8677, P97, CPU2, Cycles 668130 #6: ID8678, P96, CPU3, I175; #7: ID8679, P96, CPU3, Cycles 589423 #1 -> #0, Min 1, Cur 1, Avg 2, Max 11 #3 -> #2, Min 1, Cur 2, Avg 2, Max 13 #5 -> #4, Min 1, Cur 4, Avg 3, Max 12 #7 -> #6, Min 1, Cur 4, Avg 2, Max 12 AUTHORS
Carsten Emde <C.Emde@osadl.org> SEE ALSO
pthread_mutex_lock(3p), pthread_mutex_unlock(3p) 0.1 ptsematest(8)