nasa / cape

Computational Aerosciences Productivity & Execution
Other
22 stars 9 forks source link

Project Name Issue When Using Hooks #28

Open rbreslavsky opened 10 months ago

rbreslavsky commented 10 months ago

When using CAPE and pyfun, I prefer not to use a template fun3d.nml. This actually works quite well, as I can use Python "hooks" to populate the entire FUN3D namelist file for a given simulation / case. However, I've had some difficulty pertaining to the project_rootname field in the &project namelist. I've tried to define it in my namelist Python hook, but it keeps getting overwritten such that project_rootname = "pyfun". Is this a bug?

nasa-ddalle commented 10 months ago

In this case, you could call this a bug, but it would take some thought to fix it. The reason is that pyfun needs to know the project_rootname early in the process, and it's possible that your hooks haven't run yet when it needs that. (For example it writes mesh file names.)

I think you can work around this issue by putting this in your JSON file:

"Fun3D": {
    "project": {
        "project_rootname": "yourproject"
    }
}

You can set it to anything you want. If you want it to be different for different cases in the same run matrix, you can have your InitFunction hook set this value. But having it set in the JSON like this should fix the particular issue you're having.