Skip to content

Commit

Permalink
Merge develop into release/public-v1 (changes: PR NCAR#48 from George…
Browse files Browse the repository at this point in the history
… Gayno, chgres_cube grib2 GFS data support); update submodule pointer for cmake
  • Loading branch information
climbfuji committed Feb 4, 2020
2 parents 1e1d1c8 + 0f5d0f1 commit 40c21bd
Show file tree
Hide file tree
Showing 38 changed files with 3,379 additions and 60 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ find_package(Jasper REQUIRED)
find_package(PNG REQUIRED)
find_package(ESMF MODULE REQUIRED)
find_package(ZLIB REQUIRED)
find_package(WGRIB2 REQUIRED)

if(NOT TARGET landsfcutil_4)
find_package(landsfcutil REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion cmake
3 changes: 3 additions & 0 deletions modulefiles/chgres_cube.hera
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ module load sfcio//v1.1.0-intel-19.0.4.243
module load sigio/v2.1.0-intel-19.0.4.243-impi
module load esmf/8.0.0-intel-19.0.4.243-impi

export WGRIB2API_INC="/apps/wgrib2/2.0.8/intel/18.0.3.222/lib"
export WGRIB2_LIB="/apps/wgrib2/2.0.8/intel/18.0.3.222/lib/libwgrib2.a"

export FCOMP=mpiifort
export FFLAGS="-O3 -fp-model precise -g -traceback -r8 -i4 -qopenmp -convert big_endian -assume byterecl"
# for debugging
Expand Down
7 changes: 5 additions & 2 deletions modulefiles/chgres_cube.jet
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

module load intel/18.0.5.274
module load impi/2018.4.274
module load szip
module load hdf5
module load szip/2.1
module load hdf5/1.8.9
module load netcdf/4.2.1.1

module load w3nco/v2.0.6
Expand All @@ -22,3 +22,6 @@ export FCOMP=mpiifort
export FFLAGS="-O3 -fp-model precise -g -traceback -r8 -i4 -qopenmp -convert big_endian -assume byterecl"
#debug
#export FFLAGS="-O0 -g -traceback -r8 -i4 -qopenmp -convert big_endian -check bounds -warn unused -assume byterecl"

export WGRIB2API_INC="/mnt/lfs3/projects/hwrfv3/Jili.Dong/wgrib2-2.0.8/grib2/lib"
export WGRIB2_LIB="/mnt/lfs3/projects/hwrfv3/Jili.Dong/wgrib2-2.0.8/grib2/lib/libwgrib2.a"
24 changes: 24 additions & 0 deletions modulefiles/chgres_cube.linux.gnu
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#############################################################
## chgres_cube component - linux.gnu
#############################################################

export IP_INCd=${NCEPLIBS}/ip/include_d
export NEMSIO_INC=${NCEPLIBS}/nemsio/include
export SFCIO_INC4=${NCEPLIBS}/sfcio/include_4
export SIGIO_INC4=${NCEPLIBS}/sigio/include_4

export BACIO_LIB4=${NCEPLIBS}/bacio/lib/libbacio_v2.1.0_4.a
export IP_LIBd=${NCEPLIBS}/ip/lib/libip_v3.0.0_d.a
export NEMSIO_LIB=${NCEPLIBS}/nemsio/lib/libnemsio_v2.2.3.a
export SFCIO_LIB4=${NCEPLIBS}/sfcio/lib/libsfcio_v1.1.0_4.a
export SIGIO_LIB4=${NCEPLIBS}/sigio/lib/libsigio_v2.1.0_4.a
export SP_LIBd=${NCEPLIBS}/sp/lib/libsp_v2.0.2_d.a
export W3NCO_LIBd=${NCEPLIBS}/w3nco/lib/libw3nco_v2.0.6_d.a

export WGRIB2API_INC=${WGRIB2_DIR}/include
export WGRIB2_LIB=${WGRIB2_DIR}/lib/libwgrib2.a

export FCOMP=mpif90
export FFLAGS="-O3 -g -fbacktrace -fdefault-real-8 -ffree-line-length-none -fopenmp -fconvert=big-endian"
# for debugging
#export FFLAGS="-O0 -g -fbacktrace -fdefault-real-8 -ffree-line-length-none -fopenmp -fconvert=big-endian"
24 changes: 24 additions & 0 deletions modulefiles/chgres_cube.linux.intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#############################################################
## chgres_cube component - linux.intel
#############################################################

export IP_INCd=${NCEPLIBS}/ip/include_d
export NEMSIO_INC=${NCEPLIBS}/nemsio/include
export SFCIO_INC4=${NCEPLIBS}/sfcio/include_4
export SIGIO_INC4=${NCEPLIBS}/sigio/include_4

export BACIO_LIB4=${NCEPLIBS}/bacio/lib/libbacio_v2.1.0_4.a
export IP_LIBd=${NCEPLIBS}/ip/lib/libip_v3.0.0_d.a
export NEMSIO_LIB=${NCEPLIBS}/nemsio/lib/libnemsio_v2.2.3.a
export SFCIO_LIB4=${NCEPLIBS}/sfcio/lib/libsfcio_v1.1.0_4.a
export SIGIO_LIB4=${NCEPLIBS}/sigio/lib/libsigio_v2.1.0_4.a
export SP_LIBd=${NCEPLIBS}/sp/lib/libsp_v2.0.2_d.a
export W3NCO_LIBd=${NCEPLIBS}/w3nco/lib/libw3nco_v2.0.6_d.a

export WGRIB2API_INC=${WGRIB2_DIR}/include
export WGRIB2_LIB=${WGRIB2_DIR}/lib/libwgrib2.a

export FCOMP=mpif90
export FFLAGS="-O3 -fp-model source -g -traceback -r8 -i4 -qopenmp -convert big_endian -assume byterecl"
# for debugging
#export FFLAGS="-O0 -g -traceback -r8 -i4 -qopenmp -convert big_endian -check bounds -warn unused -assume byterecl"
27 changes: 27 additions & 0 deletions modulefiles/chgres_cube.odin
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#%Module#####################################################
## chgres build module for Odin
#############################################################

module use /oldscratch/ywang/external/modulefiles
module load esmf/8.0.0bs30

module load cray-netcdf-hdf5parallel
module load cray-parallel-netcdf
module load cray-hdf5-parallel
module load w3nco/v2.0.6
module load nemsio/v2.2.2
module load bacio/v2.0.2
module load sp/v2.0.2
module load sfcio/v1.0.0
module load sigio/v2.0.1


export FCOMP=ftn
export FFLAGS="-O3 -fp-model precise -g -traceback -r8 -i4 -qopenmp -convert big_endian -assume byterecl"
export WGRIB2API_LIB="/home/larissa.reames/tmp/wgrib2-2/grib2/lib/libwgrib2_api.a"
export WGRIB2API_INC="/home/larissa.reames/tmp/wgrib2-2/grib2/lib"
export WGRIB2_LIB="/home/larissa.reames/tmp/wgrib2-2/grib2/lib/libwgrib2.a"


# for debugging
#export FFLAGS="-O0 -g -traceback -r8 -i4 -qopenmp -convert big_endian -check bounds -warn unused -assume byterecl"
3 changes: 3 additions & 0 deletions modulefiles/chgres_cube.wcoss_cray
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ module load sfcio-intel/1.0.0
# module load esmf/7.1.0r
export ESMFMKFILE=/gpfs/hps3/emc/global/noscrub/George.Gayno/esmf/8_0_0_bs20/lib/esmf.mk

export WGRIB2API_INC=/gpfs/hps3/emc/meso/save/Dusan.Jovic/wgrib2/include
export WGRIB2_LIB=/gpfs/hps3/emc/meso/save/Dusan.Jovic/wgrib2/lib/libwgrib2.a

export FCOMP=ftn
export FFLAGS="-O3 -fp-model precise -g -r8 -i4 -qopenmp -convert big_endian -assume byterecl"
# for debugging
Expand Down
3 changes: 3 additions & 0 deletions modulefiles/chgres_cube.wcoss_dell_p3
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ module load bacio/2.0.2
module load sfcio/1.0.0
module load sigio/2.1.0

export WGRIB2API_INC=/u/Wesley.Ebisuzaki/home/grib2.v2.0.8.intel/lib
export WGRIB2_LIB=/u/Wesley.Ebisuzaki/home/grib2.v2.0.8.intel/lib/libwgrib2.a

export FCOMP=mpif90
export FFLAGS="-O3 -fp-model precise -g -traceback -r8 -i4 -qopenmp -convert big_endian -assume byterecl"
# for debugging
Expand Down
Empty file modified modulefiles/fv3gfs/fre-nctools.wcoss_cray
100755 → 100644
Empty file.
Empty file modified modulefiles/fv3gfs/fre-nctools.wcoss_dell_p3
100755 → 100644
Empty file.
Empty file modified modulefiles/modulefile.global_emcsfc_ice_blend.wcoss
100755 → 100644
Empty file.
Empty file modified modulefiles/modulefile.global_emcsfc_ice_blend.wcoss_cray
100755 → 100644
Empty file.
Empty file.
Empty file modified modulefiles/modulefile.global_emcsfc_ice_blend.wcoss_dell_p3
100755 → 100644
Empty file.
Empty file modified modulefiles/modulefile.global_emcsfc_snow2mdl.wcoss
100755 → 100644
Empty file.
Empty file modified modulefiles/modulefile.global_emcsfc_snow2mdl.wcoss_cray
100755 → 100644
Empty file.
Empty file.
Empty file modified modulefiles/modulefile.global_emcsfc_snow2mdl.wcoss_dell_p3
100755 → 100644
Empty file.
23 changes: 23 additions & 0 deletions parm/varmap_tables/GFSphys_var_map.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
dzdt dzdt set_to_fill 0 D
sphum sphum set_to_fill 1E-7 T
liq_wat liq_wat set_to_fill 0 T
o3mr o3mr set_to_fill 1E-7 T
ice_wat ice_wat set_to_fill 0 T
rainwat rainwat set_to_fill 0 T
snowwat snowwat set_to_fill 0 T
graupel graupel set_to_fill 0 T
vtype vtype skip 0 S
sotype stype skip 0 S
vfrac vfrac skip 0 S
fricv uustar set_to_fill 0 S
sfcr zorl set_to_fill 0.01 S
tprcp tprcp set_to_fill 0.00 S
ffmm ffmm set_to_fill 0.00 S
f10m f10m set_to_fill 0.00 S
soilw smc stop 0 S
soill slc set_to_fill 0.0 S
soilt stc stop 0 S
cnwat cnwat set_to_fill 0.0 S
hice icetk set_to_fill 1.5 S
weasd weasd set_to_fill 0.0 S
snod snod set_to_fill 0.0 S
24 changes: 24 additions & 0 deletions parm/varmap_tables/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#######################################################
# Description of varmap_tables #
#######################################################

These files, each named for the phys_suite variable set in the chgres_cube namelist,
control how chgres_cube, when processing grib2 files, handles variables that might
be missing from the grib2 files. Since there are so many different version of grib2
files, it's often uncertain what fields are available even if you know what source
model the data is coming from. Each file contains :

Line 1: number of entries in the table
Column 1: Name the code searches for in the table. Do not change.
Column 2: Name the code will use to save the variable in the output file. Unimplemented.
Comumn 3: Behavior when the code can't find the variable in the input file. Options are:
"skip": Don't write to output file.
"set_to_fill": Set to user-specified field value (see column 4).
"stop": Force an exception and stop code execution. Use this if you absolutely
require a field to be present.
Column 4: If column 3 = "set_to_fill", then this value is used to fill in all points
in the input field. These values may be over-written by the code before
output depending on the variable (esp. for surface variables). Be careful
with these values for surface variables. If you set this value too low
(e.g., -100000), the code may run extremely slowly due to variable replacment
at "missing" points.
41 changes: 41 additions & 0 deletions sorc/build_chgres_cube.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#! /usr/bin/env bash
set -eux

target=${target:-"NULL"}

if [[ $target == "linux.gnu" || $target == "linux.intel" ]]; then
unset -f module
else
source ./machine-setup.sh > /dev/null 2>&1
fi

cwd=`pwd`

USE_PREINST_LIBS=${USE_PREINST_LIBS:-"true"}
if [ $USE_PREINST_LIBS = true ]; then
export MOD_PATH
source ../modulefiles/chgres_cube.$target > /dev/null 2>&1
else
export MOD_PATH=${cwd}/lib/modulefiles
if [ $target = wcoss_cray ]; then
source ../modulefiles/chgres_cube.${target}_userlib > /dev/null 2>&1
else
source ../modulefiles/chgres_cube.$target > /dev/null 2>&1
fi
fi

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

#
# --- Chgres part
#
cd chgres_cube.fd

make clean
make
make install

exit
2 changes: 2 additions & 0 deletions sorc/chgres_cube.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ target_include_directories(${exe_name} PUBLIC

target_include_directories(${exe_name}
PRIVATE
${WGRIB2_INCLUDES}
${NETCDF_INCLUDES}
${NETCDF_INCLUDES_F90}
${MPI_Fortran_INCLUDE_PATH})

target_link_libraries(${exe_name}
${WGRIB2_LIBRARIES}
${NETCDF_LIBRARIES_F90} ${NETCDF_LIBRARIES}
nemsio
sfcio_4 ${MPI_Fortran_LIBRARIES}
Expand Down
Loading

0 comments on commit 40c21bd

Please sign in to comment.