Hello,
Can anyone teach me how to declare an allocatable array with another array (TYPE) nested inside? Or suggest better way to store data below?
I wish to store data into an array like...
Automaker (i) % Month (j) % SALES(j)
Automaker (i) % Month (j) % COST(j)
ex)
Automaker (bmw) %...
Hello-
Can someone teach me how to get percentile value given a sorted array data?
Data
2.56
2.44
1.2
0.99
0.76
0.36
0.35
0.32
0.22
0.11
0.09
0.031
I wish to find 70th and 30th percentile value
(0.921 // 0.25 got from excel)
Thank you for everyone who kindly provided suggestions.
I applied salgerman's read in format method as it seems to be the easiest and it works!.
Thank you!
Hello,
Can someone help me reading arrays with missing values?
Following is data that I got in text file:
A B C D E F
85337 20120531 23.2457 20.08000 148210.48 -0.017605
85337 20120629 23.2457 21.95000...
oh.. I think I know why...
after removing extra +1 on
Allocate(array(nr_elements+1))
I don't have that issue.
I wanted to be safe by allocating one extra array but maybe it doesn't work like that...
To Mikrom,
I really appreciated your prev. posts. It helped me a lot and I almost figured out except for one minor error.
When I run my code, it reads the input data file and sort.
When I look at my output, along with sorted data, I see some weird number like...
-84215041 -4.316+08...
To Mikrom
Thanks for the reply! I wish to ask one more question on this.
If I don't know the amount of data.. so I have to use either really big number for loop and dummy parameter OR use allocatable array, how should I set
integer, parameter :: l = 4 ?
I could find total number of data...
Hello,
Thanks for answering my prev. question on simple sorting of 2 column data which were:
ID nums
12 0.111
58 1.52
. .
. .
. .
101 0.5
10 2.89
I declared 2 single array ID(:) and nums(:)
DO J = 1, 9
DO K = J+1, 10
IF(nums(J) > nums(K)) THEN
temp = nums(K)
temp2 = id(k)...
Hello,
I'm a newbie to fortran and need some help on sorting 2 columns of data (related) to be sorted on 1 column.
For instance, if my input text file has following:
ID nums
12 0.111
58 1.52
101 0.5
10 2.89
I declared 2 single array ID(:) and nums(:)
and applied selection sort...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.