E3SM-Project / polaris

Testing and analysis for OMEGA, MPAS-Ocean, MALI and MPAS-Seaice
BSD 3-Clause "New" or "Revised" License
7 stars 13 forks source link

Fix how yaml model config options are update #219

Closed xylar closed 3 months ago

xylar commented 3 months ago

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

xylar commented 3 months ago

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 commented 3 months ago

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

xylar commented 3 months ago

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