Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29252 Discussions

Error #5082 in transferring a value represented by a pointer to another variable

pranava_c_
Beginner
833 Views

A value stored in a structure pointed by a pointer is unable to be passed on in another variable

 

temp_crowding_dist = pop%ind(1).crowd_dist 

 Following error is showing while building the project

Error    1     error #5082: Syntax error, found '.' when expecting one of: * ) :: , <END-OF-STATEMENT> ; . % (/ + - : ] /) ' ** / // > .LT. ...    D:\Crowding_dist\Fortran_code\F_NSGA_II\Crowding_Distence_ref_2\Crowding_Distence_ref_2\crowddist.f90    177    

If I comment this line and check the value of pop%ind(1).crowd_dist  in watch window by running upto that line, it is showing the correct value

PS:

TYPE population 
    TYPE (individual), DIMENSION(:) , POINTER :: ind
END TYPE 

TYPE individual
    INTEGER, POINTER                        :: rank
    DOUBLE PRECISION, POINTER               :: constr_violation
    DOUBLE PRECISION, POINTER               :: crowd_dist
    DOUBLE PRECISION, DIMENSION(:), POINTER :: obj
    DOUBLE PRECISION, DIMENSION(:), POINTER :: constr    
    TYPE (gene_bit), DIMENSION(:), POINTER  :: gene    
    DOUBLE PRECISION, DIMENSION(:), POINTER :: xbin    
    DOUBLE PRECISION, DIMENSION(:), Pointer :: xreal    
END TYPE

 

0 Kudos
1 Solution
mecej4
Honored Contributor III
833 Views

Replace the non-standard component separator '.' by '%'. It seems that the compiler does not recognize the period as equivalent to the % sign in all contexts.

View solution in original post

0 Kudos
3 Replies
mecej4
Honored Contributor III
834 Views

Replace the non-standard component separator '.' by '%'. It seems that the compiler does not recognize the period as equivalent to the % sign in all contexts.

0 Kudos
Steven_L_Intel1
Employee
833 Views

If you start using % you have to keep using %. Mixing them is not nice. But you should use % always and drop the dot.

0 Kudos
pranava_c_
Beginner
833 Views

Thanx very very much. It worked :)

0 Kudos
Reply