Skip to content

Commit

Permalink
Remove MAPL_MODE ifdefs in fms_io. Cmake change
Browse files Browse the repository at this point in the history
Use OVERLOAD_R8 when compiling R4. This was suggested by FMS:

NOAA-GFDL#165
  • Loading branch information
mathomp4 committed Feb 10, 2020
1 parent 9b54855 commit 6a15588
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ file (COPY include/file_version.h DESTINATION ${include_${this}})

# Various compiler options and CPP definitions ...
target_compile_definitions (${lib} PRIVATE OVERLOAD_R4 MAPL_MODE SPMD use_libMPI use_netCDF PORTABLE_KINDS)
if (precision MATCHES "r4")
target_compile_definitions (${lib} PRIVATE OVERLOAD_R8)
endif ()

if (APPLE)
target_compile_definitions(${lib} PRIVATE __APPLE__)
Expand Down
4 changes: 0 additions & 4 deletions fms/fms_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3274,14 +3274,12 @@ subroutine save_default_restart(fileObj,restartpath)
else if( Associated(fileObj%p3dr(k,j)%p) ) then
call mpp_write(unit, cur_var%field, array_domain(cur_var%domain_idx), fileObj%p3dr(k,j)%p, tlev, &
default_data=cur_var%default_data)
#ifndef MAPL_MODE
else if( Associated(fileObj%p2dr8(k,j)%p) ) then
call mpp_write(unit, cur_var%field, array_domain(cur_var%domain_idx), fileObj%p2dr8(k,j)%p, tlev_r8, &
default_data=real(cur_var%default_data,kind=DOUBLE_KIND))
else if( Associated(fileObj%p3dr8(k,j)%p) ) then
call mpp_write(unit, cur_var%field, array_domain(cur_var%domain_idx), fileObj%p3dr8(k,j)%p, tlev_r8, &
default_data=real(cur_var%default_data,kind=DOUBLE_KIND))
#endif
else if( Associated(fileObj%p4dr(k,j)%p) ) then
call mpp_write(unit, cur_var%field, array_domain(cur_var%domain_idx), fileObj%p4dr(k,j)%p, tlev, &
default_data=cur_var%default_data)
Expand Down Expand Up @@ -4090,7 +4088,6 @@ subroutine restore_state_all(fileObj, directory, nonfatal_missing_files)
call mpp_read(unit(n), fields(l), array_domain(domain_idx), fileObj%p3dr(k,j)%p, tlev)
if ( is_there_a_checksum ) &
checksum_data = mpp_chksum(fileObj%p3dr(k,j)%p(cur_var%is:cur_var%is+iadd,cur_var%js:cur_var%js+jadd, :) )
#ifndef MAPL_MODE
else if( Associated(fileObj%p2dr8(k,j)%p) ) then
call mpp_read(unit(n), fields(l), array_domain(domain_idx), fileObj%p2dr8(k,j)%p, tlev)
if ( is_there_a_checksum ) &
Expand All @@ -4099,7 +4096,6 @@ subroutine restore_state_all(fileObj, directory, nonfatal_missing_files)
call mpp_read(unit(n), fields(l), array_domain(domain_idx), fileObj%p3dr8(k,j)%p, tlev)
if ( is_there_a_checksum ) &
checksum_data = mpp_chksum(fileObj%p3dr8(k,j)%p(cur_var%is:cur_var%is+iadd,cur_var%js:cur_var%js+jadd, :) )
#endif
else if( Associated(fileObj%p4dr(k,j)%p) ) then
call mpp_read(unit(n), fields(l), array_domain(domain_idx), fileObj%p4dr(k,j)%p, tlev)
if ( is_there_a_checksum ) &
Expand Down

0 comments on commit 6a15588

Please sign in to comment.