SuOraiste
Programmer
- Sep 23, 2011
- 5
Hello
i'm trying as a test, to parse some data from a shell script into a fortran script.
I want to do this with a namelist. Here is what I've got so far
SHELL SCRIPT:
#!/bin/bash
cat > CTLFILE <<EOF
&CTLLIST
name="myname",
age="myage" /
EOF
gfortran -ffixed-line-length-none -Wall -o namelist.x namelist.f
./namelist.x < CTLFILE
exit
FORTRAN:
PROGRAM namelist
IMPLICIT NONE
CHARACTER (LEN=6) :: name
CHARACTER (LEN=5) :: age
NAMELIST /CTLLIST/ name, age
PRINT*,name," ",age
END PROGRAM namelist
This procedure should work but the program just simply outputs an empty string, just a space.
any sugestions in what i'm doing wrong.
thanks
SuOraiste
i'm trying as a test, to parse some data from a shell script into a fortran script.
I want to do this with a namelist. Here is what I've got so far
SHELL SCRIPT:
#!/bin/bash
cat > CTLFILE <<EOF
&CTLLIST
name="myname",
age="myage" /
EOF
gfortran -ffixed-line-length-none -Wall -o namelist.x namelist.f
./namelist.x < CTLFILE
exit
FORTRAN:
PROGRAM namelist
IMPLICIT NONE
CHARACTER (LEN=6) :: name
CHARACTER (LEN=5) :: age
NAMELIST /CTLLIST/ name, age
PRINT*,name," ",age
END PROGRAM namelist
This procedure should work but the program just simply outputs an empty string, just a space.
any sugestions in what i'm doing wrong.
thanks
SuOraiste