Skip to content

Rules for intent in, out, inout not explained #79

@climbfuji

Description

@climbfuji

I was looking at section Input/Output Variable (argument) Rules and I noticed that the intent isn't really explained. It's explained in the CCPP v6 tech paper https://gmd.copernicus.org/articles/16/2235/2023:

Variable metadata for physics schemes in addition contain an intent attribute, which is identical to the definition in Fortran (in, inout, out). It is important to use the correct value for this attribute because the CCPP Framework may omit certain variable transformations in the auto-generated caps based on its value. For example, if a variable is declared as intent = in, automatic unit conversions will only be performed on the temporary variable before entering the scheme, and the reverse operation after returning from the scheme will be omitted. Likewise, for a variable declared as intent = out, the temporary variable for combining blocked data structures will be allocated but left uninitialized before entering the physics scheme since the scheme is expected to overwrite the contents of this variable completely. The intent information is also used by the variable tracker described in Sect. 3.7.

I think that adding this paragraph and an additional reference to the standard (the Intel developer guide will do? https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2025-2/intent.html) would be useful.

Metadata

Metadata

Assignees

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