Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regression tests with MULTI_GASES #112

Merged

Conversation

XiaqiongZhou-NOAA
Copy link
Contributor

@XiaqiongZhou-NOAA XiaqiongZhou-NOAA commented Apr 28, 2020

To add regression tests with MULTI_GASES=Y

Related pull requests:
NOAA-EMC/fv3atm#108
NOAA-EMC/GFDL_atmos_cubed_sphere#19
NCAR/ccpp-physics#444

The input data with C96L149 saved temporarily at /gpfs/hps3/emc/ensemble/noscrub/Xiaqiong.Zhou/RT/NEMSfv3gfs (WCOSS_CRAY)
and /scratch2/NCEPDEV/ensemble/Xiaqiong.Zhou/noscrub/RT/NEMSfv3gfs (HERA)

@climbfuji
Copy link
Collaborator

While this implementation passes the regression tests, it is not correct and won't work with the old gnumake build.

cmake: These entries - same for all machines - say that MULTI_GASES is on by default:

heinzeller-lt:ufs-weather-model-rt_multigases-20200701 dom.heinzeller$ cat cmake/configure_hera.intel.cmake
...
option(MULTI_GASES  "Enable MULTI_GASES" ON)
...

Then, for each compiler

heinzeller-lt:ufs-weather-model-rt_multigases-20200701 dom.heinzeller$ cat cmake/Intel.cmake
...
if(MULTI_GASES)
    add_definitions(-DMULTI_GASES)
endif()
...

With this, -DMULTI_GASES should always be passed to the build. However, in tests/compile_cmake.sh

if [[ "${MAKE_OPT}" == *"CCPP=Y"* ]]; then
...
  if [[ "${MAKE_OPT}" == *"MULTI_GASES=Y"* ]]; then
    CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DMULTI_GASES=ON"
  else
    CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DMULTI_GASES=OFF"
  fi
...

hence the switch to turn off multi gases is in compile_cmake.sh - and only for CCPP! That means your PR will build IPD with MULTI_GASES on no matter what when cmake is used.

For the gnu make build, there are no default values set in conf/configure.fv3.*, but each of them has

ifeq ($(MULTI_GASES),Y)
CPPDEFS += -DMULTI_GASES

While not correct, this at least means that by default the gnumake build turns multi gases off. Each conf/configure.fv3.* should have a default line towards the top saying

MULTI_GASES = N

@DusanJovic-NOAA
Copy link
Collaborator

While this implementation passes the regression tests, it is not correct and won't work with the old gnumake build.

cmake: These entries - same for all machines - say that MULTI_GASES is on by default:

heinzeller-lt:ufs-weather-model-rt_multigases-20200701 dom.heinzeller$ cat cmake/configure_hera.intel.cmake
...
option(MULTI_GASES  "Enable MULTI_GASES" ON)
...

Then, for each compiler

heinzeller-lt:ufs-weather-model-rt_multigases-20200701 dom.heinzeller$ cat cmake/Intel.cmake
...
if(MULTI_GASES)
    add_definitions(-DMULTI_GASES)
endif()
...

With this, -DMULTI_GASES should always be passed to the build. However, in tests/compile_cmake.sh

if [[ "${MAKE_OPT}" == *"CCPP=Y"* ]]; then
...
  if [[ "${MAKE_OPT}" == *"MULTI_GASES=Y"* ]]; then
    CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DMULTI_GASES=ON"
  else
    CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DMULTI_GASES=OFF"
  fi
...

hence the switch to turn off multi gases is in compile_cmake.sh - and only for CCPP! That means your PR will build IPD with MULTI_GASES on no matter what when cmake is used.

For the gnu make build, there are no default values set in conf/configure.fv3.*, but each of them has

ifeq ($(MULTI_GASES),Y)
CPPDEFS += -DMULTI_GASES

While not correct, this at least means that by default the gnumake build turns multi gases off. Each conf/configure.fv3.* should have a default line towards the top saying

MULTI_GASES = N

MULTI_GASES should be set to OFF in all `cmake/configure_*.cmake

Why is this even compile time option, is there any disadvantage using run-time flag (namelist) which will be set to .false. by default. We should limit number of build time options. It complicates the build system, it complicates regression testing and makes source code less readable.

@DusanJovic-NOAA
Copy link
Collaborator

That means your PR will build IPD with MULTI_GASES on no matter what when cmake is used.

We do not build nor test IPD in develop branch anymore. We stopped doing that on May 1. It's been two months since then. We should remove IPD code in one of the future commits.

@climbfuji
Copy link
Collaborator

That means your PR will build IPD with MULTI_GASES on no matter what when cmake is used.

We do not build nor test IPD in develop branch anymore. We stopped doing that on May 1. It's been two months since then. We should remove IPD code in one of the future commits.

This commit even adds an IPD regression test - should we allow this?

@junwang-noaa
Copy link
Collaborator

junwang-noaa commented Jul 1, 2020 via email

@junwang-noaa
Copy link
Collaborator

junwang-noaa commented Jul 1, 2020 via email

@SMoorthi-emc
Copy link
Contributor

SMoorthi-emc commented Jul 1, 2020 via email

@climbfuji
Copy link
Collaborator

I urge not to drop IPD, as it is very hard, if not almost impossible to debug with CCPP. Having IPD option makes it a lot easier to debug. My 2 cents. Thanks Moorthi

Moorthi, I hope you can see how difficult it is to maintain two systems in parallel - we have been doing this for so long and it has taken so much time that we could have invested better in addressing your concerns. If you can describe in detail where your specific problems are, then we can hopefully work towards a solution that helps you do what you need to do. We are not running IPD regression tests anymore, and we will not turn them back on. There is no guarantee that it will work in the future, and as this commit shows it would have "broken" the IPD build if I didn't look carefully.

@XiaqiongZhou-NOAA
Copy link
Contributor Author

IPD multi_gases is not added in regression test, but it should be available for the test purpose as Henry mentioned that they still need it.

@XiaqiongZhou-NOAA
Copy link
Contributor Author

Dom:
I will add MULTI_GASES = N in conf/configure.fv3.* . What else should I changed?

@DusanJovic-NOAA
Copy link
Collaborator

That means your PR will build IPD with MULTI_GASES on no matter what when cmake is used.
We do not build nor test IPD in develop branch anymore. We stopped doing that on May 1. It's been two months since then. We should remove IPD code in one of the future commits.

This commit even adds an IPD regression test - should we allow this?

NO!

@climbfuji
Copy link
Collaborator

Dom:
I will add MULTI_GASES = N in conf/configure.fv3.* . What else should I changed?

If you are making changes to this PR, then you need to do the following:

  • add MULTI_GASES = N to the default section for each conf/configure.fv3.*
  • change the option MULT_GASES from ON to OFF for each cmake/configure_*.cmake
  • in tests/compile_cmake.sh, move the block
  if [[ "${MAKE_OPT}" == *"MULTI_GASES=Y"* ]]; then
    CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DMULTI_GASES=ON"
  else
    CCPP_CMAKE_FLAGS="${CCPP_CMAKE_FLAGS} -DMULTI_GASES=OFF"
  fi

outside of the block

if [[ "${MAKE_OPT}" == *"CCPP=Y"* ]]; then
  ...
fi

This way, all tests should pass against your new baseline.

@SMoorthi-emc
Copy link
Contributor

SMoorthi-emc commented Jul 1, 2020 via email

Copy link
Collaborator

@junwang-noaa junwang-noaa left a comment

Choose a reason for hiding this comment

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

Looks good.

@DusanJovic-NOAA DusanJovic-NOAA merged commit a7b9b6d into ufs-community:develop Jul 7, 2020
XiaSun-Atmos pushed a commit to XiaSun-Atmos/ufs-weather-model that referenced this pull request Aug 8, 2020
@XiaqiongZhou-NOAA XiaqiongZhou-NOAA deleted the rt_multigases branch June 13, 2021 16:04
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.

None yet

5 participants