Sponsored Content
Top Forums Programming generating pair of numbers in special order Post 302545762 by vjramana on Tuesday 9th of August 2011 12:05:06 PM
Old 08-09-2011
Hi, just for your kind information, the code which post here is not homework but is part of my 200 line code for calculate time auto correlation function of my simulation data.
Anyway, you hint really helped me to write the code and it is running as per my request.

Code:
program jumploop
implicit none
!!!!!!!!!!!!!!!!!

  integer :: i,j,k,n


do k = 1, 5
	do i = 1, 10, k
		j = (i+k)

		print*, i, j

	end do
		print*," "
end do


end program jumploop

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

generating random numbers with hamming distance 4

Hi I want to genrate 10 random 32 bit binary numbers with hamming distance 4 and 8. 11010110010101010101010101010101 11010110010101010100010101010010 if we look carefully at these two binary numbers they differ at 4 places hence hamming distance 4. Now I want to genrate these numbers... (2 Replies)
Discussion started by: hack_tom
2 Replies

2. Shell Programming and Scripting

generating line numbers

hello All Do anybody know how to generat number line that is puting the number of lines at the begining of a new line, with d bracket by the side say 1) 2) 3) any help would be nice (7 Replies)
Discussion started by: sam4now
7 Replies

3. Shell Programming and Scripting

Ascending & Descending order numbers

Dear All, I have below attached file in which i have many nos, i want the last ascending order nos. The brief description is given below. File 315 381 432 315 381 432 315 381 432 315 381 432 315 381 432 (6 Replies)
Discussion started by: pravani1
6 Replies

4. Shell Programming and Scripting

Generating random numbers

Hi, I am having trouble with generating random numbers. can this be done with awk? So I have a file that looks like this: 23 30 24 40 26 34 So column1 is start and column2 is end. I want to generate 3 random #'s between start and stop: So the output will look like this: ... (9 Replies)
Discussion started by: phil_heath
9 Replies

5. Shell Programming and Scripting

Generating Gaussian Distributed Random Numbers

I want to generate an awk function that generated a Gaussian distributed set of random numbers. I need to implement the thing below in awk. Rnd is just a uniform random number between 0 and 1 function rgaussian(r1, r2) { Do v1 = 2 * Rnd - 1 v2 = 2 * Rnd - 1 ... (0 Replies)
Discussion started by: kristinu
0 Replies

6. Shell Programming and Scripting

picking the numbers missing which is supposed to be a numercal/counting order

Hi, I have a tab delimited file with 2 columns. In the first column the numbers are sorted from smallest to largest. It is supposed to be in the numerical order but in between some numbers are missing. Is there a way I could easily get those numbers that are missing and output it a file using... (11 Replies)
Discussion started by: Lucky Ali
11 Replies

7. UNIX for Dummies Questions & Answers

Appending a column of numbers in ascending order to a text file

I have a text file where I want to append a column of numbers in ascending orders. Input: 57 abc 25 def 32 ghi 54 jkl Output:57 abc 57 abc 1 25 def 2 32 ghi 3 54 jkl 4 How do I go about doing that? Thanks! (11 Replies)
Discussion started by: evelibertine
11 Replies

8. Shell Programming and Scripting

How To Arrange Record In A Special Order?

Hi All, I have following data to be arranged based on columnd 6: 0098442947 0098222107 0098442134 0098200179 0098441067 0098442744 0098443106 0098442746 0098321411 0098443111 0098456611 0098444570 0098456600 0098385750 0098200288 (3 Replies)
Discussion started by: angshuman
3 Replies

9. Shell Programming and Scripting

Nawk special numbers

Just stumbled over a terrible feature in nawk derivates. I did not find it documented in man pages. HP-UX 11.31: echo info | awk '{print $1+0}' inf echo nano | awk '{print $1+0}' nan echo info | awk '{print $1-$1}' -nanSolaris 10: echo info | nawk '{print $1+0}' Inf echo nano | nawk... (5 Replies)
Discussion started by: MadeInGermany
5 Replies
Devel::Refcount(3pm)					User Contributed Perl Documentation				      Devel::Refcount(3pm)

NAME
"Devel::Refcount" - obtain the REFCNT value of a referent SYNOPSIS
use Devel::Refcount qw( refcount ); my $anon = []; print "Anon ARRAY $anon has " . refcount($anon) . " reference "; my $otherref = $anon; print "Anon ARRAY $anon now has " . refcount($anon) . " references "; DESCRIPTION
This module provides a single function which obtains the reference count of the object being pointed to by the passed reference value. FUNCTIONS
$count = refcount($ref) Returns the reference count of the object being pointed to by $ref. COMPARISON WITH SvREFCNT This function differs from "Devel::Peek::SvREFCNT" in that SvREFCNT() gives the reference count of the SV object itself that it is passed, whereas refcount() gives the count of the object being pointed to. This allows it to give the count of any referent (i.e. ARRAY, HASH, CODE, GLOB and Regexp types) as well. Consider the following example program: use Devel::Peek qw( SvREFCNT ); use Devel::Refcount qw( refcount ); sub printcount { my $name = shift; printf "%30s has SvREFCNT=%d, refcount=%d ", $name, SvREFCNT($_[0]), refcount($_[0]); } my $var = []; printcount 'Initially, $var', $var; my $othervar = $var; printcount 'Before CODE ref, $var', $var; printcount '$othervar', $othervar; my $code = sub { undef $var }; printcount 'After CODE ref, $var', $var; printcount '$othervar', $othervar; This produces the output Initially, $var has SvREFCNT=1, refcount=1 Before CODE ref, $var has SvREFCNT=1, refcount=2 $othervar has SvREFCNT=1, refcount=2 After CODE ref, $var has SvREFCNT=2, refcount=2 $othervar has SvREFCNT=1, refcount=2 Here, we see that SvREFCNT() counts the number of references to the SV object passed in as the scalar value - the $var or $othervar respectively, whereas refcount() counts the number of reference values that point to the referent object - the anonymous ARRAY in this case. Before the CODE reference is constructed, both $var and $othervar have SvREFCNT() of 1, as they exist only in the current lexical pad. The anonymous ARRAY has a refcount() of 2, because both $var and $othervar store a reference to it. After the CODE reference is constructed, the $var variable now has an SvREFCNT() of 2, because it also appears in the lexical pad for the new anonymous CODE block. PURE-PERL FALLBACK An XS implementation of this function is provided, and is used by default. If the XS library cannot be loaded, a fallback implementation in pure perl using the "B" module is used instead. This will behave identically, but is much slower. Rate pp xs pp 225985/s -- -66% xs 669570/s 196% -- SEE ALSO
o Test::Refcount - assert reference counts on objects AUTHOR
Paul Evans <leonerd@leonerd.org.uk> perl v5.14.2 2011-11-15 Devel::Refcount(3pm)
All times are GMT -4. The time now is 12:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy