import os
import shutil

from wmt.utils.hook import find_simulation_input_file


def execute(env):
    """Perform post-stage tasks for running a component.

    Parameters
    ----------
    env : dict
      A dict of component parameter values from WMT.

    """
    for name in ('river_forcing_file', 'waves_forcing_file'):
        src = find_simulation_input_file(env[name])
        shutil.copy(src, os.path.join(os.curdir, 'Forcing'))

@@ -74,16 +74,114 @@
 _file%0A%0A%0A
+_DEFAULT_FILES = %7B%0A    'river_forcing_file': 'river.nc',%0A    'waves_forcing_file': 'waves.nc',%0A%7D%0A%0A
 def exec
@@ -375,53 +375,209 @@
  in 
-('river_forcing_file', 'waves_forcing_file'):
+_DEFAULT_FILES:%0A        if env%5Bname%5D != _DEFAULT_FILES%5Bname%5D:%0A            try:%0A                os.remove(os.path.join(os.curdir, 'Forcing', env%5Bname%5D))%0A            except OSError:%0A                pass%0A
 %0A   

Remove default forcing files if not being used.