capgen currently always overwrites all generated code (caps, ccpp_kinds.F90). By default, it should only overwrite an existing file if that file has been modified. Here is the proposed solution.
- Generate all files to a temporary directory (e.g., if the capgen directory is ccpp, generate into ccpp_tmp).
- Only copy files from the temporary directory if they do not exist in the configured destination or have changed.
- Remove the temporary directory.
In addition, capgen will have a new switch, --force, which reproduces the current behavior (i.e., regnerate all files). This could be implemented as first removing the existing directory or by specifying that the temporary directory is the same as the existing directory (my preference as it would not overwrite anything unless the analysis phase is successful).
capgen currently always overwrites all generated code (caps, ccpp_kinds.F90). By default, it should only overwrite an existing file if that file has been modified. Here is the proposed solution.
In addition, capgen will have a new switch,
--force, which reproduces the current behavior (i.e., regnerate all files). This could be implemented as first removing the existing directory or by specifying that the temporary directory is the same as the existing directory (my preference as it would not overwrite anything unless the analysis phase is successful).