NCAR / ccpp-framework

Common Community Physics Package (CCPP)
http://www.dtcenter.org/community-code/common-community-physics-package-ccpp/
Other
26 stars 64 forks source link

capgen must handle doxygen comments between metadata table hooks and subroutine (8 hours) #369

Closed climbfuji closed 2 years ago

climbfuji commented 3 years ago

capgen's metadata/Fortran parser (the "Julie Schramm version") throws an error

No matching Fortran routine found for sfc_sice_run in /Users/dom.heinzeller/scratch/ufs-weather-model/fortran_parser_julie/ccpp-physics-fork/physics/sfc_sice.F

when there are certain doxygen lines between the metadata table hooks and the subroutine:

!! \section arg_table_sfc_sice_run Argument Table
!! \htmlinclude sfc_sice_run.html
!!
!>  @{
      subroutine sfc_sice_run                                           &
     &    ( im, kice, sbc, hvap, tgice, cp, eps, epsm1, rvrdm1, grav,   & !  ---  inputs:
     &      t0c, rd, ps, t1, q1, delt,                                  &
     &      sfcemis, dlwflx, sfcnsw, sfcdsw, srflag,                    &
     &      cm, ch, prsl1, prslki, prsik1, prslk1, wind,                &
     &      flag_iter, lprnt, ipr,                                      &
     &      hice, fice, tice, weasd, tskin, tprcp, tiice, ep,           & !  ---  input/outputs:
     &      snwdph, qsurf, snowmt, gflux, cmm, chh, evap, hflx,         & !  
     &      frac_grid, icy, islmsk_cice,                                &
     &      min_lakeice, min_seaice, oceanfrac,                         &
     &      errmsg, errflg )

If I move the line !> @{ to after & errmsg, errflg ), it works.

However, the parser is fine with the following lines:


!! \section arg_table_scm_sfc_flux_spec_run Argument Table
!! \htmlinclude scm_sfc_flux_spec_run.html
!!
!! \section general_sfc_flux_spec General Algorithm
!!  -# Compute friction velocity from the wind speed at the lowest model layer, the height about the ground, and the roughness length.
!!  -# Compute the surface stress from the friction velocity.
!!  -# Calculate the surface drag coefficient for momentum given the surface stress and wind on the lowest model layer.
!!  -# Calculate the Monin-Obukhov similarity funciton for momentum from the surface drag coefficient.
!!  -# Calculate the Obukhov length from the friction velocity, surface virtual potential temperature, and surface vertical virtual potential temperature flux.
!!  -# Calculate the bulk Richardson number at the lowest model layer.
!!  -# Calculate the Monin-Obukhov similarity function for heat and moisture from the bulk Richardson number and diagnosed similarity function for momentum.
!!  -# Calculate the surface drag coefficient for heat and moisture.
!!  -# Calculate the u and v wind at 10m.
  subroutine scm_sfc_flux_spec_run (u1, v1, z1, t1, q1, p1, roughness_length, spec_sh_flux, spec_lh_flux, &
    exner_inverse, T_surf, cp, grav, hvap, rd, fvirt, vonKarman, sh_flux, lh_flux, sh_flux_chs, lh_flux_chs, u_star, sfc_stress, cm, ch, &
    fm, fh, rb, u10m, v10m, wind1, qss, t2m, q2m, errmsg, errflg)
``
gold2718 commented 3 years ago

Sounds like a bug or 3 (I'm betting on at least 2 bugs here).

climbfuji commented 2 years ago

This bug no longer exists in capgen, see https://github.com/NCAR/ccpp-framework/pull/429