Skip to content

Commit

Permalink
Merge pull request #17 from ec-jrc/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
doc78 committed May 19, 2023
2 parents 0b57789 + f04ab7f commit a92e710
Show file tree
Hide file tree
Showing 9 changed files with 306 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
.vscode/
*.py[c|o]
*~*.*
/build
Expand Down
17 changes: 15 additions & 2 deletions CHANGE_LOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
CHANGE LOG
==========
v 3.2
v 3.2.4
-----
* Added values in parameters, intertables and geopotentials config files
* Fix to PCRaster writer for gribfile missing values
* Fix in setup tool

v 3.2.3
-----
* Fixed scale/offset use in netCDF writing function
* Using netCDF default_fillvals as missing values
* Added choice of output stepUnit value.
* Updated documentation
* Optimized scipi invdist interpolation

v 3.2.2
-----
* New interpolation methods: bilinear interpolation on irregular grids, Delaunay triangulation, bilinear interpolation based on Delaunay triangulation (best performances on irregular and projected grids)
* Additional average computation method on Aggregator
Expand All @@ -11,7 +25,6 @@ v 3.1
* **74** API is much more flexible. Check documentation on how to use pyg2p programmatically.
* **73** Intertables are saved as .gz now, to save disk space. It's possible to compress all existing intertables and use them without changes in configuration. If pyg2p doesn't find the intertable, it will try to read it with suffix .gz.


v 3.0
-----
* **72** Pruned old test suite and test runner script. Using pytest with oracle data from latest version (v 2.1).
Expand Down
6 changes: 5 additions & 1 deletion configuration/global/geopotentials.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,9 @@
"-40$80$M$214$41826$reduced_gg":"O320_p80_m40_p20_p80.grb",
"-40$80$M$214$58717$reduced_gg":"efhs_58717.grb",
"-40$80$M$106$14996$reduced_gg":"efhs_14996.grb",
"0$359.723$M$640$421120$reduced_gg":"O320_421120.grb"
"0$359.723$M$640$421120$reduced_gg":"O320_421120.grb",
"-25$15$1001$601$601601$rotated_ll": "cosmo_z_seemhews.grib",
"7$49$1556$1066$1644290$regular_ll": "nmmb_z_seemhews.grib",
"9.4$44.98$1187$1049$1244967$regular_ll": "alsmws_verif_geop_seemhews.grb2",
"9.4$45$1425$961$1369425$regular_ll": "icon_gp_seemhews.grib"
}
165 changes: 165 additions & 0 deletions configuration/global/intertables.json
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,28 @@
3600
]
},
"I-15.75_16.125_511_415_212065_rotated_ll_2614000_4078000_1000_-1000_32.03_59.80_2614000_4078000_1000_-1000_-10.48_36.57scipy_nearest":{
"filename": "cos_212065_to_2878x3479_nearest.npy",
"method": "nearest",
"source_shape": [
212065
],
"target_shape": [
2878,
3479
]
},
"I-15.75_16.125_511_415_212065_rotated_ll_-1700000_1360000_1000_-1000_0.00_60.22_-1700000_1360000_1000_-1000_-10.32_37.93scipy_nearest":{
"filename":"cos_212065_to_2878x3479_nearest.npy",
"method":"nearest",
"source_shape":[
212065
],
"target_shape":[
2980,
3570
]
},
"I-15.75_16.125_511_415_212065_rotated_ll_2568000_4163000_1000_-1000_31.63_60.56_2568000_4163000_1000_-1000_-19.97_40.95scipy_nearest":{
"filename":"cos_212065_to_2981x3571_nearest.npy",
"method":"nearest",
Expand Down Expand Up @@ -1133,5 +1155,148 @@
1500,
3600
]
},
"I-25_15_1001_601_601601_rotated_ll_4790000_2550000_5000_-5000_43.34_45.87_4790000_2550000_5000_-5000_15.83_19.90scipy_nearest": {
"filename": "tbl_csm_3111_scipy_nearest.npy",
"method": "nearest",
"source_shape": [
601601
],
"target_shape": [
51,
61
]
},
"I0_359.929_M_2560_6599680_reduced_gg_4790000_2550000_5000_-5000_43.34_45.87_4790000_2550000_5000_-5000_15.83_19.90scipy_nearest": {
"filename": "tbl_1_2021061700_3111_scipy_nearest.npy",
"method": "nearest",
"source_shape": [
6599680
],
"target_shape": [
51,
61
]
},
"I7_49_1556_1066_1644290_regular_ll_4790000_2550000_5000_-5000_43.34_45.87_4790000_2550000_5000_-5000_15.83_19.90scipy_nearest": {
"filename": "tbl_nmmb_3111_scipy_nearest.npy",
"method": "nearest",
"source_shape": [
1658696
],
"target_shape": [
51,
61
]
},
"I7_49_1556_1066_1658696_regular_ll_4790000_2550000_5000_-5000_43.34_45.87_4790000_2550000_5000_-5000_15.83_19.90scipy_nearest": {
"filename": "tbl_1_nmmb_3111_scipy_nearest.npy",
"method": "nearest",
"source_shape": [
1658696
],
"target_shape": [
51,
61
]
},
"I9.4_44.98_1187_1049_1244967_regular_ll_4790000_2550000_5000_-5000_43.34_45.87_4790000_2550000_5000_-5000_15.83_19.90scipy_nearest": {
"filename": "tbl_2_2021061700_3111_scipy_nearest.npy",
"method": "nearest",
"source_shape": [
1245163
],
"target_shape": [
51,
61
]
},
"I9.4_45_1425_961_1369425_regular_ll_4790000_2550000_5000_-5000_43.34_45.87_4790000_2550000_5000_-5000_15.83_19.90scipy_nearest": {
"filename": "tbl_3_2021061700_3111_scipy_nearest.npy",
"method": "nearest",
"source_shape": [
1369425
],
"target_shape": [
51,
61
]
},
"I0_359.722_M_640_421120_reduced_gg_-179_-89_0_0_-89.97_89.97_-179_-89_0_0_-179.97_179.97scipy_bilinear": {
"filename": "tbl_fcroo6400_25920000_scipy_bilinear.npy.gz",
"method": "bilinear",
"source_shape": [
421120
],
"target_shape": [
3600,
7200
]
},
"I0_359.723_M_640_421120_reduced_gg_-179_-89_0_0_-89.97_89.97_-179_-89_0_0_-179.97_179.97scipy_bilinear": {
"filename": "tbl_1_fcinsto640_25920000_scipy_bilinear.npy.gz",
"method": "bilinear",
"source_shape": [
421120
],
"target_shape": [
3600,
7200
]
},
"I0_359.86_M_1280_1661440_reduced_gg_-179_-59_0_0_-59.97_89.97_-179_-59_0_0_-179.97_179.97scipy_bilinear": {
"filename": "tbl_fcroo6400_21600000_scipy_bilinear.npy.gz",
"method": "bilinear",
"source_shape": [
1661440
],
"target_shape": [
3000,
7200
]
},
"I0_359.86_M_1280_1661440_reduced_gg_-179_-89_0_0_-89.97_89.97_-179_-89_0_0_-179.97_179.97scipy_bilinear": {
"filename": "tbl_fcacco6400_25920000_scipy_bilinear.npy.gz",
"method": "bilinear",
"source_shape": [
1661440
],
"target_shape": [
3600,
7200
]
},
"I0_359.722_M_640_421120_reduced_gg_-179_-59_0_0_-59.97_89.97_-179_-59_0_0_-179.97_179.97scipy_bilinear": {
"filename": "tbl_1_fcroo6400_21600000_scipy_bilinear.npy.gz",
"method": "bilinear",
"source_shape": [
421120
],
"target_shape": [
3000,
7200
]
},
"I0_359.723_M_640_421120_reduced_gg_-179_-59_0_0_-59.97_89.97_-179_-59_0_0_-179.97_179.97scipy_bilinear": {
"filename": "tbl_1_fcinsto640_21600000_scipy_bilinear.npy.gz",
"method": "bilinear",
"source_shape": [
421120
],
"target_shape": [
3000,
7200
]
},
"I0_359.718_M_640_542080_reduced_gg_-179_-59_0_0_-59.97_89.97_-179_-59_0_0_-179.97_179.97scipy_bilinear": {
"filename": "tbl_1_det0to1_21600000_scipy_bilinear.npy.gz",
"method": "bilinear",
"source_shape": [
542080
],
"target_shape": [
3000,
7200
]
}
}
53 changes: 52 additions & 1 deletion configuration/global/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@
"@id": "tomm",
"@unit": "mm"
}
},
"pev": {
"@description": "Potential Evaporation",
"@shortName": "pev",
"@unit": "m",
"Conversion": {
"@cutOffNegative": true,
"@function": "x=-x*1000",
"@id": "tomm",
"@unit": "mm"
}
},
"fis": {
"@description": "Geopotential cosmo",
Expand Down Expand Up @@ -194,6 +205,11 @@
"@shortName": "ssr",
"@unit": "W s/m^2"
},
"ssrd": {
"@description": "Surface solar radiation downwards",
"@shortName": "ssrd",
"@unit": "W s/m^2"
},
"ssro": {
"@description": "Sub-Surface Runoff",
"@shortName": "ssro",
Expand Down Expand Up @@ -260,5 +276,40 @@
"@description": "Convective inhibition",
"@shortName": "cin",
"@unit": "J kg**-1"
},
"swvl1": {
"@description": "Soil Moisture",
"@shortName": "swvl1",
"@unit": "percentage"
},
"sd": {
"@description": "soil water equivalent",
"@shortName": "scov",
"@unit": "m",
"Conversion":{
"@function":"x=1000*x",
"@id":"tomm",
"@unit":"mm"
}
},
"sf": {
"@description": "snowmelt",
"@shortName": "smelt",
"@unit": "m",
"Conversion":{
"@function":"x=1000*x",
"@id":"tomm",
"@unit":"mm"
}
},
"smlt": {
"@description": "snowmelt",
"@shortName": "smelt",
"@unit": "m",
"Conversion":{
"@function":"x=1000*x",
"@id":"tomm",
"@unit":"mm"
}
}
}
}
60 changes: 38 additions & 22 deletions ecmwf_install_as_module
Original file line number Diff line number Diff line change
@@ -1,54 +1,70 @@
#!/bin/bash

set -ex
module unload python
module unload python3
module load python3

set -eux

mod_version=${1:-3.0.0.post1}
if [[ $# -gt 0 ]]; then shift; fi
hosts=${@:-deploy@aa-login deploy@ab-login deploy@ac-login deploy@ad-login}

mod_version=${1:-2.1.1}
assets_version=$mod_version

echo "module version to be installed: $mod_version"
echo "on hosts: $hosts"

# Where is pyg2p source code
src_dir=$PWD
src_host=$HOST
src_host=hpc-login

# where to install it

dest_dir=/usr/local/apps/pyg2p/$mod_version
eccodes=eccodes/2.24.0
for dest_host in $hosts; do

#for host in localhost lxc ecgb lxop cca ccb; do
for dest_host in lxc lxop cca ccb; do

case $dest_host in
lxc* ) static_data_root=/gpfs/lxc/efas/emos/data/pyg2p/$assets_version ;;
lxop* ) static_data_root=/gpfs/lxop/efas/emos/data/pyg2p/$assets_version ;;
cca* ) static_data_root=/sc1/tcwork/emos/emos_data/efas/assets/pyg2p/$assets_version ;;
ccb* ) static_data_root=/sc2/tcwork/emos/emos_data/efas/assets/pyg2p/$assets_version ;;
* ) "unexpected target host $dest_host"; false ;;

deploy@a?-login ) dest_dir=/usr/local/apps/pyg2p/$mod_version
static_data_root=/usr/local/apps/pyg2p/data
eccodes=ecmwf-toolbox/2022.08.0.0 ;;
* ) echo "unexpected target host $dest_host"; false ;;
esac

echo installing pyg2p/$mod_version in $dest_host ....
if ssh $dest_host [[ -d $dest_dir ]]; then
if ssh -x $dest_host [[ -d $dest_dir ]]; then
case $mod_version in
dev | test ) echo "reinstalling pyg2p/$mod_version" ;;
*dev* | *test | 3.0.0-01 | 3.0.1 | 3.0.0.post1 ) echo "reinstalling pyg2p/$mod_version" ;;
* ) echo "module pyg2p/$mod_version is already installed on $dest_host. skipping."; continue ;;
esac
fi
ssh $dest_host bash -l << END
module unload python
module load python/2.7.15-01
umask 022
ssh -x $dest_host bash -l << END
set -eux
echo \$TMPDIR
cd \$TMPDIR
rsync -avz --exclude='.git/' $src_host:$src_dir .
module unload python3 python gdal grib_api eccodes || :
module load $eccodes
module load gdal/3.2.1
module load python3/3.8.8-01
module load gcc || : # on HPC ;;
umask 022
mkdir -p \$SCRATCH/tmp_pyg2p
cd \$SCRATCH/tmp_pyg2p/
rsync -avz --exclude='.git/' -e ssh $src_host:$src_dir .
cd pyg2p
echo '{
"geopotentials": "$static_data_root/geopotentials",
"intertables": "$static_data_root/intertables"
}
' > configuration/global/global_conf.json
export HTTPS_PROXY=http://proxy.ecmwf.int:3333
export PYTHONPATH=/usr/local/apps/pyg2p/$mod_version/lib/python2.7/site-packages
python setup.py clean --all
python_version=\$(python3 -c "import sys; print(f'python{sys.version_info.major}.{sys.version_info.minor}')")
export PYTHONPATH=$dest_dir/lib/\$python_version/site-packages
python3 setup.py clean --all
mkdir -p \$PYTHONPATH
python setup.py install --prefix=/usr/local/apps/pyg2p/$mod_version
PYTHONPATH=\$ECCODES_DIR/lib/\$python_version/site-packages/:\$PYTHONPATH
python3 setup.py install --prefix=$dest_dir
END
echo done
done
Loading

0 comments on commit a92e710

Please sign in to comment.