Version information for each FVS variant is currently hardcoded with strings in vbase/revise.f. Each time a version is updated, these strings must be manually updated or find-replaced. The version strings also differ from the pattern for release tags used in this repo, raising potential for confusion about which version pattern is authoritative or what it refers to.
I wanted to see if you would consider a submission of a PR (to the dev branch, following the posted contribution guidelines) that would allow for the population of Fortran parameters related to versioning that could be specified as build-time arguments such as -DFVS_VERSIONTAG=FS2026.2 and -DFVS_VERSIONDATE=20260401. The desired end-state would allow for FVS to report its version and related info in a couple ways, and for these input parameters to be easily generated in an automated build workflow (e.g., results of git ... commands)
- As a command-line tool:
Update main.f to check if version or build-info args are passed and provide these outputs based on control flow to return early and not ask for a keyfile to run.
$ FVSpn --version
FS2025.4c (USDAForestService)
and a more detailed option
$ FVSpn --build-info
Version: FS2025.4c
Org: USDAForestService
Remote: https://github.com/USDAForestService/ForestVegetationSimulator
Branch: main
Commit: abd132
Date: 20250930
- As new subroutines following the pattern of the FVS API which could be picked up by
rFVS, fvs2py, and pyfvs wrappers.
This could be placed in a new base/version.f which would include an FVSVERSION module that would establish all the placeholders for these build-time attributes (version, org name, repo, branch, commit hash, and date), define subroutines for fvsGetVersion and fvsGetBuildInfo and C wrappers as needed for rFVS like fvsGetVersionC and fvsGetBuildInfoC.
To minimize disruption to existing patterns that call revise.f, we could just update that file to USE FVSVERSION so that it depends on the new module, and then to retrieve the FVS_VERSIONDATE parameter if you wanted to retain the existing pattern in outfiles, etc. It would also be an option to incorporate additional or different build info into these plain text outputs if desired. The revise.f would be simplified significantly (no more SELECT CASE block).
I'd expect the PR to demonstrate a successful build on Windows and Linux with updates as necessary to the bin/makefile and the input file lists for each variant, and that CLI and wrapper API could also be demonstrated to work as expected.
Version information for each FVS variant is currently hardcoded with strings in
vbase/revise.f. Each time a version is updated, these strings must be manually updated or find-replaced. The version strings also differ from the pattern for release tags used in this repo, raising potential for confusion about which version pattern is authoritative or what it refers to.I wanted to see if you would consider a submission of a PR (to the
devbranch, following the posted contribution guidelines) that would allow for the population of Fortran parameters related to versioning that could be specified as build-time arguments such as-DFVS_VERSIONTAG=FS2026.2and-DFVS_VERSIONDATE=20260401. The desired end-state would allow for FVS to report its version and related info in a couple ways, and for these input parameters to be easily generated in an automated build workflow (e.g., results ofgit ...commands)Update
main.fto check ifversionorbuild-infoargs are passed and provide these outputs based on control flow to return early and not ask for a keyfile to run.and a more detailed option
rFVS,fvs2py, andpyfvswrappers.This could be placed in a new
base/version.fwhich would include anFVSVERSIONmodule that would establish all the placeholders for these build-time attributes (version, org name, repo, branch, commit hash, and date), define subroutines forfvsGetVersionandfvsGetBuildInfoand C wrappers as needed forrFVSlikefvsGetVersionCandfvsGetBuildInfoC.To minimize disruption to existing patterns that call
revise.f, we could just update that file toUSE FVSVERSIONso that it depends on the new module, and then to retrieve theFVS_VERSIONDATEparameter if you wanted to retain the existing pattern in outfiles, etc. It would also be an option to incorporate additional or different build info into these plain text outputs if desired. Therevise.fwould be simplified significantly (no moreSELECT CASEblock).I'd expect the PR to demonstrate a successful build on Windows and Linux with updates as necessary to the
bin/makefileand the input file lists for each variant, and that CLI and wrapper API could also be demonstrated to work as expected.