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. melmacianalf

    Writing whole strings including whitespace?

    How about program main implicit none character*50 what read (*,'(a50)'), what write (*,'(a50)'), what end program Gordon Shumway
  2. melmacianalf

    Logical error

    ferry2: May be you can post a sample 'Input_data.dat' ? Gordon Shumway
  3. melmacianalf

    How to skip data while reading a text file?

    I see nothing wrong in it. It is very common for someone who consults a forum for the first time to post the same question in many forums. Gordon Shumway
  4. melmacianalf

    How to skip data while reading a text file?

    ...numbers). The command is sed '/\./d' old_file > new_file You can use it in F90 as follows program using_sed implicit none character(*), parameter :: sed_cmd = "sed '/\./d' old_file > new_file" integer :: sed_cmd_stat sed_cmd_stat = system (sed_cmd) end...
  5. melmacianalf

    Write a program to read the data from a file

    mikrom: Many thanks for the link to the previous post. Gordon Shumway
  6. melmacianalf

    Write a program to read the data from a file

    Tony1984: Do you still want to do it with fortran? Gordon Shumway
  7. melmacianalf

    Write a program to read the data from a file

    ...r3 open(unit=100, file='file.data') open(unit=200, file='newfile.data') !=== read and skip junk do i = 1, skip_initial_lines read(100,*) line enddo !=== read and print header do i = 1, 3 read(100,*) c1, c2, c3 write(200,*) c1, c2, c3 enddo !=== read and print...
  8. melmacianalf

    Write a program to read the data from a file

    Tony1984: I think you ahould use other languages like 'sed' to do this task. In linux try sed -ne '/^DATA 3 467/,/^ENDDATA 469/p' file.data where file.data is the file containing your data. Gordon Shumway
  9. melmacianalf

    library and/or module

    First of all, people working with large codes use some version control programs. I use darcs to update F90 codes that have millions of lines. When I update a module or any part of the code, I only pass the 'update' or 'patches' that contains new lines. Using darcs my colleague can selectively...
  10. melmacianalf

    Question In Regards To

    ...print *, minval(Dall(1:cnt)) end program min_xyz Gordon Shumway
  11. melmacianalf

    Eror when reading list, Fortran 77

    You are right, I missed it. This is most likely the source of error. Gordon Shumway
  12. melmacianalf

    Eror when reading list, Fortran 77

    ...lies. can you also post the full input from "combin.fig" In your first post you said that the error lies in the following statement READ(3,*) ((XPOS(J,IL),YPOS(J,IL),J=1,NABUR(IL)),IL=1,NL) Did u arrive at this conclusion b'coz only at this line your WRITE statement prints wrong...
  13. melmacianalf

    Eror when reading list, Fortran 77

    stenssok: From all the informations that you had given, I am able to read and print the data using f77 without any problem. I see the following options 1. Add the statement REWIND(3) just above the read statement and try again 2. Perhaps you can try to post the full code or more code...
  14. melmacianalf

    Eror when reading list, Fortran 77

    what are the values of NABURMAX and NLMAX? Gordon Shumway
  15. melmacianalf

    Eror when reading list, Fortran 77

    ...8, 0, 0/) integer, parameter :: NL = 2 real :: XPOS(8,2), YPOS(8,2) open(unit=3, file='combin.fig') read(3,*) ( (XPOS(J,IL), YPOS(J,IL), J=1,NABUR(IL)), IL=1,NL ) write(*,*) ( (XPOS(J,IL), YPOS(J,IL), J=1,NABUR(IL)), IL=1,NL ) close(3)...
  16. melmacianalf

    Matrix Diagonalization with constraint

    dani8586: Sorry my last post got scattered every where. Also I think one should add the shift for all the diagonal elements. Tell us if this is what you want. For a matrix A = 3 2 2 4 and X = 2 you can optimize a parameter 'p' such that A(1,1) = A(1,1) + p A(2,2) =...
  17. melmacianalf

    Matrix Diagonalization with constraint

    This sounds like an optimization problem to me. First if you want the lowest eigenvalue to be X for any matrix A, you have to optimize your parameters p1 and p2. Tell me where do you want your parameters to be. Along the diagonal or off-diagonal? Suppose you want p1 to be along the diagonal...
  18. melmacianalf

    Reading table input from a .txt file

    ...do read(100,*,iostat=stat) ind, i, j, val if (stat .ne. 0) exit matrix(i,j) = val...
  19. melmacianalf

    Gfortran present() function not working as expected

    ifort 12.1.0 compiles with no error message and gives the answer TTTFFF gfortran 4.6 does not compile, gives the following error message present.f90:3.17: call test_present(a,b,c) 1 Error: Dummy argument 'x1' of procedure 'test_present' at (1) has an attribute that requires an...
  20. melmacianalf

    Calling functions

    BTW, which version of gfortran creates the problem? Did u enable optimization?

Part and Inventory Search

Back
Top