Skip to content

Host cap generation bug with long standard names #664

Description

@peverwhee

Description

When a standard name is:

  1. 111 characters, capgen dies at line 218 of fortran_write.py - line_continue = outstr[best+1:].lstrip()[0] != '!'because outstr.len() == best + 1
  2. greater than 111 characters, capgen tries to wrap the standard name

Steps to Reproduce

Basically, replace any standard name that appears in the variable lists in ccpp_physics_suite_variables with a name that is >= 111 characters. Here's what I did:

  1. cd test/capgen_test
  2. for f in *; do [ -f "$f" ] && sed -i 's/potential_temperature_at_interface/potential_temperature_at_interfaces_with_respect_to_the_smallest_hairs_on_robert_redfords_beautiful_blonde_head/g' "$f"; done (to change to a 111 character name)
  3. ./run_test - observe the error
  4. git stash - reset
  5. for f in *; do [ -f "$f" ] && sed -i 's/potential_temperature_at_interface/potential_temperature_at_interfaces_with_respect_to_the_smallest_hairs_on_robert_redfords_beautiful_blonde_heads/g' "$f"; done (to change to a 112 character name)
  6. ./run_test - test will error, but don't worry about that.
  7. vi ct_test/ccpp/test_host_ccpp_cap.F90 (observe the attempted wrapping on line 364)

Provide the tag or hash of the CCPP Framework used to reproduce the bug
Have you make any modifications to the CCPP Framework code?

Nope. this is on the head of development - 9254784f55757cdc8386509fedc7e6fdd02517ab

Output

            variable_list(4) =                                                                    &
                 'potential_temperature_at_interfaces_with_respect_to_the_smallest_hairs_on_robert_redfords_beautiful_blonde_heads&
&'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugFor issues describing bugs, or PRs fixing bugs

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions