From: Christopher Dimech <dimech@gmx.com>
To: Christopher Dimech <dimech@gmx.com>
Cc: Org Mode List <emacs-orgmode@gnu.org>, Eric S Fraga <e.fraga@ucl.ac.uk>
Subject: Re: ob-fortran behaviour
Date: Thu, 6 May 2021 01:29:31 +0200 [thread overview]
Message-ID: <trinity-5b0a355a-8b88-4e39-a007-6541af5c9e12-1620257371948@3c-app-mailcom-bs16> (raw)
In-Reply-To: <trinity-7e218b1b-73f6-4387-8924-5bcf705c094e-1620256191880@3c-app-mailcom-bs16>
There exists no problem with fortran.
My brain was not open because u(i) gets beyond its bounds.
> Sent: Thursday, May 06, 2021 at 11:09 AM
> From: "Christopher Dimech" <dimech@gmx.com>
> To: "Eric S Fraga" <e.fraga@ucl.ac.uk>
> Cc: "Org Mode List" <emacs-orgmode@gnu.org>
> Subject: ob-fortran behaviour
>
> Fortran is behaving in a weird way
>
> #+BEGIN_SRC fortran
> program matrx_vectr_mult
> implicit none
>
> integer :: m, n, i, j, k
> real :: a(5,3), u(3), v(5), rsum
>
> m = 5; n = 3
> a = 0.0; u = 0.0; v = 0.0
>
> k = 0
> do j = 1, n
> do i = 1, m
> k = i + j
> a(i,j) = real(k)
> u(i) = real(3*i)
> end do
> end do
>
> do i = 1, m
> rsum = 0.0
> do j = 1, n
> rsum = (a(i,j) * u(j)) + rsum
> end do
> v(i) = rsum
> end do
>
> write (*,*) "a * *", " * ", "u", " * ", "v"
> write (*,*) a(1,:), "*", u(1), "*", v(1)
> write (*,*) a(2,:), "*", u(2), "*", v(2)
> write (*,*) a(3,:), "*", u(3), "*", v(3)
> write (*,*) a(4,:), "* * *", v(4)
> write (*,*) a(5,:), "* * *", v(5)
>
> print *, "---"
> write (*,*) a
>
> end program
> #+END_SRC
>
> #+RESULTS:
> | a | * | * | * | u | * | v | | | | | | | | |
> | 12.0 | 3.0 | 4.0 | * | 3.0 | * | 90.0 | | | | | | | | |
> | 15.0 | 4.0 | 5.0 | * | 6.0 | * | 114.0 | | | | | | | | |
> | 4.0 | 5.0 | 6.0 | * | 9.0 | * | 96.0 | | | | | | | | |
> | 5.0 | 6.0 | 7.0 | * | * | * | 114.0 | | | | | | | | |
> | 6.0 | 7.0 | 8.0 | * | * | * | 132.0 | | | | | | | | |
> | --- | | | | | | | | | | | | | | |
> | 12.0 | 15.0 | 4.0 | 5.0 | 6.0 | 3.0 | 4.0 | 5.0 | 6.0 | 7.0 | 4.0 | 5.0 | 6.0 | 7.0 | 8.0 |
>
>
> ---------------------
> Christopher Dimech
> General Administrator - Naiad Informatics - GNU Project (Geocomputation)
> - Geophysical Simulation
> - Geological Subsurface Mapping
> - Disaster Preparedness and Mitigation
> - Natural Resource Exploration and Production
> - Free Software Advocacy
>
>
next prev parent reply other threads:[~2021-05-05 23:52 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-05 5:46 Multiple calc commands with orgbabel pietru
2021-05-05 6:33 ` Eric S Fraga
2021-05-05 6:40 ` pietru
2021-05-05 6:41 ` Eric S Fraga
2021-05-05 6:45 ` pietru
2021-05-05 15:11 ` Matt Price
2021-05-05 15:29 ` pietru
2021-05-05 16:19 ` Tom Gillespie
2021-05-05 16:39 ` Eric S Fraga
2021-05-05 17:03 ` Tom Gillespie
2021-05-06 11:16 ` Bastien
2021-05-06 15:21 ` Tom Gillespie
2021-05-07 4:04 ` Bastien
2021-05-07 7:01 ` Tom Gillespie
2021-05-07 7:31 ` Bastien
2021-05-05 20:24 ` pietru
2021-05-05 23:09 ` ob-fortran behaviour Christopher Dimech
2021-05-05 23:29 ` Christopher Dimech [this message]
2021-05-06 2:24 ` ob-fortran fixes to column position 6 and subroutine keywords pietru
2021-05-05 7:12 ` Multiple calc commands with orgbabel Dr. Arne Babenhauserheide
2021-05-05 7:20 ` pietru
2021-05-05 7:23 ` Eric S Fraga
2021-05-05 7:26 ` pietru
2021-05-05 7:59 ` Eric S Fraga
2021-05-05 8:00 ` pietru
2021-05-05 8:02 ` Calc commands for factoring, matrix computations and taking derivatives pietru
2021-05-05 9:02 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 10:04 ` pietru
2021-05-05 10:15 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 10:38 ` Christopher Dimech
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-5b0a355a-8b88-4e39-a007-6541af5c9e12-1620257371948@3c-app-mailcom-bs16 \
--to=dimech@gmx.com \
--cc=e.fraga@ucl.ac.uk \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.