Skip to content

Conversation

@tyiop794
Copy link
Collaborator

@tyiop794 tyiop794 commented Oct 17, 2025

Description:

DART prints the version (retrieved using 'git describe --dirty --tags') when it is run.

Fixes issue

fixes #747

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Documentation changes needed?

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

Tests

Please describe any tests you ran to verify your changes.

I have run the filter program multiple times. However, the tags do not seem to have transferred over to my fork, so in my case DART only prints 'unknown'. I'm still not sure how I would transfer those tags over.

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Update conf.py

Checklist for release

  • Merge into main
  • Create release from the main branch with appropriate tag
  • Delete feature-branch

Testing Datasets

  • Dataset needed for testing available upon request
  • Dataset download instructions included
  • No dataset needed

@tyiop794
Copy link
Collaborator Author

I'm struggling to get the CI build checks to pass, which is strange because it builds on my machine fine. It looks like it's unable to find the file containing the function that prints the version?

@hkershaw-brown
Copy link
Member

Thanks @tyiop794! It might be a week or two before we look at this because there are several pull requests in the queue.

@hkershaw-brown
Copy link
Member

Backed up this branch here: https://github.com/hkershaw-brown/DART/tree/747-dart-version
About to squash the history in this pull request.

@hkershaw-brown
Copy link
Member

Hi Kamil, this is nice.

There are a couple of things:
The bash version function dartversion() is duplicated, and would also need to be duplicated in buildconvfunctions.sh (functions to build observation converters). The buildconv and buildfunctions source buildpreprocess.sh so I believe the dartversion only needs to be defined in buildpreprocess.sh - I will go ahead and do this to convince myself that this is correct.

Currently this is collecting all .F90 files in the repo. There is a single .F90 in the GSI converter that gets preprocessed with its own cpp flags.

# run the c preprocessor on enkf/kinds.F90
\rm -f ../enkf/mykinds.f90
cpp -P -D_REAL8_ -traditional-cpp ../enkf/kinds.F90 > ../enkf/mykinds.f90

I actually think we should collect all .F90 files (see #696) but I am thinking for this pull request, we should be conservative add the single file version_mod.F90 to the list of source files. That way if people are making use of there own .F90 to .f90 we do not break their builds.

Cheers,
Helen

@hkershaw-brown
Copy link
Member

hkershaw-brown commented Dec 29, 2025

Also mkmf has the svn $Id$ which is from when DART was using svn for version control not git.

my $version = '$Id$ ';

so the Makefile created has this on the first line;

  1 # Makefile created by mkmf $Id$ 
  2 
  3 include /Users/hkershaw/DART/pull_requests/pull_983/build_templates/mkmf.template
  4 CPPDEFS = -DDART_VERSION="'v11.19.1-1-ga74da6ec0-dirty'"
  5 
  6 .DEFAULT:

I wonder if we can use opt_c to set the version in the Makefile.

@hkershaw-brown
Copy link
Member

@hkershaw-brown todo run build everything on this pull request.

Copy link
Member

@hkershaw-brown hkershaw-brown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super helpful Kamil, thanks for working on this!
Finally got to reviewing it, Approved!

@hkershaw-brown hkershaw-brown added the release! bundle with next release label Dec 30, 2025
tyiop794 and others added 7 commits December 31, 2025 12:08
quickbuild.sh scripts all call buildpreprocess
  -> dartversion
But added call to dartversion in buildXfunctions in
case for some reason people comment out the buildpreprocess
call.
rather than collecting all .F90 files.
see https://github.com/NCAR/DART/pull/983/changes#r2653506219
and NCAR#696. Probably should collect all .F90 files, but currently
there are .F90 clm source mods (not compiled into dart) and GSI files
(with there own preprocessing options).
More descriptive that it is the version that is unknown rather than
"Program Filter unknown"
@hkershaw-brown hkershaw-brown merged commit c3124bc into NCAR:main Dec 31, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release! bundle with next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: version of DART recorded in the log file

2 participants