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

Restore capability to export metadata sections (previously headers) to html #445

Closed climbfuji closed 2 years ago

climbfuji commented 2 years ago

Restore capability to export metadata sections (previously headers) to html.

The capability to write metadata sections to html was removed with the refactoring of the feature/capgen branch, subsequently slipped the reviews and got merged into main. As a result, the metadata2html.py script, required to generate scientific documenation (especially at times of releases!) doesn't work anymore. This PR restores the capability by putting the original code blocks back into the metadata sections (previously these were called headers).

I ran this in the two supported ways within the UFS. Once merged, the code will work like this. Maybe there are some slight path changes compared to what is in the CCPP tech doc - @mkavulich FYI.

Batch mode using ccpp_prebuild_config.py:

git clone -b develop --recursive https://github.com/ufs-community/ufs-weather-model
cd ufs-weather-model/FV3/ccpp
PYTHONPATH="$PWD/framework/scripts:$PWD/framework/scripts/parse_tools:$PYTHONPATH"  \
    ./framework/scripts/metadata2html.py -c config/ccpp_prebuild_config.py

Single-file mode:

mkdir test
PYTHONPATH="$PWD/framework/scripts:$PWD/framework/scripts/parse_tools:$PYTHONPATH" ./framework/scripts/metadata2html.py -m physics/physics/mp_thompson.meta -o test

User interface changes?: Yes (I assume some of the paths have changed compared to the documentation)

Closes #444

Testing: see above. The code changes will also be tested within the ufs-weather-model regression testing environment. I recommend that we pull this PR into #443, since #443 and associated PRs do not change the baselines. Note that #444 is required for CCPP release v6.

Other testing:

climbfuji commented 2 years ago

@mkavulich @grantfirl I addressed @gold2718's review comments, now it is your turn ...

grantfirl commented 2 years ago

@climbfuji Could we combine this with #443 for the purposes of merging with UFS?

climbfuji commented 2 years ago

Yes, I was planning to combine #443 #445 and #447 (if approved by then).