From 5ee48250196ac2998ff0b054e838b17aea023532 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 15 Sep 2020 13:34:28 +0000 Subject: [PATCH] feature/mpi_abort Updates required for gnu compiler (from Dusan). Issues #140 #147. --- sorc/fre-nctools.fd/shared_lib/mpp_domain.c | 2 +- sorc/global_chgres.fd/CMakeLists.txt | 3 +++ sorc/global_cycle.fd/CMakeLists.txt | 3 +++ sorc/orog_mask_tools.fd/lake.fd/lakefrac.F90 | 15 +++++++++------ sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt | 3 +++ 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/sorc/fre-nctools.fd/shared_lib/mpp_domain.c b/sorc/fre-nctools.fd/shared_lib/mpp_domain.c index 3c8b6b1cb..ea51d5ec1 100644 --- a/sorc/fre-nctools.fd/shared_lib/mpp_domain.c +++ b/sorc/fre-nctools.fd/shared_lib/mpp_domain.c @@ -13,7 +13,7 @@ /*********************************************************** global variables ***********************************************************/ -int pe, npes, root_pe; +static int pe, npes, root_pe; #define MAX_BUFFER_SIZE 10000000 double rBuffer[MAX_BUFFER_SIZE]; double sBuffer[MAX_BUFFER_SIZE]; diff --git a/sorc/global_chgres.fd/CMakeLists.txt b/sorc/global_chgres.fd/CMakeLists.txt index dc62c1a7d..4c2133a35 100644 --- a/sorc/global_chgres.fd/CMakeLists.txt +++ b/sorc/global_chgres.fd/CMakeLists.txt @@ -16,6 +16,9 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -convert big_endian") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fconvert=big-endian") + if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch") + endif() endif() set(exe_name global_chgres) diff --git a/sorc/global_cycle.fd/CMakeLists.txt b/sorc/global_cycle.fd/CMakeLists.txt index d962bf79e..1b8e13973 100644 --- a/sorc/global_cycle.fd/CMakeLists.txt +++ b/sorc/global_cycle.fd/CMakeLists.txt @@ -9,6 +9,9 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -convert big_endian") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fconvert=big-endian") + if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch") + endif() endif() set(exe_name global_cycle) diff --git a/sorc/orog_mask_tools.fd/lake.fd/lakefrac.F90 b/sorc/orog_mask_tools.fd/lake.fd/lakefrac.F90 index 9673dacfb..2c243078b 100644 --- a/sorc/orog_mask_tools.fd/lake.fd/lakefrac.F90 +++ b/sorc/orog_mask_tools.fd/lake.fd/lakefrac.F90 @@ -272,11 +272,11 @@ SUBROUTINE cal_lake_frac_depth(lakestat,cs_lakestat,lakedpth,cs_lakedpth) ENDIF ENDIF #endif - IF (two_section == .false.) THEN + IF (two_section .EQV. .false.) THEN DO i = src_grid_lon_beg, src_grid_lon_end, stride_lon p(1) = src_grid_lat(j); p(2) = src_grid_lon(i) p(:) = p(:)*d2r - IF(enclosure_cnvx(v, 4, p, co_gc) == .true.) THEN + IF(enclosure_cnvx(v, 4, p, co_gc) .EQV. .true.) THEN grid_ct = grid_ct+1 IF (lakestat((j-1)*nlon+i) /= 0) THEN lake_ct = lake_ct+1 @@ -296,7 +296,7 @@ SUBROUTINE cal_lake_frac_depth(lakestat,cs_lakestat,lakedpth,cs_lakedpth) DO i = src_grid_lon_beg1, src_grid_lon_end1, stride_lon p(1) = src_grid_lat(j); p(2) = src_grid_lon(i) p(:) = p(:)*d2r - IF(enclosure_cnvx(v, 4, p, co_gc) == .true.) THEN + IF(enclosure_cnvx(v, 4, p, co_gc) .EQV. .true.) THEN grid_ct = grid_ct+1 IF (lakestat((j-1)*nlon+i) /= 0) THEN lake_ct = lake_ct+1 @@ -315,7 +315,7 @@ SUBROUTINE cal_lake_frac_depth(lakestat,cs_lakestat,lakedpth,cs_lakedpth) DO i = src_grid_lon_beg2, src_grid_lon_end2, stride_lon p(1) = src_grid_lat(j); p(2) = src_grid_lon(i) p(:) = p(:)*d2r - IF(enclosure_cnvx(v, 4, p, co_gc) == .true.) THEN + IF(enclosure_cnvx(v, 4, p, co_gc) .EQV. .true.) THEN grid_ct = grid_ct+1 IF (lakestat((j-1)*nlon+i) /= 0) THEN lake_ct = lake_ct+1 @@ -577,7 +577,8 @@ SUBROUTINE write_lakedata_to_orodata(cs_res, cs_lakestat, cs_lakedpth) CALL nc_opchk(stat, "nf90_put_att: lake_depth:description") #endif - write(string,'(a,es8.1)') 'land_frac and lake_frac are adjusted such that their sum is 1 at points where inland=1; land_frac cutoff is',land_cutoff + write(string,'(a,es8.1)') 'land_frac and lake_frac are adjusted such that their sum '// & + 'is 1 at points where inland=1; land_frac cutoff is',land_cutoff stat = nf90_put_att(ncid, land_frac_id,'description',trim(string)) CALL nc_opchk(stat, "nf90_put_att: land_frac:description") @@ -773,7 +774,9 @@ SUBROUTINE write_reg_lakedata_to_orodata(cs_res, tile_x_dim, tile_y_dim, cs_lake CALL nc_opchk(stat, "nf90_put_att: lake_depth:description") #endif ENDIF - write(string,'(a,es8.1)') 'land_frac is adjusted to 1-lake_frac where lake_frac>0 but left unchanged where lake_frac=0. This could lead to land_frac+lake_frac<1 at some inland points; land_frac cutoff is',land_cutoff + write(string,'(a,es8.1)') 'land_frac is adjusted to 1-lake_frac where lake_frac>0 but lefti '// & + 'unchanged where lake_frac=0. This could lead to land_frac+lake_frac<1 '// & + 'at some inland points; land_frac cutoff is',land_cutoff stat = nf90_put_att(ncid, land_frac_id,'description',trim(string)) CALL nc_opchk(stat, "nf90_put_att: land_frac:description") diff --git a/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt b/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt index 2ef189199..5e38c7a35 100644 --- a/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt +++ b/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt @@ -6,6 +6,9 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -convert big_endian -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fconvert=big-endian -fno-range-check") + if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz") + endif() endif() set(exe_name orog)