Skip to content

Commit

Permalink
Adapted templates to Serialbox2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Hovy committed Apr 12, 2018
1 parent 1aebf53 commit e788016
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 24 deletions.
18 changes: 12 additions & 6 deletions templates/icon_standalone/replay.test.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PROGRAM ftg_${subroutine.name}_test

USE ${module.name}, ONLY: ${subroutine.name}, ftg_${subroutine.name}_capture_input_enabled, ftg_${subroutine.name}_capture_output_enabled, ftg_${subroutine.name}_capture_round, ftg_${subroutine.name}_output_dir

USE m_ser_ftg, ONLY: ftg_set_serializer, ftg_set_savepoint, ftg_destroy_serializer, ftg_destroy_savepoint, ftg_print_serializer_debuginfo, ftg_field_exists, ftg_get_bounds, ftg_read, ftg_allocate_and_read
USE m_ser_ftg, ONLY: ftg_set_serializer, ftg_set_savepoint, ftg_destroy_serializer, ftg_destroy_savepoint, ftg_print_serializer_debuginfo, ftg_field_exists, ftg_get_bounds, ftg_read, ftg_allocate_and_read_pointer, ftg_allocate_and_read_allocatable

${globals.imports}

Expand Down Expand Up @@ -85,7 +85,7 @@ CONTAINS
! BASIC ARGUMENTS
#for $argument in $arguments.all.basic
#if $isArray($argument)
CALL ftg_allocate_and_read("$argument", $argument)
CALL ftg_allocate_and_read_allocatable("$argument", $argument)
#else
CALL ftg_read("$argument", $argument)
#end if
Expand All @@ -95,7 +95,7 @@ CONTAINS
#for $argument in $arguments.all.optional
IF (PRESENT($argument)) THEN
#if $isArray($argument)
CALL ftg_allocate_and_read("$argument", $argument)
CALL ftg_allocate_and_read_allocatable("$argument", $argument)
#else
CALL ftg_read("$argument", $argument)
#end if
Expand Down Expand Up @@ -138,7 +138,11 @@ END PROGRAM ftg_${subroutine.name}_test
#end if
#end for
#if $needsAllocation($var)
CALL ftg_allocate_and_read("$var", $var)
#if $isPointer($var)
CALL ftg_allocate_and_read_pointer("$var", $var)
#else
CALL ftg_allocate_and_read_allocatable("$var", $var)
#end if
#else
CALL ftg_read("$var", $var)
#end if
Expand Down Expand Up @@ -180,8 +184,10 @@ END PROGRAM ftg_${subroutine.name}_test
#end for
$writeVarNameWithFilledIndicesToString($var, "ftg_c", $mandDims, "ftg_d1", "ftg_d2", "ftg_d3", "ftg_d4")
#set $filled = $fillIndices($var, $mandDims, "ftg_d1", "ftg_d2", "ftg_d3", "ftg_d4")
#if $isAllocatableOrPointer($var)
CALL ftg_allocate_and_read(ftg_c, $filled)
#if $isPointer($var)
CALL ftg_allocate_and_read_pointer(ftg_c, $filled)
#else if $isAllocatable($var)
CALL ftg_allocate_and_read_allocatable(ftg_c, $filled)
#else
CALL ftg_read(ftg_c, $filled)
#end if
Expand Down
18 changes: 12 additions & 6 deletions templates/icon_testbed/replay.test.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MODULE mo_ftg_${subroutine.name}_test

USE ${module.name}, ONLY: ${subroutine.name}, ftg_${subroutine.name}_capture_input_enabled, ftg_${subroutine.name}_capture_output_enabled, ftg_${subroutine.name}_capture_round, ftg_${subroutine.name}_output_dir

USE m_ser_ftg, ONLY: ftg_set_serializer, ftg_set_savepoint, ftg_destroy_serializer, ftg_destroy_savepoint, ftg_print_serializer_debuginfo, ftg_field_exists, ftg_get_bounds, ftg_read, ftg_allocate_and_read
USE m_ser_ftg, ONLY: ftg_set_serializer, ftg_set_savepoint, ftg_destroy_serializer, ftg_destroy_savepoint, ftg_print_serializer_debuginfo, ftg_field_exists, ftg_get_bounds, ftg_read, ftg_allocate_and_read_pointer, ftg_allocate_and_read_allocatable

${globals.imports}

Expand Down Expand Up @@ -76,7 +76,7 @@ CONTAINS
! BASIC ARGUMENTS
#for $argument in $arguments.all.basic
#if $isArray($argument)
CALL ftg_allocate_and_read("$argument", $argument)
CALL ftg_allocate_and_read_allocatable("$argument", $argument)
#else
CALL ftg_read("$argument", $argument)
#end if
Expand All @@ -86,7 +86,7 @@ CONTAINS
#for $argument in $arguments.all.optional
IF (PRESENT($argument)) THEN
#if $isArray($argument)
CALL ftg_allocate_and_read("$argument", $argument)
CALL ftg_allocate_and_read_allocatable("$argument", $argument)
#else
CALL ftg_read("$argument", $argument)
#end if
Expand Down Expand Up @@ -130,7 +130,11 @@ END MODULE mo_ftg_${subroutine.name}_test
#end if
#end for
#if $needsAllocation($var)
CALL ftg_allocate_and_read("$var", $var)
#if $isPointer($var)
CALL ftg_allocate_and_read_pointer("$var", $var)
#else
CALL ftg_allocate_and_read_allocatable("$var", $var)
#end if
#else
CALL ftg_read("$var", $var)
#end if
Expand Down Expand Up @@ -172,8 +176,10 @@ END MODULE mo_ftg_${subroutine.name}_test
#end for
$writeVarNameWithFilledIndicesToString($var, "ftg_c", $mandDims, "ftg_d1", "ftg_d2", "ftg_d3", "ftg_d4")
#set $filled = $fillIndices($var, $mandDims, "ftg_d1", "ftg_d2", "ftg_d3", "ftg_d4")
#if $isAllocatableOrPointer($var)
CALL ftg_allocate_and_read(ftg_c, $filled)
#if $isPointer($var)
CALL ftg_allocate_and_read_pointer(ftg_c, $filled)
#else if $isAllocatable($var)
CALL ftg_allocate_and_read_allocatable(ftg_c, $filled)
#else
CALL ftg_read(ftg_c, $filled)
#end if
Expand Down
18 changes: 12 additions & 6 deletions templates/standalone/replay.test.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PROGRAM ftg_${subroutine.name}_test

USE ${module.name}, ONLY: ${subroutine.name}, ftg_${subroutine.name}_capture_input_enabled, ftg_${subroutine.name}_capture_output_enabled, ftg_${subroutine.name}_capture_round, ftg_${subroutine.name}_output_dir

USE m_ser_ftg, ONLY: ftg_set_serializer, ftg_set_savepoint, ftg_destroy_serializer, ftg_destroy_savepoint, ftg_print_serializer_debuginfo, ftg_field_exists, ftg_get_bounds, ftg_read, ftg_allocate_and_read
USE m_ser_ftg, ONLY: ftg_set_serializer, ftg_set_savepoint, ftg_destroy_serializer, ftg_destroy_savepoint, ftg_print_serializer_debuginfo, ftg_field_exists, ftg_get_bounds, ftg_read, ftg_allocate_and_read_pointer, ftg_allocate_and_read_allocatable

${globals.imports}

Expand Down Expand Up @@ -83,7 +83,7 @@ CONTAINS
! BASIC ARGUMENTS
#for $argument in $arguments.all.basic
#if $isArray($argument)
CALL ftg_allocate_and_read("$argument", $argument)
CALL ftg_allocate_and_read_allocatable("$argument", $argument)
#else
CALL ftg_read("$argument", $argument)
#end if
Expand All @@ -93,7 +93,7 @@ CONTAINS
#for $argument in $arguments.all.optional
IF (PRESENT($argument)) THEN
#if $isArray($argument)
CALL ftg_allocate_and_read("$argument", $argument)
CALL ftg_allocate_and_read_allocatable("$argument", $argument)
#else
CALL ftg_read("$argument", $argument)
#end if
Expand Down Expand Up @@ -136,7 +136,11 @@ END PROGRAM ftg_${subroutine.name}_test
#end if
#end for
#if $needsAllocation($var)
CALL ftg_allocate_and_read("$var", $var)
#if $isPointer($var)
CALL ftg_allocate_and_read_pointer("$var", $var)
#else
CALL ftg_allocate_and_read_allocatable("$var", $var)
#end if
#else
CALL ftg_read("$var", $var)
#end if
Expand Down Expand Up @@ -178,8 +182,10 @@ END PROGRAM ftg_${subroutine.name}_test
#end for
$writeVarNameWithFilledIndicesToString($var, "ftg_c", $mandDims, "ftg_d1", "ftg_d2", "ftg_d3", "ftg_d4")
#set $filled = $fillIndices($var, $mandDims, "ftg_d1", "ftg_d2", "ftg_d3", "ftg_d4")
#if $isAllocatableOrPointer($var)
CALL ftg_allocate_and_read(ftg_c, $filled)
#if $isPointer($var)
CALL ftg_allocate_and_read_pointer(ftg_c, $filled)
#else if $isAllocatable($var)
CALL ftg_allocate_and_read_allocatable(ftg_c, $filled)
#else
CALL ftg_read(ftg_c, $filled)
#end if
Expand Down
18 changes: 12 additions & 6 deletions templates/standalone_nompi/replay.test.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PROGRAM ftg_${subroutine.name}_test

USE ${module.name}, ONLY: ${subroutine.name}, ftg_${subroutine.name}_capture_input_enabled, ftg_${subroutine.name}_capture_output_enabled, ftg_${subroutine.name}_capture_round, ftg_${subroutine.name}_output_dir

USE m_ser_ftg, ONLY: ftg_set_serializer, ftg_set_savepoint, ftg_destroy_serializer, ftg_destroy_savepoint, ftg_print_serializer_debuginfo, ftg_field_exists, ftg_get_bounds, ftg_read, ftg_allocate_and_read
USE m_ser_ftg, ONLY: ftg_set_serializer, ftg_set_savepoint, ftg_destroy_serializer, ftg_destroy_savepoint, ftg_print_serializer_debuginfo, ftg_field_exists, ftg_get_bounds, ftg_read, ftg_allocate_and_read_pointer, ftg_allocate_and_read_allocatable

${globals.imports}

Expand Down Expand Up @@ -71,7 +71,7 @@ CONTAINS
! BASIC ARGUMENTS
#for $argument in $arguments.all.basic
#if $isArray($argument)
CALL ftg_allocate_and_read("$argument", $argument)
CALL ftg_allocate_and_read_allocatable("$argument", $argument)
#else
CALL ftg_read("$argument", $argument)
#end if
Expand All @@ -81,7 +81,7 @@ CONTAINS
#for $argument in $arguments.all.optional
IF (PRESENT($argument)) THEN
#if $isArray($argument)
CALL ftg_allocate_and_read("$argument", $argument)
CALL ftg_allocate_and_read_allocatable("$argument", $argument)
#else
CALL ftg_read("$argument", $argument)
#end if
Expand Down Expand Up @@ -124,7 +124,11 @@ END PROGRAM ftg_${subroutine.name}_test
#end if
#end for
#if $needsAllocation($var)
CALL ftg_allocate_and_read("$var", $var)
#if $isPointer($var)
CALL ftg_allocate_and_read_pointer("$var", $var)
#else
CALL ftg_allocate_and_read_allocatable("$var", $var)
#end if
#else
CALL ftg_read("$var", $var)
#end if
Expand Down Expand Up @@ -166,8 +170,10 @@ END PROGRAM ftg_${subroutine.name}_test
#end for
$writeVarNameWithFilledIndicesToString($var, "ftg_c", $mandDims, "ftg_d1", "ftg_d2", "ftg_d3", "ftg_d4")
#set $filled = $fillIndices($var, $mandDims, "ftg_d1", "ftg_d2", "ftg_d3", "ftg_d4")
#if $isAllocatableOrPointer($var)
CALL ftg_allocate_and_read(ftg_c, $filled)
#if $isPointer($var)
CALL ftg_allocate_and_read_pointer(ftg_c, $filled)
#else if $isAllocatable($var)
CALL ftg_allocate_and_read_allocatable(ftg_c, $filled)
#else
CALL ftg_read(ftg_c, $filled)
#end if
Expand Down

0 comments on commit e788016

Please sign in to comment.