Skip to content

Commit

Permalink
Merge pull request #56 from climbfuji/update_dtc-hwrf-physics_from_ha…
Browse files Browse the repository at this point in the history
…fs_support_20200618

dtc/hwrf-physics: update from support/hafs 2020/06/18

These code changes have been approved previously when merged into the authoritative branches (which were then brought to support/HAFS). Merging without approval.
  • Loading branch information
climbfuji authored Jun 19, 2020
2 parents 6d07f4d + bbafea8 commit c70a57f
Show file tree
Hide file tree
Showing 214 changed files with 35,316 additions and 326,051 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
[submodule "stochastic_physics"]
path = stochastic_physics
url = https://github.com/noaa-psd/stochastic_physics

branch = master
67 changes: 58 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.15)

foreach(env_var IN ITEMS
CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_Fortran_COMPILER
Expand All @@ -23,13 +23,6 @@ find_package(ESMF REQUIRED)

include(${PROJECT_SOURCE_DIR}/cmake/configure_${CMAKE_Platform}.cmake)

if(NOT DEFINED PHYS)
set(PHYS gfs)
endif()
message("")
message("Selected physics package: ${PHYS}")
message("")

add_definitions(-Duse_libMPI)
add_definitions(-Duse_netCDF)
add_definitions(-Duse_WRTCOMP)
Expand All @@ -43,6 +36,62 @@ add_definitions(-DUSE_COND)
add_definitions(-DNEW_TAUCTMAX)
add_definitions(-DINTERNAL_FILE_NML)

if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 9.0.0)
message(FATAL_ERROR "GNU Compiler >= 9 is required")
endif()

if(CCPP)

find_package(Python 3 QUIET COMPONENTS Interpreter)
if (NOT Python_Interpreter_FOUND)
find_package(Python 2.7 QUIET REQUIRED COMPONENTS Interpreter)
endif()
message("Found Python: ${Python_EXECUTABLE}")

if(DEFINED CCPP_SUITES)
message("Calling CCPP code generator (ccpp_prebuild.py) for SUITES = ${CCPP_SUITES}")
execute_process(COMMAND FV3/ccpp/framework/scripts/ccpp_prebuild.py
"--config=FV3/ccpp/config/ccpp_prebuild_config.py"
"--suites=${CCPP_SUITES}"
"--builddir=${PROJECT_BINARY_DIR}/FV3"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.out
ERROR_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.err
RESULT_VARIABLE RC
)
else()
message("Calling CCPP code generator (ccpp_prebuild.py) ...")
execute_process(COMMAND FV3/ccpp/framework/scripts/ccpp_prebuild.py
"--config=FV3/ccpp/config/ccpp_prebuild_config.py"
"--builddir=${PROJECT_BINARY_DIR}/FV3"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.out
ERROR_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.err
RESULT_VARIABLE RC
)
endif()

# Check return code from ccpp_prebuild.py
if(RC EQUAL 0)
message("")
else()
message(FATAL_ERROR "An error occured while running ccpp_prebuild.py, check ${PROJECT_BINARY_DIR}/ccpp_prebuild.{out,err}")
endif()

# this should not be necessary; including CCPP_*.cmake here and passing
# SCHEMES, CAPS and TYPEDEFS via environment variables to CCPP build.
# CCPP should be able to directly include those three .cmake files.

include(${PROJECT_BINARY_DIR}/FV3/ccpp/physics/CCPP_SCHEMES.cmake)
include(${PROJECT_BINARY_DIR}/FV3/ccpp/physics/CCPP_CAPS.cmake)
include(${PROJECT_BINARY_DIR}/FV3/ccpp/physics/CCPP_TYPEDEFS.cmake)

set(ENV{CCPP_SCHEMES} "${SCHEMES}")
set(ENV{CCPP_CAPS} "${CAPS}")
set(ENV{CCPP_TYPEDEFS} "${TYPEDEFS}")

endif()

###############################################################################
### FMS
###############################################################################
Expand Down Expand Up @@ -226,7 +275,7 @@ target_link_libraries(NEMS.exe
fv3core
io
${IPD_LIBRARIES}
${PHYS}physics
gfsphysics
${CCPP_LIBRARIES}
fv3cpl
stochastic_physics
Expand Down
2 changes: 1 addition & 1 deletion FV3
Submodule FV3 updated 200 files
12 changes: 12 additions & 0 deletions README_HWRF_PHYSICS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ ccpp-physics
05/20/2020 update from HAFS community https://github.com/NCAR/ccpp-physics/pull/453
(entire PR)

06/18/2020 update from HAFS community https://github.com/NCAR/ccpp-physics/pull/463
(entire PR)

fv3atm
------

Expand Down Expand Up @@ -87,6 +90,12 @@ fv3atm
05/20/2020 update from HAFS community https://github.com/NCAR/fv3atm/pull/50
(entire PR)

06/18/2020 modify HAFS_v0_hwrf_nogwdps SDF https://github.com/NCAR/fv3atm/pull/55
(entire PR)

06/18/2020 update from HAFS community https://github.com/NCAR/fv3atm/pull/54
(entire PR)

ufs-weather-model
-----------------

Expand Down Expand Up @@ -114,3 +123,6 @@ ufs-weather-model

05/20/2020 update from HAFS community https://github.com/NCAR/ufs-weather-model/pull/48
(entire PR)

06/18/2020 update from HAFS community https://github.com/NCAR/ufs-weather-model/pull/56
(entire PR)
10 changes: 0 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ rm -rf ${BUILD_DIR}
mkdir ${BUILD_DIR}

CCPP_SUITES="${CCPP_SUITES:-FV3_GFS_2017_gfdlmp}"

./FV3/ccpp/framework/scripts/ccpp_prebuild.py \
--config=FV3/ccpp/config/ccpp_prebuild_config.py \
--suites=${CCPP_SUITES} \
--builddir=${BUILD_DIR}/FV3 > ${BUILD_DIR}/ccpp_prebuild.log 2>&1

source ${BUILD_DIR}/FV3/ccpp/physics/CCPP_SCHEMES.sh
source ${BUILD_DIR}/FV3/ccpp/physics/CCPP_CAPS.sh
source ${BUILD_DIR}/FV3/ccpp/physics/CCPP_STATIC_API.sh

CMAKE_FLAGS+=" -DCCPP=ON -DSUITES=${CCPP_SUITES} -DNETCDF_DIR=${NETCDF}"

cd ${BUILD_DIR}
Expand Down
File renamed without changes.
35 changes: 35 additions & 0 deletions cmake/configure_stampede.intel.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
message("")
message("Setting configuration for $ENV{CMAKE_Platform}")
message("")

get_filename_component (C_COMPILER_NAME ${CMAKE_C_COMPILER} NAME)
get_filename_component (CXX_COMPILER_NAME ${CMAKE_CXX_COMPILER} NAME)
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
message("C compiler: ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION} (${C_COMPILER_NAME})")
message("CXX compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} (${CXX_COMPILER_NAME})")
message("Fortran compiler: ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION} (${Fortran_COMPILER_NAME})")
message("")

option(DEBUG "Enable DEBUG mode" OFF)
option(REPRO "Enable REPRO mode" OFF)
option(VERBOSE "Enable VERBOSE mode" OFF)
option(32BIT "Enable 32BIT (single precision arithmetic in dycore)" OFF)
option(OPENMP "Enable OpenMP threading" ON)
option(AVX2 "Enable AVX2 instruction set" ON)

option(INLINE_POST "Enable inline post" OFF)

include( cmake/${CMAKE_Fortran_COMPILER_ID}.cmake )

set(NEMSIO_INC $ENV{NEMSIO_INC})
set(POST_INC $ENV{POST_INC})
set(NCEP_LIBS $ENV{POST_LIB} $ENV{NEMSIO_LIB} $ENV{G2_LIB4} $ENV{G2TMPL_LIB} $ENV{BACIO_LIB4} $ENV{SP_LIBd} $ENV{W3EMC_LIBd} $ENV{W3NCO_LIBd} $ENV{CRTM_LIB} $ENV{PNG_LIB} $ENV{JASPER_LIB} $ENV{Z_LIB})

set(ESMF_MOD ${ESMF_F90COMPILEPATHS})
set(ESMF_LIBS "${ESMF_F90ESMFLINKRPATHS} ${ESMF_F90ESMFLINKPATHS} ${ESMF_F90ESMFLINKLIBS}")

set(NETCDF_INC_DIR $ENV{NETCDF}/include)
set(NETCDF_LIBDIR $ENV{NETCDF}/lib)
set(NETCDF_LIBS -L$ENV{NETCDF}/lib -lnetcdff -lnetcdf)

message("")
4 changes: 4 additions & 0 deletions compsets/fv3.input
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ fv3_defaults = {
IAU_INC_FILES="''"
IAU_DRYMASSFIXER='.false.'

DO_CA='.F.'
CA_SGS='.F.'
CA_GLOBAL='.F.'

CPLFLX='.F.'
CPLWAV='.F.'
CPLWAV2ATM='.F.'
Expand Down
8 changes: 0 additions & 8 deletions conf/before_components.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ CHOSEN_MODULE=$(BUILD_TARGET)/fv3

CONFIGURE_NEMS_FILE=configure.fv3.$(BUILD_TARGET)

# ----------------------------------------------------------------------
# Exit for systems that are currently not supported
ifeq ($(BUILD_TARGET),theia.pgi)
$(error NEMSfv3gfs currently not supported on $(BUILD_TARGET))
else ifeq ($(BUILD_TARGET),cheyenne.pgi)
$(error NEMSfv3gfs currently not supported on $(BUILD_TARGET))
endif

# ----------------------------------------------------------------------
# Copy the executable and modules.nems files into the tests/ directory
# if a TEST_BUILD_NAME is specified.
Expand Down
Loading

0 comments on commit c70a57f

Please sign in to comment.