Skip to content

Commit

Permalink
Patched FMS2-branch to work with FMS1
Browse files Browse the repository at this point in the history
- Added missing #ifdef to avoid compilation errors when using an older FMS
- Changed "use_deprecated_io" to "USE_FMS2_IO"
  - The word "deprecated" has a limited lifetime (consider what to use when
    FMS2 is replaced).
  - Backwards compatibility requires that no macros are needed to use
    FMS1. That is, the new stuff can use -DUSE_FMS2_IO but the old stuff
    should not be require any changes.
  • Loading branch information
adcroft committed Jun 26, 2023
1 parent c292450 commit c17de02
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/icebergs_fms2io.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
!> Handles reading/writing of restart files and trajectory-based diagnostic files
module ice_bergs_fms2io
#ifdef USE_FMS2_IO

! This file is part of NOAA-GFDL/icebergs. See LICENSE.md for the license.

Expand Down Expand Up @@ -2765,4 +2766,5 @@ subroutine register_axis_wrapper(fileobj)
enddo
end subroutine register_axis_wrapper

#endif
end module
4 changes: 3 additions & 1 deletion src/icebergs_fmsio.F90
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
!> Handles reading/writing of restart files and trajectory-based diagnostic files
module ice_bergs_fmsio
#ifdef use_depreciated_io
#ifndef USE_FMS2_IO

! This file is part of NOAA-GFDL/icebergs. See LICENSE.md for the license.

use mpp_domains_mod, only: domain2D
Expand Down Expand Up @@ -2492,5 +2493,6 @@ logical function find_restart_file(filename, actual_file, multiPErestart, tile_i
multiPErestart=.false.

end function find_restart_file

#endif
end module
2 changes: 1 addition & 1 deletion src/icebergs_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module ice_bergs_io
! This file is part of NOAA-GFDL/icebergs. See LICENSE.md for the license.

#ifdef use_depreciated_io
#ifndef USE_FMS2_IO
use ice_bergs_fmsio
#else
use ice_bergs_fms2io
Expand Down

0 comments on commit c17de02

Please sign in to comment.