From 44174de31acc10708895185f7beb7568204f0760 Mon Sep 17 00:00:00 2001 From: Anne Philipp <anne.philipp@univie.ac.at> Date: Tue, 30 Jul 2019 22:30:21 +0200 Subject: [PATCH] commented out the WRF parts since they are still under construction and added License SPDX tags --- Source/Python/Classes/ControlFile.py | 12 +-- Source/Python/Classes/EcFlexpart.py | 109 ++++++++++++++++--------- Source/Python/Classes/GribUtil.py | 39 ++++----- Source/Python/Classes/MarsRetrieval.py | 2 + Source/Python/Classes/UioFiles.py | 2 + Source/Python/Mods/checks.py | 2 + Source/Python/Mods/disaggregation.py | 2 + Source/Python/Mods/get_mars_data.py | 2 + Source/Python/Mods/prepare_flexpart.py | 2 + Source/Python/Mods/tools.py | 2 + Source/Python/_config.py | 2 + Source/Python/install.py | 2 + Source/Python/submit.py | 2 + 13 files changed, 110 insertions(+), 70 deletions(-) diff --git a/Source/Python/Classes/ControlFile.py b/Source/Python/Classes/ControlFile.py index 5fd1798..96e901e 100644 --- a/Source/Python/Classes/ControlFile.py +++ b/Source/Python/Classes/ControlFile.py @@ -23,20 +23,12 @@ # (C) Copyright 2014-2019. # Anne Philipp, Leopold Haimberger # +# 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. -# -# @Class Methods: -# __init__ -# _read_controlfile -# __str__ -# assign_args_to_control -# assign_envs_to_control -# check_conditions -# check_install_conditions -# to_list #******************************************************************************* # ------------------------------------------------------------------------------ diff --git a/Source/Python/Classes/EcFlexpart.py b/Source/Python/Classes/EcFlexpart.py index 7326e86..67b0c90 100644 --- a/Source/Python/Classes/EcFlexpart.py +++ b/Source/Python/Classes/EcFlexpart.py @@ -41,6 +41,8 @@ # (C) Copyright 2014-2019. # Anne Philipp, Leopold Haimberger # +# 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 @@ -414,15 +416,23 @@ class EcFlexpart(object): # ADDITIONAL FIELDS FOR FLEXPART-WRF MODEL (IF QUESTIONED) # ----------------------------------------------------------------------- if wrf: - self.params['OG__ML'][0] += '/Z/VO' - if '/D' not in self.params['OG__ML'][0]: - self.params['OG__ML'][0] += '/D' + # @WRF + # THIS IS NOT YET CORRECTLY IMPLEMENTED !!! + # + # UNDER CONSTRUCTION !!! + # + + print('WRF VERSION IS UNDER CONSTRUCTION!') # dummy argument + + #self.params['OG__ML'][0] += '/Z/VO' + #if '/D' not in self.params['OG__ML'][0]: + # self.params['OG__ML'][0] += '/D' - wrf_sfc = ['SP','SKT','SST','CI','STL1','STL2', 'STL3','STL4', - 'SWVL1','SWVL2','SWVL3','SWVL4'] - for par in wrf_sfc: - if par not in self.params['OG__SL'][0]: - self.params['OG__SL'][0] += '/' + par + #wrf_sfc = ['SP','SKT','SST','CI','STL1','STL2', 'STL3','STL4', + # 'SWVL1','SWVL2','SWVL3','SWVL4'] + #for par in wrf_sfc: + # if par not in self.params['OG__SL'][0]: + # self.params['OG__SL'][0] += '/' + par return @@ -1501,11 +1511,16 @@ class EcFlexpart(object): end_period = datetime.strptime(c.end_date + c.time[-1], '%Y%m%d%H') end_period = end_period + timedelta(hours=int(c.step[-1])) - if c.wrf: - table128 = init128(_config.PATH_GRIBTABLE) - wrfpars = to_param_id('sp/mslp/skt/2t/10u/10v/2d/z/lsm/sst/ci/sd/\ - stl1/stl2/stl3/stl4/swvl1/swvl2/swvl3/swvl4', - table128) + # @WRF + # THIS IS NOT YET CORRECTLY IMPLEMENTED !!! + # + # UNDER CONSTRUCTION !!! + # + #if c.wrf: + # table128 = init128(_config.PATH_GRIBTABLE) + # wrfpars = to_param_id('sp/mslp/skt/2t/10u/10v/2d/z/lsm/sst/ci/sd/\ + # stl1/stl2/stl3/stl4/swvl1/swvl2/swvl3/swvl4', + # table128) # these numbers are indices for the temporary files "fort.xx" # which are used to seperate the grib fields to, @@ -1584,11 +1599,16 @@ class EcFlexpart(object): if timestamp < start_time or timestamp > end_time: continue - if c.wrf: - if 'olddate' not in locals() or cdate != olddate: - fwrf = open(os.path.join(c.outputdir, - 'WRF' + cdate + '.' + ctime + '.000.grb2'), 'w') - olddate = cdate[:] + # @WRF + # THIS IS NOT YET CORRECTLY IMPLEMENTED !!! + # + # UNDER CONSTRUCTION !!! + # + #if c.wrf: + # if 'olddate' not in locals() or cdate != olddate: + # fwrf = open(os.path.join(c.outputdir, + # 'WRF' + cdate + '.' + ctime + '.000.grb2'), 'w') + # olddate = cdate[:] #============================================================================================ # savedfields remembers which fields were already used. savedfields = [] @@ -1626,11 +1646,16 @@ class EcFlexpart(object): codes_set(gid, 'paramId', 201031) codes_write(gid, fdict['22']) scwc = None - elif c.wrf and paramId in [129, 138, 155] and \ - levtype == 'hybrid': # Z, VO, D - # do not do anything right now - # these are specific parameter for WRF - pass + # @WRF + # THIS IS NOT YET CORRECTLY IMPLEMENTED !!! + # + # UNDER CONSTRUCTION !!! + # + #elif c.wrf and paramId in [129, 138, 155] and \ + # levtype == 'hybrid': # Z, VO, D + # # do not do anything right now + # # these are specific parameter for WRF + # pass else: if paramId not in savedfields: # SD/MSL/TCC/10U/10V/2T/2D/Z/LSM/SDOR/CVL/CVH/SR @@ -1639,18 +1664,22 @@ class EcFlexpart(object): savedfields.append(paramId) else: print('duplicate ' + str(paramId) + ' not written') - - try: - if c.wrf: - # model layer - if levtype == 'hybrid' and \ - paramId in [129, 130, 131, 132, 133, 138, 155]: - codes_write(gid, fwrf) - # sfc layer - elif paramId in wrfpars: - codes_write(gid, fwrf) - except AttributeError: - pass + # @WRF + # THIS IS NOT YET CORRECTLY IMPLEMENTED !!! + # + # UNDER CONSTRUCTION !!! + # + #try: + # if c.wrf: + # # model layer + # if levtype == 'hybrid' and \ + # paramId in [129, 130, 131, 132, 133, 138, 155]: + # codes_write(gid, fwrf) + # # sfc layer + # elif paramId in wrfpars: + # codes_write(gid, fwrf) + #except AttributeError: + # pass codes_release(gid) gid = codes_new_from_index(iid) @@ -1720,8 +1749,14 @@ class EcFlexpart(object): shutil.copyfileobj(open(os.path.join(c.inputdir, 'fort.25'), 'rb'), fout) # ============================================================================================ - if c.wrf: - fwrf.close() + + # @WRF + # THIS IS NOT YET CORRECTLY IMPLEMENTED !!! + # + # UNDER CONSTRUCTION !!! + # + #if c.wrf: + # fwrf.close() codes_index_release(iid) diff --git a/Source/Python/Classes/GribUtil.py b/Source/Python/Classes/GribUtil.py index b7a66a2..68e8746 100644 --- a/Source/Python/Classes/GribUtil.py +++ b/Source/Python/Classes/GribUtil.py @@ -12,31 +12,15 @@ # - changed some naming # # @License: -# (C) Copyright 2014-2018. +# (C) Copyright 2014-2019. +# Anne Philipp, Leopold Haimberger # -# This software is licensed under the terms of the Apache Licence Version 2.0 -# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. -# -# @Class Description: -# The GRIB API provides all necessary tools to work directly with the -# grib files. Nevertheless, the GRIB API tools are very basic and are in -# direct connection with the grib files. This class provides some higher -# functions which apply a set of GRIB API tools together in the respective -# context. So, the class initially contains a list of grib files (their -# names) and the using program then applies the methods directly on the -# class objects without having to think about how the actual GRIB API -# tools have to be arranged. -# -# @Class Content: -# - __init__ -# - get_keys -# - set_keys -# - copy_dummy_msg -# - index -# -# @Class Attributes: -# - filenames +# 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. #******************************************************************************* # ------------------------------------------------------------------------------ @@ -52,6 +36,15 @@ import os class GribUtil(object): ''' Class for GRIB utilities (new methods) based on GRIB API + + The GRIB API provides all necessary tools to work directly with the + grib files. Nevertheless, the GRIB API tools are very basic and are in + direct connection with the grib files. This class provides some higher + functions which apply a set of GRIB API tools together in the respective + context. So, the class initially contains a list of grib files (their + names) and the using program then applies the methods directly on the + class objects without having to think about how the actual GRIB API + tools have to be arranged. ''' # -------------------------------------------------------------------------- # CLASS FUNCTIONS diff --git a/Source/Python/Classes/MarsRetrieval.py b/Source/Python/Classes/MarsRetrieval.py index c87f878..5fe2211 100644 --- a/Source/Python/Classes/MarsRetrieval.py +++ b/Source/Python/Classes/MarsRetrieval.py @@ -22,6 +22,8 @@ # (C) Copyright 2014-2019. # Anne Philipp, Leopold Haimberger # +# 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 diff --git a/Source/Python/Classes/UioFiles.py b/Source/Python/Classes/UioFiles.py index 8c1c269..10bcfb1 100644 --- a/Source/Python/Classes/UioFiles.py +++ b/Source/Python/Classes/UioFiles.py @@ -25,6 +25,8 @@ # (C) Copyright 2014-2019. # Anne Philipp, Leopold Haimberger # +# 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 diff --git a/Source/Python/Mods/checks.py b/Source/Python/Mods/checks.py index 54db0dc..74e7ba6 100644 --- a/Source/Python/Mods/checks.py +++ b/Source/Python/Mods/checks.py @@ -11,6 +11,8 @@ # (C) Copyright 2014-2019. # Anne Philipp, Leopold Haimberger # +# 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 diff --git a/Source/Python/Mods/disaggregation.py b/Source/Python/Mods/disaggregation.py index a5d36ca..07c593b 100644 --- a/Source/Python/Mods/disaggregation.py +++ b/Source/Python/Mods/disaggregation.py @@ -22,6 +22,8 @@ # (C) Copyright 2014-2019. # Anne Philipp, Leopold Haimberger # +# 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 diff --git a/Source/Python/Mods/get_mars_data.py b/Source/Python/Mods/get_mars_data.py index e3c7947..48a1d36 100755 --- a/Source/Python/Mods/get_mars_data.py +++ b/Source/Python/Mods/get_mars_data.py @@ -28,6 +28,8 @@ # (C) Copyright 2014-2019. # Anne Philipp, Leopold Haimberger # +# 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 diff --git a/Source/Python/Mods/prepare_flexpart.py b/Source/Python/Mods/prepare_flexpart.py index ba4026e..5c1fd47 100755 --- a/Source/Python/Mods/prepare_flexpart.py +++ b/Source/Python/Mods/prepare_flexpart.py @@ -31,6 +31,8 @@ # (C) Copyright 2014-2019. # Anne Philipp, Leopold Haimberger # +# 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 diff --git a/Source/Python/Mods/tools.py b/Source/Python/Mods/tools.py index 5b57f30..8a94f58 100644 --- a/Source/Python/Mods/tools.py +++ b/Source/Python/Mods/tools.py @@ -26,6 +26,8 @@ # (C) Copyright 2014-2019. # Anne Philipp, Leopold Haimberger # +# 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 diff --git a/Source/Python/_config.py b/Source/Python/_config.py index 591a6c9..03126f7 100644 --- a/Source/Python/_config.py +++ b/Source/Python/_config.py @@ -11,6 +11,8 @@ # (C) Copyright 2014-2019. # Anne Philipp, Leopold Haimberger # +# 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 diff --git a/Source/Python/install.py b/Source/Python/install.py index 172a060..1c9d8b7 100755 --- a/Source/Python/install.py +++ b/Source/Python/install.py @@ -21,6 +21,8 @@ # (C) Copyright 2014-2019. # Anne Philipp, Leopold Haimberger # +# 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 diff --git a/Source/Python/submit.py b/Source/Python/submit.py index 399ffba..62a042a 100755 --- a/Source/Python/submit.py +++ b/Source/Python/submit.py @@ -25,6 +25,8 @@ # (C) Copyright 2014-2019. # Anne Philipp, Leopold Haimberger # +# 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 -- GitLab