Skip to content

Download crtm coefficient once and use it by crtm, ufo, fv3-jedi and mpas-jedi#302

Open
rajichidamb wants to merge 5 commits into
JCSDA:developfrom
rajichidamb:feature/crtmCoeff_dwnld
Open

Download crtm coefficient once and use it by crtm, ufo, fv3-jedi and mpas-jedi#302
rajichidamb wants to merge 5 commits into
JCSDA:developfrom
rajichidamb:feature/crtmCoeff_dwnld

Conversation

@rajichidamb
Copy link
Copy Markdown

@rajichidamb rajichidamb commented Apr 24, 2026

Description

CRTM coefficient is downloaded twice when building using jedi-bundle, once by crtm module and then by ufo and saved in two different locations. Changing the download location to be in jedi-bundle and then used as a symlink in the build directory for testing, reduces the download of coefficient to only once.

Issue(s) addressed

Resolves #https://github.com/JCSDA-internal/ufo/issues/4085

Dependencies

List the other PRs that this PR is dependent on:
build-group=https://github.com/JCSDA-internal/ufo/pull/4123

Impact

Expected impact on downstream repositories:

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have run the unit tests before creating the PR

…erty so UFO can use the same path to get the crtm coefficients
Comment thread test/CMakeLists.txt Outdated
endif()


set (UFO_CRTM_TESTFILES_PATH ${CRTM_COEFFS_PATH}/${CRTM_COEFFS_BRANCH}/fix)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRTM is often used outside of JEDI. I wonder if it made sense to create a CMake option that tells the build system if this is a build in JEDI or standalone, and then set stuff like this. That might also help with the compiler flags discussion that @fmahebert and @BenjaminTJohnson had.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about naming this CRTM_TESTFILES_PATH ?

There's no need to prefix it with UFO. This way, it stays neutral and my comment from this morning can be ignored. Same in the UFO PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the variable CRTM_COEFFS_PATH available when the if (EXISTS ${FIX_FILES_PATH}) code path is taken above (instead of the download code path) ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was following the else code of (EXISTS ${FIX_FILE_PATH}), setting the CRTM_COEFFS_PATH.

Comment thread test/CMakeLists.txt
set( CRTM_COEFFS_BRANCH "fix_REL-3.1.2.0" )

set(CRTM_COEFFS_PATH ${CMAKE_BINARY_DIR}/test_data/${PROJECT_VERSION})
set(CRTM_COEFFS_PATH ${CMAKE_SOURCE_DIR}/test-data-release)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is outside my expertise, perhaps better for @BenjaminTJohnson or @climbfuji — do we think using CMAKE_SOURCE_DIR will work well when CRTM is installed as an external library (vs as part of a compiled bundle), e.g. in the case of using spack-stack to provide a CRTM module?

Or is this question moot, because this is all in test/CMakeLists.txt, and this code path is probably not exercised in a CRTM-as-a-library context?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a core part of the librification of CRTM and other JEDI components. We need to be able to run the ctests. I had to patch the CRTM code (and the UFO code) in order to make the stars line up. I can update the patch as needed in the Spack recipe, hence I don't see this as a big problem. The only thing I am adament about is to not prefix CRTM_TESTFILES_PATH with UFO_, because those testfiles are CRTM's testfiles and independent of whether UFO is being used or not?

Comment thread test/CMakeLists.txt Outdated
endif()


set (UFO_CRTM_TESTFILES_PATH ${CRTM_COEFFS_PATH}/${CRTM_COEFFS_BRANCH}/fix)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the variable CRTM_COEFFS_PATH available when the if (EXISTS ${FIX_FILES_PATH}) code path is taken above (instead of the download code path) ?

Comment thread test/CMakeLists.txt Outdated


set (CRTM_TESTFILES_PATH ${CRTM_COEFFS_PATH}/${CRTM_COEFFS_BRANCH}/fix)
message(STATUS "Set the file path to be seen by UFO at ${CRTM_TESTFILES_PATH} ")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rajichidamb change this message to be model agnostic -- specifically, CRTM is primarily a stand-alone package/library, that UFO happens to use. So mentioning UFO here would be quite weird to most users.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @BenjaminTJohnson, updated

Comment thread test/CMakeLists.txt
Comment thread test/CMakeLists.txt Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants