gfortran -c -O3 -static -fopenmp param.f90
param.f90:78.66:
namelist / alloy_spec / z_a,x,z_b,y,nscf,c_b,c_a,fil!,latt
1
Error: Unexpected NAMELIST statement at (1)
param.f90:80.29:
read(8,NML=alloy_spec)
1
Error: Symbol 'alloy_spec' at (1) must be a NAMELIST group name
make: *** [param.o] Error 1
and the corresponding code snippet is:
CONTAINS
subroutine more()
use kinds
!This is the default to be used for calculation
!with Na_{50}Mg_{50}....firts 2 metal in PT
z_a=11; x=.5;z_b=12;y=.5;c_a=10;c_b=10;nscf=10
fil="Default calculation with NaMg!! Be sure you want this"
!User Specified value for the calculation
namelist / alloy_spec / z_a,x,z_b,y,nscf,c_b,c_a,fil!,latt
open(8,file='alloy_spec.in
')
read(8,NML=alloy_spec)
close(8)
but if I just comment out the line
z_a=11; x=.5;z_b=12;y=.5;c_a=10;c_b=10;nscf=10
fil="Default calculation with NaMg!! Be sure you want this"
and make the namelist the first executable statement, then it works
fine. I saw the std(section 5.6) and there is nothing as such.
what is the problem?
> I was trying to compile my code having a namelist exiting with an
> error:
> gfortran -c -O3 -static -fopenmp param.f90
> param.f90:78.66:
> namelist / alloy_spec / z_a,x,z_b,y,nscf,c_b,c_a,fil!,latt
> Error: Unexpected NAMELIST statement at (1)
> but if I just comment out the line
> z_a=11; x=.5;z_b=12;y=.5;c_a=10;c_b=10;nscf=10
> fil="Default calculation with NaMg!! Be sure you want this"
> and make the namelist the first executable statement, then it works
> fine. I saw the std(section 5.6) and there is nothing as such.
> what is the problem?
NAMELIST statements are specification statements, not executable
statements. Group them with the other specification statements.
--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end
> "rudra" <bnrj....@gmail.com> wrote in message
> news:2c3f2196-5888-48cf...@a32g2000yqm.googlegroups.com...
> > and make the namelist the first executable statement, then it works
> > fine. I saw the std(section 5.6) and there is nothing as such.
> > what is the problem?
>
> NAMELIST statements are specification statements, not executable
> statements. Group them with the other specification statements.
And possibly to clarify, no you did not make the namelist statement "the
first executable statement." It is never an executable statement. You
made it the last specification statement.
--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain
"rudra" <bnrj....@gmail.com> wrote in message
news:2c3f2196-5888-48cf...@a32g2000yqm.googlegroups.com...