JGCRI / gcamdata

The GCAM data system
https://jgcri.github.io/gcamdata/
Other
44 stars 26 forks source link

driver_drake() first-time ran failure #1252

Closed Youyi77 closed 8 months ago

Youyi77 commented 10 months ago

Hi everyone! I am new to GCAM. While I was running driver_drake() for the first time, I encountered this error: I didn't change any background data. Not sure how to debug this. Thank you!

driver_drake() GCAM Data System v5.1 Found 430 chunks Found 4383 chunk data requirements Found 2458 chunk data products 1487 chunk data input(s) not accounted for target module_energy_L210.resources x fail module_energy_L210.resources Error: target module_energy_L210.resources failed. diagnose(module_energy_L210.resources)$error$message: In argument: environCost = if_else(resource == "coal" & region %in% L210.low_reg, 0, environCost). diagnose(module_energy_L210.resources)$error$calls: gcamdata:::module_energy_L210.resources("MAKE", c(common.GCAM_region_names, energy.A_regions, energy.A10.rsrc_info, energy.A10.subrsrc_info, energy.A10.TechChange, energy.A10.TechChange_SSPs, energy.A10.EnvironCost_SSPs, energy.A15.roofPV_TechChange, energy.A10.ResSubresourceProdLifetime, energy.A10.SubresourcePriceAdder, energy.A10.ResReserveTechLifetime, energy.A10.ResReserveTechDeclinePhase, energy.A10.ResReserveTechProfitShutdown, energy.A21.globalrsrctech_cost, energy.A21.globalrsrctech_coef, L111.RsrcCurves_EJ_R_Ffos, L111.Prod_EJ_R_F_Yh, L112.RsrcCurves_Mt_R_U, L113.RsrcCurves_EJ_R_MSW, L114.RsrcCurves_EJ_R_wind, L115.RsrcCurves_EJ_R_roofPV, L116.RsrcCurves_EJ_R_geo, L116.RsrcC Called from: stop0(msg)

SoybeanMilk2016 commented 8 months ago

I've encountered a very similar issue. These issues all occur when running module_energy_L210.resources. I'm not sure if your bug and mine are the same, and the error message I received is:

[1] "module_energy_L210.resources" Error in mutate() at gcamdata/R/utils-data.R:32:3: i In argument: environCost = if_else(resource == "coal" & region %in% L210.low_reg, 0, environCost). Caused by error in if_else(): ! false must be a vector, not NULL. Run rlang::last_trace() to see where the error occurred.

pkyle commented 8 months ago

I think this will be fixed if you follow the steps listed here: https://github.com/JGCRI/gcamdata/issues/1242#issuecomment-1585424652 The specific commit that fixes this environCost error in module_energy_L210.resources is 1d25fbc (note that this isn't the topic of discussion in the linked issue/comment, but the fix to this issue is also contained in that branch on my forked repo)

Youyi77 commented 8 months ago

Echoing Page's point, here is another way to solve it! https://github.com/JGCRI/gcamdata/issues/1252#issuecomment-2016338207