Skip to content

Commit

Permalink
HAFS build system clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
BinLiu-NOAA committed Apr 9, 2021
1 parent 646375e commit 6c9e5cd
Show file tree
Hide file tree
Showing 18 changed files with 65 additions and 289 deletions.
4 changes: 4 additions & 0 deletions modulefiles/modulefile.hafs.run.hera
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#%Module#####################################################
## Module file for hafs
#############################################################
proc ModulesHelp { } {
puts stderr "Set environment veriables for compiling or running HAFS"
}
module-whatis " HAFS model prerequisites"

module use /contrib/sutils/modulefiles
module load sutils
Expand Down
22 changes: 9 additions & 13 deletions modulefiles/modulefile.hafs.run.jet
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ setenv CMAKE_C_COMPILER mpiicc
setenv CMAKE_CXX_COMPILER mpiicpc
setenv CMAKE_Fortran_COMPILER mpiifort
setenv CMAKE_Platform jet.intel
setenv COREPATH /lfs4/HFIP/hfv3gfs/nwprod/NCEPLIBS/modulefiles
setenv NCEPLIBS /lfs4/HFIP/hfv3gfs/nwprod/NCEPLIBS/modulefiles
module load hpss
setenv WGRIB2_ROOT /lfs4/HFIP/hwrfv3/Jili.Dong/wgrib2-2.0.8/grib2/lib
setenv WGRIB2 /lfs4/HFIP/hwrfv3/Jili.Dong/wgrib2-2.0.8/grib2/wgrib2/wgrib2
setenv GRB2INDEX /lfs4/HFIP/hwrf-vd/Zhan.Zhang/H219_kjet/sorc/hwrf-utilities/exec/grb2index.exe
setenv NDATE /lfs4/HFIP/hwrfv3/Jili.Dong/fv3gfs_hafs/ndate.exe
module load rocoto/1.3.3
module load intelpython/3.6.5

module use /lfs4/HFIP/hfv3gfs/nwprod/hpc-stack/libs/modulefiles/stack

Expand All @@ -47,13 +38,18 @@ module load sp/2.3.3
module load w3emc/2.7.3
module load w3nco/2.4.1

module load nco/4.9.1
module load szip/2.1.1
module load szip/2.1.1
module load sigio/2.3.2
module load sfcio/1.4.1
module load sfcio/1.4.1
module load nemsiogfs/2.5.3
module load gfsio/1.4.1
module load gfsio/1.4.1
module load landsfcutil/2.4.1
module load bufr/11.4.0
module load prod_util/1.2.2
module load grib_util/1.2.2

module load hpss
module load wgrib2/2.0.8
module load nco/4.9.1
module load rocoto/1.3.3
module load intelpython/3.6.5
7 changes: 5 additions & 2 deletions modulefiles/modulefile.hafs.run.orion
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#%Module#####################################################
## Module file for vortextracker
## Module file for hafs
#############################################################
proc ModulesHelp { } {
puts stderr "Set environment veriables for compiling or running HAFS"
}
module-whatis " HAFS model prerequisites"

module load contrib noaatools

Expand Down Expand Up @@ -49,7 +53,6 @@ module load prod_util/1.2.2
module load grib_util/1.2.2

module load wgrib2/2.0.8
setenv WGRIB2 /apps/contrib/NCEP/libs/hpc-stack/intel-2018.4/impi-2018.4/wgrib2/2.0.8/bin/wgrib2
module load nco/4.9.3
module load rocoto/1.3.3
module load intelpython3/2020
1 change: 0 additions & 1 deletion modulefiles/modulefile.tools.wcoss_cray_userlib

This file was deleted.

31 changes: 0 additions & 31 deletions modulefiles/modulefile.vortextracker.wcoss_cray_userlib

This file was deleted.

22 changes: 7 additions & 15 deletions sorc/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eux
# USER DEFINED STUFF:
#
# USE_PREINST_LIBS: set to "true" to use preinstalled libraries.
# Anything other than "true" will use libraries locally.
# Anything other than "true" will use libraries locally.
#------------------------------------

export USE_PREINST_LIBS="true"
Expand All @@ -15,19 +15,11 @@ export USE_PREINST_LIBS="true"

build_dir=`pwd`
logs_dir=$build_dir/logs
if [ ! -d $logs_dir ]; then
echo "Creating logs folder"
mkdir $logs_dir
fi

# Check final exec folder exists
if [ ! -d "../exec" ]; then
echo "Creating ../exec folder"
mkdir ../exec
fi
mkdir -p $logs_dir
mkdir -p ../exec

#------------------------------------
# INCLUDE PARTIAL BUILD
# INCLUDE PARTIAL BUILD
#------------------------------------

. ./partial_build.sh
Expand Down Expand Up @@ -74,7 +66,7 @@ echo " .... Building utils .... "
}

#------------------------------------
# build tools
# build tools
#------------------------------------
$Build_tools && {
echo " .... Building tools .... "
Expand All @@ -90,7 +82,7 @@ echo " .... Building gsi .... "
}

#------------------------------------
# build hycom_utils
# build hycom_utils
#------------------------------------
$Build_hycom_utils && {
echo " .... Building hycom_utils .... "
Expand All @@ -100,4 +92,4 @@ echo " .... Building hycom_utils .... "

echo;echo " .... Build system finished .... "

exit 0
exit
18 changes: 3 additions & 15 deletions sorc/build_forecast.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
#!/bin/sh
set -eux

source ./machine-setup.sh > /dev/null 2>&1
cwd=`pwd`

USE_PREINST_LIBS=${USE_PREINST_LIBS:-"true"}
if [ $USE_PREINST_LIBS = true ]; then
export MOD_PATH=/scratch3/NCEPDEV/nwprod/lib/modulefiles
else
export MOD_PATH=${cwd}/lib/modulefiles
fi

# Check final exec folder exists
if [ ! -d "../exec" ]; then
mkdir ../exec
fi

if [ $target = hera ]; then target=hera.intel ; fi
if [ $target = orion ]; then target=orion.intel ; fi
if [ $target = jet ]; then target=jet.intel ; fi
#if [ $target = wcoss_cray ]; then module load python/2.7.14; fi

cd hafs_forecast.fd/
cd tests/
cd hafs_forecast.fd/tests

./compile.sh "$target" "APP=HAFS CCPP=Y STATIC=Y SUITES=HAFS_v0_gfdlmp_tedmf_nonsst,HAFS_v0_gfdlmp_tedmf,HAFS_v0_gfdlmp_nocpnsst,HAFS_v0_gfdlmp_nonsst,HAFS_v0_gfdlmp_nocp,HAFS_v0_gfdlmp,HAFS_v0_hwrf_thompson,HAFS_v0_hwrf 32BIT=Y" 32bit YES NO

exit
18 changes: 1 addition & 17 deletions sorc/build_gsi.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
#!/bin/sh
set -eux

source ./machine-setup.sh > /dev/null 2>&1
cwd=`pwd`

USE_PREINST_LIBS=${USE_PREINST_LIBS:-"true"}
if [ $USE_PREINST_LIBS = true ]; then
export MOD_PATH=/scratch3/NCEPDEV/nwprod/lib/modulefiles
else
export MOD_PATH=${cwd}/lib/modulefiles
fi

gsitarget=$target
[[ "$target" == wcoss_cray ]] && gsitarget=cray

# Check final exec folder exists
if [ ! -d "../exec" ]; then
mkdir ../exec
fi

cd hafs_gsi.fd/ush/

#./build_all_cmake.sh "PRODUCTION" "$cwd/hafs_gsi.fd"
./build_all_cmake.sh "BUILD_FV3reg" "$cwd/hafs_gsi.fd"

exit

16 changes: 1 addition & 15 deletions sorc/build_hycom_utils.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
#! /bin/sh

#!/bin/sh
set -eux

source ./machine-setup.sh > /dev/null 2>&1
cwd=`pwd`

# Check final exec folder exists
if [ ! -d "../exec" ]; then
mkdir ../exec
fi

USE_PREINST_LIBS=${USE_PREINST_LIBS:-"true"}
if [ $USE_PREINST_LIBS = true ]; then
export MOD_PATH=/scratch2/NCEPDEV/nwprod/NCEPLIBS/modulefiles
else
export MOD_PATH=${cwd}/lib/modulefiles
fi

if [ $target = wcoss_cray ]; then
export DM_FC="ftn -static"
export DM_F90="ftn -free -static"
Expand Down
17 changes: 3 additions & 14 deletions sorc/build_post.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
#!/bin/sh
set -eux

source ./machine-setup.sh > /dev/null 2>&1
cwd=`pwd`

USE_PREINST_LIBS=${USE_PREINST_LIBS:-"true"}
if [ $USE_PREINST_LIBS = true ]; then
export MOD_PATH=/scratch3/NCEPDEV/nwprod/lib/modulefiles
else
export MOD_PATH=${cwd}/lib/modulefiles
fi

# Check final exec folder exists
if [ ! -d "../exec" ]; then
mkdir ../exec
fi

cd hafs_post.fd/tests
sh compile_upp.sh
./compile_upp.sh

exit
87 changes: 8 additions & 79 deletions sorc/build_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,106 +5,36 @@ set -x
source ./machine-setup.sh > /dev/null 2>&1
cwd=`pwd`

USE_PREINST_LIBS=${USE_PREINST_LIBS:-"true"}
if [ $USE_PREINST_LIBS = true ]; then
export MOD_PATH=/scratch3/NCEPDEV/nwprod/lib/modulefiles
else
export MOD_PATH=${cwd}/lib/modulefiles
fi

USE_PREINST_LIBS=${USE_PREINST_LIBS:-"true"}
if [ $USE_PREINST_LIBS = true ]; then
export MOD_PATH=/scratch3/NCEPDEV/nwprod/lib/modulefiles
else
export MOD_PATH=${cwd}/lib/modulefiles
fi

if [ $target = wcoss ]; then

echo "Does not support wcoss phase 1/2."
exit 1

elif [ $target = hera ]; then

export $target
if [ $target = hera ] || [ $target = orion ] || [ $target = jet ]; then
#source ../modulefiles/modulefile.tools.$target > /dev/null 2>&1
module use ../modulefiles
module load modulefile.tools.$target
module list

export FC=ifort
export F90=ifort
export CC=icc
export MPIFC=mpif90

elif [ $target = orion ]; then

export $target
#source ../modulefiles/modulefile.tools.$target > /dev/null 2>&1
module use ../modulefiles
module load modulefile.tools.$target
module list

export FC=ifort
export F90=ifort
export CC=icc
export MPIFC=mpiifort

elif [ $target = jet ]; then

export $target
#source ../modulefiles/modulefile.tools.$target > /dev/null 2>&1
module use ../modulefiles
module load modulefile.tools.$target
module list

export FC=ifort
export F90=ifort
export CC=icc
export MPIFC=mpif90

elif [ $target = wcoss_cray ]; then

export target
if [ $USE_PREINST_LIBS = true ]; then
#source ../modulefiles/modulefile.tools.$target > /dev/null 2>&1
module use ../modulefiles
module load modulefile.tools.$target
else
#source ../modulefiles/modulefile.tools.${target}_userlib > /dev/null 2>&1
module use ../modulefiles
module load modulefile.tools.${target}_userlib
fi
#source ../modulefiles/modulefile.tools.${target} > /dev/null 2>&1
module use ../modulefiles
module load modulefile.tools.${target}
module load cmake/3.3.2
module list

export FC="ftn -static"
export F90="ftn -free -static"
export CC=icc
export DM_FC="ftn -static"
export DM_F90="ftn -free -static"
export DM_CC="cc -static"

elif [ $target = wcoss_dell_p3 ]; then

export $target
if [ $USE_PREINST_LIBS = true ]; then
#source ../modulefiles/modulefile.tools.$target > /dev/null 2>&1
module use ../modulefiles
module load modulefile.tools.$target
else
#source ../modulefiles/modulefile.tools.${target}_userlib > /dev/null 2>&1
module use ../modulefiles
module load modulefile.tools.${target}_userlib
fi
#source ../modulefiles/modulefile.tools.${target} > /dev/null 2>&1
module use ../modulefiles
module load modulefile.tools.${target}
module list

export FC=ifort
export F90=ifort
export CC=icc

else

echo "Unknown machine = $target"
exit 1
fi
Expand Down Expand Up @@ -142,11 +72,10 @@ if [ $target = wcoss_cray ]; then
else
cmake .. -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=icc
fi
#make -j 8
#make -j 8
make -j 8 VERBOSE=1
make install


cd ${TOOLS_PATH}/sorc

./build_hafs_utils.sh
Expand Down
Loading

0 comments on commit 6c9e5cd

Please sign in to comment.