-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from COSIMA/cmake_install
Several improvements to the Cmake
- Loading branch information
Showing
11 changed files
with
843 additions
and
787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,153 @@ | ||
# Configuration Options | ||
set(CICE_IO "PIO" CACHE STRING "CICE OPTIONS: Choose IO options.") | ||
set_property(CACHE CICE_IO PROPERTY STRINGS "NetCDF" "PIO" "Binary") | ||
### Targets | ||
|
||
# Too many files to list, so include them via this file | ||
include("cice_files.cmake") | ||
## CICE library | ||
add_fortran_library(OM3_cice mod STATIC) | ||
target_compile_definitions(OM3_cice PRIVATE FORTRANUNDERSCORE ncdf) | ||
if(OM3_CICE_IO MATCHES "^(NetCDF|PIO)$") | ||
target_compile_definitions(OM3_cice PRIVATE USE_NETCDF) | ||
endif() | ||
target_link_libraries(OM3_cice | ||
PUBLIC esmf | ||
PRIVATE OM3_share OM3_timing OM3_cdeps_common OM3_cmeps | ||
) | ||
if(OM3_CICE_IO MATCHES "^(NetCDF|PIO)$") | ||
target_link_libraries(OM3_cice PRIVATE NetCDF::NetCDF_Fortran) | ||
if(OM3_CICE_IO MATCHES "PIO") | ||
target_link_libraries(OM3_cice PRIVATE PIO::PIO_Fortran) | ||
endif() | ||
endif() | ||
if(OpenMP_Fortran_FOUND) | ||
target_link_libraries(OM3_cice PRIVATE OpenMP::OpenMP_Fortran) | ||
endif() | ||
|
||
# Collect source files for library | ||
list(APPEND lib_src_files | ||
${cice_shared_files} | ||
${cice_shared_files_c} | ||
${icepack_files} | ||
${cice_mpi_comm_files} | ||
${cice_nuopc_cmeps_driver_files}) | ||
target_sources(OM3_cice PRIVATE | ||
# Shared List: | ||
CICE/cicecore/shared/ice_arrays_column.F90 | ||
CICE/cicecore/shared/ice_calendar.F90 | ||
CICE/cicecore/shared/ice_constants.F90 | ||
CICE/cicecore/shared/ice_distribution.F90 | ||
CICE/cicecore/shared/ice_domain_size.F90 | ||
CICE/cicecore/shared/ice_fileunits.F90 | ||
CICE/cicecore/shared/ice_init_column.F90 | ||
CICE/cicecore/shared/ice_kinds_mod.F90 | ||
CICE/cicecore/shared/ice_restart_column.F90 | ||
CICE/cicecore/shared/ice_restart_shared.F90 | ||
CICE/cicecore/shared/ice_spacecurve.F90 | ||
|
||
list(APPEND _cice_defs FORTRANUNDERSCORE | ||
ncdf) | ||
# Analysis | ||
CICE/cicecore/cicedynB/analysis/ice_diagnostics.F90 | ||
CICE/cicecore/cicedynB/analysis/ice_diagnostics_bgc.F90 | ||
CICE/cicecore/cicedynB/analysis/ice_history.F90 | ||
CICE/cicecore/cicedynB/analysis/ice_history_bgc.F90 | ||
CICE/cicecore/cicedynB/analysis/ice_history_drag.F90 | ||
CICE/cicecore/cicedynB/analysis/ice_history_fsd.F90 | ||
CICE/cicecore/cicedynB/analysis/ice_history_mechred.F90 | ||
CICE/cicecore/cicedynB/analysis/ice_history_pond.F90 | ||
CICE/cicecore/cicedynB/analysis/ice_history_shared.F90 | ||
CICE/cicecore/cicedynB/analysis/ice_history_snow.F90 | ||
|
||
# Select IO source files based on CICE_IO | ||
if(CICE_IO MATCHES "NetCDF") | ||
list(APPEND lib_src_files ${cice_netcdf_io_files}) | ||
list(APPEND _cice_defs USE_NETCDF) | ||
elseif(CICE_IO MATCHES "PIO") | ||
list(APPEND lib_src_files ${cice_pio2_io_files}) | ||
list(APPEND _cice_defs USE_NETCDF) | ||
elseif(CICE_IO MATCHES "Binary") | ||
list(APPEND lib_src_files ${cice_binary_io_files}) | ||
endif() | ||
# Dynamics | ||
CICE/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 | ||
CICE/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 | ||
CICE/cicecore/cicedynB/dynamics/ice_dyn_evp_1d.F90 | ||
CICE/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 | ||
CICE/cicecore/cicedynB/dynamics/ice_dyn_vp.F90 | ||
CICE/cicecore/cicedynB/dynamics/ice_transport_driver.F90 | ||
CICE/cicecore/cicedynB/dynamics/ice_transport_remap.F90 | ||
|
||
### Create target library and set PUBLIC interfaces on the library | ||
add_fortran_library(cice mod STATIC ${lib_src_files}) | ||
target_compile_definitions(cice PUBLIC "${_cice_defs}") | ||
target_link_libraries(cice PUBLIC share cdeps_common esmf) | ||
add_patched_source(cice CICE/cicecore/drivers/nuopc/cmeps/ice_mesh_mod.F90) | ||
# General | ||
CICE/cicecore/cicedynB/general/ice_flux.F90 | ||
CICE/cicecore/cicedynB/general/ice_flux_bgc.F90 | ||
CICE/cicecore/cicedynB/general/ice_forcing.F90 | ||
CICE/cicecore/cicedynB/general/ice_forcing_bgc.F90 | ||
CICE/cicecore/cicedynB/general/ice_init.F90 | ||
CICE/cicecore/cicedynB/general/ice_state.F90 | ||
CICE/cicecore/cicedynB/general/ice_step_mod.F90 | ||
|
||
if(CICE_IO MATCHES "^(NetCDF|PIO)$") | ||
target_link_libraries(cice PUBLIC NetCDF::NetCDF_Fortran) | ||
if(CICE_IO MATCHES "PIO") | ||
target_link_libraries(cice PUBLIC PIO::PIO_Fortran) | ||
endif() | ||
endif() | ||
if(OpenMP_Fortran_FOUND) | ||
target_link_libraries(cice PRIVATE OpenMP::OpenMP_Fortran) | ||
# Infrastructure | ||
CICE/cicecore/cicedynB/infrastructure/ice_blocks.F90 | ||
CICE/cicecore/cicedynB/infrastructure/ice_domain.F90 | ||
CICE/cicecore/cicedynB/infrastructure/ice_grid.F90 | ||
CICE/cicecore/cicedynB/infrastructure/ice_memusage.F90 | ||
CICE/cicecore/cicedynB/infrastructure/ice_memusage_gptl.c | ||
CICE/cicecore/cicedynB/infrastructure/ice_read_write.F90 | ||
CICE/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 | ||
CICE/cicecore/cicedynB/infrastructure/ice_restoring.F90 | ||
|
||
# Icepack | ||
CICE/icepack/columnphysics/icepack_aerosol.F90 | ||
CICE/icepack/columnphysics/icepack_age.F90 | ||
CICE/icepack/columnphysics/icepack_algae.F90 | ||
CICE/icepack/columnphysics/icepack_atmo.F90 | ||
CICE/icepack/columnphysics/icepack_brine.F90 | ||
CICE/icepack/columnphysics/icepack_firstyear.F90 | ||
CICE/icepack/columnphysics/icepack_flux.F90 | ||
CICE/icepack/columnphysics/icepack_fsd.F90 | ||
CICE/icepack/columnphysics/icepack_intfc.F90 | ||
CICE/icepack/columnphysics/icepack_isotope.F90 | ||
CICE/icepack/columnphysics/icepack_itd.F90 | ||
CICE/icepack/columnphysics/icepack_kinds.F90 | ||
CICE/icepack/columnphysics/icepack_mechred.F90 | ||
CICE/icepack/columnphysics/icepack_meltpond_lvl.F90 | ||
CICE/icepack/columnphysics/icepack_meltpond_topo.F90 | ||
CICE/icepack/columnphysics/icepack_mushy_physics.F90 | ||
CICE/icepack/columnphysics/icepack_ocean.F90 | ||
CICE/icepack/columnphysics/icepack_orbital.F90 | ||
CICE/icepack/columnphysics/icepack_parameters.F90 | ||
CICE/icepack/columnphysics/icepack_shortwave.F90 | ||
CICE/icepack/columnphysics/icepack_snow.F90 | ||
CICE/icepack/columnphysics/icepack_therm_bl99.F90 | ||
CICE/icepack/columnphysics/icepack_therm_itd.F90 | ||
CICE/icepack/columnphysics/icepack_therm_mushy.F90 | ||
CICE/icepack/columnphysics/icepack_therm_shared.F90 | ||
CICE/icepack/columnphysics/icepack_therm_vertical.F90 | ||
CICE/icepack/columnphysics/icepack_tracers.F90 | ||
CICE/icepack/columnphysics/icepack_warnings.F90 | ||
CICE/icepack/columnphysics/icepack_wavefracspec.F90 | ||
CICE/icepack/columnphysics/icepack_zbgc.F90 | ||
CICE/icepack/columnphysics/icepack_zbgc_shared.F90 | ||
CICE/icepack/columnphysics/icepack_zsalinity.F90 | ||
|
||
# Shared C | ||
CICE/cicecore/cicedynB/infrastructure/ice_shr_reprosum86.c | ||
|
||
# MPI | ||
CICE/cicecore/cicedynB/infrastructure/comm/mpi/ice_boundary.F90 | ||
CICE/cicecore/cicedynB/infrastructure/comm/mpi/ice_broadcast.F90 | ||
CICE/cicecore/cicedynB/infrastructure/comm/mpi/ice_communicate.F90 | ||
CICE/cicecore/cicedynB/infrastructure/comm/mpi/ice_exit.F90 | ||
CICE/cicecore/cicedynB/infrastructure/comm/mpi/ice_gather_scatter.F90 | ||
CICE/cicecore/cicedynB/infrastructure/comm/mpi/ice_global_reductions.F90 | ||
CICE/cicecore/cicedynB/infrastructure/comm/mpi/ice_reprosum.F90 | ||
CICE/cicecore/cicedynB/infrastructure/comm/mpi/ice_timers.F90 | ||
|
||
# NUOPC CMEPS driver | ||
CICE/cicecore/drivers/nuopc/cmeps/CICE_FinalMod.F90 | ||
CICE/cicecore/drivers/nuopc/cmeps/CICE_InitMod.F90 | ||
CICE/cicecore/drivers/nuopc/cmeps/CICE_RunMod.F90 | ||
CICE/cicecore/drivers/nuopc/cmeps/cice_wrapper_mod.F90 | ||
CICE/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 | ||
CICE/cicecore/drivers/nuopc/cmeps/ice_import_export.F90 | ||
CICE/cicecore/drivers/nuopc/cmeps/ice_prescribed_mod.F90 | ||
CICE/cicecore/drivers/nuopc/cmeps/ice_scam.F90 | ||
CICE/cicecore/drivers/nuopc/cmeps/ice_shr_methods.F90 | ||
) | ||
add_patched_source(OM3_cice CICE/cicecore/drivers/nuopc/cmeps/ice_mesh_mod.F90) | ||
# Select IO source files based on CICE_IO | ||
if(OM3_CICE_IO MATCHES "NetCDF") | ||
target_sources(OM3_cice PRIVATE | ||
CICE/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_history_write.F90 | ||
CICE/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 | ||
) | ||
elseif(OM3_CICE_IO MATCHES "PIO") | ||
target_sources(OM3_cice PRIVATE | ||
CICE/cicecore/cicedynB/infrastructure/io/io_pio2/ice_history_write.F90 | ||
CICE/cicecore/cicedynB/infrastructure/io/io_pio2/ice_pio.F90 | ||
CICE/cicecore/cicedynB/infrastructure/io/io_pio2/ice_restart.F90 | ||
) | ||
elseif(OM3_CICE_IO MATCHES "Binary") | ||
target_sources(OM3_cice PRIVATE | ||
CICE/cicecore/cicedynB/infrastructure/io/io_binary/ice_history_write.F90 | ||
CICE/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 | ||
) | ||
endif() |
Oops, something went wrong.