Added example and bin/irpf90. irpman needs to be written

Version:1.1.14
This commit is contained in:
Anthony Scemama 2009-09-14 18:40:08 +02:00
parent 50cfddd824
commit 8d36c357ae
8 changed files with 98 additions and 1 deletions

12
bin/irpf90 Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/python
import os
import sys
wd = os.path.abspath(os.path.dirname(__file__))
wd += "/../src/"
sys.path.append(wd)
for p in sys.path:
print p
import irpf90

10
bin/irpman Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/python
import os
import sys
wd = os.path.abspath(os.path.dirname(__file__))
wd += "/../src/"
sys.path.append(wd)
import irpman

12
example/Makefile Normal file
View File

@ -0,0 +1,12 @@
IRPF90 = irpf90 #-a -d
FC = gfortran
FCFLAGS= -ffree-line-length-none -O2
SRC=
OBJ=
LIB=
include irpf90.make
irpf90.make: $(wildcard *.irp.f)
$(IRPF90)

16
example/input.irp.f Normal file
View File

@ -0,0 +1,16 @@
BEGIN_PROVIDER [ integer, d1 ]
&BEGIN_PROVIDER [ integer, d2 ]
&BEGIN_PROVIDER [ integer, d3 ]
&BEGIN_PROVIDER [ integer, d4 ]
&BEGIN_PROVIDER [ integer, d5 ]
BEGIN_SHELL [ /usr/bin/python ]
for i in range(1,6):
print " print *, 'd%d'"%(i,)
print " read(*,*) d%d"%(i,)
if i > 1:
print " ASSERT ( d%d > d%d )"%(i,i-1)
END_SHELL
END_PROVIDER

View File

@ -0,0 +1,13 @@
program irp_example1
BEGIN_SHELL [ /bin/bash ]
echo print *, \'Compiled by `whoami` on `date`\'
echo print *, \'$FC $FCFLAGS\'
echo print *, \'$IRPF90\'
END_SHELL
call run
end
subroutine run
print *, 't = ', t
end

View File

@ -0,0 +1,7 @@
program irp_example2
print *, "Example 2"
print *, 't = ', t
! IRP_WRITE t
end

27
example/uvwt.irp.f Normal file
View File

@ -0,0 +1,27 @@
BEGIN_PROVIDER [ integer, t ]
t = u1+v+4
END_PROVIDER
BEGIN_PROVIDER [integer,w]
w = d5+3
END_PROVIDER
BEGIN_PROVIDER [ integer, v ]
v = u2+w+2
END_PROVIDER
BEGIN_PROVIDER [ integer, u1 ]
integer :: fu
u1 = fu(d1,d2)
PROVIDE u2
END_PROVIDER
BEGIN_PROVIDER [ integer, u2 ]
integer :: fu
u2 = fu(d3,d4)
END_PROVIDER
integer function fu(x,y)
integer :: x,y
fu = x+y+1
end function

View File

@ -1 +1 @@
version = "1.1.13"
version = "1.1.14"