diff --git a/.codacy.yml b/.codacy.yml old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml old mode 100644 new mode 100755 diff --git a/.prospector.yml b/.prospector.yml old mode 100644 new mode 100755 diff --git a/.pylintrc b/.pylintrc old mode 100644 new mode 100755 diff --git a/CHANGELOG b/CHANGELOG old mode 100644 new mode 100755 index ed2436dda0fb006bcaf25178d5f50f3bb1450b6f..ecc61958559475076da1457a1bb548cee6cfe7b4 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +1.0.3 + 2019/06/07 + - Solved bug on WRF-Chem unit change + - Solved issue #16 + 1.0.2 2019/04/30 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/conf/EI_configuration.csv b/conf/EI_configuration.csv old mode 100644 new mode 100755 diff --git a/conf/hermes.conf b/conf/hermes.conf old mode 100644 new mode 100755 diff --git a/data/global_attributes.csv b/data/global_attributes.csv old mode 100644 new mode 100755 diff --git a/data/profiles/speciation/MolecularWeights.csv b/data/profiles/speciation/MolecularWeights.csv old mode 100644 new mode 100755 diff --git a/data/profiles/speciation/Speciation_profile_cb05_aero5_CMAQ.csv b/data/profiles/speciation/Speciation_profile_cb05_aero5_CMAQ.csv old mode 100644 new mode 100755 diff --git a/data/profiles/speciation/Speciation_profile_cb05_aero5_MONARCH.csv b/data/profiles/speciation/Speciation_profile_cb05_aero5_MONARCH.csv old mode 100644 new mode 100755 diff --git a/data/profiles/speciation/Speciation_profile_cb05_aero6_CMAQ.csv b/data/profiles/speciation/Speciation_profile_cb05_aero6_CMAQ.csv old mode 100644 new mode 100755 diff --git a/data/profiles/speciation/Speciation_profile_cb05e51_aero6_CMAQ.csv b/data/profiles/speciation/Speciation_profile_cb05e51_aero6_CMAQ.csv old mode 100644 new mode 100755 diff --git a/data/profiles/speciation/Speciation_profile_radm2_madesorgam_WRF_CHEM.csv b/data/profiles/speciation/Speciation_profile_radm2_madesorgam_WRF_CHEM.csv old mode 100644 new mode 100755 diff --git a/data/profiles/temporal/TemporalProfile_Daily.csv b/data/profiles/temporal/TemporalProfile_Daily.csv old mode 100644 new mode 100755 diff --git a/data/profiles/temporal/TemporalProfile_Hourly.csv b/data/profiles/temporal/TemporalProfile_Hourly.csv old mode 100644 new mode 100755 diff --git a/data/profiles/temporal/TemporalProfile_Monthly.csv b/data/profiles/temporal/TemporalProfile_Monthly.csv old mode 100644 new mode 100755 diff --git a/data/profiles/temporal/TemporalProfile_Weekly.csv b/data/profiles/temporal/TemporalProfile_Weekly.csv old mode 100644 new mode 100755 diff --git a/data/profiles/temporal/tz_world_country_iso3166.csv b/data/profiles/temporal/tz_world_country_iso3166.csv old mode 100644 new mode 100755 diff --git a/data/profiles/vertical/Benchmark_15layers_vertical_description.csv b/data/profiles/vertical/Benchmark_15layers_vertical_description.csv old mode 100644 new mode 100755 diff --git a/data/profiles/vertical/Vertical_profile.csv b/data/profiles/vertical/Vertical_profile.csv old mode 100644 new mode 100755 diff --git a/environment.yml b/environment.yml old mode 100644 new mode 100755 diff --git a/hermesv3_gr/__init__.py b/hermesv3_gr/__init__.py old mode 100644 new mode 100755 index 7863915fa5f8f014c64c8abff41a138e9b3cd4d3..976498ab9cacbd0ed9a538cebd482e5df53f8efb --- a/hermesv3_gr/__init__.py +++ b/hermesv3_gr/__init__.py @@ -1 +1 @@ -__version__ = "1.0.2" +__version__ = "1.0.3" diff --git a/hermesv3_gr/config/__init__.py b/hermesv3_gr/config/__init__.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/config/config.py b/hermesv3_gr/config/config.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/config/settings.py b/hermesv3_gr/config/settings.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/__init__.py b/hermesv3_gr/modules/__init__.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/emision_inventories/__init__.py b/hermesv3_gr/modules/emision_inventories/__init__.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/emision_inventories/emission_inventory.py b/hermesv3_gr/modules/emision_inventories/emission_inventory.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/grids/__init__.py b/hermesv3_gr/modules/grids/__init__.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/grids/grid.py b/hermesv3_gr/modules/grids/grid.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/grids/grid_global.py b/hermesv3_gr/modules/grids/grid_global.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/grids/grid_latlon.py b/hermesv3_gr/modules/grids/grid_latlon.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/grids/grid_lcc.py b/hermesv3_gr/modules/grids/grid_lcc.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/grids/grid_mercator.py b/hermesv3_gr/modules/grids/grid_mercator.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/grids/grid_rotated.py b/hermesv3_gr/modules/grids/grid_rotated.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/masking/__init__.py b/hermesv3_gr/modules/masking/__init__.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/masking/masking.py b/hermesv3_gr/modules/masking/masking.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/regrid/__init__.py b/hermesv3_gr/modules/regrid/__init__.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/regrid/regrid.py b/hermesv3_gr/modules/regrid/regrid.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/regrid/regrid_conservative.py b/hermesv3_gr/modules/regrid/regrid_conservative.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/speciation/__init__.py b/hermesv3_gr/modules/speciation/__init__.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/speciation/speciation.py b/hermesv3_gr/modules/speciation/speciation.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/temporal/__init__.py b/hermesv3_gr/modules/temporal/__init__.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/temporal/temporal.py b/hermesv3_gr/modules/temporal/temporal.py old mode 100644 new mode 100755 index 9ebb759cd66424d9c50012e319432c1432e6f2ed..858edd5b76399fa965e7bfbffac3c82b36947115 --- a/hermesv3_gr/modules/temporal/temporal.py +++ b/hermesv3_gr/modules/temporal/temporal.py @@ -198,13 +198,31 @@ class TemporalDistribution(object): def get_gridded_temporal_profile(self, profile_value, profile_path): from netCDF4 import Dataset nc_in = Dataset(profile_path, mode='r') - if nc_in.dimensions['latitude'].size * nc_in.dimensions['longitude'].size != self.grid.full_shape[-2] * \ - self.grid.full_shape[-1]: - settings.write_log('ERROR: Check the .err file to get more info.') - if settings.rank == 0: - raise IOError('ERROR: The temporal gridded profile {0} '.format(profile_path) + - 'is not in the destiny resolution like {1}.'.format(self.grid.coords_netcdf_file)) - sys.exit(1) + if self.grid.grid_type == 'rotated': + lat_name = 'rlat' + lon_name = 'rlon' + elif self.grid.grid_type.isin(['mercator', 'lcc']): + lat_name = 'x' + lon_name = 'y' + else: + lat_name = 'lat' + lon_name = 'lon' + try: + if nc_in.dimensions[lat_name].size * nc_in.dimensions[lon_name].size != self.grid.full_shape[-2] * \ + self.grid.full_shape[-1]: + settings.write_log('ERROR: Check the .err file to get more info.') + if settings.rank == 0: + raise IOError('ERROR: The temporal gridded profile {0} '.format(profile_path) + + 'is not in the destiny resolution like {0}.'.format(self.grid.coords_netcdf_file)) + sys.exit(1) + + except KeyError: + if nc_in.dimensions['latitude'].size * nc_in.dimensions['longitude'].size != self.grid.full_shape[-2] * \ + self.grid.full_shape[-1]: + settings.write_log('ERROR: Check the .err file to get more info.') + if settings.rank == 0: + raise IOError('ERROR: The temporal gridded profile {0} '.format(profile_path) + + 'is not in the destiny resolution like {0}.'.format(self.grid.coords_netcdf_file)) try: var = nc_in.variables[profile_value][:, self.grid.x_lower_bound:self.grid.x_upper_bound, diff --git a/hermesv3_gr/modules/vertical/__init__.py b/hermesv3_gr/modules/vertical/__init__.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/vertical/vertical.py b/hermesv3_gr/modules/vertical/vertical.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/vertical/vertical_gfas.py b/hermesv3_gr/modules/vertical/vertical_gfas.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/writing/__init__.py b/hermesv3_gr/modules/writing/__init__.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/writing/writer.py b/hermesv3_gr/modules/writing/writer.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/writing/writer_cmaq.py b/hermesv3_gr/modules/writing/writer_cmaq.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/writing/writer_monarch.py b/hermesv3_gr/modules/writing/writer_monarch.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/modules/writing/writer_wrf_chem.py b/hermesv3_gr/modules/writing/writer_wrf_chem.py old mode 100644 new mode 100755 index 5cf01cf0dd1cebf6cd8743b1eb1aa4bbd0d7f47d..968b8c792172e00503133794404ccbbff606d996 --- a/hermesv3_gr/modules/writing/writer_wrf_chem.py +++ b/hermesv3_gr/modules/writing/writer_wrf_chem.py @@ -91,13 +91,13 @@ class WriterWrfChem(Writer): break if Unit(units).symbol == Unit('mol.h-1.km-2').symbol: - # 10e6 -> from m2 to km2 - # 10e3 -> from kmol to mol - # 3600n -> from s to h - data = data * 10e6 * 10e3 * 3600 + # 10**6 -> from m2 to km2 + # 10**3 -> from kmol to mol + # 3600 -> from s to h + data = data * 10**6 * 10**3 * 3600 elif Unit(units).symbol == Unit('ug.s-1.m-2').symbol: - # 10e9 -> from kg to ug - data = data * 10e9 + # 10**9 -> from kg to ug + data = data * 10**9 else: settings.write_log('ERROR: Check the .err file to get more info.') if settings.rank == 0: diff --git a/hermesv3_gr/tools/__init__.py b/hermesv3_gr/tools/__init__.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/tools/coordinates_tools.py b/hermesv3_gr/tools/coordinates_tools.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/tools/custom_calendar.py b/hermesv3_gr/tools/custom_calendar.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/tools/download_benchmark.py b/hermesv3_gr/tools/download_benchmark.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/tools/netcdf_tools.py b/hermesv3_gr/tools/netcdf_tools.py old mode 100644 new mode 100755 diff --git a/hermesv3_gr/tools/sample_files.py b/hermesv3_gr/tools/sample_files.py old mode 100644 new mode 100755 diff --git a/preproc/GFAS_Parameters.csv b/preproc/GFAS_Parameters.csv old mode 100644 new mode 100755 diff --git a/preproc/GFAS_hourly_Parameters.csv b/preproc/GFAS_hourly_Parameters.csv old mode 100644 new mode 100755 diff --git a/preproc/NMVOC_split_for_CAMS-REG-v2_2_melt.csv b/preproc/NMVOC_split_for_CAMS-REG-v2_2_melt.csv old mode 100644 new mode 100755 diff --git a/preproc/PM_split_for_CAMS-REG-v2_2.csv b/preproc/PM_split_for_CAMS-REG-v2_2.csv old mode 100644 new mode 100755 diff --git a/preproc/VOC_split_AIR.csv b/preproc/VOC_split_AIR.csv old mode 100644 new mode 100755 diff --git a/preproc/VOC_split_SHIP.csv b/preproc/VOC_split_SHIP.csv old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc01.nc b/preproc/nmvoc/ratio_voc01.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc02.nc b/preproc/nmvoc/ratio_voc02.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc03.nc b/preproc/nmvoc/ratio_voc03.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc04.nc b/preproc/nmvoc/ratio_voc04.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc05.nc b/preproc/nmvoc/ratio_voc05.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc06.nc b/preproc/nmvoc/ratio_voc06.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc07.nc b/preproc/nmvoc/ratio_voc07.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc08.nc b/preproc/nmvoc/ratio_voc08.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc09.nc b/preproc/nmvoc/ratio_voc09.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc12.nc b/preproc/nmvoc/ratio_voc12.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc13.nc b/preproc/nmvoc/ratio_voc13.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc14.nc b/preproc/nmvoc/ratio_voc14.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc15.nc b/preproc/nmvoc/ratio_voc15.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc16.nc b/preproc/nmvoc/ratio_voc16.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc17.nc b/preproc/nmvoc/ratio_voc17.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc18.nc b/preproc/nmvoc/ratio_voc18.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc19.nc b/preproc/nmvoc/ratio_voc19.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc20.nc b/preproc/nmvoc/ratio_voc20.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc21.nc b/preproc/nmvoc/ratio_voc21.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc22.nc b/preproc/nmvoc/ratio_voc22.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc23.nc b/preproc/nmvoc/ratio_voc23.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc24.nc b/preproc/nmvoc/ratio_voc24.nc old mode 100644 new mode 100755 diff --git a/preproc/nmvoc/ratio_voc25.nc b/preproc/nmvoc/ratio_voc25.nc old mode 100644 new mode 100755 diff --git a/run_test.py b/run_test.py old mode 100644 new mode 100755 diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 diff --git a/tests/__init__.py b/tests/__init__.py old mode 100644 new mode 100755 diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py old mode 100644 new mode 100755 diff --git a/tests/unit/test_lint.py b/tests/unit/test_lint.py old mode 100644 new mode 100755 diff --git a/tests/unit/test_temporal.py b/tests/unit/test_temporal.py old mode 100644 new mode 100755