source: codes/icosagcm/devel/Python/src/macros.jin @ 650

Last change on this file since 650 was 650, checked in by dubos, 6 years ago

devel/unstructured : more loop unrolling

File size: 1.3 KB
Line 
1{#  ---------------------------------- Macros common to all variants ---------------------------------------- #}
2
3{% set flat='#' %}
4
5{% macro cst_if(condition, action) %}
6{{ flat }}if {{ condition }}
7{{ action }}
8{{ flat }}endif
9{%- endmacro %}
10 
11{% macro define(key,val) %}
12{{ flat }}undef {{ key }}
13{{ flat }}define {{ key }} {{ val }}
14{%- endmacro %}
15
16{% macro define_cppmacro(key,args,val) %}
17{{ flat }}undef {{ key }}
18{{ flat }}define {{ key+args }} {{ val }}
19{%- endmacro %}
20
21{% macro undef(key) %}
22{{ flat }}undef {{ key }}
23{{ flat }}define {{ key }} {{ key }}_UNDEFINED_HERE
24{%- endmacro %}
25
26{% macro cdef(code, key,val) %}
27{{ define(key,val) if key in code }}
28{%- endmacro %}
29
30{% macro cundef(code, keys) %}
31{% for key in keys %}
32{{ undef(key) if key in code }}
33{%- endfor %}
34{%- endmacro %}
35
36
37{% macro dummy() -%}
38  {{ caller() }}
39{%- endmacro %}
40
41{% macro define_kernel(name) %}
42{{ flat }}ifdef KERNEL_{{name}}
43!--------------------------------------------------------------------------
44!---------------------------- {{ name }} ----------------------------------
45  {{ caller() }}
46!---------------------------- {{ name }} ----------------------------------
47!--------------------------------------------------------------------------
48
49{{ flat }}endif
50{%- endmacro %}
Note: See TracBrowser for help on using the repository browser.