Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. mikibelavista

    problem with forall

    I have array and I want to compare elements,how many 100.3 10.0 pairs do I have 100.3 10.0 110.0 10.0 100.3 10.0 I have tried this: program pck implicit none real,dimension(10,2) :: a integer,dimension(10) :: b integer :: i,check open(10,file='pic.txt') do i=1,10 read(10,*)a(i,:) end do...
  2. mikibelavista

    reading file problem

    My file: 3515 2.154 3516 2.126 3517 2.098 3518 2.063 3519 2.084 3520 2.114 3521 2.128 . . 13093 2.302 13094 2.294 13095 2.29 13096 2.314 13097 2.314 13098 2.294 13099 2.294 13100 2.279 9586 lines in the file. My code: program pr2 implicit none integer :: i,j real,dimension(9586) :: c...
  3. mikibelavista

    how to read this

    < 1| 255.33 | This will be repeated 90000 times in file. So first number will change length.Also | | creates problem,should I read it as character?
  4. mikibelavista

    reading binary file!!

    character*72 ifname,ofname write(*, fmt="(/'Enter input file name')") read(5,85) ifname 85 format(a72) write(*, fmt="(/'Enter output file name')") read(5,85) ofname open(unit=11, file=ifname, form='unformatted', status='old') open(unit=12, file=ofname)...
  5. mikibelavista

    fortran random number generator

    I am translating some code form matlab to fortran90,I need to generate random numbers for matrix. This is how MATLAB code looks like,and gives me the same values all the time. rand('state',0) v = 2*(ones(c,1)*aa).*(rand(c,n)-0.5) + ones(c,1)*mm; Is there any idea how to solve this in FORTRAN?
  6. mikibelavista

    comparing arrays with different dimensions

    I have program like this program comp implicit none integer :: i real,dimension(17) :: a real,dimension(29) :: b,c open(10,file='01.txt',status='old') open(11,file='frekvencije.dat',status='old') read(10,*)a read(11,*)b do i=1,29 if (b(i)==a(1)) then c(i)=i end if end do write(*,*)c end...
  7. mikibelavista

    how to read this?

    < 1| 255.33 | < 2| 32.233353 | < 3| 27.115475 | < 4| 24.594143 | < 5| 32.685696 | < 6| 21.042452 | < 7| 47.647877 | < 8| 92.553001 | < 9| 96.665306 | How to format < and |.I have tried with a2 like character but it does not work.
  8. mikibelavista

    reading from file

    I want to skip first 19 lines(description of file),the in the 20th start numerical values what I really need.How to write this?
  9. mikibelavista

    segmentation fault

    I am running a bash script,large code.I have problems with some arrays in this subroutine: subroutine atupv(m,n,u,v) include 'ray.par' parameter(nnzmax=100000, ndmax=1000) parameter(nsconst=3*nximax*nzimax, + nszero=7*nximax*nzimax, +...
  10. mikibelavista

    didi i made a mistake,binary file?

    I have modified one code,guy creates like this input file: integer*2 veli(nxmax) open(unit=36, file='vel.mod', form='unformatted') do 130 k=1,nz do 130 j=1,ny do 131 i=1,nx 131 veli(i)=vel(i,j,k)*1000. 130 write(36) (veli(i),i=1,nx) c...
  11. mikibelavista

    creating binary file

    I need this binary for other program,want to transfer my ascii values but pr3.f: In program `pr3': pr3.f:4: real(nmax) a 1 2 Invalid kind at (2) for type at (1) -- unsupported or not permitted pr3.f:5: integer*2(nmax) b ^ Invalid form for...
  12. mikibelavista

    where construct

    I have problem that I have two arrays and I want to associate their arguments.But I have not managed this with where construct. real,dimension(100) :: d,v d has 6 different values,if d is 3,how to take all array elements of v?
  13. mikibelavista

    how to make this authomatically?

    program col2 implicit none real,dimension(5,4) :: a real,dimension(4) :: a1,a2 integer :: i,j open(10,file='m.dat',status='old') do i=1,5 read(10,*)(a(i,j),j=1,4) end do a1=a(1,:) call comp(a1,a2) write(*,*)a2 end program subroutine comp(b1,b) real,dimension(4),intent(in) :: b1...
  14. mikibelavista

    how to solve this?

    I have problem like this: do k = 1, n_data do i = 1, c work_s = vv(i,:) - x(k,:) w(k,i,:)=work_s di=1/work_s di2=di**2 di3=di**3 d(k,i,:)=di2 tri(k,i,:)=di3 select case (k) case(1) b1=d(1,:,:) t1=tri(1,1,:) q1=tri(1,2,:) res1=sum(b1,dim=1)...

Part and Inventory Search

Back
Top