[Solved] fortran code do not cycle


As stated already in the comments, your program has many code style problems (wrong intentation, …) as well as not using best Fortran practises (e.g. implicit none). Your problem can be solved by trivial usage of a debugger.

An obvious problem is that you are using uninitialized variables in the functions:

  1. subroutine f(x,y,fx,fy) : rho, mu, R in calculation of fx and fy, which produces NaN
  2. function H() : ome, rho, mu, …

and similarly on other places

solved fortran code do not cycle