Skip to content

Commit

Permalink
feature/jetlibs
Browse files Browse the repository at this point in the history
Merge branch 'develop' into feature/jetlibs

Issue ufs-community#196
  • Loading branch information
GeorgeGayno-NOAA committed Oct 30, 2020
2 parents 1809b6f + 486df9f commit 770388a
Show file tree
Hide file tree
Showing 15 changed files with 498 additions and 567 deletions.
16 changes: 7 additions & 9 deletions build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export MOD_PATH
if [[ "$target" == "linux.*" || "$target" == "macosx.*" ]]; then
unset -f module
set +x
source ./modulefiles/build.$target > /dev/null 2>&1
source ./modulefiles/build.$target > /dev/null 2>&1
set -x
else
set +x
Expand All @@ -20,21 +20,19 @@ else
set -x
fi

# --- Build all programs.
#

rm -fr ./build
mkdir ./build
cd ./build

CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON"

if [[ "$compiler" == "intel" ]]; then
if [[ "$target" != "wcoss_cray" && "$target" != "odin" ]]; then
if [[ "$target" != "wcoss_cray" && \
"$target" != "gaea" && \
"$target" != "odin" ]]; then
CMAKE_FLAGS+=" -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=icc"
fi
fi

rm -fr ./build
mkdir ./build && cd ./build

cmake .. ${CMAKE_FLAGS}

make -j 8 VERBOSE=1
Expand Down
22 changes: 22 additions & 0 deletions modulefiles/build.gaea.intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#%Module#####################################################
## Build module for Gaea
#############################################################

module switch intel/18.0.6.288

module load git/2.26.0
module load cmake/3.17.0

# hpc-stack installed as a flat install at:
# /ncrc/home2/Rahul.Mahajan/dev/opt

setenv ESMFMKFILE /ncrc/home2/Rahul.Mahajan/dev/opt/lib/esmf.mk

prepend-path PATH /ncrc/home2/Rahul.Mahajan/dev/opt/bin
prepend-path CMAKE_PREFIX_PATH /ncrc/home2/Rahul.Mahajan/dev/opt
prepend-path LD_LIBRARY_PATH /ncrc/home2/Rahul.Mahajan/dev/opt/lib
prepend-path LD_LIBRARY_PATH /ncrc/home2/Rahul.Mahajan/dev/opt/lib64

setenv CMAKE_C_COMPIELR cc
setenv CMAKE_CXX_COMPIELR CC
setenv CMAKE_Fortran_COMPIELR ftn
11 changes: 4 additions & 7 deletions modulefiles/module-setup.sh.inc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ elif [[ -d /gpfs/hps && -e /etc/SuSE-release ]] ; then
elif [[ -L /usrx && "$( readlink /usrx 2> /dev/null )" =~ dell ]] ; then
# We are on NOAA Mars or Venus
if ( ! eval module help > /dev/null 2>&1 ) ; then
source /usrx/local/prod/lmod/lmod/init/$__ms_shell
source /usrx/local/prod/lmod/lmod/init/$__ms_shell
fi
module purge
elif [[ -d /glade ]] ; then
Expand All @@ -58,7 +58,7 @@ elif [[ -d /glade ]] ; then
fi
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
Expand All @@ -70,8 +70,9 @@ elif [[ -d /lustre && -d /ncrc ]] ; then
else
__ms_source_etc_profile=no
fi
module purge > /dev/null 2>&1
module purge
# clean up after purge
# clean up after purge
unset _LMFILES_
unset _LMFILES_000
unset _LMFILES_001
Expand All @@ -89,10 +90,6 @@ elif [[ -d /lustre && -d /ncrc ]] ; then
if [[ -s /etc/opt/cray/pe/admin-pe/site-config ]] ; then
source /etc/opt/cray/pe/admin-pe/site-config
fi
export NCEPLIBS=/lustre/f1/pdata/ncep_shared/NCEPLIBS/lib
if [[ -d "$NCEPLIBS" ]] ; then
module use $NCEPLIBS/modulefiles
fi
if [[ "$__ms_source_etc_profile" == yes ]] ; then
source /etc/profile
unset __ms_source_etc_profile
Expand Down
47 changes: 36 additions & 11 deletions sorc/machine-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ USERNAME=`echo $LOGNAME | awk '{ print tolower($0)'}`
if [[ -d /lfs3 ]] ; then
# We are on NOAA Jet
if ( ! eval module help > /dev/null 2>&1 ) ; then
echo load the module command 1>&2
echo load the module command 1>&2
source /apps/lmod/lmod/init/$__ms_shell
fi
target=jet
module purge
elif [[ -d /scratch1 ]] ; then
# We are on NOAA Hera
if ( ! eval module help > /dev/null 2>&1 ) ; then
echo load the module command 1>&2
echo load the module command 1>&2
source /apps/lmod/lmod/init/$__ms_shell
fi
target=hera
module purge
elif [[ -d /gpfs/hps && -e /etc/SuSE-release ]] ; then
# We are on NOAA Luna or Surge
if ( ! eval module help > /dev/null 2>&1 ) ; then
echo load the module command 1>&2
source /opt/modules/default/init/$__ms_shell
echo load the module command 1>&2
source /opt/modules/default/init/$__ms_shell
fi
target=wcoss_cray

Expand Down Expand Up @@ -72,32 +72,57 @@ elif [[ -d /gpfs/hps && -e /etc/SuSE-release ]] ; then
elif [[ -L /usrx && "$( readlink /usrx 2> /dev/null )" =~ dell ]] ; then
# We are on NOAA Venus or Mars
if ( ! eval module help > /dev/null 2>&1 ) ; then
echo load the module command 1>&2
source /usrx/local/prod/lmod/lmod/init/$__ms_shell
echo load the module command 1>&2
source /usrx/local/prod/lmod/lmod/init/$__ms_shell
fi
target=wcoss_dell_p3
module purge
module purge
elif [[ -d /glade ]] ; then
# We are on NCAR Cheyenne
if ( ! eval module help > /dev/null 2>&1 ) ; then
echo load the module command 1>&2
echo load the module command 1>&2
. /glade/u/apps/ch/opt/lmod/8.1.7/lmod/8.1.7/init/sh
fi
target=cheyenne
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
# before loading the module command. Without those variables,
# the module command fails. Hence we actually have to source
# /etc/profile here.
echo load the module command 1>&2
source /etc/profile
__ms_source_etc_profile=yes
else
__ms_source_etc_profile=no
fi
target=gaea
module purge > /dev/null 2>&1
module purge
# clean up after purge
unset _LMFILES_
unset _LMFILES_000
unset _LMFILES_001
unset LOADEDMODULES
module load modules
if [[ -d /opt/cray/ari/modulefiles ]] ; then
module use -a /opt/cray/ari/modulefiles
fi
if [[ -d /opt/cray/pe/ari/modulefiles ]] ; then
module use -a /opt/cray/pe/ari/modulefiles
fi
if [[ -d /opt/cray/pe/craype/default/modulefiles ]] ; then
module use -a /opt/cray/pe/craype/default/modulefiles
fi
if [[ -s /etc/opt/cray/pe/admin-pe/site-config ]] ; then
source /etc/opt/cray/pe/admin-pe/site-config
fi
if [[ "$__ms_source_etc_profile" == yes ]] ; then
source /etc/profile
unset __ms_source_etc_profile
fi
target=gaea
elif [[ "$(hostname)" =~ "Orion" ]]; then
target="orion"
module purge
Expand Down
40 changes: 19 additions & 21 deletions sorc/sfc_climo_gen.fd/driver.F90
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
program driver

!-------------------------------------------------------------------------
! program documentation block
!
! Abstract: Reads static surface data on a global lat/lon grid,
! interpolates the data to the fv3 model grid, and outputs the
! result in netcdf format.
!
! Program execution is controlled by variables defined in the
! program configuration namelist (see module program_setup for
! details).
!
! Requires the following input files:
! 1) Model mosaic file (netcdf)
! 2) Model orography files (netcdf)
! 3) Model grid files (netcdf)
! 4) Source data file on global lat/lon grid (netcdf)
!
! Outputs surface data on the model tiles in netcdf format.
!-------------------------------------------------------------------------
!> @file
!!
!! Reads static surface data on a global lat/lon grid,
!! interpolates the data to the fv3 model grid, and outputs the
!! result in netcdf format.
!!
!! Program execution is controlled by variables defined in the
!! program configuration namelist (see module program_setup for
!! details).
!!
!! Requires the following input files:
!! 1) Model mosaic file (netcdf)
!! 2) Model orography files (netcdf)
!! 3) Model grid files (netcdf)
!! 4) Source data file on global lat/lon grid (netcdf)
!!
!! Outputs surface data on the model tiles in netcdf format.
!!
program driver

use model_grid
use source_grid
Expand Down
28 changes: 10 additions & 18 deletions sorc/sfc_climo_gen.fd/interp.F90
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
!> @file
!! @author gayno @date 2018
!!
!! Read the input source data and interpolate it to the
!! model grid.
!!
!! @param[in] input_flle filename of input source data.
!! @param[in] localpet this mpi task
!! @param[in] method interpolation method.defined where mask=1
!!
subroutine interp(localpet, method, input_file)

!-----------------------------------------------------------------------
! subroutine documentation block
!
! Subroutine: interp
! prgmmr: gayno org: w/np2 date: 2018
!
! Abstract: Read the input source data and interpolate it to the
! model grid.
!
! Usage: call interp(localpet, method, input_file)
!
! input argument list:
! input_flle filename of input source data.
! localpet this mpi task
! method interpolation method.defined where mask=1
!
!-----------------------------------------------------------------------

use esmf
use netcdf
use model_grid
Expand Down
Loading

0 comments on commit 770388a

Please sign in to comment.