femiguez / apsimx

R package for APSIM-X
https://femiguez.github.io/apsimx-docs/
45 stars 19 forks source link

the function 'edit_apsim_replace_soil_profile' get error #116

Closed zkwabm closed 1 year ago

zkwabm commented 1 year ago

Hi,

when running the function 'edit_apsim_replace_soil_profile' for a '.apsim' file by using:

edit_apsim_replace_soil_profile('Sugarcane.apsim',soil.profile = wanrong_spf,overwrite=TRUE)

I will get an error:

Error in edit_apsim(file = file, src.dir = src.dir, wrt.dir = ".", node = "Soil", : Don't really know how to do this yet

but when running the function 'edit_apsim_replace_soil_profile' for a '.apsimx' file by using

edit_apsimx_replace_soil_profile('Sugarcane.apsimx',soil.profile = wanrong_spf,overwrite=TRUE)

There is no problem.

Any ideas about how to solve the problem? Thank you!

femiguez commented 1 year ago

With APSIM Classic there is a bug which does not allow you to run it - through the command line - from a folder different from the current directory. I can't change that. So 'src.dir' has to be the current directory. This bug was fixed for APSIM Next Gen, that is why the second approach works.

femiguez commented 1 year ago

I'm closing this, but feel free to open a new issue if you have questions