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

Follow up fix for issue 209 #211

Merged
merged 5 commits into from
Nov 29, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions payu/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ def set_env_vars(init_run=None, n_runs=None, lab_path=None, dir_path=None,
if reproduce:
payu_env_vars['PAYU_REPRODUCE'] = reproduce

# Pass through important module related environment variables
module_env_vars = ['MODULESHOME', 'MODULES_CMD', 'MODULEPATH', 'MODULEV']
for var in module_env_vars:
if var in os.environ:
payu_env_vars[var] = os.environ[var]

return payu_env_vars


Expand Down
8 changes: 5 additions & 3 deletions payu/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,11 @@ def load_modules(self):
loaded_mods = os.environ.get('LOADEDMODULES', '').split(':')

for mod in loaded_mods:
mod_base = mod.split('/')[0]
if mod_base not in core_modules:
envmod.module('unload', mod)
if len(mod) > 0:
print('mod '+mod)
mod_base = mod.split('/')[0]
if mod_base not in core_modules:
envmod.module('unload', mod)

# Now load model-dependent modules
for mod in self.modules:
Expand Down