diff --git a/For_developers/mk_upload_tarball.sh b/For_developers/mk_upload_tarball.sh index aa7ba79560744aa3ba0c3ffc2984df5b5ccdc95d..0bb9d1fe68fbd0aaafa7c8db7d25fcc37252df25 100755 --- a/For_developers/mk_upload_tarball.sh +++ b/For_developers/mk_upload_tarball.sh @@ -17,8 +17,8 @@ # Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. # -tarname='flex_extract_v7.1.tar.gz' -tardir='flex_extract_v7.1' +tarname='flex_extract_v7.1.2.tar.gz' +tardir='flex_extract_v7.1.2' # go back to directory which is above flex_extract directory cd ../.. diff --git a/Source/Python/Classes/EcFlexpart.py b/Source/Python/Classes/EcFlexpart.py index 09e6f35c68e55a515dc536a5c565264506048e3c..e3b3faa51ce3bdee1e6a19b195bde345c81d0693 100644 --- a/Source/Python/Classes/EcFlexpart.py +++ b/Source/Python/Classes/EcFlexpart.py @@ -1721,10 +1721,17 @@ class EcFlexpart(object): os.chdir(pwd) # ============================================================================================ # create name of final output file, e.g. EN13040500 (ENYYMMDDHH) + # for CERA-20C we need all 4 digits for the year sinc 1900 - 2010 if c.purefc: - suffix = cdate[2:8] + '.' + ctime + '.' + cstep + if c.marsclass == 'EP': + suffix = cdate[0:8] + '.' + ctime + '.' + cstep + else: + suffix = cdate[2:8] + '.' + ctime + '.' + cstep else: - suffix = cdate_hour[2:10] + if c.marsclass == 'EP': + suffix = cdate_hour[0:10] + else: + suffix = cdate_hour[2:10] # if necessary, add ensemble member number to filename suffix if 'number' in index_keys: diff --git a/Testing/Installation/Api_testscripts/README.md b/Testing/Installation/Api_testscripts/README.md new file mode 100644 index 0000000000000000000000000000000000000000..802b6d61f65301265b9eaa80516801fd6be20e8b --- /dev/null +++ b/Testing/Installation/Api_testscripts/README.md @@ -0,0 +1,7 @@ +# API test scripts + +These example scripts were prepared to test the two APIs "CDS API" and "ECMWF Web API" after their installation for both, member-state users and public users. + +They were taken from the official journal publication from Section A2 "System prerequisites". + +Execute the scripts and wait for the retrieval to finish and look for the final GRIB file in the directory where the script was executed. diff --git a/Testing/Installation/Api_testscripts/test_cdsapi_modellevel.py b/Testing/Installation/Api_testscripts/test_cdsapi_modellevel.py new file mode 100644 index 0000000000000000000000000000000000000000..baba95cb34fc54089cb1e25ea72f7e3f98a81dee --- /dev/null +++ b/Testing/Installation/Api_testscripts/test_cdsapi_modellevel.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import cdsapi + +c = cdsapi.Client() + +c.retrieve('reanalysis-era5-complete', +{ + 'class' : 'ea', + 'expver' : '1', + 'stream' : 'oper', + 'type' : 'fc', + 'step' : '3/to/12/by/3', + 'param' : '130.128', + 'levtype' : 'ml', + 'levelist': '135/to/137', + 'date' : '2013-01-01', + 'time' : '06/18', + 'area' : '50/-5/40/5', + 'grid' : '1.0/1.0', + 'format' : 'grib', +}, 'download_era5_cdsapi.grib') diff --git a/Testing/Installation/Api_testscripts/test_cdsapi_pressurelevel.py b/Testing/Installation/Api_testscripts/test_cdsapi_pressurelevel.py new file mode 100644 index 0000000000000000000000000000000000000000..0e5b7a51a5ff27c68909f0598980246a34203233 --- /dev/null +++ b/Testing/Installation/Api_testscripts/test_cdsapi_pressurelevel.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import cdsapi + +c = cdsapi.Client() + +c.retrieve("reanalysis-era5-pressure-levels", +{ + "variable": "temperature", + "pressure_level": "1000", + "product_type": "reanalysis", + "year": "2008", + "month": "01", + "day": "01", + "time": "12:00", + "format": "grib" +}, +"download_cdsapi.grib") diff --git a/Testing/Installation/Api_testscripts/test_ecmwfapi_member.py b/Testing/Installation/Api_testscripts/test_ecmwfapi_member.py new file mode 100644 index 0000000000000000000000000000000000000000..607d93b2612706b8afaa112602c835fed49a33b6 --- /dev/null +++ b/Testing/Installation/Api_testscripts/test_ecmwfapi_member.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +from ecmwfapi import ECMWFService + +server = ECMWFService('mars') + +server.retrieve({ + 'stream' : "oper", + 'levtype' : "sfc", + 'param' : "165.128/166.128/167.128", + 'dataset' : "interim", + 'step' : "0", + 'grid' : "0.75/0.75", + 'time' : "00/06/12/18", + 'date' : "2014-07-01/to/2014-07-31", + 'type' : "an", + 'class' : "ei", + 'target' : "download_erainterim_ecmwfapi.grib" +}) diff --git a/Testing/Installation/Api_testscripts/test_ecmwfapi_public.py b/Testing/Installation/Api_testscripts/test_ecmwfapi_public.py new file mode 100644 index 0000000000000000000000000000000000000000..89013e0055fa56c59ea1a5bbb5cfaa86378c8643 --- /dev/null +++ b/Testing/Installation/Api_testscripts/test_ecmwfapi_public.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +from ecmwfapi import ECMWFDataServer + +server = ECMWFDataServer() + +server.retrieve({ + 'stream' : "enda", + 'levtype' : "sfc", + 'param' : "165.128/166.128/167.128", + 'dataset' : "cera20c", + 'step' : "0", + 'grid' : "1./1.", + 'time' : "00/06/12/18", + 'date' : "2000-07-01/to/2000-07-31", + 'type' : "an", + 'class' : "ep", + 'target' : "download_cera20c_ecmwfapi.grib" +}) diff --git a/Testing/Installation/Convert/README b/Testing/Installation/Calc_etadot/README similarity index 100% rename from Testing/Installation/Convert/README rename to Testing/Installation/Calc_etadot/README diff --git a/Testing/Installation/Convert/fort.10 b/Testing/Installation/Calc_etadot/fort.10 similarity index 100% rename from Testing/Installation/Convert/fort.10 rename to Testing/Installation/Calc_etadot/fort.10 diff --git a/Testing/Installation/Convert/fort.11 b/Testing/Installation/Calc_etadot/fort.11 similarity index 100% rename from Testing/Installation/Convert/fort.11 rename to Testing/Installation/Calc_etadot/fort.11 diff --git a/Testing/Installation/Convert/fort.12 b/Testing/Installation/Calc_etadot/fort.12 similarity index 100% rename from Testing/Installation/Convert/fort.12 rename to Testing/Installation/Calc_etadot/fort.12 diff --git a/Testing/Installation/Convert/fort.13 b/Testing/Installation/Calc_etadot/fort.13 similarity index 100% rename from Testing/Installation/Convert/fort.13 rename to Testing/Installation/Calc_etadot/fort.13 diff --git a/Testing/Installation/Convert/fort.16 b/Testing/Installation/Calc_etadot/fort.16 similarity index 100% rename from Testing/Installation/Convert/fort.16 rename to Testing/Installation/Calc_etadot/fort.16 diff --git a/Testing/Installation/Convert/fort.17 b/Testing/Installation/Calc_etadot/fort.17 similarity index 100% rename from Testing/Installation/Convert/fort.17 rename to Testing/Installation/Calc_etadot/fort.17 diff --git a/Testing/Installation/Convert/fort.18 b/Testing/Installation/Calc_etadot/fort.18 similarity index 100% rename from Testing/Installation/Convert/fort.18 rename to Testing/Installation/Calc_etadot/fort.18 diff --git a/Testing/Installation/Convert/fort.19 b/Testing/Installation/Calc_etadot/fort.19 similarity index 100% rename from Testing/Installation/Convert/fort.19 rename to Testing/Installation/Calc_etadot/fort.19 diff --git a/Testing/Installation/Convert/fort.21 b/Testing/Installation/Calc_etadot/fort.21 similarity index 100% rename from Testing/Installation/Convert/fort.21 rename to Testing/Installation/Calc_etadot/fort.21 diff --git a/Testing/Installation/Convert/fort.22 b/Testing/Installation/Calc_etadot/fort.22 similarity index 100% rename from Testing/Installation/Convert/fort.22 rename to Testing/Installation/Calc_etadot/fort.22 diff --git a/Testing/Installation/Convert/fort.4 b/Testing/Installation/Calc_etadot/fort.4 similarity index 100% rename from Testing/Installation/Convert/fort.4 rename to Testing/Installation/Calc_etadot/fort.4 diff --git a/Testing/Installation/First_extraction/README.md b/Testing/Installation/First_extraction/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a43c701235b56cf143fc32711b06911742d155db --- /dev/null +++ b/Testing/Installation/First_extraction/README.md @@ -0,0 +1,11 @@ +# Run scripts for the first extraction + +These are the run.sh scripts mentioned in the "Usage section" in the flex_extract publication. + +run.sh - member and gateway mode, member-state users + +run_local.sh - local mode, both user groups: member-state users: all data sets; public users: ERA5 + +run_local_public.sh - local mode, public users (CERA-20C, ERA-Interim) + + diff --git a/Testing/Installation/First_extraction/run.sh b/Testing/Installation/First_extraction/run.sh new file mode 100644 index 0000000000000000000000000000000000000000..0f820f86f39ac72d4c4d318616a88ce8c5c3b16d --- /dev/null +++ b/Testing/Installation/First_extraction/run.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# +# @Author: Anne Philipp +# +# @Date: October, 4 2018 +# +# @Description: +# This script defines the available command-line parameters +# for running flex_extract and combines them for the execution +# of the Python program. It also does some checks to +# guarantee necessary parameters were set and consistent. +# +# @Licence: +# (C) Copyright 2014-2019. +# +# SPDX-License-Identifier: CC-BY-4.0 +# +# This work is licensed under the Creative Commons Attribution 4.0 +# International License. To view a copy of this license, visit +# http://creativecommons.org/licenses/by/4.0/ or send a letter to +# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. +# +# ----------------------------------------------------------------- +# AVAILABLE COMMANDLINE ARGUMENTS TO SET +# +# THE USER HAS TO SPECIFY THESE PARAMETERS: + +QUEUE='ecgate' +START_DATE=None +END_DATE=None +DATE_CHUNK=None +JOB_CHUNK=3 +BASETIME=None +STEP=None +LEVELIST=None +AREA=None +INPUTDIR=None +OUTPUTDIR=None +PP_ID=None +JOB_TEMPLATE='submitscript.template' +CONTROLFILE='CONTROL_CERA' +DEBUG=0 +REQUEST=2 +PUBLIC=0 + +# ----------------------------------------------------------------- +# +# AFTER THIS LINE THE USER DOES NOT HAVE TO CHANGE ANYTHING !!! +# +# ----------------------------------------------------------------- + +# PATH TO SUBMISSION SCRIPT +pyscript=../Source/Python/submit.py + +# INITIALIZE EMPTY PARAMETERLIST +parameterlist="" + +# CHECK IF ON ECMWF SERVER; +if [[ $HOST == *"ecgb"* ]] || [[ $HOST == *"cca"* ]] || [[ $HOST == *"ccb"* ]]; then +# LOAD PYTHON3 MODULE + module load python3 +fi + +# CHECK FOR MORE PARAMETER +if [ -n "$START_DATE" ]; then + parameterlist+=" --start_date=$START_DATE" +fi +if [ -n "$END_DATE" ]; then + parameterlist+=" --end_date=$END_DATE" +fi +if [ -n "$DATE_CHUNK" ]; then + parameterlist+=" --date_chunk=$DATE_CHUNK" +fi +if [ -n "$JOB_CHUNK" ]; then + parameterlist+=" --job_chunk=$JOB_CHUNK" +fi +if [ -n "$BASETIME" ]; then + parameterlist+=" --basetime=$BASETIME" +fi +if [ -n "$STEP" ]; then + parameterlist+=" --step=$STEP" +fi +if [ -n "$LEVELIST" ]; then + parameterlist+=" --levelist=$LEVELIST" +fi +if [ -n "$AREA" ]; then + parameterlist+=" --area=$AREA" +fi +if [ -n "$INPUTDIR" ]; then + parameterlist+=" --inputdir=$INPUTDIR" +fi +if [ -n "$OUTPUTDIR" ]; then + parameterlist+=" --outputdir=$OUTPUTDIR" +fi +if [ -n "$PP_ID" ]; then + parameterlist+=" --ppid=$PP_ID" +fi +if [ -n "$JOB_TEMPLATE" ]; then + parameterlist+=" --job_template=$JOB_TEMPLATE" +fi +if [ -n "$QUEUE" ]; then + parameterlist+=" --queue=$QUEUE" +fi +if [ -n "$CONTROLFILE" ]; then + parameterlist+=" --controlfile=$CONTROLFILE" +fi +if [ -n "$DEBUG" ]; then + parameterlist+=" --debug=$DEBUG" +fi +if [ -n "$REQUEST" ]; then + parameterlist+=" --request=$REQUEST" +fi +if [ -n "$PUBLIC" ]; then + parameterlist+=" --public=$PUBLIC" +fi + +# ----------------------------------------------------------------- +# CALL SCRIPT WITH DETERMINED COMMANDLINE ARGUMENTS + +$pyscript $parameterlist + diff --git a/Testing/Installation/First_extraction/run_local.sh b/Testing/Installation/First_extraction/run_local.sh new file mode 100644 index 0000000000000000000000000000000000000000..1c8243a585d923963812da8681dde76ab9df92c0 --- /dev/null +++ b/Testing/Installation/First_extraction/run_local.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# +# @Author: Anne Philipp +# +# @Date: October, 4 2018 +# +# @Description: +# This script defines the available command-line parameters +# for running flex_extract and combines them for the execution +# of the Python program. It also does some checks to +# guarantee necessary parameters were set and consistent. +# +# @Licence: +# (C) Copyright 2014-2019. +# +# SPDX-License-Identifier: CC-BY-4.0 +# +# This work is licensed under the Creative Commons Attribution 4.0 +# International License. To view a copy of this license, visit +# http://creativecommons.org/licenses/by/4.0/ or send a letter to +# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. +# +# ----------------------------------------------------------------- +# AVAILABLE COMMANDLINE ARGUMENTS TO SET +# +# THE USER HAS TO SPECIFY THESE PARAMETERS: + +QUEUE=None +START_DATE=None +END_DATE=None +DATE_CHUNK=None +JOB_CHUNK=3 +BASETIME=None +STEP=None +LEVELIST=None +AREA=None +INPUTDIR='Workspace/CERA' +OUTPUTDIR='Workspace/CERA' +PP_ID=None +JOB_TEMPLATE=None +CONTROLFILE='CONTROL_CERA' +DEBUG=0 +REQUEST=2 +PUBLIC=0 + +# ----------------------------------------------------------------- +# +# AFTER THIS LINE THE USER DOES NOT HAVE TO CHANGE ANYTHING !!! +# +# ----------------------------------------------------------------- + +# PATH TO SUBMISSION SCRIPT +pyscript=../Source/Python/submit.py + +# INITIALIZE EMPTY PARAMETERLIST +parameterlist="" + +# CHECK IF ON ECMWF SERVER; +if [[ $HOST == *"ecgb"* ]] || [[ $HOST == *"cca"* ]] || [[ $HOST == *"ccb"* ]]; then +# LOAD PYTHON3 MODULE + module load python3 +fi + +# CHECK FOR MORE PARAMETER +if [ -n "$START_DATE" ]; then + parameterlist+=" --start_date=$START_DATE" +fi +if [ -n "$END_DATE" ]; then + parameterlist+=" --end_date=$END_DATE" +fi +if [ -n "$DATE_CHUNK" ]; then + parameterlist+=" --date_chunk=$DATE_CHUNK" +fi +if [ -n "$JOB_CHUNK" ]; then + parameterlist+=" --job_chunk=$JOB_CHUNK" +fi +if [ -n "$BASETIME" ]; then + parameterlist+=" --basetime=$BASETIME" +fi +if [ -n "$STEP" ]; then + parameterlist+=" --step=$STEP" +fi +if [ -n "$LEVELIST" ]; then + parameterlist+=" --levelist=$LEVELIST" +fi +if [ -n "$AREA" ]; then + parameterlist+=" --area=$AREA" +fi +if [ -n "$INPUTDIR" ]; then + parameterlist+=" --inputdir=$INPUTDIR" +fi +if [ -n "$OUTPUTDIR" ]; then + parameterlist+=" --outputdir=$OUTPUTDIR" +fi +if [ -n "$PP_ID" ]; then + parameterlist+=" --ppid=$PP_ID" +fi +if [ -n "$JOB_TEMPLATE" ]; then + parameterlist+=" --job_template=$JOB_TEMPLATE" +fi +if [ -n "$QUEUE" ]; then + parameterlist+=" --queue=$QUEUE" +fi +if [ -n "$CONTROLFILE" ]; then + parameterlist+=" --controlfile=$CONTROLFILE" +fi +if [ -n "$DEBUG" ]; then + parameterlist+=" --debug=$DEBUG" +fi +if [ -n "$REQUEST" ]; then + parameterlist+=" --request=$REQUEST" +fi +if [ -n "$PUBLIC" ]; then + parameterlist+=" --public=$PUBLIC" +fi + +# ----------------------------------------------------------------- +# CALL SCRIPT WITH DETERMINED COMMANDLINE ARGUMENTS + +$pyscript $parameterlist + diff --git a/Testing/Installation/First_extraction/run_local_public.sh b/Testing/Installation/First_extraction/run_local_public.sh new file mode 100644 index 0000000000000000000000000000000000000000..71e31af90cbdeab7ab08424c97391e4e93d819b2 --- /dev/null +++ b/Testing/Installation/First_extraction/run_local_public.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# +# @Author: Anne Philipp +# +# @Date: October, 4 2018 +# +# @Description: +# This script defines the available command-line parameters +# for running flex_extract and combines them for the execution +# of the Python program. It also does some checks to +# guarantee necessary parameters were set and consistent. +# +# @Licence: +# (C) Copyright 2014-2019. +# +# SPDX-License-Identifier: CC-BY-4.0 +# +# This work is licensed under the Creative Commons Attribution 4.0 +# International License. To view a copy of this license, visit +# http://creativecommons.org/licenses/by/4.0/ or send a letter to +# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. +# +# ----------------------------------------------------------------- +# AVAILABLE COMMANDLINE ARGUMENTS TO SET +# +# THE USER HAS TO SPECIFY THESE PARAMETERS: + +QUEUE=None +START_DATE=None +END_DATE=None +DATE_CHUNK=None +JOB_CHUNK=3 +BASETIME=None +STEP=None +LEVELIST=None +AREA=None +INPUTDIR='Workspace/CERApublic' +OUTPUTDIR='Workspace/CERApublic' +PP_ID=None +JOB_TEMPLATE=None +CONTROLFILE='CONTROL_CERA.public' +DEBUG=0 +REQUEST=0 +PUBLIC=1 + +# ----------------------------------------------------------------- +# +# AFTER THIS LINE THE USER DOES NOT HAVE TO CHANGE ANYTHING !!! +# +# ----------------------------------------------------------------- + +# PATH TO SUBMISSION SCRIPT +pyscript=../Source/Python/submit.py + +# INITIALIZE EMPTY PARAMETERLIST +parameterlist="" + +# CHECK IF ON ECMWF SERVER; +if [[ $HOST == *"ecgb"* ]] || [[ $HOST == *"cca"* ]] || [[ $HOST == *"ccb"* ]]; then +# LOAD PYTHON3 MODULE + module load python3 +fi + +# CHECK FOR MORE PARAMETER +if [ -n "$START_DATE" ]; then + parameterlist+=" --start_date=$START_DATE" +fi +if [ -n "$END_DATE" ]; then + parameterlist+=" --end_date=$END_DATE" +fi +if [ -n "$DATE_CHUNK" ]; then + parameterlist+=" --date_chunk=$DATE_CHUNK" +fi +if [ -n "$JOB_CHUNK" ]; then + parameterlist+=" --job_chunk=$JOB_CHUNK" +fi +if [ -n "$BASETIME" ]; then + parameterlist+=" --basetime=$BASETIME" +fi +if [ -n "$STEP" ]; then + parameterlist+=" --step=$STEP" +fi +if [ -n "$LEVELIST" ]; then + parameterlist+=" --levelist=$LEVELIST" +fi +if [ -n "$AREA" ]; then + parameterlist+=" --area=$AREA" +fi +if [ -n "$INPUTDIR" ]; then + parameterlist+=" --inputdir=$INPUTDIR" +fi +if [ -n "$OUTPUTDIR" ]; then + parameterlist+=" --outputdir=$OUTPUTDIR" +fi +if [ -n "$PP_ID" ]; then + parameterlist+=" --ppid=$PP_ID" +fi +if [ -n "$JOB_TEMPLATE" ]; then + parameterlist+=" --job_template=$JOB_TEMPLATE" +fi +if [ -n "$QUEUE" ]; then + parameterlist+=" --queue=$QUEUE" +fi +if [ -n "$CONTROLFILE" ]; then + parameterlist+=" --controlfile=$CONTROLFILE" +fi +if [ -n "$DEBUG" ]; then + parameterlist+=" --debug=$DEBUG" +fi +if [ -n "$REQUEST" ]; then + parameterlist+=" --request=$REQUEST" +fi +if [ -n "$PUBLIC" ]; then + parameterlist+=" --public=$PUBLIC" +fi + +# ----------------------------------------------------------------- +# CALL SCRIPT WITH DETERMINED COMMANDLINE ARGUMENTS + +$pyscript $parameterlist + diff --git a/Testing/Installation/testecmwfapi_member.py b/Testing/Installation/testecmwfapi_member.py deleted file mode 100644 index 66cc7c1eed9f4ebaa6f541b41bb62fc9b3df9be7..0000000000000000000000000000000000000000 --- a/Testing/Installation/testecmwfapi_member.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - -import pytest -from ecmwfapi import ECMWFService - -class TestECMWFApi: - """ - """ - - def test_member(): - server = ECMWFService("mars") - - server.execute({'class' : "ei", - 'time' : "00", - 'date' : "2013-09-01/to/2013-09-30", - 'step' : "0", - 'type' : "an", - 'levtype' : "sfc", - 'param' : "165.128/41.128", - 'grid' : "0.75/0.75"}, - "interim201309.grib") - diff --git a/Testing/Installation/testecmwfapi_public.py b/Testing/Installation/testecmwfapi_public.py deleted file mode 100644 index 6e261df92ee7e776521013b5fcbceb4b4c7887bc..0000000000000000000000000000000000000000 --- a/Testing/Installation/testecmwfapi_public.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - -import pytest -from ecmwfapi import ECMWFDataServer - -class TestECMWFApi: - """ - """ - - def test_public(): - server = ECMWFDataServer() - - server.retrieve({'dataset' : "interim", - 'time' : "00", - 'date' : "2013-09-01/to/2013-09-30", - 'step' : "0", - 'type' : "an", - 'levtype' : "sfc", - 'param' : "165.128/41.128", - 'grid' : "0.75/0.75", - 'target' : "interim201309.grib" - }) - -