Skip to content

Commit

Permalink
Merge pull request #364 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
Sync develop into main
  • Loading branch information
sdrabenh authored Oct 14, 2020
2 parents 0a9880f + f95828e commit e6d7913
Show file tree
Hide file tree
Showing 10 changed files with 604 additions and 677 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build Tests

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]

jobs:
build_gcm:
name: Build GEOSgcm
if: "!contains(github.event.pull_request.labels.*.name, '0 diff trivial')"
runs-on: ubuntu-latest
container: gmao/ubuntu20-geos-env-mkl:6.0.16-openmpi_4.0.5-gcc_10.2.0
env:
LANGUAGE: en_US.UTF-8
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LC_TYPE: en_US.UTF-8
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.5.0
with:
access_token: ${{ github.token }}
- name: Checkout GCM
uses: actions/checkout@v2
with:
repository: GEOS-ESM/GEOSgcm
fetch-depth: 1
- name: Versions etc.
run: |
gfortran --version
mpirun --version
echo $BASEDIR
echo ${GITHUB_HEAD_REF}
- name: Mepo clone external repos
run: |
mepo clone
mepo status
mepo develop GEOSgcm_GridComp GEOSgcm_App
mepo status
- name: Update GEOSgcm_GridComp branch
if:
"!contains('refs/heads/main,refs/heads/develop', github.ref)"
run: |
mepo checkout-if-exists ${GITHUB_HEAD_REF}
mepo status
- name: CMake
run: |
mkdir build
cd build
cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_BUILD_TYPE=Debug -DMPIEXEC_PREFLAGS='--oversubscribe'
- name: Build
run: |
cd build
make -j4 install
326 changes: 255 additions & 71 deletions GEOSagcm_GridComp/GEOS_AgcmGridComp.F90

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,22 @@ subroutine SetServices ( GC, RC )
VLOCATION = MAPL_VLocationNone, RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OLRB06RG', &
LONG_NAME = 'upwelling_longwave_flux_at_toa_in_RRTMG_band06 (820-980 cm-1)', &
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'TBRB06RG', &
LONG_NAME = 'brightness_temperature_in_RRTMG_band06 (820-980 cm-1)', &
UNITS = 'K', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OLRB09RG', &
LONG_NAME = 'upwelling_longwave_flux_at_toa_in_RRTMG_band09 (1180-1390 cm-1)', &
Expand Down Expand Up @@ -1019,6 +1035,20 @@ subroutine SetServices ( GC, RC )
VLOCATION = MAPL_VLocationEdge, RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddInternalSpec(GC, &
SHORT_NAME = 'OLRB06RG', &
LONG_NAME = 'upwelling_longwave_flux_at_toa_in_RRTMG_band06', &
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, __RC__ )

call MAPL_AddInternalSpec(GC, &
SHORT_NAME = 'DOLRB06RGDT', &
LONG_NAME = 'derivative_of_upwelling_longwave_flux_at_toa_in_RRTMG_band06_wrt_surface_temp', &
UNITS = 'W m-2 K-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, __RC__ )

call MAPL_AddInternalSpec(GC, &
SHORT_NAME = 'OLRB09RG', &
LONG_NAME = 'upwelling_longwave_flux_at_toa_in_RRTMG_band09', &
Expand Down Expand Up @@ -1188,8 +1218,8 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
real, pointer, dimension(:,:,:) :: DFDTSC
real, pointer, dimension(:,:,:) :: DFDTSCNA

real, pointer, dimension(:,: ) :: OLRB09RG_INT, OLRB10RG_INT, OLRB11RG_INT
real, pointer, dimension(:,: ) :: DOLRB09RG_DT, DOLRB10RG_DT, DOLRB11RG_DT
real, pointer, dimension(:,: ) :: OLRB06RG_INT, OLRB09RG_INT, OLRB10RG_INT, OLRB11RG_INT
real, pointer, dimension(:,: ) :: DOLRB06RG_DT, DOLRB09RG_DT, DOLRB10RG_DT, DOLRB11RG_DT

real, external :: getco2

Expand Down Expand Up @@ -1305,6 +1335,8 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_GetPointer(INTERNAL, DFDTSNA, 'DFDTSNA', RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(INTERNAL, DFDTSCNA, 'DFDTSCNA',RC=STATUS); VERIFY_(STATUS)

call MAPL_GetPointer(INTERNAL, OLRB06RG_INT, 'OLRB06RG' , __RC__)
call MAPL_GetPointer(INTERNAL, DOLRB06RG_DT, 'DOLRB06RGDT', __RC__)
call MAPL_GetPointer(INTERNAL, OLRB09RG_INT, 'OLRB09RG' , __RC__)
call MAPL_GetPointer(INTERNAL, DOLRB09RG_DT, 'DOLRB09RGDT', __RC__)
call MAPL_GetPointer(INTERNAL, OLRB10RG_INT, 'OLRB10RG' , __RC__)
Expand Down Expand Up @@ -1520,6 +1552,7 @@ subroutine Lw_Driver(IM,JM,LM,LATS,LONS,CoresPerNode,RC)
real, allocatable, dimension(:,:) :: HR, HRC
integer, allocatable, dimension(:,:) :: CLOUDFLAG
real, allocatable, dimension(:) :: ALAT
real, allocatable, dimension(:) :: OLRB06RG_1D, DOLRB06RG_DT_1D
real, allocatable, dimension(:) :: OLRB09RG_1D, DOLRB09RG_DT_1D
real, allocatable, dimension(:) :: OLRB10RG_1D, DOLRB10RG_DT_1D
real, allocatable, dimension(:) :: OLRB11RG_1D, DOLRB11RG_DT_1D
Expand Down Expand Up @@ -3284,6 +3317,8 @@ subroutine Lw_Driver(IM,JM,LM,LATS,LONS,CoresPerNode,RC)
allocate(HRC(IM*JM,LM+1),__STAT__)
allocate(CLOUDFLAG(IM*JM,4),__STAT__)
allocate(ALAT(IM*JM),__STAT__)
allocate(OLRB06RG_1D(IM*JM),__STAT__)
allocate(DOLRB06RG_DT_1D(IM*JM),__STAT__)
allocate(OLRB09RG_1D(IM*JM),__STAT__)
allocate(DOLRB09RG_DT_1D(IM*JM),__STAT__)
allocate(OLRB10RG_1D(IM*JM),__STAT__)
Expand Down Expand Up @@ -3410,7 +3445,8 @@ subroutine Lw_Driver(IM,JM,LM,LATS,LONS,CoresPerNode,RC)
TAUCLD ,CICEWP ,CLIQWP ,REICE ,RELIQ , &
TAUAER , ZL_R, LCLDLM, LCLDMH, &
UFLX, DFLX, HR, UFLXC, DFLXC, HRC, DUFLX_DT, DUFLXC_DT, CLOUDFLAG, &
OLRB09RG_1D, DOLRB09RG_DT_1D, OLRB10RG_1D, DOLRB10RG_DT_1D, OLRB11RG_1D, DOLRB11RG_DT_1D, &
OLRB06RG_1D, DOLRB06RG_DT_1D, OLRB09RG_1D, DOLRB09RG_DT_1D, &
OLRB10RG_1D, DOLRB10RG_DT_1D, OLRB11RG_1D, DOLRB11RG_DT_1D, &
DOY, ALAT, CoresPerNode, PARTITION_SIZE)

call MAPL_TimerOff(MAPL,"---RRTMG_RUN",RC=STATUS)
Expand Down Expand Up @@ -3456,7 +3492,9 @@ subroutine Lw_Driver(IM,JM,LM,LATS,LONS,CoresPerNode,RC)

SFCEM_INT(i,j) = -UFLX(IJ,1) + DFLX(IJ,1)*(1.0-EMISS(IJ,1))

! band 9-11 water vapor products
! band 6 window and band 9-11 water vapor products
OLRB06RG_INT(i,j) = OLRB06RG_1D(IJ)
DOLRB06RG_DT(i,j) = DOLRB06RG_DT_1D(IJ)
OLRB09RG_INT(i,j) = OLRB09RG_1D(IJ)
DOLRB09RG_DT(i,j) = DOLRB09RG_DT_1D(IJ)
OLRB10RG_INT(i,j) = OLRB10RG_1D(IJ)
Expand Down Expand Up @@ -3510,6 +3548,8 @@ subroutine Lw_Driver(IM,JM,LM,LATS,LONS,CoresPerNode,RC)
deallocate(HRC,__STAT__)
deallocate(CLOUDFLAG,__STAT__)
deallocate(ALAT,__STAT__)
deallocate(OLRB06RG_1D,__STAT__)
deallocate(DOLRB06RG_DT_1D,__STAT__)
deallocate(OLRB09RG_1D,__STAT__)
deallocate(DOLRB09RG_DT_1D,__STAT__)
deallocate(OLRB10RG_1D,__STAT__)
Expand Down Expand Up @@ -3654,6 +3694,7 @@ subroutine Update_Flx(IM,JM,LM,RC)
real, pointer, dimension(:,: ) :: OLC
real, pointer, dimension(:,: ) :: OLCC5
real, pointer, dimension(:,: ) :: OLA
real, pointer, dimension(:,: ) :: OLRB06RG, TBRB06RG
real, pointer, dimension(:,: ) :: OLRB09RG, TBRB09RG
real, pointer, dimension(:,: ) :: OLRB10RG, TBRB10RG
real, pointer, dimension(:,: ) :: OLRB11RG, TBRB11RG
Expand Down Expand Up @@ -3703,6 +3744,8 @@ subroutine Update_Flx(IM,JM,LM,RC)
call MAPL_GetPointer(EXPORT, OLC , 'OLC' ,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, OLCC5 , 'OLCC5' ,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, OLA , 'OLA' ,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, OLRB06RG, 'OLRB06RG',RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, TBRB06RG, 'TBRB06RG',RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, OLRB09RG, 'OLRB09RG',RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, TBRB09RG, 'TBRB09RG',RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, OLRB10RG, 'OLRB10RG',RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -3854,6 +3897,8 @@ subroutine Update_Flx(IM,JM,LM,RC)
if(associated(FLNSC )) FLNSC = FLC_INT(:,:,LM) + DFDTSC (:,:,LM) * DELT
if(associated(FLNSA )) FLNSA = FLA_INT(:,:,LM) + DFDTSCNA(:,:,LM) * DELT

if(associated(OLRB06RG)) OLRB06RG = MAPL_UNDEF
if(associated(TBRB06RG)) TBRB06RG = MAPL_UNDEF
if(associated(OLRB09RG)) OLRB09RG = MAPL_UNDEF
if(associated(TBRB09RG)) TBRB09RG = MAPL_UNDEF
if(associated(OLRB10RG)) OLRB10RG = MAPL_UNDEF
Expand Down Expand Up @@ -3927,6 +3972,18 @@ subroutine Update_Flx(IM,JM,LM,RC)
if(associated(FLNSC )) FLNSC = FLC_INT(:,:,LM) + DFDTSC(:,:,LM) * DELT
if(associated(FLNSA )) FLNSA = MAPL_UNDEF

if(associated(OLRB06RG).or.associated(TBRB06RG)) then
allocate(OLRBNN(IM,JM),__STAT__)
OLRBNN = OLRB06RG_INT + DOLRB06RG_DT * DELT
if(associated(OLRB06RG)) OLRB06RG = OLRBNN
if(associated(TBRB06RG)) then
! brightness temperature for RRTMG band 06
wn1 = 820.e2; wn2 = 980.e2 ! NB: [m-1]
call Tbr_from_band_flux(IM, JM, OLRBNN, wn1, wn2, TBRB06RG, __RC__)
end if
deallocate(OLRBNN)
end if

if(associated(OLRB09RG).or.associated(TBRB09RG)) then
allocate(OLRBNN(IM,JM),__STAT__)
OLRBNN = OLRB09RG_INT + DOLRB09RG_DT * DELT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ module gpu_rrtmg_lw_rtrnmc
! with respect to surface temperature
real , allocatable _gpudev :: dplankbnd_dtd(:,:)

! TOA OLR in bands 9-11 and their derivatives with surface temp
! TOA OLR in bands 6 & 9-11 and their derivatives with surface temp
real , allocatable _gpudev :: olrb06d(:) ! (W/m2)
real , allocatable _gpudev :: dolrb06_dtd(:) ! (W/m2/K)
real , allocatable _gpudev :: olrb09d(:) ! (W/m2)
real , allocatable _gpudev :: dolrb09_dtd(:) ! (W/m2/K)
real , allocatable _gpudev :: olrb10d(:) ! (W/m2)
Expand Down Expand Up @@ -657,6 +659,7 @@ _gpuker subroutine rtrnadd(ncol, nlay, ngpt, drvf, ngb)
totuclfld(iplon, ilay)=totuclfld(iplon, ilay)+gclrurad(iplon, igp, ilay)
totdclfld(iplon, ilay)=totdclfld(iplon, ilay)+gclrdrad(iplon, igp, ilay)
if (ilay .eq. nlay) then
if (ngb(igp) .eq. 6) olrb06d(iplon) = olrb06d(iplon) + gurad(iplon, igp, nlay)
if (ngb(igp) .eq. 9) olrb09d(iplon) = olrb09d(iplon) + gurad(iplon, igp, nlay)
if (ngb(igp) .eq. 10) olrb10d(iplon) = olrb10d(iplon) + gurad(iplon, igp, nlay)
if (ngb(igp) .eq. 11) olrb11d(iplon) = olrb11d(iplon) + gurad(iplon, igp, nlay)
Expand All @@ -670,6 +673,7 @@ _gpuker subroutine rtrnadd(ncol, nlay, ngpt, drvf, ngb)
dtotuflux_dtd(iplon, ilay) = dtotuflux_dtd(iplon, ilay) + gdtotuflux_dtd( iplon, igp, ilay)
dtotuclfl_dtd(iplon, ilay) = dtotuclfl_dtd(iplon, ilay) + gdtotuclfl_dtd( iplon, igp, ilay)
if (ilay .eq. nlay) then
if (ngb(igp) .eq. 6) dolrb06_dtd(iplon) = dolrb06_dtd(iplon) + gdtotuflux_dtd(iplon, igp, nlay)
if (ngb(igp) .eq. 9) dolrb09_dtd(iplon) = dolrb09_dtd(iplon) + gdtotuflux_dtd(iplon, igp, nlay)
if (ngb(igp) .eq. 10) dolrb10_dtd(iplon) = dolrb10_dtd(iplon) + gdtotuflux_dtd(iplon, igp, nlay)
if (ngb(igp) .eq. 11) dolrb11_dtd(iplon) = dolrb11_dtd(iplon) + gdtotuflux_dtd(iplon, igp, nlay)
Expand Down Expand Up @@ -781,6 +785,8 @@ subroutine allocateGPUrtrnmcg(ncol, nlay, ngptlw, drvf)
allocate (dtotuclfl_dtd(ncol, 0:nlay))
allocate (dplankbnd_dtd(ncol,nbndlw))

allocate (olrb06d(ncol))
allocate (dolrb06_dtd(ncol))
allocate (olrb09d(ncol))
allocate (dolrb09_dtd(ncol))
allocate (olrb10d(ncol))
Expand Down Expand Up @@ -821,6 +827,7 @@ subroutine deallocateGPUrtrnmcg( drvf )
deallocate( gdtotuflux_dtd, gdtotuclfl_dtd )
end if

deallocate (olrb06d, dolrb06_dtd)
deallocate (olrb09d, dolrb09_dtd)
deallocate (olrb10d, dolrb10_dtd)
deallocate (olrb11d, dolrb11_dtd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ subroutine rrtmg_lw( &
tauaer , zm, cloudMH, cloudHH, &
uflx ,dflx ,hr ,uflxc ,dflxc, hrc, &
duflx_dt, duflxc_dt, cloudFlag, &
olrb09, dolrb09_dt, olrb10, dolrb10_dt, olrb11, dolrb11_dt, &
olrb06, dolrb06_dt, olrb09, dolrb09_dt, &
olrb10, dolrb10_dt, olrb11, dolrb11_dt, &
dyofyr, alat, numCPUs, partition_size)
! -------- Description --------

Expand Down Expand Up @@ -288,6 +289,7 @@ subroutine rrtmg_lw( &
! Dimensions: (ncol,nlay)
integer , intent(out), optional :: cloudFlag(:,:)

real, intent(out), dimension(:), optional :: olrb06, dolrb06_dt
real, intent(out), dimension(:), optional :: olrb09, dolrb09_dt
real, intent(out), dimension(:), optional :: olrb10, dolrb10_dt
real, intent(out), dimension(:), optional :: olrb11, dolrb11_dt
Expand Down Expand Up @@ -396,7 +398,8 @@ subroutine rrtmg_lw( &
tauaer , zm, cloudMH, cloudHH, &
uflx ,dflx ,hr ,uflxc ,dflxc, hrc, &
duflx_dt, duflxc_dt, cloudFlag, &
olrb09, dolrb09_dt, olrb10, dolrb10_dt, olrb11, dolrb11_dt, &
olrb06, dolrb06_dt, olrb09, dolrb09_dt, &
olrb10, dolrb10_dt, olrb11, dolrb11_dt, &
dyofyr,alat)
end do

Expand All @@ -420,7 +423,8 @@ subroutine rrtmg_lw_part &
tauaer , zm, cloudMH, cloudHH, &
uflx ,dflx ,hr ,uflxc ,dflxc, hrc, &
duflx_dt, duflxc_dt, cloudFlag, &
olrb09, dolrb09_dt, olrb10, dolrb10_dt, olrb11, dolrb11_dt, &
olrb06, dolrb06_dt, olrb09, dolrb09_dt, &
olrb10, dolrb10_dt, olrb11, dolrb11_dt, &
dyofyr,alat)


Expand Down Expand Up @@ -551,10 +555,11 @@ subroutine rrtmg_lw_part &
! Dimensions: (ncol,nlay)
integer , intent(out), optional :: cloudFlag(:,:)

real, intent(out), dimension(:), optional :: olrb06, dolrb06_dt
real, intent(out), dimension(:), optional :: olrb09, dolrb09_dt
real, intent(out), dimension(:), optional :: olrb10, dolrb10_dt
real, intent(out), dimension(:), optional :: olrb11, dolrb11_dt
! OLR for bands 9-11 and temperature derivatives (W/m2, W/m2/K)
! OLR for bands 6 & 9-11 and temperature derivatives (W/m2, W/m2/K)
! Dimensions: (ncol)

real _gpudeva :: cldfmcd(:,:,:) ! layer cloud fraction [mcica]
Expand Down Expand Up @@ -1020,6 +1025,8 @@ subroutine rrtmg_lw_part &
htrcd = 0.0
dtotuflux_dtd = 0.0
dtotuclfl_dtd = 0.0
olrb06d = 0.0
dolrb06_dtd = 0.0
olrb09d = 0.0
dolrb09_dtd = 0.0
olrb10d = 0.0
Expand Down Expand Up @@ -1055,6 +1062,7 @@ subroutine rrtmg_lw_part &
dflxc(colstart:(colstart+pncol-1), 1:(nlayers+1)) = totdclfld(:,0:nlayers)
hr(colstart:(colstart+pncol-1), 1:(nlayers+1)) = htrd(:,0:nlayers)
hrc(colstart:(colstart+pncol-1), 1:(nlayers+1)) = htrcd(:,0:nlayers)
olrb06(colstart:(colstart+pncol-1)) = olrb06d(:)
olrb09(colstart:(colstart+pncol-1)) = olrb09d(:)
olrb10(colstart:(colstart+pncol-1)) = olrb10d(:)
olrb11(colstart:(colstart+pncol-1)) = olrb11d(:)
Expand All @@ -1063,6 +1071,7 @@ subroutine rrtmg_lw_part &

duflx_dt(colstart:(colstart+pncol-1), 1:(nlayers+1)) = dtotuflux_dtd(:,0:nlayers)
duflxc_dt(colstart:(colstart+pncol-1), 1:(nlayers+1)) = dtotuclfl_dtd(:,0:nlayers)
dolrb06_dt(colstart:(colstart+pncol-1)) = dolrb06_dtd(:)
dolrb09_dt(colstart:(colstart+pncol-1)) = dolrb09_dtd(:)
dolrb10_dt(colstart:(colstart+pncol-1)) = dolrb10_dtd(:)
dolrb11_dt(colstart:(colstart+pncol-1)) = dolrb11_dtd(:)
Expand Down
Loading

0 comments on commit e6d7913

Please sign in to comment.