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 SkipVought 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?

    In cases like this, I have been using 'sed' (thanks to mikrom) to delete the lines containing '.' (in real 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'...
  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

    You can try something like this program extract implicit none integer, parameter :: skip_initial_lines = 52 integer, parameter :: print_middle_lines = 471 integer :: i character(len=100) :: line character(len=10) :: c1, c2, c3 double precision :: r1, r2, r3...
  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

    program min_xyz implicit none...
  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

    stenssok: It is still not clear where the error 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...
  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

    Did you declare XPOS and YPOS as real data? Here is what I did program main implicit none integer :: J, IL integer, parameter :: NABUR(4) = (/8, 8, 0, 0/) integer, parameter :: NL = 2 real :: XPOS(8,2), YPOS(8,2) open(unit=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

    Try something like this program read_table implicit none integer, parameter :: size_matrix = 4...
  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