Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'wax on, wax off' around fortran10 and macro10:) #10

Open
statespacedev opened this issue Sep 21, 2024 · 0 comments
Open

'wax on, wax off' around fortran10 and macro10:) #10

statespacedev opened this issue Sep 21, 2024 · 0 comments

Comments

@statespacedev
Copy link
Collaborator

statespacedev commented Sep 21, 2024

just a quick nutshell fwiw 'weekend update' before next 'brainstorming session'
here's the link, and will copypasta current state below - https://github.com/drforbin/decwar/tree/minimalist/docs/algebra
onward to the macro version now!:)

algebra (python, fortran10, macro10)

target is, using all three languages in parallel to reproduce feynman's table 22-3. for python things are straightforward

    y = .00225
    x = round(sqrt(1. - y**2), 7)
    for _ in range(11):
        print('%10.5f %10.5f' % (x, y))
        x2 = round(x**2 - y**2, 7)
        y2 = round(2 * x * y, 7)
        x, y = x2, y2    

with fortran10, the basic workflow for iterating between raspi and tops10 is there now. what would be nice is to be able to at the least do 'initial work' on fortran10's old school fortran iv/66 source code in a raspi ide debugger. clearly nothing like this will be possible for macro10, but for fortran10 it's worthwhile.

onboard the raspi, insure that 'sudo apt install gcc' and 'sudo apt install gdb' are go. these cover the gfortran compiler, which does seem able to handle the source code. vscode and its 'modern fortran' extension also work alright. for vscode run configurations, see tasks.json and launch.json.

here's the fortran10. note in the write (6, 10) the '6' is a 'unit designation' and the '10' is a format statement line number. currently unit designation for terminal is 6 on raspi but 5 on tops10. would like to make this portable, no differences between raspi and tops10.

      integer i
      real x, y, x2, y2
10    format (2f10.5)
      y = .00225
      x = sqrt(1. - y**2)
      do 20 i=1,11
        write (6, 10) x, y
        x2 = x**2 - y**2
        y2 = 2 * x * y
        x = x2
        y = y2
20    continue
      end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant