NOAA-EMC / UPP

Other
33 stars 95 forks source link

Add BUILD_WITH_NEMSIO build option to allow building UPP without nemsio #911

Closed DusanJovic-NOAA closed 3 months ago

DusanJovic-NOAA commented 3 months ago

Added BUILD_WITH_NEMSIO cmake option (ON by default), which allows building the UPP executable without nemsio file support and without requiring nemsio library.

WenMeng-NOAA commented 3 months ago

@DusanJovic-NOAA I ran the UPP build script 'comiple_upp.sh' under UPP/tests and got failure as:

[ 97%] Building Fortran object sorc/ncep_post.fd/CMakeFiles/upp.x.dir/getIVariableN.f.o
[ 98%] Building Fortran object sorc/ncep_post.fd/CMakeFiles/upp.x.dir/getVariable.f.o
[ 99%] Building Fortran object sorc/ncep_post.fd/CMakeFiles/upp.x.dir/INITPOST_NEMS.f.o
[100%] Linking Fortran executable upp.x
/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/install/intel/2021.5.0/nemsio-2.5.4-gvup4la/lib64/libnemsio.a(nemsio_read.f90.o): In function `nemsio_read_mp_nemsio_readrecgrb8_':
/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/cache/build_stage/spack-stage-nemsio-2.5.4-gvup4lazwrieeerhzitvuka772v7t4nn/spack-src/src/nemsio_read.f90:974: undefined reference to `getgbm_'
/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/install/intel/2021.5.0/nemsio-2.5.4-gvup4la/lib64/libnemsio.a(nemsio_read.f90.o): In function `nemsio_read_mp_nemsio_readrecvgrb8_':
/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/cache/build_stage/spack-stage-nemsio-2.5.4-gvup4lazwrieeerhzitvuka772v7t4nn/spack-src/src/nemsio_read.f90:1027: undefined reference to `getgbm_'
/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/install/intel/2021.5.0/nemsio-2.5.4-gvup4la/lib64/libnemsio.a(nemsio_read.f90.o): In function `nemsio_read_mp_nemsio_readrecgrb4w34_':
/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/cache/build_stage/spack-stage-nemsio-2.5.4-gvup4lazwrieeerhzitvuka772v7t4nn/spack-src/src/nemsio_read.f90:865: undefined reference to `getgbm_'
/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/install/intel/2021.5.0/nemsio-2.5.4-gvup4la/lib64/libnemsio.a(nemsio_read.f90.o): In function `nemsio_read_mp_nemsio_readrecvgrb4w34_':
/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/cache/build_stage/spack-stage-nemsio-2.5.4-gvup4lazwrieeerhzitvuka772v7t4nn/spack-src/src/nemsio_read.f90:919: undefined reference to `getgbm_'
make[2]: *** [sorc/ncep_post.fd/CMakeFiles/upp.x.dir/build.make:309: sorc/ncep_post.fd/upp.x] Error 1
make[1]: *** [CMakeFiles/Makefile2:159: sorc/ncep_post.fd/CMakeFiles/upp.x.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
DusanJovic-NOAA commented 3 months ago

@WenMeng-NOAA Please try again. The nemsio library depends on w3emc and bacio, so I had to explicitly add them as dependencies.

https://github.com/NOAA-EMC/NCEPLIBS-nemsio/blob/develop/src/CMakeLists.txt#L42-L43

WenMeng-NOAA commented 3 months ago

@DusanJovic-NOAA Now It works. Thanks!

WenMeng-NOAA commented 3 months ago

@DusanJovic-NOAA Could you modify build scripts compile_upp.sh under /tests to add an option without nemsio lib? You might refer to the option '-w' used for wrf_io lib.

DusanJovic-NOAA commented 3 months ago

@DusanJovic-NOAA Could you modify build scripts compile_upp.sh under /tests to add an option without nemsio lib? You might refer to the option '-w' used for wrf_io lib.

Done. See 5b6815f

WenMeng-NOAA commented 3 months ago

@DusanJovic-NOAA Your changes look good in my UPP standalone tests. Thanks!

WenMeng-NOAA commented 3 months ago

@DusanJovic-NOAA Can you sync your branch with the latest UPP develop for our merging process?

DusanJovic-NOAA commented 3 months ago

@DusanJovic-NOAA Can you sync your branch with the latest UPP develop for our merging process?

Done.

WenMeng-NOAA commented 3 months ago

@FernandoAndrade-NOAA You may start the UPP RTs on Hera and Orion. There should be baseline update with this PR.

WenMeng-NOAA commented 3 months ago

@DusanJovic-NOAA Thanks for contributing to the enhancement of UPP, making it more flexible to support various configurations.

WenMeng-NOAA commented 3 months ago

The UPP RTs were completed on WCOSS2. No baseline update is needed with this PR.

FernandoAndrade-NOAA commented 3 months ago

@FernandoAndrade-NOAA You may start the UPP RTs on Hera and Orion. There should be baseline update with this PR.

RT results look good to go from my side on Hera, Hercules, and Orion.

WenMeng-NOAA commented 3 months ago

This PR is ready for merging.