I\'m testing out ranges of values (-1:34 just for kicks) for the function selected_real_kind to determine the kind parameter it returns and the actual
elaborating on my comment, here is a python example:
fortrancode = """
implicit none
integer, parameter :: n=%i
integer,parameter :: rp=selected_real_kind(n)
write(*,*)n,rp
end
"""
from subprocess import call
for n in range(-1,33):
f=open('test.f','w')
f.write(fortrancode%(n)) ! <- n here gets string substituted
!for the '%i' in fortrancode
f.close()
! optional check call(['grep','n=','test.f'])
call(['gfortran','test.f','-o','test.exe'])
call(['./test.exe'])
python test.py
-1 4
0 4
1 4
...
7 8
...
18 10
19 -1
...
32 -1