Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not require label on end subroutine statement #1

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/fortran_tools/parse_fortran_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ def parse_scheme_metadata(statements, pobj, spec_name, table_name, run_env):
seen_contains = seen_contains or is_contains_statement(statement, insub)
if seen_contains:
inpreamble = False
# End if
if asmatch is not None:
# We have run off the end of something, hope that is okay
# Put this statement back for the caller to deal with
Expand Down Expand Up @@ -680,7 +681,7 @@ def parse_scheme_metadata(statements, pobj, spec_name, table_name, run_env):
# End if
elif inpreamble or seen_contains:
# Process a preamble statement (use or argument declaration)
if esmatch is not None and scheme_name == esmatch.group(1):
if esmatch is not None:
inpreamble = False
seen_contains = False
insub = False
Expand Down
18 changes: 16 additions & 2 deletions test/capgen_test/temp_calc_adjust.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ SUBROUTINE temp_calc_adjust_run(nbox, timestep, temp_level, temp_calc, &
integer, intent(out) :: errflg
!----------------------------------------------------------------

integer :: col_index
integer :: col_index
real(kind_phys) :: bar = 1.0_kind_phys

errmsg = ''
errflg = 0

call temp_calc_adjust_nested_subroutine(temp_calc)
if (check_foo()) then
call foo(bar)
end if

CONTAINS

Expand All @@ -46,7 +50,17 @@ ELEMENTAL SUBROUTINE temp_calc_adjust_nested_subroutine(temp)

END SUBROUTINE temp_calc_adjust_nested_subroutine

END SUBROUTINE temp_calc_adjust_run
SUBROUTINE foo(bar)
REAL(kind_phys), intent(inout) :: bar
bar = bar + 1.0_kind_phys

END SUBROUTINE

logical function check_foo()
check_foo = .true.
end function check_foo

END SUBROUTINE

!> \section arg_table_temp_calc_adjust_init Argument Table
!! \htmlinclude arg_table_temp_calc_adjust_init.html
Expand Down