How to declare a complex type array in fortran 90 -
i need help initialize complex type 1-d array in fortran on linux
complex(kind=dp),dimension(8),public:: zc = (/(0.0_dp,0.0_dp) ,(-3.496991526333d001,0.0_dp) , ( -3.944481647220d+000 , 0.0_dp ) , (-4.294180799072d+000 , 0.0_dp ) , (-4.294180799072d+000, -1.0_dp) , ( -3.944481647220d+000,-1.0_dp ) , (-3.496991526333d- 001,-1.0_dp ) , (0.0_dp,-1.0_dp)/) ! z computational above statement works in fortran powerfulness station( windows ) not on linux. gives next error
missing ')' in statement @ or before (1) note : '1' comma b/w 3rd , 4th complex no. extension of programme .f90
you must utilize right way of continuing lines. if utilize fixed form (usually .f,.form) place character on 6th column of new line , statement. utilize this, otherwise -3.496991526333d- 001 coudn't work, because spaces of import in free form. ! denotes comments in free form. if utilize free form, right number. sure not go past column 72 in fixed form.
for example:
complex(kind=dp),dimension(8),public:: zc = (/(0.0_dp,0.0_dp) ,(-3.496991526333d001,0.0_dp) , * ( -3.944481647220d+000 , 0.0_dp ) , (-4.294180799072d+000 , 0.0_dp ) , * (-4.294180799072d+000, -1.0_dp) , ( -3.944481647220d+000,-1.0_dp ) , * (-3.496991526333d-001,-1.0_dp ) , (0.0_dp,-1.0_dp)/) c z computational in free form (usually .f90) utilize & @ of line go on on next one.
complex(kind=dp),dimension(8),public:: zc = (/(0.0_dp,0.0_dp) ,(-3.496991526333d001,0.0_dp) , & ( -3.944481647220d+000 , 0.0_dp ) , (-4.294180799072d+000 , 0.0_dp ) , & (-4.294180799072d+000, -1.0_dp) , ( -3.944481647220d+000,-1.0_dp ) , & (-3.496991526333d-001,-1.0_dp ) , (0.0_dp,-1.0_dp)/) !z computational you should read more right soource form in fortran tutorial.
arrays fortran fortran90 complex-numbers
No comments:
Post a Comment