Commit 6a143db8 authored by Oriol Tintó-Prims's avatar Oriol Tintó-Prims
Browse files

Casting to wp instead of sp

parent 520744e5
......@@ -52,15 +52,15 @@ def find_call_in_original_file(routine, argument, argument_index, _file, target_
"""
Open a file and look for a specific line that contains the routine and the arguments.
"""
# TODO: Probably shouldn't use sp and wp since those are model specific.
if target_type == "sp":
target_type = "wp"
# Add a cast to the proper type
new_argument = "REAL(%s, %s)" % (argument, target_type)
# Fix in case the argument already had a cast, in which case we'll only change the type of the cast
if new_argument.count("REAL(REAL("):
patt = "REAL\((.*),(.*)\)"
m = re.search(patt, argument)
# TODO: Probably shouldn't use sp and wp since those are model specific.
if target_type == "sp":
target_type = "wp"
new_argument = "REAL(%s, %s)" % (m.group(1), target_type)
# Fix the pattern to account for regex rules
pattern = r"\b%s\b####$$$$%s" % (routine, argument)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment