Skip to content

Fix logic for ctl%rof_from_glc #114

@billsacks

Description

@billsacks

This is a minor issue that doesn't cause any problems in practice right now, but should probably be fixed to avoid creating problems in the future.

The logic for ctl%rof_from_glc is:

if (fldchk(importState, 'Fgrg_rofl') .and. fldchk(importState, 'Fgrg_rofl')) then
ctl%rof_from_glc = .true.
else
ctl%rof_from_glc = .false.
end if

Note the duplication of Fgrg_rofl as opposed to Fgrg_rofi.

I think the right logic here is something like:

if (fldchk(importState, 'Fgrg_rofl') .and. fldchk(importState, 'Fgrg_rofi')) then
   ctl%rof_from_glc = .true.
else if (fldchk(importState, 'Fgrg_rofl') .or. fldchk(importState, 'Fgrg_rofi')) then
   ! ABORT WITH AN ERROR: I think it should never be the case that one of these fields is present but not the other; I think if it could be the case, some other code may need to be generalized to allow for this possibility
else
   ctl%rof_from_glc = .false.
end if

But I'd like a second set of eyes on that to make sure it looks right.

Tagging @olyson who rediscovered this issue that I had mentioned as a side note in #103 (comment) but never followed up on. And tagging @ekluzek or @slevis-lmwg , who were involved in that earlier discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions