Skip to content

Commit

Permalink
Updates from rt-GEOSadas-5_27_1p2_toGit-2 comparison on 2021-Jan-11. …
Browse files Browse the repository at this point in the history
…GEOSgcm_GridComp
  • Loading branch information
mathomp4 committed Jan 11, 2021
1 parent 94b6df3 commit 7d14871
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,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 @@ -310,6 +311,96 @@ 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__
error stop 'negative values in input: play'
end if
if (any(plev < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: plev'
end if
if (any(tlay < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: tlay'
end if
if (any(tlev < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: tlev'
end if
if (any(tsfc < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: tsfc'
end if
if (any(h2ovmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: h2ovmr'
end if
if (any(o3vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: o3vmr'
end if
if (any(co2vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: co2vmr'
end if
if (any(ch4vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: ch4vmr'
end if
if (any(n2ovmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: n2ovmr'
end if
if (any(o2vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: o2vmr'
end if
if (any(cfc11vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: cfc11vmr'
end if
if (any(cfc12vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: cfc12vmr'
end if
if (any(cfc22vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: cfc22vmr'
end if
if (any(ccl4vmr < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: ccl4vmr'
end if
if (any(emis < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: emis'
end if
if (any(cldfrac < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: cldfrac'
end if
if (any(ciwp < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: ciwp'
end if
if (any(clwp < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: clwp'
end if
if (any(rei < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: rei'
end if
if (any(rel < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
error stop 'negative values in input: rel'
end if
if (any(tauaer < 0.)) then
write(error_unit,*) 'file:', __FILE__, ', line:', __LINE__
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 @@ -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,99 @@ subroutine rrtmg_sw &

integer :: npart, pncol

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

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

0 comments on commit 7d14871

Please sign in to comment.