Help --- continued code conversion

From: Jason (jspaldin_at_umflint.edu)
Date: 10/20/04

  • Next message: James Van Buskirk: "Re: Help --- continued code conversion"
    Date: 20 Oct 2004 12:18:32 -0700
    
    

    I am trying to learn FORTRAN so that I can convert 200 lines of FORTRAN to C++.
     
    ----------------------------------------------------------------
          program kmc

     1. implicit double precision (a-h,o-z)
     2. parameter(mmax = 300)
     3. integer height(mmax*mmax),iper(0:mmax+1), idx(4), idy(4)
     4. dimension rho(mmax,mmax)
     5. data idx/1, 0, -1, 0/, idy/0, 1, 0, -1/
     6. common/iseed/idum

    ----------------------------------------------------------------

    //c++ code maybe
    1. double a,b,c,d,e,f,g,h,o,p,q,r,s,t,u,v,w,x,y,z;
    2. int mmax = 300;
    3. int height[mmax][mmax];
            int iper[mmax+1];
            int idx[4];
            int idy[4];
    4. --------I am not sure how to handle this
    5. idx[0] = 1; idx[1] = 0; idx[2] = -1; idx[3] = 0;
            idy[0] = 0; idy[1] = 1; idy[2] = 0; idy[3] = -1;
    6. --------I am not sure how to handle this

    -------------------------------------------------------------------

    Any suggestions?


  • Next message: James Van Buskirk: "Re: Help --- continued code conversion"

    Relevant Pages

    • Re: Basic question on local variable
      ... implicit none ... end program funtest ... double precision function addten ... I compiled this with intel fortran on windows. ...
      (comp.lang.fortran)
    • Re: Basic question on local variable
      ... I have a very basic question. ... implicit none ... double precision x ... Note that Fortran does not guarantee pass by reference, ...
      (comp.lang.fortran)
    • Re: Basic question on local variable
      ... Fortran passes arguments by reference (unless the ... compilers). ... double precision function addtenresult ... implicit none ...
      (comp.lang.fortran)
    • Basic question on local variable
      ... implicit none ... end program funtest ... double precision function addten ... I compiled this with intel fortran on windows. ...
      (comp.lang.fortran)
    • Object Oriented Optimization
      ... I have the following problem with re-using a fortran 77 optimization ... double precision, dimension, intent:: co ... several objectives and constraints. ...
      (comp.lang.fortran)