forked from ecmwf-ifs/ecrad
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
220 additions
and
11 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
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
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# (C) Copyright 2014- ECMWF. | ||
# | ||
# This software is licensed under the terms of the Apache Licence Version 2.0 | ||
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# In applying this licence, ECMWF does not waive the privileges and immunities | ||
# granted to it by virtue of its status as an intergovernmental organisation | ||
# nor does it submit to any jurisdiction. | ||
|
||
set( CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) | ||
|
||
set( ecrad_loki_SOURCE_DIRS "" ) | ||
set( target_list | ||
ecrad_ifsaux.${PREC} | ||
ecrad_utilities.${PREC} | ||
ifsrrtm.${PREC} | ||
ecrad.${PREC} | ||
ifs.${PREC} | ||
) | ||
|
||
foreach( tgt IN LISTS target_list ) | ||
get_target_property( ${tgt}_SOURCE_DIR ${tgt} SOURCE_DIR ) | ||
list( APPEND ecrad_loki_SOURCE_DIRS "${${tgt}_SOURCE_DIR}" ) | ||
endforeach() | ||
|
||
ecbuild_add_library( | ||
TARGET | ||
ecrad_loki.${PREC} | ||
SOURCES | ||
${ifsaux_SOURCES} | ||
${utilities_SOURCES} | ||
${ifsrrtm_SOURCES} | ||
${radiation_SOURCES} | ||
${ifs_SOURCES} | ||
PRIVATE_INCLUDES | ||
${ecrad_loki_SOURCE_DIRS} | ||
PUBLIC_INCLUDES | ||
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>" | ||
"$<BUILD_INTERFACE:${CMAKE_Fortran_MODULE_DIRECTORY}>" | ||
"$<INSTALL_INTERFACE:${ecrad_${PREC}_INSTALL_INCLUDEDIR}>" | ||
PRIVATE_LIBS | ||
ecrad_base.${PREC} | ||
NetCDF::NetCDF_Fortran | ||
$<${HAVE_OMP}:OpenMP::OpenMP_Fortran> | ||
) | ||
|
||
loki_transform_target( | ||
TARGET ecrad_loki.${PREC} | ||
MODE idem | ||
CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/ecrad_loki.config | ||
PLAN ${CMAKE_CURRENT_BINARY_DIR}/ecrad_loki_plan.${PREC}.cmake | ||
SOURCES ${ecrad_loki_SOURCE_DIRS} | ||
NO_PLAN_SOURCEDIR | ||
) |
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# ------------------------------------------------------------------- | ||
# Loki source transformation configurations | ||
# ------------------------------------------------------------------- | ||
# This file contains configurations for multiple source transformation | ||
# pipelines and batch processing settings to apply Loki transformations | ||
# to the ecrad source tree. | ||
|
||
|
||
# Loki batch scheduler configuration | ||
# ------------------------------------------------------------------- | ||
# The Loki batch scheduler performs automated discovery of call trees | ||
# from a select set of seed subroutines. Whenever it adds new | ||
# nodes to the call tree, the following default behaviour will be | ||
# honoured, unless it is specifically overwritten below. | ||
|
||
[default] | ||
role = 'kernel' # Role to determine how to transform a routine | ||
expand = true # Automatically expand call tree to subroutine calls | ||
strict = true # Throw exceptions during dicovery | ||
enable_imports = true # Chase dependencies incurred via imports | ||
|
||
# Ensure that we are never adding these to the tree, and thus | ||
# do not attempt to look up the source files for these. | ||
disable = [ | ||
'delta_eddington*', 'fast_expm_exchange', 'date_and_time', 'get_command', | ||
'rng_type', 'radiation_reverse', 'yomhook', 'netcdf', 'ec_lun', | ||
] | ||
|
||
# Prune these modules from the tree to ensure they are not processed by | ||
# transformations | ||
ignore = ['parkind1', 'easy_netcdf'] | ||
|
||
|
||
# Frontend argument overrides | ||
# ------------------------------------------------------------------- | ||
# Certain modules hard depend on preprocessing | ||
[frontend_args] | ||
|
||
[frontend_args."radiation_random_numbers.F90"] | ||
preprocess = true | ||
|
||
[frontend_args."radiation_spartacus_sw.F90"] | ||
preprocess = true | ||
|
||
[frontend_args."radiation_two_stream.F90"] | ||
preprocess = true | ||
|
||
|
||
# Call tree entry points ("driver" subroutines) | ||
# ------------------------------------------------------------------- | ||
# | ||
# Note that Loki differentiates between "driver" routines, which act as | ||
# call tree roots and contain the offload and parallelisation loops, and | ||
# "kernel" routines that only contain compute loops and are called | ||
# from drivers or other kernels within parallel sections. | ||
[routines] | ||
|
||
[routines.radiation] | ||
role = 'driver' | ||
expand = true | ||
|
||
|
||
# Define specific transformation settings | ||
# ------------------------------------------------------------------- | ||
# The section configures the invididual steps of the transformation | ||
# pipelines. Importantly, it also defines the class name and Python | ||
# module that Transformation objects will be instatiated from. | ||
[transformations] | ||
|
||
# A set of utility transformations | ||
# ------------------------------------------------------------------- | ||
[transformations.Idem] | ||
classname = 'IdemTransformation' | ||
module = 'loki.transformations' | ||
|
||
# Housekeeping and other transformations | ||
# ------------------------------------------------------------------- | ||
[transformations.Sanitise] | ||
classname = 'SanitiseTransformation' | ||
module = 'loki.transformations' | ||
options = { resolve_associate_mappings = true } | ||
|
||
[transformations.FileWriteTransformation] | ||
classname = 'FileWriteTransformation' | ||
module = 'loki.transformations' | ||
options = { include_module_var_imports = true } | ||
|
||
|
||
# Full transformation pipelines | ||
# ------------------------------------------------------------------- | ||
# The entries below are mapped to the "mode" entry point in | ||
# loki-transform.py. The define the set of transformation and the | ||
# order in which they are applies to the complete call tree. | ||
[pipelines] | ||
|
||
[pipelines.idem] | ||
transformations = ['Idem'] |
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
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