PyCrop2ML icon indicating copy to clipboard operation
PyCrop2ML copied to clipboard

Translated Array variable in test case for F90 has syntax error

Open MengZhang opened this issue 6 years ago • 0 comments

Following is the input XML for translation, generated test case code, compiler error for the generated code and revision of code for passing the compiling.

*XML: <InputValue name="DLAYR">[5,5,10,10,20,20,40,40,0,0]</InputValue>

*Generated F90 test case code: INTEGER:: NL REAL, ALLOCATABLE, DIMENSION(NL) :: DLAYR .... NL = 10 DLAYR = [5,5,10,10,20,20,40,40,0,0]

*Compiler error message: REAL, ALLOCATABLE, DIMENSION(NL) :: DLAYR 1 Error: Explicit shaped array with nonconstant bounds at (1)

 DLAYR = [5,5,10,10,20,20,40,40,0,0]
1

Error: Incompatible ranks 0 and 1 in assignment at (1)

  • Revised code: REAL, DIMENSION(10) :: DLAYR = [5,5,10,10,20,20,40,40,0,0]

MengZhang avatar Apr 11 '19 15:04 MengZhang