Skip to content

Commit

Permalink
Add 1 when setting tile_level for Fortran subroutines
Browse files Browse the repository at this point in the history
This addresses Item 2 of OrchestrationRuntime Issue #94.
  • Loading branch information
kweide committed Aug 19, 2024
1 parent d9a07fc commit d01359d
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/milhoja_pypkg/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.6
0.0.7
Original file line number Diff line number Diff line change
@@ -296,12 +296,14 @@ def generate_source_code(self, destination, overwrite):
for argument in actual_args:
spec = self._tf_spec.argument_specification(argument)
extents = ""
offs = ""
if spec["source"] in points:
extents = "(:, n)"
elif spec["source"] == TILE_DELTAS_ARGUMENT:
extents = "(:, n)"
elif spec["source"] == TILE_LEVEL_ARGUMENT:
extents = "(1, n)"
offs = " + 1"
elif spec["source"] in bounds:
extents = "(:, :, n)"
elif spec["source"] == GRID_DATA_ARGUMENT:
@@ -310,7 +312,7 @@ def generate_source_code(self, destination, overwrite):
dimension = len(parse_extents(spec["extents"]))
tmp = [":" for _ in range(dimension)]
extents = "(" + ", ".join(tmp) + ", n)"
arg_list.append(f"{INDENT*5}{argument}_d{extents}")
arg_list.append(f"{INDENT*5}{argument}_d{extents}{offs}")
fptr.write(", &\n".join(arg_list) + " &\n")
fptr.write(f"{INDENT*5})\n")
fptr.write(f"{INDENT*2}end do\n")
Original file line number Diff line number Diff line change
@@ -281,7 +281,7 @@ def generate_source_code(self, destination, overwrite):

# get the first argument in the tile level array?
if argument == TILE_LEVEL_ARGUMENT:
arg += "(1)"
arg += "(1) + 1"

arg_list.append(arg)
fptr.write(", &\n".join(arg_list) + " &\n")

0 comments on commit d01359d

Please sign in to comment.