Skip to content

Commit

Permalink
Modify linux and macos wflow modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielabdi-noaa committed Dec 7, 2022
1 parent de49d8c commit da73e20
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 14 deletions.
33 changes: 26 additions & 7 deletions modulefiles/wflow_linux.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,35 @@ This module sets a path to activate conda environment needed for running the UFS
whatis([===[This module sets a path for conda environment needed for running the UFS SRW App on Linux]===])

setenv("CMAKE_Platform", "linux")
setenv("VENV", pathJoin(os.getenv("HOME"), "condaenv/envs/regional_workflow"))

--[[
local ROCOTOmod="/Users/username/modules"
prepend_path("MODULEPATH", ROCOTOmod)
load(rocoto)
--]]
-- Conda initialization function
function init_conda(conda_path)
local shell=myShellType()
local conda_file
if shell == "csh" then
conda_file=pathJoin(conda_path,"etc/profile.d/conda.csh")
else
conda_file=pathJoin(conda_path,"etc/profile.d/conda.sh")
end
local mcmd="source " .. conda_file
execute{cmd=mcmd, modeA={"load"}}
end

-- initialize conda
local conda_path="/home/username/miniconda3"
init_conda(conda_path)

-- add rocoto to path
local rocoto_path="/home/username/rocoto"
prepend_path("PATH", pathJoin(rocoto_path,"bin"))

-- add fake slurm commands
local srw_path="/home/username/ufs-srweather-app"
prepend_path("PATH", pathJoin(srw_path, "ush/rocoto_fake_slurm"))

-- display conda activation message
if mode() == "load" then
LmodMsgRaw([===[Please do the following to activate conda:
> conda activate $VENV
> conda activate regional_workflow
]===])
end
33 changes: 26 additions & 7 deletions modulefiles/wflow_macos.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,36 @@ This module set a path needed to activate conda environement for running UFS SRW
whatis([===[This module activates conda environment for running the UFS SRW App on macOS]===])

setenv("CMAKE_Platform", "macos")
setenv("VENV", pathJoin(os.getenv("HOME"), "condaenv/envs/regional_workflow"))

--[[
local ROCOTOmod="/Users/username/modules"
prepend_path("MODULEPATH", ROCOTOmod)
load(rocoto)
--]]
-- Conda initialization function
function init_conda(conda_path)
local shell=myShellType()
local conda_file
if shell == "csh" then
conda_file=pathJoin(conda_path,"etc/profile.d/conda.csh")
else
conda_file=pathJoin(conda_path,"etc/profile.d/conda.sh")
end
local mcmd="source " .. conda_file
execute{cmd=mcmd, modeA={"load"}}
end

-- initialize conda
local conda_path="/Users/username/miniconda3"
init_conda(conda_path)

-- add rocoto to path
local rocoto_path="/Users/username/rocoto"
prepend_path("PATH", pathJoin(rocoto_path,"bin"))

-- add fake slurm commands
local srw_path="/Users/username/ufs-srweather-app"
prepend_path("PATH", pathJoin(srw_path, "ush/rocoto_fake_slurm"))

-- display conda activation message
if mode() == "load" then
LmodMsgRaw([===[Please do the following to activate conda virtual environment:
> conda activate $VENV "
> conda activate regional_workflow"
]===])
end

0 comments on commit da73e20

Please sign in to comment.