Skip to content

Commit

Permalink
Merge pull request #3 from climbfuji/mraerosol_dom
Browse files Browse the repository at this point in the history
Update to mraerosol branch from Dom
  • Loading branch information
AnningCheng-NOAA authored Oct 7, 2021
2 parents 8a9b8d1 + 1aa28fb commit 95c67d3
Show file tree
Hide file tree
Showing 43 changed files with 1,287 additions and 1,025 deletions.
57 changes: 16 additions & 41 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ endif (NOT PROJECT)
#------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.0)

project(ccppphys
VERSION 4.0.0
LANGUAGES C CXX Fortran)
project(ccpp_physics
VERSION 5.0.0
LANGUAGES Fortran)

# Use rpaths on MacOSX
set(CMAKE_MACOSX_RPATH 1)
Expand All @@ -31,25 +31,9 @@ set(AUTHORS "Grant Firl" "Dom Heinzeller" "Man Zhang" "Laurie Carson")
if (OPENMP)
include(detect_openmp)
detect_openmp()
#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
#set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}")
message(STATUS "Enable OpenMP support for C/C++/Fortran compiler")
message(STATUS "Enable OpenMP support")
else (OPENMP)
message (STATUS "Disable OpenMP support for C/C++/Fortran compiler")
endif()

#------------------------------------------------------------------------------
# The Fortran compiler/linker flag inserted by cmake to create shared libraries
# with the Intel compiler is deprecated (-i_dynamic), correct here.
# CMAKE_Fortran_COMPILER_ID = {"Intel", "PGI", "GNU", "Clang", "MSVC", ...}
if ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "Intel")
string(REPLACE "-i_dynamic" "-shared-intel"
CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS
"${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS}")
string(REPLACE "-i_dynamic" "-shared-intel"
CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS
"${CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS}")
message (STATUS "Disable OpenMP support")
endif()

#------------------------------------------------------------------------------
Expand Down Expand Up @@ -321,22 +305,8 @@ else()
message (FATAL_ERROR "This program has only been compiled with gfortran, pgf90 and ifort. If another compiler is needed, the appropriate flags must be added in ${GFS_PHYS_SRC}/CMakeLists.txt")
endif()

# The auto-generated caps can contain calls to physics schemes in
# which some of the arguments (pointers, arrays) are not associated/allocated.
# This is on purpose to avoid allocating fields that are not used inside the
# scheme if, for example, certain conditions are not met. To avoid
# Fortran runtime errors, it is necessary to remove checks for pointers
# that are not associated and for array bounds from the caps ONLY. For the
# physics schemes, these checks can and should remain enabled. Overwriting
# the pointer check flags explicitly works for Intel and GNU, but not for PGI.
if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
set_property(SOURCE ${CAPS} APPEND_STRING PROPERTY COMPILE_FLAGS " -fcheck=no-pointer,no-bounds ")
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
set_property(SOURCE ${CAPS} APPEND_STRING PROPERTY COMPILE_FLAGS " -check nopointers,nobounds ")
endif ()

#------------------------------------------------------------------------------
add_library(ccppphys STATIC ${SCHEMES} ${SCHEMES_SFX_OPT} ${CAPS})
add_library(ccpp_physics STATIC ${SCHEMES} ${SCHEMES_SFX_OPT} ${CAPS})
# Generate list of Fortran modules from defined sources
foreach(source_f90 ${CAPS})
get_filename_component(tmp_source_f90 ${source_f90} NAME)
Expand All @@ -345,20 +315,25 @@ foreach(source_f90 ${CAPS})
list(APPEND MODULES_F90 ${CMAKE_CURRENT_BINARY_DIR}/${module_f90})
endforeach()

set_target_properties(ccppphys PROPERTIES VERSION ${PROJECT_VERSION}
set_target_properties(ccpp_physics PROPERTIES VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})

target_include_directories(ccpp_physics PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)

target_link_libraries(ccpp_physics PUBLIC w3nco::w3nco_d NetCDF::NetCDF_Fortran)

if (PROJECT STREQUAL "CCPP-FV3")
# Define where to install the library
install(TARGETS ccppphys
EXPORT ccppphys-targets
install(TARGETS ccpp_physics
EXPORT ccpp_physics-targets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib
)
# Export our configuration
install(EXPORT ccppphys-targets
FILE ccppphys-config.cmake
install(EXPORT ccpp_physics-targets
FILE ccpp_physics-config.cmake
DESTINATION lib/cmake
)
# Define where to install the C headers and Fortran modules
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# These owners will be the default owners for everything in the repo.
#* @defunkt
* @climbfuji @llpcarson @grantfirl @JulieSchramm
* @climbfuji @llpcarson @grantfirl

# Order is important. The last matching pattern has the most precedence.
# So if a pull request only touches javascript files, only these owners
Expand Down
10 changes: 5 additions & 5 deletions physics/GFS_DCNV_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
standard_name = convective_transportable_tracers
long_name = array to contain cloud water and other convective trans. tracers
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers_for_convective_transport)
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers_for_convective_transport)
type = real
kind = kind_phys
intent = in
Expand Down Expand Up @@ -477,7 +477,7 @@
standard_name = cumulative_change_of_state_variables
long_name = diagnostic tendencies for state variables
units = various
dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes)
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_cumulative_change_processes)
type = real
kind = kind_phys
intent = inout
Expand Down Expand Up @@ -534,7 +534,7 @@
standard_name = tracer_concentration_of_new_state
long_name = tracer concentration updated by physics
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers)
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers)
type = real
kind = kind_phys
intent = in
Expand All @@ -543,7 +543,7 @@
standard_name = tracer_concentration_save
long_name = tracer concentration before entering a physics scheme
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers)
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers)
type = real
kind = kind_phys
intent = in
Expand Down Expand Up @@ -778,7 +778,7 @@
standard_name = convective_transportable_tracers
long_name = array to contain cloud water and other convective trans. tracers
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers_for_convective_transport)
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers_for_convective_transport)
type = real
kind = kind_phys
intent = in
Expand Down
4 changes: 2 additions & 2 deletions physics/GFS_MP_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@
standard_name = cumulative_change_of_state_variables
long_name = diagnostic tendencies for state variables
units = various
dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes)
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_cumulative_change_processes)
type = real
kind = kind_phys
intent = inout
Expand All @@ -832,7 +832,7 @@
standard_name = cumulative_change_of_state_variables_outer_index
long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index
units = index
dimensions = (number_of_tracers_plus_one_hundred,number_of_causes)
dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes)
type = integer
intent = in
optional = F
Expand Down
2 changes: 1 addition & 1 deletion physics/GFS_PBL_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@
standard_name = cumulative_change_of_state_variables
long_name = diagnostic tendencies for state variables
units = various
dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes)
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_cumulative_change_processes)
type = real
kind = kind_phys
intent = inout
Expand Down
2 changes: 1 addition & 1 deletion physics/GFS_SCNV_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
standard_name = convective_transportable_tracers
long_name = array to contain cloud water and other convective trans. tracers
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers_for_convective_transport)
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers_for_convective_transport)
type = real
kind = kind_phys
intent = in
Expand Down
Loading

0 comments on commit 95c67d3

Please sign in to comment.