Skip to content

STICS Fortran source code generated for Dynamic memory allocation statement #19

@fabiooliveira72

Description

@fabiooliveira72

Dynamically allocated memory for some variables in STICS need to be declared as allocatable. CROP2ML is not generating it as allocatable, this produces a compilation issue to access the arrays. See below which are the files and variables change manually input variables in

Layers_temp.f90, line ~10-13

> REAL ,  DIMENSION(: ), INTENT(IN) :: temp_profile
> REAL ,  DIMENSION(: ), INTENT(OUT) :: layer_temp
New code:
> REAL ,  ALLOCATABLE,  DIMENSION(: ), INTENT(IN) :: temp_profile
> REAL ,  ALLOCATABLE, DIMENSION(: ), INTENT(OUT) :: layer_temp

Temp_profile.f90, line ~17:

> REAL , DIMENSION(: ), INTENT(OUT) :: prev_temp_profile
New code:
> REAL , ALLOCATABLE, DIMENSION(: ), INTENT(OUT) :: prev_temp_profile
And line ~127:
> REAL , DIMENSION(: ), INTENT(OUT) :: temp_profile
New code:
> REAL , ALLOCATABLE, DIMENSION(: ), INTENT(OUT) :: temp_profile
					
Update.f90 needs allocatable and dimension is wrong too needs to be changed (1) to (:). in line 14:
> REAL , ALLOCATABLE, DIMENSION(: ), INTENT(OUT) :: prev_temp_profile
New code:
> REAL , ALLOCATABLE, DIMENSION(: ), INTENT(OUT) :: prev_temp_profile
				
Soil_tempComponent.f90 needs allocatable the following variables, line ~27:
> REAL , ALLOCATABLE, DIMENSION(: ), INTENT(INOUT) :: prev_temp_profile
> REAL , ALLOCATABLE, DIMENSION(: ), INTENT(OUT) :: temp_profile
> REAL , ALLOCATABLE, DIMENSION(: ), INTENT(OUT) :: layer_temp

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions