Skip to content

Commit

Permalink
feature/mpi_abort Updates required for gnu compiler (from Dusan).
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGayno-NOAA committed Sep 15, 2020
1 parent c3b25a7 commit 5ee4825
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sorc/fre-nctools.fd/shared_lib/mpp_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
3 changes: 3 additions & 0 deletions sorc/global_chgres.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions sorc/global_cycle.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 9 additions & 6 deletions sorc/orog_mask_tools.fd/lake.fd/lakefrac.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand Down
3 changes: 3 additions & 0 deletions sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5ee4825

Please sign in to comment.