mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-22 07:09:47 +00:00
9e8c968bff
* testing/examples/ob-C-test.org: * testing/examples/ob-fortran-test.org: * testing/examples/ob-maxima-test.org: * testing/lisp/test-ob-python.el (test-ob-python/colnames-yes-header-argument-again): (test-ob-python/colnames-no-header-argument-again): * testing/lisp/test-ob.el (test-ob/do-not-resolve-to-partial-names-data): Use NAME instead of TBLNAME. TBLNAME is deprecated syntax since Org 8.
2.3 KiB
2.3 KiB
a collection of examples for ob-fortran tests
simple programs
print *, 'Hello world'
integer, parameter :: i = 10
write (*, '(i2)') i
variable resolution
write (*, '(i2)') N
Define for preprocessed fortran
implicit none
write (*, '(i2)') N
write (*, '(a4)') s
arrays
Real array as input
write (*, '(3f5.2)'), s
1.0 |
2.0 |
write (*, '(2f5.2)'), s
matrix
Real matrix as input
0.0 | 42.0 |
0.0 | 0.0 |
0.0 | 0.0 |
0.0 | 0.0 | 0.0 |
0.0 | 0.0 | 42.0 |
write (*, '(i2)'), nint(s(1,2))
write (*, '(i2)'), nint(s(2,3))
failing
Should fail (TODO: add input variables for the case with explicit program statement)
program ex
print *, "output of ex program"
end program ex
Fails to compile (TODO: error check in ob-fortran.el)
print *, s
Should fail to compile with gfortran
program ex
integer*8 :: i
end program ex
programs input parameters
Pass parameters to the program
character(len=255) :: cmd
call get_command_argument(1, cmd)
write (*,*) trim(cmd)