emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
blob 6906b24572b3ea10bd9f89ad9a8ec9f64cf99d12 1277 bytes (raw)
name: testing/examples/ob-fortran-test.org 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 
* Test org fortran file
#+begin_src fortran
print *, 'Hello world'
#+end_src

#+begin_src fortran
integer, parameter :: i = 10
print *, 'i = ', i
#+end_src

#+begin_src fortran :var N = 10
print *, 'N = ', N
#+end_src

Define for preprocessed fortran
#+begin_src fortran :defines N 42
implicit none
print *, 'N = ', N
#+end_src

#+begin_src fortran :var s="word"
print *, 's = ', s
print *, 'size(s) = ', size(s)
#+end_src

#+begin_src fortran :var s=42.0
print *, 's = ', s
print *, 'kind(s) = ', kind(s)
#+end_src

#+begin_src fortran
program ex
print *, "output of ex program"
end program ex
#+end_src

Should fail (TODO: add input variables for the case with explicit
program statement)
#+begin_src fortran :var s="word"
program ex
print *, "output of ex program"
end program ex
#+end_src

Real array as input
#+begin_src fortran :var s='(1.0 2.0 3.0)
print *, s
#+end_src

Fails to compile (TODO: error check in ob-fortran.el)
#+begin_src fortran :var s='(1 ())
print *, s
#+end_src

Should fail to compile with gfortran
#+begin_src fortran :flags --std=f95 --pedantic-error
program ex
integer*8 :: i
end program ex
#+end_src

Pass parameters to the program
#+begin_src fortran :cmdline "23"
character(len=255) :: cmd
call get_command(cmd)
write (*,*) trim(cmd)
#+end_src

debug log:

solving 6906b24 ...
found 6906b24 in https://list.orgmode.org/orgmode/CAEBOWYAmbwOvWu6GBaoOkGhWU=pFMWKdOvfQmeAqRNBNcmBfsg@mail.gmail.com/

applying [1/1] https://list.orgmode.org/orgmode/CAEBOWYAmbwOvWu6GBaoOkGhWU=pFMWKdOvfQmeAqRNBNcmBfsg@mail.gmail.com/
diff --git a/testing/examples/ob-fortran-test.org b/testing/examples/ob-fortran-test.org
new file mode 100644
index 0000000..6906b24

Checking patch testing/examples/ob-fortran-test.org...
Applied patch testing/examples/ob-fortran-test.org cleanly.

index at:
100644 6906b24572b3ea10bd9f89ad9a8ec9f64cf99d12	testing/examples/ob-fortran-test.org

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).