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

    Fortran runtime error: End of file while reading data from unformatted file

    Well, for starters, if what you have posted reflects exactly your source code...line 94 has the '&' in the wrong column; it needs to be in column 6
  2. salgerman

    Little help with a code

    It's always a bit difficult to help without knowing the details; when writing a little processor program like this one, often times one also designs the format of the expected data to make things simpler. For example, I think that having x,y pair sets, one after the other, in one single file is...
  3. salgerman

    Library Power Station Fortran

    You have one too many "end", remove the one right below the call to sub LINRG
  4. salgerman

    Compiler Fortran RADAU

    Try the following: Those arrays that were declared with full length, x(3), in the main program but with just on, x(1), in the subroutines, declared them with full length in every subroutine, too.
  5. salgerman

    Interface between Fortran77 program and Fortran90 program

    Well, it was mentioned that each set of sources is an actual program, each with its own "program" unit. In any case, there is no need for a formal interface, if you don't want one. So, it all depends what you want to achieve...if the Fortran 90 needs nothing from the "main" of the Fortran 77...
  6. salgerman

    Polymorphism / Dynamic dispatch? Fortran 90.

    And, as I mentioned before, for as long as you need to tell things apart you are going to need a "select" or an "if-then" somewhere, there is no way around it...even the example with pointers needs a "select" to assign the pointer, so, what's the point of complicating the matter with potential...
  7. salgerman

    Polymorphism / Dynamic dispatch? Fortran 90.

    module my_module implicit none integer :: a contains subroutine alpha() a = 1 end subroutine alpha subroutine beta() a = 2 end subroutine beta subroutine gamma() a = 3 end subroutine gamma end module my_module program main use...
  8. salgerman

    Polymorphism / Dynamic dispatch? Fortran 90.

    And, no, with modules you do not need to pass a long list of arguments, just encapsulate the data and the functions that manipulate it in the same module.
  9. salgerman

    Polymorphism / Dynamic dispatch? Fortran 90.

    mikrom beat me to the punch...I was about to say just about the same; basically, you cannot get away from the 'if-then' in some shape or form if you want to tell things apart. So, instead of putting the "if-then" in the main program, you place it inside the single function being call.
  10. salgerman

    gfortran initialized allocated arrays

    Yes, they are both officially accepted; though, it is recommended to go the "array(:,:,...)" route for clarity, for you and others reading your code. To quote a couple of items from "The Zen of Python": - Explicit is better than implicit. - Readability counts.
  11. salgerman

    Writing an equantion in Compaq Visual fortran 6.1

    I suggest you do a few things: - break down the equation into several lines to make it easier to read and make it look as much as possible to the textbook - leave the "sign(0.8,-0.2)" operation out of the double loop, its value does not change with the indices...it will always be -0.8 -...
  12. salgerman

    Problem with cubic spline interplation

    In line 142 if the attached spline.f90 file you have "xn(i)=int", except that "int" has never been initialized nor assigned any value, not before entering the loop, not in the loop, not anywhere. By the way, for your variable names, try to use something other that Fortran keywords for...
  13. salgerman

    EXIT LABELED DO LOOP FORTRAN 90

    program rbx integer i, j real*8 z(5,10) z=0.0 outer: do i = 1, 5, 1 do j = 1, 10, 1 ! complicated mathematics to calculate Z(i,j) ! test Z(i,j)...but do it correctly; for example, can Z(i,j) be negative? if ( z(i,j) > 1.0e-06 ) then...
  14. salgerman

    [HELP] Math program with fortran 90

    Lost in translation", I am sure judging by "fortan 90 and his logical background"; not uncommon, after all, most people in the world are not native English speakers and this site, I presume, can be reached from anywhere.
  15. salgerman

    [HELP] Math program with fortran 90

    Maybe it's supposed to be IV program? as in Intel Visual? [bigsmile] Either way, he's got some learning to do.
  16. salgerman

    Can you avoid temporary storage when overloading operators?

    just a comment regarding the loop in the function above; this: do i=1,n V2%q(i) = s + V1%q(i) end do can be more efficiently written like this: V2%q(1:n) = s + V1%q(1:n)
  17. salgerman

    How to parallelize a counter?

    I think what you need to do is calculate the "counter" as a function of the loop variables so that it can be calculated any time independent of the order in which the looks are carried out (in parallel). Something like: cont = ii + ncx*(jj-1) + ncx*ncy*(kk-1)
  18. salgerman

    Can you avoid temporary storage when overloading operators?

    hhhmmm, operator overloading is not something I do often; but, first...I am curious, why are you implementing something Fortran already does? I guess there is more to 'vector' type, but you don't show it. Is it more than just an array? And size and resize does not count! That can be done...
  19. salgerman

    Do loop in ascending and descending order

    Maybe something like this? program updown integer i, iv, iinc integer j, jv, jinc integer k, kv, kinc integer nmax write(*,'("Nmax ?:",$)') read(*,*) nmax iv = 0 ; iinc = -1 jv = 0 ; jinc = -1 kv = 0 ; kinc = -1 do i = 1, 2*nmax call step (...
  20. salgerman

    Peppe89

    is this a guessing game you are writing? Please provide more context, like your fortran program and tell us what is happening or not happening.

Part and Inventory Search

Back
Top