diff c3s.sh @ 1:eadc0e7f9abd draft default tip

planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/c3s commit e8074c9f6817bba5ca6cb322434ca5e4412b34cf
author climate
date Fri, 27 Sep 2024 19:34:28 +0000
parents 7fa6bc1fb588
children
line wrap: on
line diff
--- a/c3s.sh	Tue Apr 13 18:32:15 2021 +0000
+++ b/c3s.sh	Fri Sep 27 19:34:28 2024 +0000
@@ -7,9 +7,14 @@
    cdo -f nc -t ecmwf copy tmpg.grib tmp.nc
 elif [ -f download.zip ]; then
    unzip download.zip
-   cat *.grib > tmp.grib
-   cdo setgridtype,regular tmp.grib tmpg.grib
-   cdo -f nc -t ecmwf copy tmpg.grib tmp.nc
+   files=(*.nc)
+   if [ -e "${files[0]}" ]; then
+     mv ${files[0]} tmp.nc
+   else
+     cat *.grib > tmp.grib
+     cdo setgridtype,regular tmp.grib tmpg.grib
+     cdo -f nc -t ecmwf copy tmpg.grib tmp.nc
+   fi
 elif [ -f download.grib ]; then
    cdo -f nc -t ecmwf copy download.grib tmp.nc
 elif [ -f download.nc ]; then