From f5db685e7a6a32863676e6f1fdff30f8234599a3 Mon Sep 17 00:00:00 2001 From: CoryMartin-NOAA Date: Fri, 8 Mar 2024 16:26:43 +0000 Subject: [PATCH 1/5] Work on Rocky8 modulefile --- modulefiles/GDAS/hera.intel.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/modulefiles/GDAS/hera.intel.lua b/modulefiles/GDAS/hera.intel.lua index 50556a7d0..cbf872741 100644 --- a/modulefiles/GDAS/hera.intel.lua +++ b/modulefiles/GDAS/hera.intel.lua @@ -6,8 +6,8 @@ local pkgName = myModuleName() local pkgVersion = myModuleVersion() local pkgNameVer = myModuleFullName() -prepend_path("MODULEPATH", '/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core') -prepend_path("MODULEPATH", '/scratch1/NCEPDEV/da/python/opt/modulefiles/stack') +prepend_path("MODULEPATH", '/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/install/modulefiles/Core') +--prepend_path("MODULEPATH", '/scratch1/NCEPDEV/da/python/opt/modulefiles/stack') -- below two lines get us access to the spack-stack modules load("stack-intel/2021.5.0") @@ -42,7 +42,7 @@ load("eckit/1.24.5") load("fftw/3.3.10") load("fckit/0.11.0") load("fiat/1.2.0") -load("ectrans/1.2.0") +--load("ectrans/1.2.0") load("atlas/0.35.1") load("sp/2.5.0") load("gsl-lite/0.37.0") @@ -60,15 +60,19 @@ load("udunits/2.2.28") load("ncview/2.1.9") load("netcdf-cxx4/4.3.1") load("json/3.10.5") -load("py-pybind11/2.11.0") --load("crtm/v2.4_jedi") load("rocoto/1.3.6") +load("prod_util/2.1.1") + +load("py-netcdf4/1.5.8") +load("py-pybind11/2.11.0") +load("py-pycodestyle/2.11.0") +load("py-pyyaml/6.0") +load("py-scipy/1.11.3") +load("py-xarray/2023.7.0") -load("hpc/1.2.0") -unload("python/3.10.13") -unload("py-numpy/1.22.3") -load("miniconda3/4.6.14") -load("gdasapp/1.0.0") +-- hack for wxflow +prepend_path("PYTHONPATH", "/scratch1/NCEPDEV/da/python/gdasapp/wxflow/20240307/src") setenv("CC","mpiicc") setenv("FC","mpiifort") @@ -81,7 +85,7 @@ setenv('MPIEXEC_NPROC', mpinproc) setenv("CRTM_FIX","/scratch1/NCEPDEV/da/Cory.R.Martin/GDASApp/fix/crtm/2.4.0") setenv("GDASAPP_TESTDATA","/scratch1/NCEPDEV/da/Cory.R.Martin/CI/GDASApp/data") -prepend_path("PATH","/scratch2/NCEPDEV/nwprod/hpc-stack/libs/hpc-stack/intel-18.0.5.274/prod_util/1.2.2/bin") +--prepend_path("PATH","/scratch2/NCEPDEV/nwprod/hpc-stack/libs/hpc-stack/intel-18.0.5.274/prod_util/1.2.2/bin") whatis("Name: ".. pkgName) whatis("Version: ".. pkgVersion) From e0b351c7bf81962f58c16fc4beec1f6518d312ce Mon Sep 17 00:00:00 2001 From: CoryMartin-NOAA Date: Fri, 8 Mar 2024 18:19:14 +0000 Subject: [PATCH 2/5] Jinja --- modulefiles/GDAS/hera.intel.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modulefiles/GDAS/hera.intel.lua b/modulefiles/GDAS/hera.intel.lua index cbf872741..dadf95689 100644 --- a/modulefiles/GDAS/hera.intel.lua +++ b/modulefiles/GDAS/hera.intel.lua @@ -64,6 +64,7 @@ load("json/3.10.5") load("rocoto/1.3.6") load("prod_util/2.1.1") +load("py-jinja2/3.0.3") load("py-netcdf4/1.5.8") load("py-pybind11/2.11.0") load("py-pycodestyle/2.11.0") From edd37b64515d402ed7ca28f714b810be6f3af307 Mon Sep 17 00:00:00 2001 From: RussTreadon-NOAA Date: Mon, 11 Mar 2024 16:45:24 +0000 Subject: [PATCH 3/5] remove obsolete and replace remaining solo references with wxflow (#958) --- ush/ufsda/misc_utils.py | 22 ---------------------- ush/ufsda/ufs_yaml.py | 3 +-- ush/ufsda/yamltools.py | 2 -- 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/ush/ufsda/misc_utils.py b/ush/ufsda/misc_utils.py index 519cdc11d..9da525235 100644 --- a/ush/ufsda/misc_utils.py +++ b/ush/ufsda/misc_utils.py @@ -2,7 +2,6 @@ import logging import os import re -import solo.date import stat import subprocess @@ -13,27 +12,6 @@ } -def calc_fcst_steps(fcst_step, win_length): - """ - function to return a list of forecast steps - for a given fcst_step (forecast step) - and win_length (window length) - """ - # need to get +- half of the window length - # assumes only hours for now, probably bad... - # also assumes the window is symmetric, probably also bad - h = int(re.findall('PT(\\d+)H', win_length)[0]) - h2 = int(re.findall('PT(\\d+)H', fcst_step)[0]) - assert h % h2 == 0, "win_length must be divisible by fcst_step" - if h2 > h//2: - return [fcst_step] - start = f'PT{h-h//2}H' - end = f'PT{h+h//2}H' - # solo has a nice utility for this - fcst_steps = solo.date.step_sequence(start, end, fcst_step) - return fcst_steps - - def isTrue(str_in): """ isTrue(str_in) - function to translate shell variables to python logical variables diff --git a/ush/ufsda/ufs_yaml.py b/ush/ufsda/ufs_yaml.py index aebc8bd7a..c0712d18c 100644 --- a/ush/ufsda/ufs_yaml.py +++ b/ush/ufsda/ufs_yaml.py @@ -1,7 +1,6 @@ import datetime import os -from solo.yaml_file import YAMLFile -from solo.template import TemplateConstants, Template +from wxflow import YAMLFile, TemplateConstants, Template def gen_yaml(outyaml, templateyaml): diff --git a/ush/ufsda/yamltools.py b/ush/ufsda/yamltools.py index 9a0e033bf..332a47891 100644 --- a/ush/ufsda/yamltools.py +++ b/ush/ufsda/yamltools.py @@ -2,8 +2,6 @@ import os import re import logging -from solo.yaml_file import YAMLFile -from solo.template import TemplateConstants, Template from ufsda.misc_utils import isTrue import wxflow From 8bfc238bfdb070460a6c7954a5a4c5307e9978ca Mon Sep 17 00:00:00 2001 From: RussTreadon-NOAA Date: Mon, 11 Mar 2024 17:50:55 +0000 Subject: [PATCH 4/5] replace SOLO with wxflow in comments --- ush/ufsda/ufs_yaml.py | 2 +- ush/ufsda/yamltools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ush/ufsda/ufs_yaml.py b/ush/ufsda/ufs_yaml.py index c0712d18c..57f89a957 100644 --- a/ush/ufsda/ufs_yaml.py +++ b/ush/ufsda/ufs_yaml.py @@ -120,7 +120,7 @@ def get_exp_vars(): def replace_vars(config): - # use SOLO to replace variables in the configuration dictionary + # use wxflow to replace variables in the configuration dictionary # as appropriate with either other dictionary key/value pairs # or environment variables config = Template.substitute_structure_from_environment(config) diff --git a/ush/ufsda/yamltools.py b/ush/ufsda/yamltools.py index 332a47891..52ceacd32 100644 --- a/ush/ufsda/yamltools.py +++ b/ush/ufsda/yamltools.py @@ -305,7 +305,7 @@ def include_yaml(config): def replace_vars(config): - # use SOLO to replace variables in the configuration dictionary + # use wxflow to replace variables in the configuration dictionary # as appropriate with either other dictionary key/value pairs # or environment variables config = Template.substitute_structure_from_environment(config) From 5d43b3390ba41b5ee5d958c4861e2fddee0fdbed Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Mon, 18 Mar 2024 11:10:26 +0000 Subject: [PATCH 5/5] Add EVA modulefile to rocky8 branch (#975) --- modulefiles/EVA/hera.lua | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/modulefiles/EVA/hera.lua b/modulefiles/EVA/hera.lua index d5188a652..865676c9f 100644 --- a/modulefiles/EVA/hera.lua +++ b/modulefiles/EVA/hera.lua @@ -8,11 +8,24 @@ local pkgNameVer = myModuleFullName() conflict(pkgName) -prepend_path("MODULEPATH", '/scratch1/NCEPDEV/da/python/opt/modulefiles/stack') +prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/install/modulefiles/Core") +load("stack-intel/2021.5.0") +load("python/3.10.13") +load("proj/9.2.1") -load("hpc/1.2.0") -load("miniconda3/4.6.14") -load("eva/1.0.0") +local pyenvpath = "/scratch1/NCEPDEV/da/python/envs/" +local pyenvname = "eva" + +local pyenvactivate = pathJoin(pyenvpath, pyenvname, "bin/activate") +if (mode() == "load") then + local activate_cmd = "source "..pyenvactivate + execute{cmd=activate_cmd, modeA={"load"}} +else + if (mode() == "unload") then + local deactivate_cmd = "deactivate" + execute{cmd=deactivate_cmd, modeA={"unload"}} + end +end whatis("Name: ".. pkgName) whatis("Version: ".. pkgVersion)