JGCRI / gcam-core

GCAM -- The Global Change Analysis Model
http://jgcri.github.io/gcam-doc/
Other
263 stars 159 forks source link

driver_drake() running failure #375

Closed Youyi77 closed 5 months ago

Youyi77 commented 5 months ago

Hi everyone! I am new to the GCAM. While I was running driver_drake()for the first time, I encountered this error message. I didn't change anything in the background. Really appreciate any help. I have been stuck here for a while. 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 i Consider drake::r_make() to improve robustness. 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 In addition: Warning message: package ‘drake’ was built under R version 4.1.3

Thanks!!!!

enlochner commented 5 months ago

Yes, this is a bug. You should be able to fix it by changing lines 540-541 to

mutate(input.cost = if_else(resource == "coal" & region %in% L210.low_reg, 0, input.cost),
       input.cost = if_else(resource == "coal" & region %in% L210.high_reg, 10 * input.cost, input.cost)) %>%

(Switching environCost to input.cost) in zenergy_L210.resources.R

Youyi77 commented 5 months ago

Thanks so much! That works :)