Skip to content

Commit

Permalink
Merge pull request #398 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
Sync dev into main
  • Loading branch information
sdrabenh authored Jan 12, 2021
2 parents b8006a7 + e0cf9fa commit fb293fc
Show file tree
Hide file tree
Showing 26 changed files with 2,404 additions and 55 deletions.
29 changes: 24 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
version: 2.1
jobs:
build:

executors:
gcc-build-env:
docker:
- image: gmao/ubuntu20-geos-env-mkl:v6.0.22-openmpi_4.0.5-gcc_10.2.0
- image: gmao/ubuntu20-geos-env-mkl:v6.0.27-openmpi_4.0.5-gcc_10.2.0
auth:
username: $DOCKERHUB_USER
password: $DOCKERHUB_AUTH_TOKEN
resource_class: xlarge
environment:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none
#XLARGE# resource_class: xlarge
resource_class: medium

workflows:
version: 2.1
build-test:
jobs:
- build-GEOSgcm:
context:
- docker-hub-creds

jobs:
build-GEOSgcm:
executor: gcc-build-env
working_directory: /root/project
steps:
- run:
Expand Down Expand Up @@ -38,4 +56,5 @@ jobs:
name: "Build"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSgcm/build
make -j"$(nproc)" install
#XLARGE# make -j"$(nproc)" install
make -j4 install
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

# The ocean is the Ocean Team's responsibility
/GEOSogcm_GridComp/ @GEOS-ESM/ocean-team
# Also _connections_ to the ocean should be included in Ocean Team's responsibility
/GEOSdataatm_GridComp/ @GEOS-ESM/ocean-team
/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/GEOSsaltwater_GridComp/ @GEOS-ESM/ocean-team @GEOS-ESM/seaice-team



# Per https://github.com/GEOS-ESM/GEOSgcm_GridComp/issues/266
# The Land Team owns these directories (and subdirectories)
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ name: Build Tests
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
# Do not run if the only files changed cannot affect the build
paths-ignore:
- "**.md"
- "**.pro"
- "**.sh"
- "**.perl"
- ".github/CODEOWNERS"

jobs:
build_gcm:
name: Build GEOSgcm
if: "!contains(github.event.pull_request.labels.*.name, '0 diff trivial')"
runs-on: ubuntu-latest
container:
image: gmao/ubuntu20-geos-env-mkl:v6.0.22-openmpi_4.0.5-gcc_10.2.0
image: gmao/ubuntu20-geos-env-mkl:v6.0.27-openmpi_4.0.5-gcc_10.2.0
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ set (srcs
# ras00.F90 cloud.F90
)

if (CMAKE_Fortran_COMPILER_ID MATCHES Intel AND CMAKE_BUILD_TYPE MATCHES Aggressive)
set (CMAKE_Fortran_FLAGS_AGGRESSIVE "${GEOS_Fortran_FLAGS_VECT}")
endif ()

esma_add_library (${this}
SRCS ${srcs}
DEPENDENCIES GEOS_Shared GMAO_mpeu MAPL Chem_Shared Chem_Base
Expand All @@ -21,7 +25,7 @@ target_include_directories(${this} PRIVATE
$<BUILD_INTERFACE:${extra_incs}>
)

file (GLOB_RECURSE rc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc)
file (GLOB_RECURSE rc_files CONFIGURE_DEPENDS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rc)
foreach ( file ${rc_files} )
get_filename_component( dir ${file} DIRECTORY )
install( FILES ${file} DESTINATION etc/${dir} )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set (k_g_srcs
# MAT With GCC -O1 -g with these files causes an issue. But disabling var tracking
# seems to make compilation bearable on release
foreach (file ${k_g_srcs})
if (CMAKE_BUILD_TYPE MATCHES Release)
if (CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES Aggressive)
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
set_source_files_properties( ${file} PROPERTIES COMPILE_FLAGS "-O1 -fno-var-tracking")
else ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ subroutine rrtmg_lw( &
use parrrtm, only : nbndlw, ngptlw, maxxsec, mxmol, nbndlw
use rrlw_con, only: fluxfac, heatfac, oneminus, pi
use rrlw_wvn, only: ng, ngb, nspa, nspb, wavenum1, wavenum2, delwave
use iso_fortran_env, only : error_unit

! ------- Declarations -------

Expand Down Expand Up @@ -312,6 +313,118 @@ subroutine rrtmg_lw( &
real gmem, cmem
real t1,t2

! ASSERTs to catch unphysical inputs
if (any(play < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(play):', minval(play)
error stop 'negative values in input: play'
end if
if (any(plev < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(plev):', minval(plev)
error stop 'negative values in input: plev'
end if
if (any(tlay < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(tlay):', minval(tlay)
error stop 'negative values in input: tlay'
end if
if (any(tlev < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(tlev):', minval(tlev)
error stop 'negative values in input: tlev'
end if
if (any(tsfc < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(tsfc):', minval(tsfc)
error stop 'negative values in input: tsfc'
end if
if (any(h2ovmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(h2ovmr):', minval(h2ovmr)
error stop 'negative values in input: h2ovmr'
end if
if (any(o3vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(o3vmr):', minval(o3vmr)
error stop 'negative values in input: o3vmr'
end if
if (any(co2vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(co2vmr):', minval(co2vmr)
error stop 'negative values in input: co2vmr'
end if
if (any(ch4vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(ch4vmr):', minval(ch4vmr)
error stop 'negative values in input: ch4vmr'
end if
if (any(n2ovmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(n2ovmr):', minval(n2ovmr)
error stop 'negative values in input: n2ovmr'
end if
if (any(o2vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(o2vmr):', minval(o2vmr)
error stop 'negative values in input: o2vmr'
end if
if (any(cfc11vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(cfc11vmr):', minval(cfc11vmr)
error stop 'negative values in input: cfc11vmr'
end if
if (any(cfc12vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(cfc12vmr):', minval(cfc12vmr)
error stop 'negative values in input: cfc12vmr'
end if
if (any(cfc22vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(cfc22vmr):', minval(cfc22vmr)
error stop 'negative values in input: cfc22vmr'
end if
if (any(ccl4vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(ccl4vmr):', minval(ccl4vmr)
error stop 'negative values in input: ccl4vmr'
end if
if (any(emis < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(emis):', minval(emis)
error stop 'negative values in input: emis'
end if
if (any(cldfrac < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(cldfrac):', minval(cldfrac)
error stop 'negative values in input: cldfrac'
end if
if (any(ciwp < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(ciwp):', minval(ciwp)
error stop 'negative values in input: ciwp'
end if
if (any(clwp < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(clwp):', minval(clwp)
error stop 'negative values in input: clwp'
end if
if (any(rei < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(rei):', minval(rei)
error stop 'negative values in input: rei'
end if
if (any(rel < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(rel):', minval(rel)
error stop 'negative values in input: rel'
end if
if (any(tauaer < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(tauaer):', minval(tauaer)
error stop 'negative values in input: tauaer'
end if

#ifdef _CUDA

err = cudaGetDeviceProperties( prop, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set (k_g_srcs
# MAT With GCC -O1 -g with these files causes an issue. But disabling var tracking
# seems to make compilation bearable on release
foreach (file ${k_g_srcs})
if (CMAKE_BUILD_TYPE MATCHES Release)
if (CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES Aggressive)
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
set_source_files_properties( ${file} PROPERTIES COMPILE_FLAGS "-O1 -fno-var-tracking")
else ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ subroutine rrtmg_sw &
abari, bbari, cbari, dbari, ebari, fbari
use rrsw_wvn, only : wavenum2, ngb
use rrsw_ref, only : preflog, tref
use iso_fortran_env, only : error_unit
#ifdef _CUDA
use cudafor
#endif
Expand Down Expand Up @@ -291,6 +292,122 @@ subroutine rrtmg_sw &

integer :: npart, pncol

! ASSERTs to catch unphysical inputs
if (any(play < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(play):', minval(play)
error stop 'negative values in input: play'
end if
if (any(plev < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(plev):', minval(plev)
error stop 'negative values in input: plev'
end if
if (any(tlay < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(tlay):', minval(tlay)
error stop 'negative values in input: tlay'
end if
if (any(tlev < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(tlev):', minval(tlev)
error stop 'negative values in input: tlev'
end if
if (any(tsfc < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(tsfc):', minval(tsfc)
error stop 'negative values in input: tsfc'
end if
if (any(h2ovmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(h2ovmr):', minval(h2ovmr)
error stop 'negative values in input: h2ovmr'
end if
if (any(o3vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(o3vmr):', minval(o3vmr)
error stop 'negative values in input: o3vmr'
end if
if (any(co2vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(co2vmr):', minval(co2vmr)
error stop 'negative values in input: co2vmr'
end if
if (any(ch4vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(ch4vmr):', minval(ch4vmr)
error stop 'negative values in input: ch4vmr'
end if
if (any(n2ovmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(n2ovmr):', minval(n2ovmr)
error stop 'negative values in input: n2ovmr'
end if
if (any(o2vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(o2vmr):', minval(o2vmr)
error stop 'negative values in input: o2vmr'
end if
if (any(asdir < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(asdir):', minval(asdir)
error stop 'negative values in input: asdir'
end if
if (any(aldir < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(aldir):', minval(aldir)
error stop 'negative values in input: aldir'
end if
if (any(asdif < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(asdif):', minval(asdif)
error stop 'negative values in input: asdif'
end if
if (any(aldif < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(aldif):', minval(aldif)
error stop 'negative values in input: aldif'
end if
if (any(cld < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(cld):', minval(cld)
error stop 'negative values in input: cld'
end if
if (any(ciwp < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(ciwp):', minval(ciwp)
error stop 'negative values in input: ciwp'
end if
if (any(clwp < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(clwp):', minval(clwp)
error stop 'negative values in input: clwp'
end if
if (any(rei < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(rei):', minval(rei)
error stop 'negative values in input: rei'
end if
if (any(rel < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(rel):', minval(rel)
error stop 'negative values in input: rel'
end if
if (any(tauaer < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(tauaer):', minval(tauaer)
error stop 'negative values in input: tauaer'
end if
if (any(ssaaer < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
write(error_unit,*) 'minval(ssaaer):', minval(ssaaer)
error stop 'negative values in input: ssaaer'
end if
! if (any(asmaer < 0.)) then
! write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
! write(error_unit,*) 'minval(asmaer):', minval(asmaer)
! error stop 'negative values in input: asmaer'
! end if

#ifdef _CUDA
type(cudadeviceprop) :: prop
Expand Down
Loading

0 comments on commit fb293fc

Please sign in to comment.