Skip to content

Commit

Permalink
chore: add fms_io/mpp_io deprecation warning (#1609)
Browse files Browse the repository at this point in the history
  • Loading branch information
uramirez8707 authored Nov 7, 2024
1 parent 7a73eaa commit 644cbd3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ if(WITH_YAML)
endif()

if(USE_DEPRECATED_IO)
message( WARNING "fms_io WILL BE DEPRECATED IN A FUTURE RELEASE. PLEASE UPDATE TO USE FMS2_IO AND REMOVE "
"-DUSE_DEPRECATED_IO=on FROM YOUR OPTIONS")
list(APPEND fms_defs use_deprecated_io)
endif()

Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -537,3 +537,7 @@ AC_CONFIG_FILES([
])

AC_OUTPUT()

if test $enable_deprecated_io = yes; then
AC_MSG_WARN(FMS_IO WILL BE DEPRECATED IN A FUTURE RLEASE. PLEASE UPDATE TO USE FMS2_IO AND REMOVE --enable-deprecated-io FROM YOUR CONFIGURE OPTIONS)
fi
10 changes: 10 additions & 0 deletions fms/fms_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,11 @@ subroutine fms_io_init()
call mpp_error(FATAL,'=>fms_io_init: Error reading input nml file')
endif

call mpp_error(NOTE, "fms_io_init: fms_io WILL BE DEPRECATED IN A FUTURE RELEASE! "//&
"PLEASE REMOVE -Duse_deprecated_io FROM YOUR COMPILE FLAGS "// &
"AND MOVE TO FMS2_IO. CONTACT YOUR MODEL LIASISON IF YOU NEED "// &
"ASSISTANCE")

! take namelist options if present
! read_data_bug is no longer supported.
if (read_data_bug) then
Expand Down Expand Up @@ -802,6 +807,11 @@ subroutine fms_io_exit()

if( .NOT.module_is_initialized )return !make sure it's only called once per PE

call mpp_error(NOTE, "fms_io_exit: fms_io WILL BE DEPRECATED IN A FUTURE RELEASE! "//&
"PLEASE REMOVE -Duse_deprecated_io FROM YOUR COMPILE FLAGS "// &
"AND MOVE TO FMS2_IO. CONTACT YOUR MODEL LIASISON IF YOU NEED "// &
"ASSISTANCE")

do i=1,max_axis_size
axisdata(i) = i
enddo
Expand Down
1 change: 1 addition & 0 deletions test_fms/mpp/test_stdlog.F90
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ subroutine check_write()
if (trim(line) == '') cycle
!! if we're testing with the old io enabled, we'll have some additional output we can skip
if (trim(line) == 'NOTE from PE 0: MPP_IO_SET_STACK_SIZE: stack size set to 131072.') cycle
if (index(trim(line), "fms_io") .ne. 0) cycle
if(trim(line) .ne. trim(ref_line(ref_num))) call mpp_error(FATAL, "warnfile output does not match reference data"&
//"reference line:"//ref_line(ref_num) &
//"output line:"//line)
Expand Down

0 comments on commit 644cbd3

Please sign in to comment.