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

Fix how yaml model config options are update #219

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

xylar
Copy link
Collaborator

@xylar xylar commented Aug 7, 2024

With this update, we treat config options from files (with sections) differently from replacement options provided in a dictionary in code.

This merge also explicitly converts some model config options to floats. This seems to be necessary because the yaml parser doesn't understand numpy scalars.

Checklist

  • Testing comment in the PR documents testing used to verify the changes

xylar added 2 commits August 7, 2024 13:58
We treat config options from files (with sections) differently
from replacement options provided in a dictionary in code.
This seems to be necessary because the yaml parser doesn't understand
numpy scalars.
@xylar xylar requested a review from hyungyukang August 7, 2024 19:10
@xylar xylar self-assigned this Aug 7, 2024
@xylar xylar added bug Something isn't working framework Changes relating to the polaris framework as opposed to individual tests or analysis ocean Related to ocean tests or analysis labels Aug 7, 2024
@xylar
Copy link
Collaborator Author

xylar commented Aug 7, 2024

Testing

With these instructions, I was able to set up the manufactured solution test case for Omega following @hyungyukang's instructions modified here for Intel on Chrysalis:

workdir=$PWD
git clone -b hkang/omega-sw-try1 https://github.com/hyungyukang/Omega.git
cd Omega
git submodule update --init --recursive
cd components/omega/build

module load cmake

PARMETIS_ROOT=/lcrc/soft/climate/polaris/chrysalis/spack/dev_polaris_0_4_0_intel_openmpi/var/spack/environments/dev_polaris_0_4_0_intel_openmpi/.spack-env/view
cmake \
   -DOMEGA_CIME_COMPILER=intel  \
   -DOMEGA_CIME_MACHINE=chrysalis \
   -DOMEGA_PARMETIS_ROOT=${PARMETIS_ROOT}\
   -Wno-dev \
   ../

./omega_build.sh

cp -rf ./default_inputs ./src/

cd $workdir
git clone -b fix-model-yaml-update git@github.com:xylar/polaris.git
cd polaris

./configure_polaris_envs.py --conda ~/miniforge3 -c intel -m crhysalis

cp ../Omega/components/omega/build/default_inputs/omega.cfg polaris/ocean/

vim polaris/ocean/ocean.cfg

# Change line 7 from 'mpas-ocean' to 'omega'
# model = omega

source load_dev_polaris_0.4.0-alpha.2_chrysalis_intel_openmpi.sh
polaris setup -t ocean/planar/manufactured_solution -m pm-cpu -w /lcrc/group/e3sm/ac.xylar/polaris_0.4/chrysalis/test_20240807/omega_manufactured_solution -p ../Omega/components/omega/build/src

@xylar
Copy link
Collaborator Author

xylar commented Aug 7, 2024

@hyungyukang, could you let me know if this fixes the problem for you as well?

Copy link

@hyungyukang hyungyukang left a comment

Choose a reason for hiding this comment

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

@xylar , thank you very much for your quick update! This PR fixes the problem I had on pm-cpu.

After setting up the manufactured solution test with the Omega-0 test model, I submitted a job and was able to get this convergence result:

image

Note that the model options are hardcoded in the test model now, and time step size is fixed.

I'm approving this PR as the yaml generation problem has been fixed.

Thanks again for your work on this!

@xylar
Copy link
Collaborator Author

xylar commented Aug 8, 2024

@hyungyukang, thanks for the quick review! Glad it worked for you, too!

@xylar xylar merged commit 0cbc130 into E3SM-Project:main Aug 8, 2024
4 checks passed
@xylar xylar deleted the fix-model-yaml-update branch August 8, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working framework Changes relating to the polaris framework as opposed to individual tests or analysis ocean Related to ocean tests or analysis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants