19 Troubleshooting and Debugging PEcAn
19.0.2 Warning: mkdir() [function.mkdir]: No such file or directory
If you are seeing: Warning: mkdir() [function.mkdir]: No such file or directory in /path/to/pecan/web/runpecan.php at line 169
it is because you have used a relative path for $output_folder in system.php.
19.0.3 After creating a new PFT the tag for PFT not passed to config.xml in ED
This is a result of the rather clunky way we currently have adding PFTs to PEcAn. This is happening because you need to edit the ./pecan/models/ed/data/pftmapping.csv file to include your new PFTs.
This is what the file looks like:
PEcAn;ED
ebifarm.acru;11
ebifarm.acsa3;11
...
You just need to edit this file (in a text editor, no Excel) and add your PFT names and associated number to the end of the file. Once you do this, recompile PEcAn and it should then work for you. We currently need to reference this file in order to properly set the PFT number and maintain internal consistency between PEcAn and ED2.
19.1 Debugging
How to identify the source of a problem.
19.1.1 Using tests/workflow.R
This script, along with model-specific settings files in the tests
folder, provide a working example. From inside the tests folder, R CMD --vanilla -- --settings pecan.<model>.xml < workflow.R
should work.
The next step is to add debugonce(<broken.function.name>)
before running the test workflow.
This allows you can step through the function and evaluate the different objects as they are created and/or transformed.
See tests README for more information.
19.1.2 Useful scripts
The following scripts (in qaqc/vignettes
identify, respectively:
- relationships among functions across packages
- function inputs and outputs (e.g. that will identify which functions and outputs are used in a workflow).