- Timestamp:
- 08/09/18 13:32:43 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/Python/src/hexagonal/macros.jin
r721 r723 29 29 #ifdef PASS_PRE2 30 30 31 #ifdef HEX_MASTER 32 #define BARRIER 33 #else 31 34 #define BARRIER !$OMP BARRIER 35 #endif 32 36 33 37 #define KERNEL(name) {% call define_kernel(#name) %} … … 86 90 {% macro at_level_primal(lev,ext) -%} 87 91 {{ define('LL', lev) }} 92 !DIR$ SIMD 88 93 DO ij={{ ij_omp(ext) }} 89 {{ caller() }}94 {{ caller() }} 90 95 END DO 91 96 {%- endmacro %} … … 94 99 {{ define('LL', 'l') }} 95 100 DO l = {{ range }} 101 !DIR$ SIMD 96 102 DO ij={{ ij_omp(ext) }} 97 103 {{ caller() }} … … 106 112 {% macro at_level_edge(lev,ext) -%} 107 113 {{ define('LL', lev) }} 114 !DIR$ SIMD 108 115 DO ij={{ ij_omp(ext) }} 109 116 {{ caller('u_right','t_right') }} … … 116 123 {{ define('LL', 'l') }} 117 124 DO l = {{ range }} 125 !DIR$ SIMD 118 126 DO ij={{ ij_omp(ext) }} 119 127 {{ caller('u_right','t_right') }} … … 147 155 we shall write special code for l=1 and start the loop at l=2 #} 148 156 149 IF ( ll_begin==1) THEN157 IF ({{ll_begin}}==1) THEN 150 158 {{ define('IS_BOTTOM_LEVEL', '_TRUE_') }} 151 159 {{ define_levels('1', 'ij,1', 'ij,1', thecode) }} 152 !DIR$ SIMD160 !DIR$ SIMD 153 161 DO ij={{ij_range}} 154 162 {{ thecode }} 155 163 END DO 156 164 END IF 157 {% set start_omp= 'll_beginp1'%}165 {% set start_omp=ll_beginp1 %} 158 166 {% endif %} 159 167 … … 161 169 {{ 'ERROR : using _IS_TOP_LAYER_ in a loop ending at l=llm+1' if end=='llm+1' }} 162 170 {# the code checks whether l==llm, write special code for l=llm and end the loop at l=llm-1 #} 163 {% set end_omp, is_top_layer = 'll_endm1', True %}171 {% set end_omp, is_top_layer = ll_endm1, True %} 164 172 {% endif %} 165 173 … … 167 175 {# the code checks whether l==llm+1, write special code for l=llm+1 and end the loop at l=llm #} 168 176 {{ 'ERROR : using _IS_TOP_INTERFACE_ in a loop ending at l=llm' if end=='llm' }} 169 {% set end_omp, is_top_inter = 'll_end', True %}177 {% set end_omp, is_top_inter = ll_end, True %} 170 178 {% endif %} 171 179 … … 173 181 {{ define_levels('l', 'ij,l-1', 'ij,l', thecode) }} 174 182 DO l = {{start_omp}}, {{end_omp}} 175 !DIR$ SIMD183 !DIR$ SIMD 176 184 DO ij={{ij_range}} 177 185 {{ thecode }} … … 180 188 181 189 {% if is_top_layer %} 182 IF( ll_end==llm) THEN190 IF({{ll_end}}==llm) THEN 183 191 {{ define('IS_TOP_LAYER', '_TRUE_') }} 184 192 {{ define_levels('llm', 'ij,llm-1', 'ij,llm', thecode) }} … … 191 199 192 200 {% if is_top_inter %} 193 IF( ll_endp1==llm+1) THEN201 IF({{ll_endp1}}==llm+1) THEN 194 202 {{ define('IS_TOP_INTERFACE', '_TRUE_') }} 195 203 {{ define_levels('llm+1', 'ij,llm', 'ij,llm', thecode) }}
Note: See TracChangeset
for help on using the changeset viewer.