diff --git a/modulefiles/modulefile.hafs.run.hera b/modulefiles/modulefile.hafs.run.hera index aa430d7f4..ee738048b 100644 --- a/modulefiles/modulefile.hafs.run.hera +++ b/modulefiles/modulefile.hafs.run.hera @@ -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 diff --git a/modulefiles/modulefile.hafs.run.jet b/modulefiles/modulefile.hafs.run.jet index 537a2af34..2286d3c61 100644 --- a/modulefiles/modulefile.hafs.run.jet +++ b/modulefiles/modulefile.hafs.run.jet @@ -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 @@ -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 diff --git a/modulefiles/modulefile.hafs.run.orion b/modulefiles/modulefile.hafs.run.orion index 7ebf4e124..32c86b412 100644 --- a/modulefiles/modulefile.hafs.run.orion +++ b/modulefiles/modulefile.hafs.run.orion @@ -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 @@ -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 diff --git a/modulefiles/modulefile.tools.wcoss_cray_userlib b/modulefiles/modulefile.tools.wcoss_cray_userlib deleted file mode 120000 index 64ecdb4b9..000000000 --- a/modulefiles/modulefile.tools.wcoss_cray_userlib +++ /dev/null @@ -1 +0,0 @@ -modulefile.vortextracker.wcoss_cray_userlib \ No newline at end of file diff --git a/modulefiles/modulefile.vortextracker.wcoss_cray_userlib b/modulefiles/modulefile.vortextracker.wcoss_cray_userlib deleted file mode 100644 index 802f0b815..000000000 --- a/modulefiles/modulefile.vortextracker.wcoss_cray_userlib +++ /dev/null @@ -1,31 +0,0 @@ -#%Module##################################################### -## Module file for vortextracker -############################################################# -module load craype-network-aries -module load craype-haswell -module load craype/2.3.0 -module load PrgEnv-intel/5.2.56 -module load intel/15.0.3.187 -module load cray-mpich/7.2.0 - -module unuse /gpfs/hps/nco/ops/nwprod/lib/modulefiles -module use -a $MOD_PATH - -module load jasper/v1.900.1 -module load png/v1.2.44 -module load z/v1.2.6 - -module load g2/v2.5.0 -module load w3emc/v2.2.0 -module load w3nco/v2.0.6 -module load sp/v2.0.2 -module load ip/v3.0.0 -module load bufr/v11.1.0 -module load bacio/v2.0.1 -module load sigio/v2.1.0 -module load sfcio/v1.0.0 -module load nemsio/v2.2.2 -module load nemsiogfs/v2.0.1 - -module load HDF5-serial-intel-haswell/1.8.9 -module load NetCDF-intel-haswell/4.2 diff --git a/sorc/build_all.sh b/sorc/build_all.sh index 73eab50f4..4e39094e1 100755 --- a/sorc/build_all.sh +++ b/sorc/build_all.sh @@ -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" @@ -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 @@ -74,7 +66,7 @@ echo " .... Building utils .... " } #------------------------------------ -# build tools +# build tools #------------------------------------ $Build_tools && { echo " .... Building tools .... " @@ -90,7 +82,7 @@ echo " .... Building gsi .... " } #------------------------------------ -# build hycom_utils +# build hycom_utils #------------------------------------ $Build_hycom_utils && { echo " .... Building hycom_utils .... " @@ -100,4 +92,4 @@ echo " .... Building hycom_utils .... " echo;echo " .... Build system finished .... " -exit 0 +exit diff --git a/sorc/build_forecast.sh b/sorc/build_forecast.sh index 1fc326a92..846aa3f40 100755 --- a/sorc/build_forecast.sh +++ b/sorc/build_forecast.sh @@ -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 diff --git a/sorc/build_gsi.sh b/sorc/build_gsi.sh index d5958900f..b2491a28d 100755 --- a/sorc/build_gsi.sh +++ b/sorc/build_gsi.sh @@ -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 - diff --git a/sorc/build_hycom_utils.sh b/sorc/build_hycom_utils.sh index dda1d7ab4..ebc70dbbc 100755 --- a/sorc/build_hycom_utils.sh +++ b/sorc/build_hycom_utils.sh @@ -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" diff --git a/sorc/build_post.sh b/sorc/build_post.sh index 9235023b8..f39d06f8d 100755 --- a/sorc/build_post.sh +++ b/sorc/build_post.sh @@ -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 diff --git a/sorc/build_tools.sh b/sorc/build_tools.sh index 216d52b45..c3c4bff0f 100755 --- a/sorc/build_tools.sh +++ b/sorc/build_tools.sh @@ -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 @@ -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 diff --git a/sorc/build_utils.sh b/sorc/build_utils.sh index a2f4a82ca..8504b1209 100755 --- a/sorc/build_utils.sh +++ b/sorc/build_utils.sh @@ -1,23 +1,9 @@ #!/bin/sh set -eux - -export USE_PREINST_LIBS="true" - -#------------------------------------ -# END USER DEFINED STUFF -#------------------------------------ - -build_dir=`pwd` -logs_dir=$build_dir/logs -if [ ! -d $logs_dir ]; then - echo "Creating logs folder" - mkdir $logs_dir -fi +cwd=`pwd` cd hafs_utils.fd ./build_all.sh -cd $build_dir - -echo 'Building utils done' +exit diff --git a/sorc/build_vortextracker.sh b/sorc/build_vortextracker.sh index b90131c9c..e2b00c8e8 100755 --- a/sorc/build_vortextracker.sh +++ b/sorc/build_vortextracker.sh @@ -1,109 +1,62 @@ -#! /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 ]; then - - echo "Does not support wcoss phase 1/2." - exit 1 - -elif [ $target = hera ]; then - +if [ $target = hera ]; then targetx=hera #source ../modulefiles/modulefile.vortextracker.$target > /dev/null 2>&1 module use ../modulefiles module load modulefile.vortextracker.$target module list - export FC=ifort export F90=ifort export CC=icc export hwrf_g2_inc=/scratch1/NCEPDEV/hwrf/save/Bin.Liu/hwrf-utilities/libs/mods/g2 export hwrf_g2_lib=/scratch1/NCEPDEV/hwrf/save/Bin.Liu/hwrf-utilities/libs/libg2.a - elif [ $target = orion ]; then - targetx=orion #source ../modulefiles/modulefile.vortextracker.$target > /dev/null 2>&1 module use ../modulefiles module load modulefile.vortextracker.$target module list - export FC=ifort export F90=ifort export CC=icc export hwrf_g2_inc=/work/noaa/hwrf/noscrub/bthomas/H220/sorc/hwrf-utilities/libs/mods/g2 export hwrf_g2_lib=/work/noaa/hwrf/noscrub/bthomas/H220/sorc/hwrf-utilities/libs/libg2.a - elif [ $target = jet ]; then - targetx=jet #source ../modulefiles/modulefile.vortextracker.$target > /dev/null 2>&1 module use ../modulefiles module load modulefile.vortextracker.$target module list - export FC=ifort export F90=ifort export CC=icc export hwrf_g2_inc=/lfs4/HFIP/hwrf-vd/Zhan.Zhang/H219_kjet/sorc/hwrf-utilities/libs/mods/g2 export hwrf_g2_lib=/lfs4/HFIP/hwrf-vd/Zhan.Zhang/H219_kjet/sorc/hwrf-utilities/libs/libg2.a - elif [ $target = wcoss_cray ]; then - targetx=cray - if [ $USE_PREINST_LIBS = true ]; then - #source ../modulefiles/modulefile.vortextracker.$target > /dev/null 2>&1 - module use ../modulefiles - module load modulefile.vortextracker.$target - else - #source ../modulefiles/modulefile.vortextracker.${target}_userlib > /dev/null 2>&1 - module use ../modulefiles - module load modulefile.vortextracker.${target}_userlib - fi + #source ../modulefiles/modulefile.vortextracker.$target > /dev/null 2>&1 + module use ../modulefiles + module load modulefile.vortextracker.$target module list - export FC=ftn export F90=ftn export CC=icc export hwrf_g2_inc=/gpfs/hps3/emc/hwrf/noscrub/Bin.Liu/save/H221final/sorc/hwrf-utilities/libs/mods/g2 export hwrf_g2_lib=/gpfs/hps3/emc/hwrf/noscrub/Bin.Liu/save/H221final/sorc/hwrf-utilities/libs/libg2.a - elif [ $target = wcoss_dell_p3 ]; then - targetx=wcoss_dell_p3 - if [ $USE_PREINST_LIBS = true ]; then - #source ../modulefiles/modulefile.vortextracker.$target > /dev/null 2>&1 - module use ../modulefiles - module load modulefile.vortextracker.$target - else - #source ../modulefiles/modulefile.vortextracker.${target}_userlib > /dev/null 2>&1 - module use ../modulefiles - module load modulefile.vortextracker.${target}_userlib - fi + #source ../modulefiles/modulefile.vortextracker.$target > /dev/null 2>&1 + module use ../modulefiles + module load modulefile.vortextracker.$target module list - export FC=ifort export F90=ifort export CC=icc - else - echo "Unknown machine = $target" exit 1 fi diff --git a/sorc/install_all.sh b/sorc/install_all.sh index 90cdf7a4c..ba020e337 100755 --- a/sorc/install_all.sh +++ b/sorc/install_all.sh @@ -1,18 +1,11 @@ #!/bin/sh set -xeu - -build_dir=`pwd` +cwd=`pwd` CP='cp -rp' -# Check final exec folder exists -if [ ! -d "../exec" ]; then - echo "Creating ../exec folder" - mkdir ../exec -fi - #------------------------------------ -# INCLUDE PARTIAL BUILD +# INCLUDE PARTIAL BUILD #------------------------------------ . ./partial_build.sh @@ -102,7 +95,7 @@ $Build_gsi && { } #------------------------------------ -# install hycom_utils +# install hycom_utils #------------------------------------ $Build_hycom_utils && { ${CP} hafs_hycom_utils.fd/exec/hafs_get_rtofs ../exec/hafs_get_rtofs.x @@ -119,4 +112,4 @@ $Build_hycom_utils && { echo;echo " .... Install system finished .... " -exit 0 +exit diff --git a/sorc/install_hafs.sh b/sorc/install_hafs.sh index 9c35d833f..8874e85d0 100755 --- a/sorc/install_hafs.sh +++ b/sorc/install_hafs.sh @@ -1,8 +1,6 @@ #!/bin/sh set -x - source ./machine-setup.sh > /dev/null 2>&1 - cwd=$(pwd) cd ${cwd} diff --git a/sorc/logs/.gitignore b/sorc/logs/.gitignore new file mode 100644 index 000000000..efadbd837 --- /dev/null +++ b/sorc/logs/.gitignore @@ -0,0 +1,7 @@ +# git does not allow empty directories. +# Yet, we need to add this empty directory on git. +# To achieve that, we created this .gitignore file, so that the directory will not be empty thus enabling us to commit it. +# Since we want all generated files/folders in this directory to be ignored by git, we add a rule for this. +* +# And then add an exception for this specifc file (so that we can commit it). +!.gitignore diff --git a/sorc/machine-setup.sh b/sorc/machine-setup.sh old mode 100644 new mode 100755 index d3e4f7f36..f066c0f93 --- a/sorc/machine-setup.sh +++ b/sorc/machine-setup.sh @@ -85,7 +85,7 @@ elif [[ -L /usrx && "$( readlink /usrx 2> /dev/null )" =~ dell ]] ; then source /usrx/local/prod/lmod/lmod/init/$__ms_shell fi target=wcoss_dell_p3 - module purge + module purge elif [[ -d /dcom && -d /hwrf ]] ; then # We are on NOAA Tide or Gyre @@ -104,7 +104,7 @@ elif [[ -d /glade ]] ; then target=yellowstone module purge elif [[ -d /lustre && -d /ncrc ]] ; then - # We are on GAEA. + # We are on GAEA. if ( ! eval module help > /dev/null 2>&1 ) ; then # We cannot simply load the module command. The GAEA # /etc/profile modifies a number of module-related variables diff --git a/sorc/partial_build.sh b/sorc/partial_build.sh index 7e0137ca9..40675a3bf 100755 --- a/sorc/partial_build.sh +++ b/sorc/partial_build.sh @@ -1,7 +1,7 @@ # # define the array of the name of build program # - declare -a Build_prg=("Build_libs" + declare -a Build_prg=("Build_libs" "Build_forecast" \ "Build_post" \ "Build_vortextracker" \