Skip to content

Commit

Permalink
Merge pull request NOAA-GFDL#5 from adcroft/solo-driver-clean
Browse files Browse the repository at this point in the history
docs: update CPP ifdef logic to set "file version"
  • Loading branch information
alex-huth authored Jan 5, 2023
2 parents 0d7db2a + 821a4c7 commit 2a69473
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/icebergs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ module ice_bergs
real, parameter :: Cd_iv=0.9 !< (Vertical) Drag coefficient between bergs and sea-ice
!TOM> no horizontal drag for sea ice! real, parameter :: Cd_ih=0.0012 !< (Horizontal) Drag coefficient between bergs and sea-ice

#ifdef _FILE_VERSION
character(len=128) :: version = _FILE_VERSION !< Version of file
#else
character(len=128) :: version = 'unknown' !< Version of file
#ifndef _FILE_VERSION
! Version of file provided can be set to git hash via a CPP macro but if not set we use 'unknown'
#define _FILE_VERSION 'unknown'
#endif
character(len=128) :: version = _FILE_VERSION !< Version of file

contains

Expand Down
9 changes: 4 additions & 5 deletions src/icebergs_framework.F90
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,11 @@ module ice_bergs_framework
!! \todo Remove when backward compatibility no longer needed
logical :: orig_read=.false.

!> Version of file provided by CPP macro (usually set to git hash)
#ifdef _FILE_VERSION
character(len=128) :: version = _FILE_VERSION !< Version of file
#else
character(len=128) :: version = 'unknown' !< Version of file
#ifndef _FILE_VERSION
! Version of file provided can be set to git hash via a CPP macro but if not set we use 'unknown'
#define _FILE_VERSION 'unknown'
#endif
character(len=128) :: version = _FILE_VERSION !< Version of file

!> Set a value in the buffer at position (counter,n) after incrementing counter
interface push_buffer_value
Expand Down
8 changes: 4 additions & 4 deletions src/icebergs_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ module ice_bergs_io
integer :: clock_trw,clock_trp
integer :: clock_btrw,clock_btrp !bond trajectories

#ifdef _FILE_VERSION
character(len=128) :: version = _FILE_VERSION
#else
character(len=128) :: version = 'unknown'
#ifndef _FILE_VERSION
! Version of file provided can be set to git hash via a CPP macro but if not set we use 'unknown'
#define _FILE_VERSION 'unknown'
#endif
character(len=128) :: version = _FILE_VERSION !< Version of file

contains

Expand Down

0 comments on commit 2a69473

Please sign in to comment.