diff --git a/CMakeLists.txt b/CMakeLists.txt index 427f38a42e..d30bc06011 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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__) diff --git a/fms/fms_io.F90 b/fms/fms_io.F90 index fee9836f56..d7a6250e0f 100644 --- a/fms/fms_io.F90 +++ b/fms/fms_io.F90 @@ -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) @@ -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 ) & @@ -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 ) &