Skip to content

aed_carbon and simExposed issue causing seg fault #73

@rqthomas

Description

@rqthomas

I was able to diagnose the cause of segmentation fault:

When simExposed == false, the data%id_drytime diagnostic and data%id_atemp environment link are not defined.

data%id_drytime = aed_define_sheet_diag_variable('drytime','d','time cell has been exposed')

IF( data%simExposed ) data%id_atemp = aed_locate_sheet_global('air_temp')

Yet they are used in aed_calculate_riparian_carbon without a check for simExposed == false

https://github.com/AquaticEcoDynamics/libaed-water/blob/4842d506c1fba931333792c63edbca2f8e5d7be5/src/aed_carbon.F90#L957C1-L964C10

and

atemp = _STATE_VAR_S_(data%id_atemp) ! local air temperature

I am happy to do a PR to fix this but I am not sure what behavoir you want. Do you want the diagnostic and environment link to occur regardless of the value for simExposed or do you want the lines in aed_calculate_riparian_carbon to be run only if simExposed == false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions