Skip to content

Commit

Permalink
Spack Stack 1.8.0 (NOAA-EMC#1062)
Browse files Browse the repository at this point in the history
Upgrade to space-stack v1.8.0
---------
Co-authors: 
@FernandoAndrade-NOAA 
@WenMeng-NOAA 
@AlexanderRichert-NOAA 
@gspetro-NOAA
  • Loading branch information
FernandoAndrade-NOAA authored Nov 20, 2024
1 parent ce5f3b1 commit 4fba2fb
Show file tree
Hide file tree
Showing 15 changed files with 229 additions and 201 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ if(BUILD_POSTEXEC)
find_package(nemsio REQUIRED)
find_package(sigio REQUIRED)
endif()
find_package(sp REQUIRED)
find_package(sp QUIET)
find_package(ip 5.0 QUIET)
if((NOT ip_VERSION VERSION_GREATER_EQUAL 5.0) AND (NOT sp_FOUND))
message(SEND_ERROR "UPP requires sp or ip v5+.")
endif()
find_package(w3emc REQUIRED)
if(BUILD_WITH_WRFIO)
find_package(wrf_io REQUIRED)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ Required NCEPLIBS packages:

- [NCEPLIBS-g2](https://github.com/NOAA-EMC/NCEPLIBS-g2)
- [NCEPLIBS-g2tmpl](https://github.com/NOAA-EMC/NCEPLIBS-g2tmpl)
- [NCEPLIBS-sp](https://github.com/NOAA-EMC/NCEPLIBS-sp)
- [NCEPLIBS-ip](https://github.com/NOAA-EMC/NCEPLIBS-ip)
- [NCEPLIBS-bacio](https://github.com/NOAA-EMC/NCEPLIBS-bacio)
- [NCEPLIBS-w3emc](https://github.com/NOAA-EMC/NCEPLIBS-w3emc)
Expand Down Expand Up @@ -135,4 +134,4 @@ States Government.

## UPP Terms of Use Notice

The UPP Terms of Use Notice is available at: https://github.com/NOAA-EMC/UPP/wiki/UPP-Terms-of-Use-Notice
The UPP Terms of Use Notice is available at: https://github.com/NOAA-EMC/UPP/wiki/UPP-Terms-of-Use-Notice
6 changes: 3 additions & 3 deletions ci/rt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ if [ $mac2 = hf ]; then # for HERA
export machine=HERA
export homedir=${homedir:-"/scratch2/NAGAPE/epic/UPP/test_suite"}
export rundir=${rundir:-"/scratch1/NCEPDEV/stmp2/${USER}"}
module use /scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/upp-addon-env/install/modulefiles/Core
module use /contrib/spack-stack/spack-stack-1.8.0/envs/ue-intel-2021.5.0/install/modulefiles/Core
module load stack-intel/2021.5.0
module load stack-intel-oneapi-mpi/2021.5.1
module load prod_util/2.1.1
elif [ $mac3 = orio ] ; then
export machine=ORION
export homedir=${homedir:-"/work/noaa/epic/UPP"}
export rundir=${rundir:-"/work2/noaa/stmp/$USER"}
module use /work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.6.0/envs/upp-addon-env/install/modulefiles/Core
module use /apps/contrib/spack-stack/spack-stack-1.8.0/envs/ue-intel-2021.9.0/install/modulefiles/Core
module load stack-intel/2021.9.0
module load stack-intel-oneapi-mpi/2021.9.0
module load prod_util/2.1.1
Expand All @@ -84,7 +84,7 @@ elif [ $mac3 = herc ] ; then
export machine=HERCULES
export homedir=${homedir:-"/work/noaa/epic/UPP"}
export rundir=${rundir:-"/work2/noaa/stmp/$USER"}
module use /work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.6.0/envs/upp-addon-env/install/modulefiles/Core
module use /apps/contrib/spack-stack/spack-stack-1.8.0/envs/ue-intel-2021.9.0/install/modulefiles/Core
module load stack-intel/2021.9.0
module load stack-intel-oneapi-mpi/2021.9.0
module load prod_util/2.1.1
Expand Down
3 changes: 1 addition & 2 deletions ci/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ spack:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
Expand Down
5 changes: 2 additions & 3 deletions doc/UserGuide/BuildingRunningTesting/BuildingUPP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ the instructions in the :doc:`spack-stack User's Guide <spack-stack:index>`.
Common Modules
----------------

As of February 1, 2024, the UPP uses the following `common modules <https://github.com/NOAA-EMC/UPP/blob/develop/modulefiles/upp_common.lua>`__ from spack-stack:
As of October 2024, the UPP uses the following `common modules <https://github.com/NOAA-EMC/UPP/blob/develop/modulefiles/upp_common.lua>`__ from spack-stack:

.. code-block:: console
Expand All @@ -46,8 +46,7 @@ As of February 1, 2024, the UPP uses the following `common modules <https://gith
g2tmpl 1.10.2
parallelio 2.5.10
bacio 2.4.1
ip 4.3.0
sp 2.5.0
ip 5.0.0
crtm 2.4.0.1
w3emc 2.10.0
nemsio 2.5.4
Expand Down
4 changes: 2 additions & 2 deletions modulefiles/gaeac5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ help([[

whatis([===[Loads libraries needed for building the UPP on Gaea C5 ]===])

prepend_path("MODULEPATH", "/autofs/ncrc-svm1_proj/epic/spack-stack/spack-stack-1.6.0/envs/upp-addon-env/install/modulefiles/Core")
prepend_path("MODULEPATH", "/ncrc/proj/epic/spack-stack/spack-stack-1.8.0/envs/ue-intel-2021.9.0/install/modulefiles/Core")

stack_intel_ver=os.getenv("stack_intel_ver") or "2023.2.0"
load(pathJoin("stack-intel", stack_intel_ver))

stack_cray_mpich_ver=os.getenv("stack_cray_mpich_ver") or "8.1.28"
load(pathJoin("stack-cray-mpich", stack_cray_mpich_ver))

cmake_ver=os.getenv("cmake_ver") or "3.23.1"
cmake_ver=os.getenv("cmake_ver") or "3.27.9"
load(pathJoin("cmake", cmake_ver))

load("upp_common")
Expand Down
4 changes: 2 additions & 2 deletions modulefiles/hera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Load environment to build UPP on hera
]])


prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/upp-addon-env/install/modulefiles/Core")
prepend_path("MODULEPATH", "/contrib/spack-stack/spack-stack-1.8.0/envs/ue-intel-2021.5.0/install/modulefiles/Core")

stack_intel_ver=os.getenv("stack_intel_ver") or "2021.5.0"
load(pathJoin("stack-intel", stack_intel_ver))

stack_impi_ver=os.getenv("stack_impi_ver") or "2021.5.1"
load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver))

cmake_ver=os.getenv("cmake_ver") or "3.23.1"
cmake_ver=os.getenv("cmake_ver") or "3.27.9"
load(pathJoin("cmake", cmake_ver))

load("upp_common")
Expand Down
4 changes: 2 additions & 2 deletions modulefiles/hercules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Load environment to build UPP on hecules
]])


prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.6.0/envs/upp-addon-env/install/modulefiles/Core")
prepend_path("MODULEPATH", "/apps/contrib/spack-stack/spack-stack-1.8.0/envs/ue-intel-2021.9.0/install/modulefiles/Core")

stack_intel_ver=os.getenv("stack_intel_ver") or "2021.9.0"
load(pathJoin("stack-intel", stack_intel_ver))

stack_impi_ver=os.getenv("stack_impi_ver") or "2021.9.0"
load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver))

cmake_ver=os.getenv("cmake_ver") or "3.23.1"
cmake_ver=os.getenv("cmake_ver") or "3.27.9"
load(pathJoin("cmake", cmake_ver))

python_ver=os.getenv("python_ver") or "3.10.8"
Expand Down
4 changes: 2 additions & 2 deletions modulefiles/orion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Load environment to build UPP on orion
]])


prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.6.0/envs/upp-addon-env/install/modulefiles/Core")
prepend_path("MODULEPATH", "/apps/contrib/spack-stack/spack-stack-1.8.0/envs/ue-intel-2021.9.0/install/modulefiles/Core")

stack_intel_ver=os.getenv("stack_intel_ver") or "2021.9.0"
load(pathJoin("stack-intel", stack_intel_ver))

stack_impi_ver=os.getenv("stack_impi_ver") or "2021.9.0"
load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver))

cmake_ver=os.getenv("cmake_ver") or "3.23.1"
cmake_ver=os.getenv("cmake_ver") or "3.27.9"
load(pathJoin("cmake", cmake_ver))

python_ver=os.getenv("python_ver") or "3.10.8"
Expand Down
29 changes: 14 additions & 15 deletions modulefiles/upp_common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@ whatis("Description: UPP build environment common libraries")
help([[Load UFS Model common libraries]])

local ufs_modules = {
{["jasper"] = "2.0.32"},
{["zlib"] = "1.2.13"},
{["libpng"] = "1.6.37"},
{["hdf5"] = "1.14.0"},
{["netcdf-c"] = "4.9.2"},
{["netcdf-fortran"] = "4.6.1"},
{["bacio"] = "2.4.1"},
{["jasper"] = "2.0.32" },
{["zlib-ng"] = "2.1.6" },
{["libpng"] = "1.6.37" },
{["hdf5"] = "1.14.3" },
{["netcdf-c"] = "4.9.2" },
{["netcdf-fortran"] = "4.6.1" },
{["bacio"] = "2.4.1" },
{["crtm"] = "2.4.0.1"},
{["g2"] = "3.5.1"},
{["g2tmpl"] = "1.13.0"},
{["ip"] = "4.3.0"},
{["sp"] = "2.5.0"},
{["w3emc"] = "2.10.0"},
{["nemsio"] = "2.5.4"},
{["sigio"] = "2.3.2"},
{["wrf-io"] = "1.2.0"},
{["g2"] = "3.5.1" },
{["g2tmpl"] = "1.13.0" },
{["ip"] = "5.0.0" },
{["w3emc"] = "2.10.0" },
{["nemsio"] = "2.5.4" },
{["sigio"] = "2.3.2" },
{["wrf-io"] = "1.2.0" },
}

for i = 1, #ufs_modules do
Expand Down
10 changes: 9 additions & 1 deletion sorc/ncep_post.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,18 @@ endif()

if(BUILD_POSTEXEC)
add_executable(${EXENAME} ${EXE_SRC})
if(ip_FOUND)
set(sp_target ip::ip_4)
if(ip_VERSION VERSION_GREATER_EQUAL 5.1)
target_compile_definitions(${EXENAME} PRIVATE USE_SP_MOD=1)
endif()
else()
set(sp_target sp::sp_4)
endif()
target_link_libraries(${EXENAME} PRIVATE
${LIBNAME}
w3emc::w3emc_4
sp::sp_4)
${sp_target})
set_target_properties(${EXENAME} PROPERTIES LINKER_LANGUAGE Fortran)
if(IFI_FOUND)
target_link_libraries(${EXENAME} PRIVATE IFI)
Expand Down
18 changes: 18 additions & 0 deletions sorc/ncep_post.fd/GFSPOSTSIG.F
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ subroutine rtsig(lusig,head,k1,k2,kgds,ijo,levs,ntrac,jcap,lnt2,me, &
use sigio_module, only : sigio_intkind, sigio_head
use sigio_r_module, only : sigio_dati, sigio_rrdati
use physcons_post, only : con_omega, con_fvirt
#ifdef USE_SP_MOD
use sp_mod, only : sptezd, sptezm, sptezmv
#endif
use omp_lib
implicit none
integer(sigio_intkind),intent(in) :: lusig
Expand Down Expand Up @@ -131,7 +134,11 @@ subroutine rtsig(lusig,head,k1,k2,kgds,ijo,levs,ntrac,jcap,lnt2,me, &
endif
if (allocated(wrk)) deallocate(wrk)

#ifdef USE_SP_MOD
call sptezd(0,jcap,idrt,io,jo,trisca(1,k1+1),(/pmean/),px,py,1)
#else
call sptezd(0,jcap,idrt,io,jo,trisca(1,k1+1),pmean,px,py,1)
#endif
iret = 0

! if (k2 < k1) return
Expand Down Expand Up @@ -449,6 +456,9 @@ subroutine trssc(jcap,nc,km,ntrac,idvc,idvm,idsl,nvcoord,vcoord, &
cpi,idrt,lonb,latb,ijl,ijn,j1,j2,jc,chgq0, &
szs,sps,st,sd,sz,sq,gfszs,gfsps,gfsp,gfsdp, &
gfst,gfsu,gfsv,gfsq,gfsw)
#ifdef USE_SP_MOD
use sp_mod, only : sptran, sptranv
#endif
implicit none
integer,intent(in)::jcap,nc,km,ntrac,idvc,idvm,idsl,nvcoord,idrt,lonb,latb
integer,intent(in)::ijl,ijn,j1,j2,jc,chgq0
Expand Down Expand Up @@ -641,6 +651,9 @@ subroutine getomega(jcap,nc,km,idvc,idvm,idrt,idsl,nvcoord,vcoord, &
lonb,latb,ijn,j1,j2,jc,sd,sps,psi,ti,ui,vi,wi,pm,pd)
!!!!!
use sigio_module, only : sigio_modprd
#ifdef USE_SP_MOD
use sp_mod, only : sptran, sptrand
#endif
implicit none

integer,intent(in):: jcap,nc,km,idvc,idvm,idrt,idsl,nvcoord
Expand All @@ -660,8 +673,13 @@ subroutine getomega(jcap,nc,km,idvc,idvm,idrt,idsl,nvcoord,vcoord, &
ij=lonb2*(j2-j1+1)
in=1
is=1+lonb
#ifdef USE_SP_MOD
call sptrand(0,jcap,idrt,lonb,latb,1,1,1,lonb2,lonb2,nc,ijn, &
j1,j2,jc,sps,(/real(psmean,4)/),psx(in),psx(is),psy(in),psy(is),1)
#else
call sptrand(0,jcap,idrt,lonb,latb,1,1,1,lonb2,lonb2,nc,ijn, &
j1,j2,jc,sps,psmean,psx(in),psx(is),psy(in),psy(is),1)
#endif

call sptran(0,jcap,idrt,lonb,latb,km,1,1,lonb2,lonb2,nc,ijn, &
j1,j2,jc,sd,di(in,1),di(is,1),1)
Expand Down
Loading

0 comments on commit 4fba2fb

Please sign in to comment.