Skip to content

Commit

Permalink
Merge pull request #750 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
Sync develop into main
  • Loading branch information
mathomp4 authored May 10, 2023
2 parents 481a717 + 69d6971 commit 91c183c
Show file tree
Hide file tree
Showing 20 changed files with 2,075 additions and 1,389 deletions.
18 changes: 17 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1

# Anchors to prevent forgetting to update a version
baselibs_version: &baselibs_version v7.7.0
bcs_version: &bcs_version v10.25.0
bcs_version: &bcs_version v11.00.0

orbs:
ci: geos-esm/circleci-tools@1
Expand All @@ -23,6 +23,7 @@ workflows:
checkout_fixture: true
mepodevelop: true
persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra

# Run GCM (1 hour, no ExtData)
- ci/run_gcm:
name: run-GCM-on-<< matrix.compiler >>
Expand All @@ -37,3 +38,18 @@ workflows:
baselibs_version: *baselibs_version
bcs_version: *bcs_version

# Run Coupled GCM (1 hour, no ExtData)
- ci/run_gcm:
name: run-coupled-GCM-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran, ifort]
requires:
- build-GEOSgcm-on-<< matrix.compiler >>
repo: GEOSgcm
baselibs_version: *baselibs_version
bcs_version: *bcs_version
gcm_ocean_type: MOM6
change_layout: false
2 changes: 1 addition & 1 deletion GEOSagcm_GridComp/GEOSphysics_GridComp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set (alldirs
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/GEOS_PhysicsGridComp.F90)

esma_add_library (${this}
SRCS GEOS_PhysicsGridComp.F90
SRCS GEOS_PhysicsGridComp.F90 MBundle_IncrementMod.F90
SUBCOMPONENTS ${alldirs}
DEPENDENCIES MAPL GMAO_mpeu GMAO_stoch esmf)

Expand Down
48 changes: 20 additions & 28 deletions GEOSagcm_GridComp/GEOSphysics_GridComp/GEOS_PhysicsGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module GEOS_PhysicsGridCompMod

use GEOS_UtilsMod, only: GEOS_Qsat
use Bundle_IncrementMod
use MBundle_IncrementMod

! PGI Module that contains the initialization
! routines for the GPUs
Expand Down Expand Up @@ -339,28 +340,23 @@ subroutine SetServices ( GC, RC )
! Add export states for turbulence increments
!-------------------------------------------------
call ESMF_ConfigGetDim (cf, NQ, nCols, label=('TRI_increments::'), rc=STATUS)

if (NQ > 0) then
call ESMF_ConfigFindLabel (cf, ('TRI_increments::'), rc=STATUS)
VERIFY_(STATUS)

allocate (NAMES(NQ), stat=STATUS)
VERIFY_(STATUS)

do i = 1, NQ
call ESMF_ConfigNextLine(cf, rc=STATUS)
VERIFY_(STATUS)
call ESMF_ConfigGetAttribute(cf, NAMES(i), rc=STATUS)
VERIFY_(STATUS)
enddo

do i = 1, NQ
if (NAMES(i) == 'AOADAYS') then
TendUnits = 'days s-1'
else
TendUnits = 'UNITS'
end if

call MAPL_AddExportSpec(GC, &
SHORT_NAME = trim(NAMES(i))//'IT', &
LONG_NAME = 'tendency_of_'//trim(NAMES(i))//'_due_to_turbulence', &
Expand All @@ -374,7 +370,6 @@ subroutine SetServices ( GC, RC )
end if !NQ > 0

!-----------------------------------------------------------

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'DTDT', &
LONG_NAME = 'pressure_weighted_tendency_of_air_temperature_due_to_physics', &
Expand Down Expand Up @@ -570,6 +565,14 @@ subroutine SetServices ( GC, RC )
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'MCHEMTRI', &
LONG_NAME = 'moist_quantities', &
UNITS = 'UNITS s-1', &
DATATYPE = MAPL_BundleItem, &
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
LONG_NAME = 'upward_net_turbulence_heat_flux', &
UNITS = 'W m-2', &
Expand Down Expand Up @@ -1310,9 +1313,8 @@ subroutine SetServices ( GC, RC )
VERIFY_(STATUS)

call MAPL_AddConnectivity ( GC, &
SHORT_NAME = (/'USTAR', 'TSTAR', 'QSTAR', 'T2M ', &
'Q2M ', 'TA ', 'QA ', 'SH ', &
'EVAP ' &
SHORT_NAME = (/'T2M ', 'Q2M ', 'TA ', 'QA ', 'SH ', &
'EVAP' &
/), &
DST_ID = MOIST, &
SRC_ID = SURF, &
Expand All @@ -1338,21 +1340,6 @@ subroutine SetServices ( GC, RC )
RC=STATUS )
VERIFY_(STATUS)

!Gravity wave drag parameters for subgrid scale V
call MAPL_AddConnectivity ( GC, &
SHORT_NAME = (/'TAUGWX'/), &
DST_ID = MOIST, &
SRC_ID = GWD, &
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddConnectivity ( GC, &
SHORT_NAME = (/'TAUGWY'/), &
DST_ID = MOIST, &
SRC_ID = GWD, &
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddConnectivity ( GC, &
SHORT_NAME = (/'TAUOROX'/), &
DST_ID = MOIST, &
Expand Down Expand Up @@ -1964,7 +1951,7 @@ subroutine Initialize ( GC, IMPORT, EXPORT, CLOCK, RC )
! Fill the moist increments bundle
!---------------------------------

call Initialize_IncBundle_init(GC, GIM(MOIST), EXPORT, MTRIinc, __RC__)
call Initialize_IncMBundle_init(GC, GIM(MOIST), EXPORT, __RC__)

#ifdef PRINT_STATES
call WRITE_PARALLEL ( trim(Iam)//": Convective Transport Tendency Bundle" )
Expand Down Expand Up @@ -2014,6 +2001,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
! Local derived type aliases

type (MAPL_MetaComp), pointer :: STATE
type (MAPL_MetaComp), pointer :: CMETA
type (ESMF_GridComp), pointer :: GCS(:)
type (ESMF_State), pointer :: GIM(:)
type (ESMF_State), pointer :: GEX(:)
Expand All @@ -2025,7 +2013,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
type (ESMF_FieldBundle) :: BUNDLE
character(len=ESMF_MAXSTR),pointer :: GCNames(:)
character(len=ESMF_MAXSTR) :: DUMMY
integer :: I, L, K, N
integer :: I, J, L, K, N
integer :: IM, JM, LM, NQ
integer :: ISPPT,ISKEB
logical :: DO_SPPT,DO_SKEB
Expand Down Expand Up @@ -2449,7 +2437,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
! Moist Processes
!----------------

call Initialize_IncBundle_run(GIM(MOIST), EXPORT, MTRIinc, __RC__)
call Initialize_IncMBundle_run(GIM(MOIST), EXPORT, DM=DM,__RC__)

I=MOIST

Expand All @@ -2458,7 +2446,9 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_GenericRunCouplers (STATE, I, CLOCK, RC=STATUS ); VERIFY_(STATUS)
call MAPL_TimerOff(STATE,GCNames(I))

call Compute_IncBundle(GIM(MOIST), EXPORT, MTRIinc, STATE, __RC__)
call MAPL_GetObjectFromGC ( GCS(I), CMETA, _RC)

call Compute_IncMBundle(GIM(MOIST), EXPORT, CMETA, DM=DM,__RC__)

call MAPL_GetPointer(GIM(MOIST), DTDT_BL, 'DTDT_BL', alloc = .true. ,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(GIM(MOIST), DQDT_BL, 'DQDT_BL', alloc = .true. ,RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -2712,6 +2702,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
if(associated(DUDT )) DUDT = UIM + UIT + UIG
if(associated(DVDT )) DVDT = VIM + VIT + VIG
if(associated(DWDT )) DWDT = WIM

!-stochastic-physics
IF( DO_SPPT ) THEN
allocate(TMP(IM,JM,LM),stat=STATUS)
Expand Down Expand Up @@ -2770,6 +2761,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
if( MAPL_am_I_root() ) print*, "GEOS_PhysicsGridComp: missing T-tend pointer, aborting ..."
VERIFY_(STATUS)
endif

TOT = TIR & ! Mass-Weighted Temperature Tendency due to Radiation
+ STN & ! Mass-Weighted Temperature Tendency due to Turbulent Mixing
+ TTN & ! Mass-Weighted Temperature Tendency due to Moist Processes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ subroutine Initialize ( GC, IMPORT, EXPORT, CLOCK, RC )
character(len=2) :: dateline
integer :: imsize,nn
integer :: LM
real :: STRETCH_FACTOR
real :: sigma,STRETCH_FACTOR

real, pointer, dimension(:) :: PREF

Expand Down Expand Up @@ -841,6 +841,7 @@ subroutine Initialize ( GC, IMPORT, EXPORT, CLOCK, RC )
if(dateline.eq.'CF') imsize = imsize*4
call MAPL_GetResource(MAPL,STRETCH_FACTOR,'AGCM.STRETCH_FACTOR:', default=1.0, _RC)
imsize = imsize*CEILING(STRETCH_FACTOR)
sigma = 1.0-0.9900*exp(-0.12500*4.e7*0.9/imsize/3000.) ! Modified from Arakawa 2011 sigma used in GF2020

! Gravity wave drag
! -----------------
Expand Down Expand Up @@ -885,9 +886,9 @@ subroutine Initialize ( GC, IMPORT, EXPORT, CLOCK, RC )
! -----------------
call MAPL_GetResource( MAPL, NCAR_TAU_TOP_ZERO, Label="NCAR_TAU_TOP_ZERO:", default=.true., _RC)
call MAPL_GetResource( MAPL, NCAR_PRNDL, Label="NCAR_PRNDL:", default=0.50, _RC)
NCAR_QBO_HDEPTH_SCALING = min( imsize/2880.0 , 1.0 )
NCAR_QBO_HDEPTH_SCALING = 1.0 - (1.0-0.125)*sigma
call MAPL_GetResource( MAPL, NCAR_QBO_HDEPTH_SCALING, Label="NCAR_QBO_HDEPTH_SCALING:", default=NCAR_QBO_HDEPTH_SCALING, _RC)
NCAR_HR_CF = max( 10.0*720.0/imsize , 1.0 )
NCAR_HR_CF = ceiling(50.0*sigma)
call MAPL_GetResource( MAPL, NCAR_HR_CF, Label="NCAR_HR_CF:", default=NCAR_HR_CF, _RC)

call gw_common_init( NCAR_TAU_TOP_ZERO , 1 , &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,14 @@ subroutine gw_beres_ifc( band, &
effgw = 0.0
end where

!GEOS pressure scaling near model top
zfac_layer = 1.0e2 ! 1mb
do k=1,pver+1
do i=1,ncol
pint_adj(i,k) = MIN(1.0,MAX(0.0,(pint(i,k)/zfac_layer)**3))
enddo
enddo

do k = 0, pver
! spectrum source index
if (pref(k+1) < desc%spectrum_source) desc%k(:) = k+1
Expand All @@ -611,7 +619,7 @@ subroutine gw_beres_ifc( band, &
src_level, tend_level, dt, t, &
piln, rhoi, nm, ni, ubm, ubi, xv, yv, &
c, kvtt, tau, utgw, vtgw, &
ttgw, gwut, alpha)
ttgw, gwut, alpha, tau_adjust=pint_adj)

! Apply efficiency and limiters
call energy_momentum_adjust(ncol, pver, band, pint, delp, u, v, dt, c, tau, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,6 @@ subroutine gw_rdg_ifc( band, &
pint_adj(i,k) = MIN(1.0,MAX(0.0,(pint(i,k)/zfac_layer)**3))
enddo
enddo
! AVOID this code in favor of tndmax limiter
! adjust strength from surface (1.0) to 10,000m (0.1)
! do k=1,pver+1
! pint_adj(:,k)= 0.1 + PINTADJ_0 * ((ATAN((2.*(z+zi(:,k)-2500.0)/(-2500.0)-1.) * PINTADJ_1) + PINTADJ_2) * PINTADJ_3 - 1.)
! enddo
! AVOID this code in favor of tndmax limiter

isoflag = 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ SUBROUTINE GF2020_INTERFACE( mxp,myp,mzp,LONS,LATS,DT_MOIST
,CNV_MFC, CNV_UPDF, CNV_CVW, CNV_QC, CLCN,CLLS &
,QV_DYN_IN,PLE_DYN_IN,U_DYN_IN,V_DYN_IN,T_DYN_IN &
,RADSW ,RADLW ,DQDT_BL ,DTDT_BL &
,FRLAND ,AREA ,USTAR ,TSTAR ,QSTAR ,T2M ,Q2M &
,FRLAND ,AREA ,T2M ,Q2M &
,TA ,QA ,SH ,EVAP ,PHIS &
,KPBLIN ,CNVFRC,SRFTYPE &
,STOCHASTIC_SIG, SIGMA_DEEP, SIGMA_MID &
Expand Down Expand Up @@ -210,7 +210,7 @@ SUBROUTINE GF2020_INTERFACE( mxp,myp,mzp,LONS,LATS,DT_MOIST

REAL ,DIMENSION(mxp,myp,mzp) ,INTENT(IN) :: RADSW, RADLW, DQDT_BL, DTDT_BL

REAL ,DIMENSION(mxp,myp) ,INTENT(IN) :: FRLAND, AREA, USTAR, TSTAR, QSTAR, &
REAL ,DIMENSION(mxp,myp) ,INTENT(IN) :: FRLAND, AREA, &
T2M, Q2M, TA, QA, SH, EVAP, PHIS, &
LONS, LATS, &
STOCHASTIC_SIG
Expand Down Expand Up @@ -548,8 +548,8 @@ SUBROUTINE GF2020_INTERFACE( mxp,myp,mzp,LONS,LATS,DT_MOIST
DO k=1,mzp
gsf_t (k,i,j) = 0.
gsf_q (k,i,j) = 0.
sgsf_t (k,i,j) = DTDT_BL(i,j,flip(k)) + RADSW(i,j,flip(k)) + RADLW(i,j,flip(k))
sgsf_q (k,i,j) = DQDT_BL(i,j,flip(k))
sgsf_t (k,i,j) = 0.
sgsf_q (k,i,j) = 0.
advf_t (k,i,j) = 0.
ENDDO
ENDDO
Expand Down Expand Up @@ -2313,8 +2313,8 @@ SUBROUTINE CUP_gf(its,ite,kts,kte ,itf,ktf, mtp, nmp &
ierrc(i)='scale_dep renders convection insignificant'
endif
if(ierr(i) /= 0) cycle
!sig(i)= 1.0-0.9839*exp(-0.09835*(dx(i)/1000.)) ! Arakawa 2011 sigma
sig(i)= 1.0-0.9900*exp(-0.12500*(dx(i)/3000.)) ! Modified from Arakawa 2011 sigma
sig(i)= 1.0-0.9839*exp(-0.09835*(dx(i)/1000.)) ! Arakawa 2011 sigma
!sig(i)= 1.0-0.9839*exp(-0.09835*(dx(i)/ 500.)) ! Modified from Arakawa 2011 sigma
if (stochastic_sig(i) /= 1.0) then
sig(i) = sig(i)**(stochastic_sig(i)*MAX(1.0,sig(i)))
endif
Expand Down Expand Up @@ -9230,8 +9230,8 @@ SUBROUTINE cup_output_ens_3d(name,xff_shal,xff_mid,xf_ens,ierr,dellat,dellaq,del
outtem (i,k) = tend2d(k,1)
outq (i,k) = tend2d(k,2)
outqc (i,k) = tend2d(k,3)
outu (i,k) = tend2d(k,4)
outv (i,k) = tend2d(k,5)
outu (i,k) = tend2d(k,4)
outv (i,k) = tend2d(k,5)
ENDDO
cycle

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ SUBROUTINE GF_GEOS5_INTERFACE(mxp,myp,mzp,LONS,LATS,dt_moist &
,CNV_MFC, CNV_UPDF, CNV_CVW, CNV_QC, CLCN &
,QV_DYN_IN,PLE_DYN_IN,U_DYN_IN,V_DYN_IN,T_DYN_IN &
,RADSW ,RADLW ,DQDT_BL ,DTDT_BL &
,FRLAND ,AREA ,USTAR ,TSTAR ,QSTAR ,T2M ,Q2M &
,FRLAND ,AREA ,T2M ,Q2M &
,TA ,QA ,SH ,EVAP ,PHIS &
,KPBLIN ,CNVFRC,SRFTYPE &
,STOCHASTIC_SIG, SIGMA_DEEP, SIGMA_MID &
Expand Down Expand Up @@ -131,7 +131,7 @@ SUBROUTINE GF_GEOS5_INTERFACE(mxp,myp,mzp,LONS,LATS,dt_moist &
REAL ,DIMENSION(mxp,myp) ,INTENT(OUT) :: MFDP,MFSH,MFMD,ERRDP,ERRSH,ERRMD
REAL ,DIMENSION(mxp,myp) ,INTENT(OUT) :: AA0,AA1,AA2,AA3,AA1_BL,AA1_CIN,TAU_BL,TAU_EC

REAL ,DIMENSION(MXP,MYP) ,INTENT(IN) :: FRLAND ,AREA ,USTAR ,TSTAR ,QSTAR &
REAL ,DIMENSION(MXP,MYP) ,INTENT(IN) :: FRLAND ,AREA &
,T2M ,Q2M ,TA ,QA ,SH ,EVAP ,PHIS &
,KPBLIN,CNVFRC,SRFTYPE,LONS,LATS &
,STOCHASTIC_SIG
Expand Down
Loading

0 comments on commit 91c183c

Please sign in to comment.