Skip to content

Fix snowmelt declaration that should be illegal#695

Open
Whyborn wants to merge 3 commits into
mainfrom
tidy-up-snowmelt-declaration
Open

Fix snowmelt declaration that should be illegal#695
Whyborn wants to merge 3 commits into
mainfrom
tidy-up-snowmelt-declaration

Conversation

@Whyborn
Copy link
Copy Markdown
Contributor

@Whyborn Whyborn commented Feb 23, 2026

CABLE

Thank you for submitting a pull request to the CABLE Project.

Description

The declaration of the ssnow dummy variable in snow_melting seems like it should be illegal, as it's using a non-parameter value to declare an explicit array shape. The sequence around this call is also somewhat non-sensical, as the dummy variable is INTENT(OUT), so any information set prior to this call is meaningless.

Type of change

Please delete options that are not relevant.

  • Bug fix

Checklist

  • The new content is accessible and located in the appropriate section
  • I have checked that links are valid and point to the intended content
  • I have checked my code/text and corrected any misspellings

Testing

  • Are the changes bitwise-compatible with the main branch? If working on an optional feature, are the results bitwise-compatible when this feature is off? If yes, copy benchcab output showing successful completion of the bitwise compatibility tests or equivalent results below this line.

  • Are the changes non bitwise-compatible with the main branch because of a bug fix or a feature being newly implemented or improved? If yes, add the link to the modelevaluation.org analysis versus the main branch or equivalent results below this line.


📚 Documentation preview 📚: https://cable--695.org.readthedocs.build/en/695/

REAL, INTENT(IN) :: dels ! integration time step (s)

REAL, DIMENSION(mp), INTENT(OUT) :: snowmlt ! snow melt
REAL, DIMENSION(:), ALLOCATABLE, INTENT(OUT) :: snowmlt ! snow melt
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer snowmlt to ALLOCATED in ssnow_main and then passed down into the SUBROUTINEs snow_melting(), cbl_thermal etc. consistently rather than in a lower routine, then up and down.

! REAL, DIMENSION(:), INTENT(INOUT) :: snowmlt ! replaced by rk4417 - phase2
INTEGER :: k,i

snowmlt = 0.0 ! inserted by rk4417 - phase2
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check whether this is a science change or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants