code: def modify_subroutine(subroutine):
      
      # print('\n----',subroutine['name'],'----')
  
      #-- use original function from shtools:
      subroutine['use'] = {'shtools': {'map': {subroutine['name']: subroutine['name']}, 'only': 1}}
  
      #-- loop through variables:
      for varname, varattribs in subroutine['vars'].items():
          #-- prefix function return variables with 'py'
          if varname == subroutine['name']:
              subroutine['vars']['py' + varname] = subroutine['vars'].pop(varname)
              varname = 'py' + varname
              # print('prefix added:',varname)
          #-- change assumed to explicit:
          if has_assumed_shape(varattribs):
              make_explicit(subroutine, varname, varattribs)
              # print('assumed shape variable modified to:',varname,varattribs['dimension'])
  
      #-- add py prefix to subroutine:
      subroutine['name'] = 'py' + subroutine['name']
docs: loops through variables of a subroutine and modifies them