Skip to content

Commit

Permalink
Add missing commits from MOM5 repo (#9)
Browse files Browse the repository at this point in the history
Add some cherry-picked commits that were mistakenly added directly to the subtree embedded FMS source in MOM5

* Fixed some double ifdef defined preprocessor directives
* Removed all preprocessor comment like labels
* Added MPI support for GCC >= 11
  • Loading branch information
aidanheerdegen authored Sep 9, 2024
1 parent 3bd2480 commit e2dc2f4
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion axis_utils/axis_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ program test
end program test


#endif /* test_axis_utils */
#endif



Expand Down
2 changes: 1 addition & 1 deletion exchange/test_xgrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -980,4 +980,4 @@ end program xgrid_test
module null_test_xgrid
end module

#endif /* test_mpp */
#endif
4 changes: 2 additions & 2 deletions memutils/memutils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ integer function hplen( hpalloc, hplargest, hpshrink, hpgrow, hpfirs
if( present(hplast ) )hplast = IHPSTAT(14) !Last word address
return
end function hplen
#endif /* _CRAY */
#endif

#ifdef _CRAYT90
integer function stklen( stkhiwm, stknumber, stktotal, stkmost, stkgrew, stkgtimes )
Expand All @@ -259,7 +259,7 @@ integer function stklen( stkhiwm, stknumber, stktotal, stkmost, stkgr
if( present(stkgtimes) )stkgtimes = istat(7) !#times stack grew
return
end function stklen
#endif /* _CRAYT90 */
#endif

!cache utilities: need to write version for other argument types
function get_l1_cache_line(a)
Expand Down
2 changes: 1 addition & 1 deletion mpp/include/mpp_io_write.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@
else
call mpp_error( FATAL, 'WRITE_ATTRIBUTE_NETCDF: one of rval, ival, cval must be present.' )
end if
#endif /* use_netCDF */
#endif
return
end subroutine write_attribute_netcdf

Expand Down
2 changes: 1 addition & 1 deletion mpp/include/mpp_update_domains2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -620,4 +620,4 @@

return
end subroutine MPP_UPDATE_DOMAINS_5D_V_
#endif /* VECTOR_FIELD_ */
#endif
2 changes: 1 addition & 1 deletion mpp/include/mpp_update_domains2D_ad.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,4 +417,4 @@
whalo, ehalo, shalo, nhalo, name, tile_count )
return
end subroutine MPP_UPDATE_DOMAINS_AD_5D_V_
#endif /* VECTOR_FIELD_ */
#endif
9 changes: 5 additions & 4 deletions mpp/mpp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,9 @@ module mpp_mod
use shmem_interface
#endif

#if defined(use_libMPI) && defined(sgi_mipspro)
#if defined(use_libMPI) && (defined(sgi_mipspro) || (__GNUC__ >= 11))
use mpi
#define MPI_IMPORTED 1
#endif

use mpp_parameter_mod, only : MPP_VERBOSE, MPP_DEBUG, ALL_PES, ANY_PE, NULL_PE
Expand Down Expand Up @@ -205,9 +206,9 @@ module mpp_mod
#include <mpp/shmem.fh>
#endif

#if defined(use_libMPI) && !defined(sgi_mipspro)
#if defined(use_libMPI) && !defined(MPI_IMPORTED)
#include <mpif.h>
!sgi_mipspro gets this from 'use mpi'
! !sgi_mipspro gets this from 'use mpi'
#endif

!--- public paramters -----------------------------------------------
Expand Down Expand Up @@ -1297,7 +1298,7 @@ module mpp_mod
!(t3e: fixed on 3.3 I believe)
integer, parameter :: MPI_INTEGER8=MPI_INTEGER
#endif
#endif /* use_libMPI */
#endif
#ifdef use_MPI_SMA
#include <mpp/shmem.fh>
integer :: pSync(SHMEM_BARRIER_SYNC_SIZE)
Expand Down
2 changes: 1 addition & 1 deletion mpp/mpp_parameter.F90
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ module mpp_parameter_mod
! combination with the flag parameter defined above to create a unique identifier for
! each Domain+flags combination. Therefore, the value of any flag must not exceed DOMAIN_ID_BASE.
! integer(LONG_KIND), parameter :: DOMAIN_ID_BASE=INT( 2**(4*LONG_KIND),KIND=LONG_KIND )
integer(LONG_KIND), parameter :: DOMAIN_ID_BASE=Z'0000000100000000' ! Workaround for 64bit init problem
integer(LONG_KIND), parameter :: DOMAIN_ID_BASE=INT(Z'0000000100000000', kind=LONG_KIND) ! Workaround for 64bit init problem
integer, parameter :: NON_BITWISE_EXACT_SUM=0
integer, parameter :: BITWISE_EXACT_SUM=1
integer, parameter :: BITWISE_EFP_SUM=2
Expand Down
2 changes: 1 addition & 1 deletion mpp/test_mpp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -543,4 +543,4 @@ end program test
module null_mpp_test
end module

#endif /* test_mpp */
#endif
2 changes: 1 addition & 1 deletion mpp/threadloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int find_nodenum(int mynodedev) {
int mld_id_() { /* dummy routine for portability */
return 0;
}
#endif /* sgi */
#endif

#ifdef test_threadloc
void main(int argc, char **argv) {
Expand Down

0 comments on commit e2dc2f4

Please sign in to comment.