rajabadsha
Programmer
Hi,
I am new in Fortran and trying to convert the following Fortran program in C:
Program contbc
parameter (ndwgt=1000,ndpow=1000)
dimension cplot(ndwgt,ndpow)
character*80 project_name
character*80 control_file
open(10,file="setup.dat",form="formatted",
x status="old")
200 format(a)
read(10,200) project_name
write(6,200) project_name
read(10,200) control_file
write(6,200) control_file
read(10,*) nwgt_start,nwgt_end,nwgt_step
write(6,*) nwgt_start,nwgt_end,nwgt_step
read(10,*) pow_start,pow_end,pow_step
write(6,*) pow_start,pow_end,pow_step
close(10)
I have the following questions:
1) What does character*80 means? Why is there a * after the character?
2) What does dimension cplot means? Is cplot a keyword?
3) How does read and write works for:
a) read(10,*) nwgt_start,nwgt_end,nwgt_step
b) write(6,*) nwgt_start,nwgt_end,nwgt_step
How is nwgt_start, nwgt_end, and nwgt_step used without being initiated?
I need help...
I am new in Fortran and trying to convert the following Fortran program in C:
Program contbc
parameter (ndwgt=1000,ndpow=1000)
dimension cplot(ndwgt,ndpow)
character*80 project_name
character*80 control_file
open(10,file="setup.dat",form="formatted",
x status="old")
200 format(a)
read(10,200) project_name
write(6,200) project_name
read(10,200) control_file
write(6,200) control_file
read(10,*) nwgt_start,nwgt_end,nwgt_step
write(6,*) nwgt_start,nwgt_end,nwgt_step
read(10,*) pow_start,pow_end,pow_step
write(6,*) pow_start,pow_end,pow_step
close(10)
I have the following questions:
1) What does character*80 means? Why is there a * after the character?
2) What does dimension cplot means? Is cplot a keyword?
3) How does read and write works for:
a) read(10,*) nwgt_start,nwgt_end,nwgt_step
b) write(6,*) nwgt_start,nwgt_end,nwgt_step
How is nwgt_start, nwgt_end, and nwgt_step used without being initiated?
I need help...