NCAR / NCAR/ccpp-framework

Fortran/metadata comparison incorrectly reporting bug when comparing Fortran variable declarations and metadata for derived types

Open
#360 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug capgen
Dominant language
Python
Stars
25
Forks
67
Avg merge
3d 8h
Merged PRs (30d)
2

Description

The Fortran/metadata comparison seems to incorrectly report a bug (this is the version used by @JulieSchramm) when comparing Fortran variable declarations and metadata for derived types:

kind mismatch ( != cmpfsw_type) in rrtmg_sw_post_run, at /Users/dom.heinzeller/scratch/ufs-weather-model/fortran_parser_julie/ccpp-physics-fork/physics/rrtmg_sw_post.meta:244
kind mismatch ( != sfcfsw_type) in rrtmg_sw_post_run, at /Users/dom.heinzeller/scratch/ufs-weather-model/fortran_parser_julie/ccpp-physics-fork/physics/rrtmg_sw_post.meta:252
kind mismatch ( != topfsw_type) in rrtmg_sw_post_run, at /Users/dom.heinzeller/scratch/ufs-weather-model/fortran_parser_julie/ccpp-physics-fork/physics/rrtmg_sw_post.meta:260
3 errors found comparing /Users/dom.heinzeller/scratch/ufs-weather-model/fortran_parser_julie/ccpp-physics-fork/physics/rrtmg_sw_post.meta to /Users/dom.heinzeller/scratch/ufs-weather-model/fortran_parser_julie/ccpp-physics-fork/physics/rrtmg_sw_post.F90

The metadata for the first variable:

[scmpsw]
  standard_name = components_of_surface_downward_shortwave_fluxes
  long_name = derived type for special components of surface downward shortwave fluxes
  units = W m-2
  dimensions = (horizontal_loop_extent)
  type = cmpfsw_type
  intent = inout
  optional = F

The Fortran declaration:

      type(cmpfsw_type), dimension(:),     intent(inout) :: scmpsw

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Fortran/metadata comparison for rrtmg_sw_post.meta and rrtmg_sw_post.F90, then trace how the derived-type declarations are matched. Reproduce the three kind-mismatch reports and determine what comparison result is expected for the shown declarations; done means these false mismatches no longer appear.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran, python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.