Skip to content

Commit

Permalink
Changing environment to point to one that is publicly available, addi…
Browse files Browse the repository at this point in the history
…ng requirements, short pam-file, make COMPARE_VARIABLES optional
  • Loading branch information
maritsandstad committed Dec 16, 2024
1 parent 8bb3dc0 commit f7c3e69
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 4 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ Currently very much a work in progress

## Prerequisites

In order to use the tool you need to load and ESMF module and build an xesmf-containing conda environment on top of it.
In order to use the tool you need to load and ESMF module and build an xesmf-containing conda environment on top of it. On Nird running, navigating to the folder called `scripts` and running:

```
. setup.sh
```
will automatically do this for you.

Otherwise you can install an environment using the file `requirements.txt` to install such an environment yourself using conda. However, be aware that to do so you also need ESMF installed and loaded before building, and you need to loaded the same ESMF module when loading the environment. We recommend editing the `setup.sh` file to reflect the setup needed on your machine if you build your own environment this way.

## Usage

Expand All @@ -33,5 +40,5 @@ If you want this to be viewable by web, choose a web-facing directory. For insta
This file should be a json-file containing the three keyword arguments:
* VAR_LIST_MAIN - and this should be followed by the list of main variables to plot on maps and for trends
* SEASONAL_VARSETS - and this should be followed by a dictionary of named variable sets for which to plot seasonal cycles over the various regions
* COMPARE_VARIABLES - and this should be followed by a list of variables to use to make comparison plots
* COMPARE_VARIABLES - is optional, if included this should be followed by a list of variables to use to make comparison plots, if not sent but a comparison is still requested, the compare_variables will be taken from VAR_LIST_MAIN
If the no pamfile argument is sent, the file standard_pams.json is used. Feel free to copy that file to use as a template when making your own parameterfile, but we recommend not editing the file itself.
169 changes: 169 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
_libgcc_mutex=0.1=conda_forge
_openmp_mutex=4.5=2_gnu
alsa-lib=1.2.12=h4ab18f5_0
black=24.8.0=py312h06a4308_0
blosc=1.21.6=hef167b5_0
brotli=1.1.0=hd590300_1
brotli-bin=1.1.0=hd590300_1
bzip2=1.0.8=h4bc722e_7
c-ares=1.33.0=ha66036c_0
ca-certificates=2024.9.24=h06a4308_0
cached-property=1.5.2=hd8ed1ab_1
cached_property=1.5.2=pyha770c72_1
cairo=1.18.0=hebfffa5_3
cartopy=0.23.0=py312h1d6d2e6_1
certifi=2024.8.30=py312h06a4308_0
cf_xarray=0.9.4=pyhd8ed1ab_0
cftime=1.6.4=py312h085067d_0
click=8.1.7=py312h06a4308_0
contourpy=1.2.1=py312h8572e83_0
cycler=0.12.1=pyhd8ed1ab_0
dbus=1.13.6=h5008d03_3
double-conversion=3.3.0=h59595ed_0
esmf=8.6.1=nompi_h0a5817f_2
esmpy=8.6.1=pyhc1e730c_0
expat=2.6.2=h59595ed_0
font-ttf-dejavu-sans-mono=2.37=hab24e00_0
font-ttf-inconsolata=3.000=h77eed37_0
font-ttf-source-code-pro=2.038=h77eed37_0
font-ttf-ubuntu=0.83=h77eed37_2
fontconfig=2.14.2=h14ed4e7_0
fonts-conda-ecosystem=1=0
fonts-conda-forge=1=0
fonttools=4.53.1=py312h41a817b_0
freetype=2.12.1=h267a509_2
geos=3.12.2=he02047a_1
graphite2=1.3.13=h59595ed_1003
h5netcdf=1.3.0=pyhd8ed1ab_0
h5py=3.11.0=nompi_py312hb7ab980_102
harfbuzz=9.0.0=hda332d3_1
hdf4=4.2.15=h2a13503_7
hdf5=1.14.3=nompi_hdf9ad27_105
icu=75.1=he02047a_0
keyutils=1.6.1=h166bdaf_0
kiwisolver=1.4.5=py312h8572e83_1
krb5=1.21.3=h659f571_0
lcms2=2.16=hb7c19ff_0
ld_impl_linux-64=2.40=hf3520f5_7
lerc=4.0.0=h27087fc_0
libaec=1.1.3=h59595ed_0
libblas=3.9.0=23_linux64_openblas
libbrotlicommon=1.1.0=hd590300_1
libbrotlidec=1.1.0=hd590300_1
libbrotlienc=1.1.0=hd590300_1
libcblas=3.9.0=23_linux64_openblas
libclang-cpp18.1=18.1.8=default_hf981a13_2
libclang13=18.1.8=default_h9def88c_2
libcups=2.3.3=h4637d8d_4
libcurl=8.9.1=hdb1bdb2_0
libdeflate=1.21=h4bc722e_0
libdrm=2.4.122=h4ab18f5_0
libedit=3.1.20191231=he28a2e2_2
libev=4.33=hd590300_2
libexpat=2.6.2=h59595ed_0
libffi=3.4.2=h7f98852_5
libgcc-ng=14.1.0=h77fa898_0
libgfortran-ng=14.1.0=h69a702a_0
libgfortran5=14.1.0=hc5f4f2c_0
libglib=2.80.3=h315aac3_2
libgomp=14.1.0=h77fa898_0
libiconv=1.17=hd590300_2
libjpeg-turbo=3.0.0=hd590300_1
liblapack=3.9.0=23_linux64_openblas
libllvm14=14.0.6=hcd5def8_4
libllvm18=18.1.8=h8b73ec9_2
libnetcdf=4.9.2=nompi_h135f659_114
libnghttp2=1.58.0=h47da74e_1
libnsl=2.0.1=hd590300_0
libopenblas=0.3.27=pthreads_hac2b453_1
libpciaccess=0.18=hd590300_0
libpng=1.6.43=h2797004_0
libpq=16.4=h482b261_0
libsqlite=3.46.0=hde9e2c9_0
libssh2=1.11.0=h0841786_0
libstdcxx-ng=14.1.0=hc0a3c3a_0
libtiff=4.6.0=h46a8edc_4
libuuid=2.38.1=h0b41bf4_0
libwebp-base=1.4.0=hd590300_0
libxcb=1.16=hd590300_0
libxcrypt=4.4.36=hd590300_1
libxkbcommon=1.7.0=h2c5496b_1
libxml2=2.12.7=he7c6b58_4
libxslt=1.1.39=h76b75d6_0
libzip=1.10.1=h2629f0a_3
libzlib=1.3.1=h4ab18f5_1
llvmlite=0.43.0=py312h9c5d478_0
lz4-c=1.9.4=hcb278e6_0
matplotlib=3.9.2=py312h7900ff3_0
matplotlib-base=3.9.2=py312h854627b_0
munkres=1.1.4=pyh9f0ad1d_0
mypy_extensions=1.0.0=py312h06a4308_0
mysql-common=8.3.0=h70512c7_5
mysql-libs=8.3.0=ha479ceb_5
ncurses=6.5=h59595ed_0
netcdf-fortran=4.6.1=nompi_h228c76a_104
netcdf4=1.7.1=nompi_py312h1ef7fb6_101
numba=0.60.0=py312h83e6fd3_0
numpy=2.0.1=py312h1103770_0
openjpeg=2.5.2=h488ebb8_0
openssl=3.3.1=h4bc722e_2
packaging=24.1=pyhd8ed1ab_0
pandas=2.2.2=py312h1d6d2e6_1
pathspec=0.10.3=py312h06a4308_0
pcre2=10.44=hba22ea6_2
pillow=10.4.0=py312h287a98d_0
pip=24.2=pyhd8ed1ab_0
pixman=0.43.2=h59595ed_0
platformdirs=3.10.0=py312h06a4308_0
proj=9.4.1=h54d7996_1
pthread-stubs=0.4=h36c2ea0_1001
pyparsing=3.1.2=pyhd8ed1ab_0
pyproj=3.6.1=py312h01329cd_8
pyshp=2.3.1=pyhd8ed1ab_0
pyside6=6.7.2=py312hb5137db_2
python=3.12.5=h2ad013b_0_cpython
python-dateutil=2.9.0=pyhd8ed1ab_0
python-tzdata=2024.1=pyhd8ed1ab_0
python_abi=3.12=5_cp312
pytz=2024.1=pyhd8ed1ab_0
qhull=2020.2=h434a139_5
qt6-main=6.7.2=hb12f9c5_4
readline=8.2=h8228510_1
scipy=1.14.0=py312h499d17b_2
setuptools=72.2.0=pyhd8ed1ab_0
shapely=2.0.6=py312h8413631_0
six=1.16.0=pyh6c4a22f_0
snappy=1.2.1=ha2e4443_0
sparse=0.15.4=pyhd8ed1ab_0
sqlite=3.46.0=h6d4b2fc_0
tk=8.6.13=noxft_h4845f30_101
tornado=6.4.1=py312h9a8786e_0
tzdata=2024a=h0c530f3_0
wayland=1.23.0=h5291e77_0
wheel=0.44.0=pyhd8ed1ab_0
xarray=2024.7.0=pyhd8ed1ab_0
xcb-util=0.4.1=hb711507_2
xcb-util-cursor=0.1.4=h4ab18f5_2
xcb-util-image=0.4.0=hb711507_2
xcb-util-keysyms=0.4.1=hb711507_0
xcb-util-renderutil=0.3.10=hb711507_0
xcb-util-wm=0.4.2=hb711507_0
xesmf=0.8.7=pyhd8ed1ab_0
xkeyboard-config=2.42=h4ab18f5_0
xorg-kbproto=1.0.7=h7f98852_1002
xorg-libice=1.1.1=hd590300_0
xorg-libsm=1.2.4=h7391055_0
xorg-libx11=1.8.9=hb711507_1
xorg-libxau=1.0.11=hd590300_0
xorg-libxdmcp=1.1.3=h7f98852_0
xorg-libxext=1.3.4=h0b41bf4_2
xorg-libxrender=0.9.11=hd590300_0
xorg-renderproto=0.11.1=h7f98852_1002
xorg-xextproto=7.3.0=h0b41bf4_1003
xorg-xproto=7.0.31=h7f98852_1007
xz=5.2.6=h166bdaf_0
zlib=1.3.1=h4ab18f5_1
zstd=1.5.6=ha6fb4c9_0
2 changes: 1 addition & 1 deletion scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ source deactivate
module purge
module load Anaconda3/2022.05
module load ESMF/8.4.1-intel-2022a
conda activate /projects/NS9188K/NORESM_INTERIM_TEMP/environment/diag_xesmf_env/
conda activate /projects/NS9560K/diagnostics/land_xesmf_env/diag_xesmf_env/
15 changes: 15 additions & 0 deletions scripts/short_pams_no_compare.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"VAR_LIST_MAIN" : [
"TSA",
"SNOW",
"TLAI",
"FLDS",
"RAIN",
"LAISUN"
],

"SEASONAL_VARSETS":
{
"landf": ["TSA", "RAIN", "SNOW", "LAISUN"]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ def read_pam_file(pam_file_path):
raise ValueError(f"{pam_file_path} must evaluate to dict")
for elem, e_type in required.items():
if elem not in data.keys():
raise ValueError(f"{pam_file_path} must include {elem}")
if (elem == "COMPARE_VARIABLES") and ("VAR_LIST_MAIN" in data.keys()):
data["COMPARE_VARIABLES"] = data["VAR_LIST_MAIN"]
else:
raise ValueError(f"{pam_file_path} must include {elem}")
if not isinstance(data[elem], e_type):
raise TypeError(f"{pam_file_path} element {elem} must be a {e_type}, but is {type(data[elem])}")
return data
Expand Down

0 comments on commit f7c3e69

Please sign in to comment.