I have a program I am trying to understand. According to the function definition(vdot), the function acccepts arrays as inputs. But the function is called with a scalar input and it works just fine. Shouldnt it throw an error ?(adsbygoogle = window.adsbygoogle || []).push({});

w and v are arrays of different sizes. ms is a scalar constant.

Calling it asCode (Text):real*8 function vdot(x,y,size)

real*8 x(*),y(*)

integer size,j

vdot = 0.d0

do j = 1,size

vdot = vdot + x(j)*y(j)

end do

end

Code (Text):do k = 1,i

kp = (k-1)*ms+1

h(k,i) = vdot(w,v(kp),ms)

enddo

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Fortran function calling with wrong arguments

Loading...

Similar Threads for Fortran function calling |
---|

Fortran Successive Over Relaxation Method in FORTRAN |

If statement for Monte Carlo integration |

C/++/# How to use C++ in studying calculus |

Fortran How to buy Fortran Programming Software Commersial License |

Fortran Fortran external functions vs subroutines |

**Physics Forums | Science Articles, Homework Help, Discussion**