Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CDEPS to UFS-weather-model for Data component needs #524

Merged
merged 33 commits into from
Apr 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0dbb6f6
point to Jun fv3atm personal fork
junwang-noaa Oct 21, 2019
30d4ea2
Merge branch 'develop' of https://github.com/ufs-community/ufs-weathe…
junwang-noaa Oct 24, 2019
f1ba56c
Merge remote-tracking branch 'upstream/develop' into develop
junwang-noaa Jan 28, 2020
927077b
update to the top of upstream develop branch
junwang-noaa Jan 25, 2021
6e7873a
add CDEPS submodule
aerorahul Apr 1, 2021
d3ab4ee
add building instructions
aerorahul Apr 1, 2021
d48a780
fix issues that came from building
aerorahul Apr 2, 2021
3df54b8
builds CDEPS targets
aerorahul Apr 2, 2021
f24c62b
missed w3nco dep
aerorahul Apr 2, 2021
cbb5f0b
cleanup use of FoX and remove redundant library links in components
aerorahul Apr 5, 2021
df4b2ae
Merge branch 'develop' into feature/cdeps
aerorahul Apr 8, 2021
4a0a068
Merge branch 'develop' into feature/cdeps
aerorahul Apr 9, 2021
4a2f475
Add 3 files generated by genf90.pl to the CDEPS-interface/ufs directo…
binli2337 Apr 9, 2021
a414acf
remove dependency on genf90.pl for CDEPS/share
aerorahul Apr 9, 2021
d58b5d9
remove FoX (#2)
junwang-noaa Apr 13, 2021
734fd49
Merge branch 'develop' of https://github.com/aerorahul/ufs-weather-mo…
aerorahul Apr 13, 2021
cda62b1
Merge branch 'develop' into feature/cdeps
aerorahul Apr 13, 2021
678ab1c
Merge remote-tracking branch 'upstream/develop' into develop
aerorahul Apr 13, 2021
7f695d9
Merge branch 'develop' into feature/cdeps
aerorahul Apr 13, 2021
35ee892
Add CDEPS-interface/ufs/cdeps_share/dtypes.h. (#3)
binli2337 Apr 13, 2021
8919639
include header during CDEPS compilation
aerorahul Apr 13, 2021
53982e7
update CDEPS pointer
aerorahul Apr 14, 2021
8796b9d
add compile test for CDEPS data atm
aerorahul Apr 15, 2021
479c742
clean-up cmake flags that are redundant
aerorahul Apr 15, 2021
5e03cbd
Merge remote-tracking branch 'upstream/develop' into develop
aerorahul Apr 15, 2021
9c6e645
Merge branch 'develop' into feature/cdeps
aerorahul Apr 15, 2021
e037701
RT JOBS PASSED: hera.gnu. Log file uploaded.
BrianCurtis-NOAA Apr 16, 2021
eb3dcc5
RT JOBS PASSED: hera.intel. Log file uploaded.
BrianCurtis-NOAA Apr 16, 2021
1cf5fa6
RT JOBS PASSED: gaea.intel. Log file uploaded.
BrianCurtis-NOAA Apr 16, 2021
8ec3ffd
RT JOBS PASSED: orion.intel. Log file uploaded.
BrianCurtis-NOAA Apr 16, 2021
c464b9b
RT JOBS PASSED: jet.intel. Log file uploaded.
BrianCurtis-NOAA Apr 16, 2021
9849d4d
Add WCOSS logs and run-ci
aerorahul Apr 16, 2021
db23409
RT JOBS PASSED: cheyenne.intel, cheyenne.gnu. Add log files. run-ci
aerorahul Apr 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@
path = DATM
url = https://github.com/NOAA-EMC/NEMSdatm
branch = develop
[submodule "CDEPS"]
path = CDEPS-interface/CDEPS
url = https://github.com/NOAA-EMC/CDEPS
branch = emc/develop
1 change: 1 addition & 0 deletions CDEPS-interface/CDEPS
Submodule CDEPS added at 69a3a6
137 changes: 137 additions & 0 deletions CDEPS-interface/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# CDEPS compiler flags
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "-g -fbacktrace -ffree-line-length-none")
set(CMAKE_Fortran_FLAGS_RELEASE "-O2")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -fcheck=bounds -ffpe-trap=invalid,zero,overflow,underflow" )
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
set(CMAKE_Fortran_FLAGS "-g -traceback")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O -assume realloc_lhs")
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fp-model precise")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check -check noarg_temp_created -check nopointer -fpe0 -ftrapuv")
else()
message(WARNING "Fortran compiler with ID ${CMAKE_Fortran_COMPILER_ID} will be used with CMake default options")
endif()

# Too many files to list, so include them via this file
include("cdeps_files.cmake")

# CDEPS/share
add_library(share STATIC ${cdeps_share_files} ${ufs_cdeps_share_files})
add_library(cdeps::share ALIAS share)
set_target_properties(share PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_include_directories(share PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ufs/cdeps_share)
target_include_directories(share PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)
target_link_libraries(share PUBLIC esmf)
list(APPEND LIB_TARGETS share)

# CDEPS/streams
add_library(streams STATIC ${cdeps_streams_files})
add_library(cdeps::streams ALIAS streams)
add_dependencies(streams cdeps::share)
set_target_properties(streams PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_include_directories(streams PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)
target_compile_definitions(streams PUBLIC "DISABLE_FoX")
target_link_libraries(streams PUBLIC cdeps::share)
target_link_libraries(streams PUBLIC esmf PIO::PIO_Fortran)
list(APPEND LIB_TARGETS streams)

# CDEPS/dshr
add_library(dshr STATIC ${cdeps_dshr_files})
add_library(cdeps::dshr ALIAS dshr)
add_dependencies(dshr cdeps::share cdeps::streams)
set_target_properties(dshr PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_include_directories(dshr PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)
target_link_libraries(dshr PUBLIC cdeps::share cdeps::streams)
target_link_libraries(dshr PUBLIC esmf PIO::PIO_Fortran)
list(APPEND LIB_TARGETS dshr)

# CDEPS/datm
add_library(datm STATIC ${cdeps_datm_files})
add_library(cdeps::datm ALIAS datm)
add_dependencies(datm cdeps::share cdeps::streams cdeps::dshr)
set_target_properties(datm PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_include_directories(datm PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)
target_link_libraries(datm PUBLIC cdeps::dshr cdeps::share cdeps::streams)
target_link_libraries(datm PUBLIC esmf PIO::PIO_Fortran)
list(APPEND LIB_TARGETS datm)

# CDEPS/dice
add_library(dice STATIC ${cdeps_dice_files})
add_library(cdeps::dice ALIAS dice)
add_dependencies(dice cdeps::share cdeps::streams cdeps::dshr)
set_target_properties(dice PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_include_directories(dice PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)
target_link_libraries(dice PUBLIC cdeps::dshr cdeps::share cdeps::streams)
target_link_libraries(dice PUBLIC esmf)
list(APPEND LIB_TARGETS dice)

# CDEPS/dlnd
add_library(dlnd STATIC ${cdeps_dlnd_files})
add_library(cdeps::dlnd ALIAS dlnd)
add_dependencies(dlnd cdeps::share cdeps::streams cdeps::dshr)
set_target_properties(dlnd PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_include_directories(dlnd PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)
target_link_libraries(dlnd PUBLIC cdeps::dshr cdeps::share cdeps::streams)
target_link_libraries(dlnd PUBLIC esmf)
list(APPEND LIB_TARGETS dlnd)

# CDEPS/docn
add_library(docn STATIC ${cdeps_docn_files})
add_library(cdeps::docn ALIAS docn)
add_dependencies(docn cdeps::share cdeps::streams cdeps::dshr)
set_target_properties(docn PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_include_directories(docn PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)
target_link_libraries(docn PUBLIC cdeps::dshr cdeps::share cdeps::streams)
target_link_libraries(docn PUBLIC esmf)
list(APPEND LIB_TARGETS docn)

# CDEPS/drof
add_library(drof STATIC ${cdeps_drof_files})
add_library(cdeps::drof ALIAS drof)
add_dependencies(drof cdeps::share cdeps::streams cdeps::dshr)
set_target_properties(drof PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_include_directories(drof PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)
target_link_libraries(drof PUBLIC cdeps::dshr cdeps::share cdeps::streams)
target_link_libraries(drof PUBLIC esmf)
list(APPEND LIB_TARGETS drof)

# CDEPS/dwav
add_library(dwav STATIC ${cdeps_dwav_files})
add_library(cdeps::dwav ALIAS dwav)
add_dependencies(dwav cdeps::share cdeps::streams cdeps::dshr)
set_target_properties(dwav PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_include_directories(dwav PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)
target_link_libraries(dwav PUBLIC cdeps::dshr cdeps::share cdeps::streams)
target_link_libraries(dwav PUBLIC esmf)
list(APPEND LIB_TARGETS dwav)

###############################################################################
### Install
###############################################################################

install(
TARGETS ${LIB_TARGETS}
EXPORT CDEPSExports
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
COMPONENT Library)

export(EXPORT CDEPSExports
NAMESPACE cdeps::
FILE cdeps-targets.cmake)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod DESTINATION ${CMAKE_INSTALL_PREFIX}/CDEPS)

install(EXPORT CDEPSExports
NAMESPACE cdeps::
FILE cdeps-targets.cmake
DESTINATION lib/cmake)
74 changes: 74 additions & 0 deletions CDEPS-interface/cdeps_files.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# CDEPS generates these with genf90.pl acting on templates .in in CDEPS/share
# For the UFS, they are pre-generated and committed to the UFS repository
list(APPEND ufs_cdeps_share_files
ufs/cdeps_share/shr_assert_mod.F90
ufs/cdeps_share/shr_frz_mod.F90
ufs/cdeps_share/shr_infnan_mod.F90
)

list(APPEND cdeps_share_files
CDEPS/share/glc_elevclass_mod.F90
CDEPS/share/shr_abort_mod.F90
CDEPS/share/shr_assert.h
CDEPS/share/shr_cal_mod.F90
CDEPS/share/shr_const_mod.F90
CDEPS/share/shr_kind_mod.F90
CDEPS/share/shr_log_mod.F90
CDEPS/share/shr_mpi_mod.F90
CDEPS/share/shr_orb_mod.F90
CDEPS/share/shr_precip_mod.F90
CDEPS/share/shr_strconvert_mod.F90
CDEPS/share/shr_string_mod.F90
CDEPS/share/shr_sys_mod.F90
CDEPS/share/shr_timer_mod.F90
)

list(APPEND cdeps_streams_files
CDEPS/streams/dshr_methods_mod.F90
CDEPS/streams/dshr_strdata_mod.F90
CDEPS/streams/dshr_stream_mod.F90
CDEPS/streams/dshr_tinterp_mod.F90
)

list(APPEND cdeps_dshr_files
CDEPS/dshr/dshr_dfield_mod.F90
CDEPS/dshr/dshr_fldlist_mod.F90
CDEPS/dshr/dshr_mod.F90
)

list(APPEND cdeps_datm_files
CDEPS/datm/atm_comp_nuopc.F90
CDEPS/datm/datm_datamode_cfsr_mod.F90
CDEPS/datm/datm_datamode_clmncep_mod.F90
CDEPS/datm/datm_datamode_core2_mod.F90
CDEPS/datm/datm_datamode_cplhist_mod.F90
CDEPS/datm/datm_datamode_era5_mod.F90
CDEPS/datm/datm_datamode_gefs_mod.F90
CDEPS/datm/datm_datamode_jra_mod.F90
)

list(APPEND cdeps_dice_files
CDEPS/dice/dice_datamode_ssmi_mod.F90
CDEPS/dice/dice_flux_atmice_mod.F90
CDEPS/dice/ice_comp_nuopc.F90
)

list(APPEND cdeps_dlnd_files
CDEPS/dlnd/lnd_comp_nuopc.F90
)

list(APPEND cdeps_docn_files
CDEPS/docn/docn_datamode_aquaplanet_mod.F90
CDEPS/docn/docn_datamode_copyall_mod.F90
CDEPS/docn/docn_datamode_iaf_mod.F90
CDEPS/docn/docn_datamode_som_mod.F90
CDEPS/docn/ocn_comp_nuopc.F90
)

list(APPEND cdeps_drof_files
CDEPS/drof/rof_comp_nuopc.F90
)

list(APPEND cdeps_dwav_files
CDEPS/dwav/wav_comp_nuopc.F90
)
6 changes: 6 additions & 0 deletions CDEPS-interface/ufs/cdeps_share/dtypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#define TYPETEXT 100
#define TYPEREAL 101
#define TYPEDOUBLE 102
#define TYPEINT 103
#define TYPELONG 104
#define TYPELOGICAL 105
Loading