atmoschem / EmissV

Create and processing emissions for numeric air quality models
https://atmoschem.github.io/EmissV/
Other
39 stars 10 forks source link

EmissV vulnerable to forthcoming changes in sp and rgdal #25

Closed rsbivand closed 4 years ago

rsbivand commented 5 years ago

Running revdep checks for current rgdal on R-Forge - see:

https://stat.ethz.ch/pipermail/r-sig-geo/2019-November/027801.html

shows the errors in the test failures below, related to use of PROJ&/GDAL3 and required changes to sp and rgdal. If useful find a regerence to a docker image in this thread:

https://github.com/r-spatial/discuss/issues/28

Changes will occur quite fast, and packages need to be prepared.


R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(testthat)
> library(EmissV)
> 
> test_check("EmissV")
using a example emission factor (values calculated from CETESB 2015):
                                      CO            PM
Light Duty Vehicles Gasohol  1.75 [g/km] 0.0013 [g/km]
Light Duty Vehicles Ethanol 10.04 [g/km] 0.0000 [g/km]
Light Duty Vehicles Flex     0.39 [g/km] 0.0010 [g/km]
Diesel Trucks                0.45 [g/km] 0.0612 [g/km]
Diesel Urban Busses          0.77 [g/km] 0.1052 [g/km]
Diesel Intercity Busses      1.48 [g/km] 0.1693 [g/km]
Gasohol Motorcycles          1.61 [g/km] 0.0000 [g/km]
Flex Motorcycles             0.75 [g/km] 0.0000 [g/km]
Emission factors:
                                      CO            PM
Light Duty Vehicles Gasohol  1.75 [g/km] 0.0013 [g/km]
Light Duty Vehicles Ethanol 10.04 [g/km] 0.0000 [g/km]
Light Duty Vehicles Flex     0.39 [g/km] 0.0010 [g/km]
Diesel Trucks                0.45 [g/km] 0.0612 [g/km]
Diesel Urban Busses          0.77 [g/km] 0.1052 [g/km]
Diesel Intercity Busses      1.48 [g/km] 0.1693 [g/km]
Gasohol Motorcycles          1.61 [g/km] 0.0000 [g/km]
Flex Motorcycles             0.75 [g/km] 0.0000 [g/km]
processing area ... 
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
fraction of area inside the domain = 0.955761973247402
── 1. Failure: emissions with source by area (@test-areaSource.R#4)  ───────────
areaSource(...) not equal to readRDS("data01.Rds").
Attributes: < Component "crs": Attributes: < Names: 1 string mismatch > >
Attributes: < Component "crs": Attributes: < Length mismatch: comparison on first 2 components > >
Attributes: < Component "crs": Attributes: < Component 2: 1 string mismatch > >

processing Chururuba area ... 
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
fraction of Chururuba area inside the domain = 0.955761973247402
processing Juruzinha area ... 
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
Total of CO : 1676996.43578795 t year-1 
FISH not found in total !
FISH not found in total !
calculating emissions for CO as aerosol ...
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
Total of CO : 1676996.43578795 t year-1 
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
calculating emissions for CO using molar mass = 28 ...
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
reading emi_co (EDGAR) output unit is g m-2 s-1 ...
from edgar_co_test.nc x 1.00 
Using raster from inventory ...
Grid output: 99 columns 93 rows
reading emi_co (EDGAR) output unit is g m-2 s-1 ...
from edgar_co_test.nc x 1.00 
Using raster from inventory ...
Grid output: 99 columns 93 rows
Grid information from: vertical.nc 
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d03 
using length as emission variable
Number of lat points 51
Number of lon points 51
using length as emission variable
Number of lat points 51
Number of lon points 51
convective, h/L = -5.7372346528973 
using weil max= 31 
convective, h/L = -8.61326442721792 
strong convective, h/L = -16.3733115022513 
using weil max= 155 
strong convective, h/L = -33.003300330033 
using weil max= 217 
strong convective, h/L = -67.7966101694915 
strong convective, h/L = -79.3650793650794 
strong convective, h/L = -110.650069156293 
strong convective, h/L = -32.0056899004267 
stable, h/L = 200 - calm, U= 0.11 m/s 
stable, h/L = 200 - windy, U= 3.11 m/s 
neutral, h/L = 0.956937799043062 
* max iterations reached! 
Grid information from: vertical.nc 
Layer limits for grid position lat= -23.5803346633911 lon= -44.9668502807617 
  height= 0.00 m k= 1 
  height= 59.74 m k= 2 
  height= 145.50 m k= 3 
  height= 257.90 m k= 4 
  height= 397.87 m k= 5 
  height= 575.59 m k= 6 
  height= 802.06 m k= 7 
  height= 1070.66 m k= 8 
  height= 1532.39 m k= 9 
  height= 2014.39 m k= 10 
  height= 2519.01 m k= 11 
  height= 3049.04 m k= 12 
  height= 4035.38 m k= 13 
  height= 5020.68 m k= 14 
  height= 6005.89 m k= 15 
  height= 6992.68 m k= 16 
  height= 7982.44 m k= 17 
  height= 8976.27 m k= 18 
  height= 9968.42 m k= 19 
  height= 10957.52 m k= 20 
  height= 11941.38 m k= 21 
  height= 12920.99 m k= 22 
  height= 13908.15 m k= 23 
  height= 14879.66 m k= 24 
  height= 15842.59 m k= 25 
  height= 16803.16 m k= 26 
  height= 17760.40 m k= 27 
  height= 18715.93 m k= 28 
  height= 19676.74 m k= 29 
  height= 20649.44 m k= 30 
Emission heigh between 59.74 m and 145.50 m at k= 2 for z= 100
Layer limits for grid position lat= -23.5803346633911 lon= -44.9668502807617 
  height= 0.00 m k= 1 
  height= 59.74 m k= 2 
  height= 145.50 m k= 3 
  height= 257.90 m k= 4 
  height= 397.87 m k= 5 
  height= 575.59 m k= 6 
  height= 802.06 m k= 7 
  height= 1070.66 m k= 8 
  height= 1532.39 m k= 9 
  height= 2014.39 m k= 10 
  height= 2519.01 m k= 11 
  height= 3049.04 m k= 12 
  height= 4035.38 m k= 13 
  height= 5020.68 m k= 14 
  height= 6005.89 m k= 15 
  height= 6992.68 m k= 16 
  height= 7982.44 m k= 17 
  height= 8976.27 m k= 18 
  height= 9968.42 m k= 19 
  height= 10957.52 m k= 20 
  height= 11941.38 m k= 21 
  height= 12920.99 m k= 22 
  height= 13908.15 m k= 23 
  height= 14879.66 m k= 24 
  height= 15842.59 m k= 25 
  height= 16803.16 m k= 26 
  height= 17760.40 m k= 27 
  height= 18715.93 m k= 28 
  height= 19676.74 m k= 29 
  height= 20649.44 m k= 30 
Emission heigh between 802.06 m and 1070.66 m at k= 7 for z= 1000
Layer limits for grid position lat= -23.5196027755737 lon= -44.9668502807617 
  height= 0.00 m k= 1 
  height= 59.81 m k= 2 
  height= 145.61 m k= 3 
  height= 257.97 m k= 4 
  height= 397.90 m k= 5 
  height= 575.53 m k= 6 
  height= 801.97 m k= 7 
  height= 1070.70 m k= 8 
  height= 1532.64 m k= 9 
  height= 2014.67 m k= 10 
  height= 2519.25 m k= 11 
  height= 3049.28 m k= 12 
  height= 4035.69 m k= 13 
  height= 5020.84 m k= 14 
  height= 6005.95 m k= 15 
  height= 6993.00 m k= 16 
  height= 7982.73 m k= 17 
  height= 8976.44 m k= 18 
  height= 9968.59 m k= 19 
  height= 10957.95 m k= 20 
  height= 11942.11 m k= 21 
  height= 12921.73 m k= 22 
  height= 13908.66 m k= 23 
  height= 14880.00 m k= 24 
  height= 15842.81 m k= 25 
  height= 16803.23 m k= 26 
  height= 17760.21 m k= 27 
  height= 18715.41 m k= 28 
  height= 19675.99 m k= 29 
  height= 20648.63 m k= 30 
Emission heigh between 575.53 m and 801.97 m at k= 6 for z= 666
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
grid position lat= -22.010806627171 lon= -46.0152584808041 
grid position lat= -22.010806627171 lon= -47.9944115841027 
grid position lat= -23.4723500487625 lon= -47.0048350324534 
Grid information from: vertical.nc 
Grid output: 4 columns 4 rows 30 levels
Grid information from: vertical.nc 
Grid output: 4 columns 4 rows 30 levels
reading emi_co (EDGAR) output unit is g m-2 s-1 ...
from edgar_co_test.nc x 1.00 
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
                             Category   Type Fuel        Use       SP      RJ
Light Duty Vehicles Gasohol   LDV_E25    LDV  E25  41 [km/d] 11624342 2712343
Light Duty Vehicles Ethanol  LDV_E100    LDV E100  41 [km/d]   874627  204079
Light Duty Vehicles Flex        LDV_F    LDV FLEX  41 [km/d]  9845022 2297169
Diesel Trucks               TRUCKS_B5 TRUCKS   B5 110 [km/d]   710634  165814
Diesel Urban Busses           CBUS_B5    BUS   B5 165 [km/d]   792630  184947
Diesel Intercity Busses       MBUS_B5    BUS   B5 165 [km/d]    21865    5101
Gasohol Motorcycles          MOTO_E25   MOTO  E25 140 [km/d]  3227921  753180
Flex Motorcycles               MOTO_F   MOTO FLEX 140 [km/d]   235056   54846
                                 MG      PR      SC
Light Duty Vehicles Gasohol 4371228 3036828 2029599
Light Duty Vehicles Ethanol  328895  228494  152709
Light Duty Vehicles Flex    3702131 2571986 1718932
Diesel Trucks                267227  185651  124076
Diesel Urban Busses          298061  207072  138392
Diesel Intercity Busses        8222    5712    3817
Gasohol Motorcycles         1213830  843285  563592
Flex Motorcycles              88390   61407   41040
using a example emission factor (values calculated from CETESB 2015):
                                      CO            PM
Light Duty Vehicles Gasohol  1.75 [g/km] 0.0013 [g/km]
Light Duty Vehicles Ethanol 10.04 [g/km] 0.0000 [g/km]
Light Duty Vehicles Flex     0.39 [g/km] 0.0010 [g/km]
Diesel Trucks                0.45 [g/km] 0.0612 [g/km]
Diesel Urban Busses          0.77 [g/km] 0.1052 [g/km]
Diesel Intercity Busses      1.48 [g/km] 0.1693 [g/km]
Gasohol Motorcycles          1.61 [g/km] 0.0000 [g/km]
Flex Motorcycles             0.75 [g/km] 0.0000 [g/km]
Total of PM : 15071.8124616163 t year-1 
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
FISH not found in emission factor!
The emissions factors contains:
CO
 PM
function totalVOC will be discontinued in the next versions
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
Total COV: 2703251.58732021 t year-1 
xyl 262330984930.355 MOL year-1 
function totalVOC will be discontinued in the next versions
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
a is not in suported COV speciation
The specie list contains:
eth hc3 hc5 hc8 ol2 olt oli iso tol xyl ket ch3oh ald 
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
                             Category   Type Fuel        Use       SP      RJ
Light Duty Vehicles Gasohol   LDV_E25    LDV  E25  41 [km/d] 11624342 2712343
Light Duty Vehicles Ethanol  LDV_E100    LDV E100  41 [km/d]   874627  204079
Light Duty Vehicles Flex        LDV_F    LDV FLEX  41 [km/d]  9845022 2297169
Diesel Trucks               TRUCKS_B5 TRUCKS   B5 110 [km/d]   710634  165814
Diesel Urban Busses           CBUS_B5    BUS   B5 165 [km/d]   792630  184947
Diesel Intercity Busses       MBUS_B5    BUS   B5 165 [km/d]    21865    5101
Gasohol Motorcycles          MOTO_E25   MOTO  E25 140 [km/d]  3227921  753180
Flex Motorcycles               MOTO_F   MOTO FLEX 140 [km/d]   235056   54846
                                 MG      PR      SC
Light Duty Vehicles Gasohol 4371228 3036828 2029599
Light Duty Vehicles Ethanol  328895  228494  152709
Light Duty Vehicles Flex    3702131 2571986 1718932
Diesel Trucks                267227  185651  124076
Diesel Urban Busses          298061  207072  138392
Diesel Intercity Busses        8222    5712    3817
Gasohol Motorcycles         1213830  843285  563592
Flex Motorcycles              88390   61407   41040
vehicles:
  Category Type Fuel       Use       SP
1       B5  LDV   NA 41 [km/d] 27332097
══ testthat results  ═══════════════════════════════════════════════════════════
[ OK: 21 | SKIPPED: 0 | WARNINGS: 72 | FAILED: 1 ]
1. Failure: emissions with source by area (@test-areaSource.R#4) 

Error: testthat unit tests failed
Execution halted
rsbivand commented 4 years ago

Error still:

* checking tests ... ERROR
  Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
  Light Duty Vehicles Flex    3702131 2571986 1718932
  Diesel Trucks                267227  185651  124076
  Diesel Urban Busses          298061  207072  138392
  Diesel Intercity Busses        8222    5712    3817
  Gasohol Motorcycles         1213830  843285  563592
  Flex Motorcycles              88390   61407   41040
  vehicles:
    Category Type Fuel       Use       SP
  1       B5  LDV   NA 41 [km/d] 27332097
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 21 | SKIPPED: 0 | WARNINGS: 72 | FAILED: 1 ]
  1. Failure: emissions with source by area (@test-areaSource.R#4) 

  Error: testthat unit tests failed
  Execution halted

Release of rgdal soon, please address ASAP

Schuch666 commented 4 years ago

Hi @rsbivand

I disable the first part of this test for now (I don't have this version of gdal/proj on this computer to replace this file night now), In the future I will replace this file and enable this test.

Can you run a test with the GitHub current version or do I need to upload a new version to CRAN?

Thank you

rsbivand commented 4 years ago

Please attach a built source package either to this issue or by email to roger.bivand@nhh.no.

Roger Bivand Falsensvei 32 5063 Bergen

tir. 31. mar. 2020, 21.43 skrev Daniel Schuch notifications@github.com:

Hi @rsbivand https://github.com/rsbivand

I disable the first part of this test for now (I don't have this version of gdal/proj on this computer to replace this file night now), In the future I will replace this file and enable this test.

Can you run a test with the GitHub current version or do I need to upload a new version to CRAN?

Thank you

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/atmoschem/EmissV/issues/25#issuecomment-606834596, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNZ3BDNP2NRMTCGZR2R7S3RKJBV3ANCNFSM4JOF3LUA .

Schuch666 commented 4 years ago

@rsbivand sent for you email

rsbivand commented 4 years ago

The tarball you sent has just 2 notes, no error for me on the same system that threw the error yesterday. Thanks for responding quickly! Before submitting to CRAN, check locally too on your platform, and increment the version number, please.