Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull in hwt_v04 updates into develop #745

Merged
merged 14 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions GEOSagcm_GridComp/GEOSphysics_GridComp/GEOS_PhysicsGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -340,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 @@ -375,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 @@ -571,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 @@ -2011,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 @@ -2700,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 @@ -2758,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 @@ -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.9839*exp(-0.09835*(dx(i)/ 500.)) ! 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
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ subroutine BACM_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
real, allocatable, dimension(:,:) :: TMP2D
type(ESMF_State) :: AERO
! Exports
real, pointer, dimension(:,:,:) :: DQVDT_macro, DQIDT_macro, DQLDT_macro, DQADT_macro
real, pointer, dimension(:,:,:) :: DQVDT_micro, DQIDT_micro, DQLDT_micro, DQADT_micro
real, pointer, dimension(:,:,:) :: DUDT_micro, DVDT_micro, DTDT_micro
real, pointer, dimension(:,:,:) :: RAD_CF, RAD_QV, RAD_QL, RAD_QI, RAD_QR, RAD_QS, RAD_QG
Expand Down Expand Up @@ -474,6 +475,10 @@ subroutine BACM_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
end do

! Export Tendencies
call MAPL_GetPointer(EXPORT, DQVDT_macro, 'DQVDT_macro' , ALLOC=.TRUE., RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, DQIDT_macro, 'DQIDT_macro' , ALLOC=.TRUE., RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, DQLDT_macro, 'DQLDT_macro' , ALLOC=.TRUE., RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, DQADT_macro, 'DQADT_macro' , ALLOC=.TRUE., RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, DQVDT_micro, 'DQVDT_micro' , ALLOC=.TRUE., RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, DQIDT_micro, 'DQIDT_micro' , ALLOC=.TRUE., RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT, DQLDT_micro, 'DQLDT_micro' , ALLOC=.TRUE., RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -686,6 +691,7 @@ subroutine BACM_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
VFALLSN_AN , VFALLSN_LS ,VFALLSN_CN ,VFALLSN_SC , &
VFALLRN_AN , VFALLRN_LS ,VFALLRN_CN ,VFALLRN_SC , &
PDF_A, PDFITERS, &
DQVDT_macro, DQLDT_macro, DQIDT_macro, DQADT_macro, &
WTHV2, WQL, &
NACTL, &
NACTI, &
Expand Down Expand Up @@ -730,10 +736,10 @@ subroutine BACM_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
CLDREFFL = 14.0e-6
end where

DQVDT_micro = ( Q - DQVDT_micro) / DT_MOIST
DQLDT_micro = ((QLLS+QLCN) - DQLDT_micro) / DT_MOIST
DQIDT_micro = ((QILS+QICN) - DQIDT_micro) / DT_MOIST
DQADT_micro = ((CLLS+CLCN) - DQADT_micro) / DT_MOIST
DQVDT_micro = ( Q - DQVDT_micro) / DT_MOIST - DQVDT_macro
DQLDT_micro = ((QLLS+QLCN) - DQLDT_micro) / DT_MOIST - DQLDT_macro
DQIDT_micro = ((QILS+QICN) - DQIDT_micro) / DT_MOIST - DQIDT_macro
DQADT_micro = ((CLLS+CLCN) - DQADT_micro) / DT_MOIST - DQADT_macro
DUDT_micro = ( U - DUDT_micro) / DT_MOIST
DVDT_micro = ( V - DVDT_micro) / DT_MOIST
DTDT_micro = ( T - DTDT_micro) / DT_MOIST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ subroutine GFDL_1M_Initialize (MAPL, RC)
call gfdl_cloud_microphys_init()
call WRITE_PARALLEL ("INITIALIZED GFDL_1M microphysics in non-generic GC INIT")

call MAPL_GetResource( MAPL, TURNRHCRIT , 'TURNRHCRIT:' , DEFAULT= 750.0 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, PDFSHAPE , 'PDFSHAPE:' , DEFAULT= 2 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, TURNRHCRIT , 'TURNRHCRIT:' , DEFAULT= -9999., RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, PDFSHAPE , 'PDFSHAPE:' , DEFAULT= 1 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, ANV_ICEFALL , 'ANV_ICEFALL:' , DEFAULT= 0.8 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, LS_ICEFALL , 'LS_ICEFALL:' , DEFAULT= 0.8 , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource( MAPL, FAC_RI , 'FAC_RI:' , DEFAULT= 1.0 , RC=STATUS); VERIFY_(STATUS)
Expand All @@ -246,11 +246,11 @@ subroutine GFDL_1M_Initialize (MAPL, RC)
call MAPL_GetResource( MAPL, MAX_RL , 'MAX_RL:' , DEFAULT=60.0e-6, RC=STATUS); VERIFY_(STATUS)

CCW_EVAP_EFF = 4.e-3
!!! if (do_evap) CCW_EVAP_EFF = 0.0 ! Evap done inside of GFDL
if (do_evap) CCW_EVAP_EFF = 0.0 ! Evap done inside GFDL-MP
call MAPL_GetResource( MAPL, CCW_EVAP_EFF, 'CCW_EVAP_EFF:', DEFAULT= CCW_EVAP_EFF, RC=STATUS); VERIFY_(STATUS)

CCI_EVAP_EFF = 4.e-3
!!! if (do_subl) CCI_EVAP_EFF = 0.0 ! Subl done inside of GFDL
if (do_subl) CCI_EVAP_EFF = 0.0 ! Subl done inside GFDL-MP
call MAPL_GetResource( MAPL, CCI_EVAP_EFF, 'CCI_EVAP_EFF:', DEFAULT= CCI_EVAP_EFF, RC=STATUS); VERIFY_(STATUS)

call MAPL_GetResource( MAPL, CNV_FRACTION_MIN, 'CNV_FRACTION_MIN:', DEFAULT= 0.0, RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -319,8 +319,8 @@ subroutine GFDL_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
real, pointer, dimension(:,: ) :: PTR2D

! Local variables
real :: turnrhcritS, turnrhcritU, facEIS
real :: turnrhcrit, minrhcrit, ALPHA, RHCRIT
real :: facEIS
real :: minrhcrit, ALPHA, RHCRIT
integer :: IM,JM,LM
integer :: I, J, L

Expand Down Expand Up @@ -531,11 +531,13 @@ subroutine GFDL_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
do J=1,JM
do I=1,IM
! Send the condensates through the pdf after convection
facEIS = MIN(1.0,EIS(I,J)/10.0)**2
! determine the turn pressure using the LCL
turnrhcrit = PLmb(I, J, KLCL(I,J)) - 50.0 ! 50mb above the LCL
facEIS = MAX(0.0,MIN(1.0,EIS(I,J)/10.0))**2
! determine combined minrhcrit in stable/unstable regimes
minrhcrit = (1.0-dw_ocean)*(1.0-facEIS) + (1.0-dw_land)*facEIS
if (turnrhcrit <= 0.0) then
! determine the turn pressure using the LCL
turnrhcrit = PLmb(I, J, KLCL(I,J)) - 250.0 ! 250mb above the LCL
endif
! Use Slingo-Ritter (1985) formulation for critical relative humidity
RHCRIT = 1.0
! lower turn from maxrhcrit=1.0
Expand All @@ -546,12 +548,12 @@ subroutine GFDL_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
RHCRIT = 1.0
else
RHCRIT = minrhcrit + (1.0-minrhcrit)/(19.) * &
((atan( (2.*(PLmb(i,j,l)-turnrhcrit)/min(100., PLEmb(i,j,LM)-turnrhcrit)-1.) * &
((atan( (2.*(PLmb(i,j,l)-turnrhcrit)/(PLEmb(i,j,LM)-turnrhcrit)-1.) * &
tan(20.*MAPL_PI/21.-0.5*MAPL_PI) ) + 0.5*MAPL_PI) * 21./MAPL_PI - 1.)
endif
endif
! include grid cell area scaling and limit RHcrit to > 70%
ALPHA = max(0.0,min(0.30, (1.0-RHCRIT)*SQRT(SQRT(AREA(I,J)/1.e10))))
ALPHA = max(0.0,min(0.30, (1.0-RHCRIT)*SQRT(SQRT(AREA(I,J)/1.e10)) ) )
! fill RHCRIT export
if (associated(RHCRIT3D)) RHCRIT3D(I,J,L) = 1.0-ALPHA
! Put condensates in touch with the PDF
Expand Down Expand Up @@ -591,6 +593,19 @@ subroutine GFDL_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
.false. , &
USE_BERGERON)
RHX(I,J,L) = Q(I,J,L)/GEOS_QSAT( T(I,J,L), PLmb(I,J,L) )
! meltfrz new condensates
call MELTFRZ ( DT_MOIST , &
CNV_FRC(I,J) , &
SRF_TYPE(I,J), &
T(I,J,L) , &
QLCN(I,J,L) , &
QICN(I,J,L) )
call MELTFRZ ( DT_MOIST , &
CNV_FRC(I,J) , &
SRF_TYPE(I,J), &
T(I,J,L) , &
QLLS(I,J,L) , &
QILS(I,J,L) )
endif
! evaporation for CN
if (CCW_EVAP_EFF > 0.0) then ! else evap done inside GFDL
Expand Down Expand Up @@ -630,19 +645,8 @@ subroutine GFDL_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
QST3(I,J,L) )
SUBLC(I,J,L) = ( Q(I,J,L) - SUBLC(I,J,L) ) / DT_MOIST
endif
! meltfrz new condensates
call MELTFRZ ( DT_MOIST , &
CNV_FRC(I,J) , &
SRF_TYPE(I,J), &
T(I,J,L) , &
QLCN(I,J,L) , &
QICN(I,J,L) )
call MELTFRZ ( DT_MOIST , &
CNV_FRC(I,J) , &
SRF_TYPE(I,J), &
T(I,J,L) , &
QLLS(I,J,L) , &
QILS(I,J,L) )
! cleanup clouds
call FIX_UP_CLOUDS( Q(I,J,L), T(I,J,L), QLLS(I,J,L), QILS(I,J,L), CLLS(I,J,L), QLCN(I,J,L), QICN(I,J,L), CLCN(I,J,L) )
end do ! IM loop
end do ! JM loop
end do ! LM loop
Expand Down Expand Up @@ -719,8 +723,6 @@ subroutine GFDL_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)
call gfdl_cloud_microphys_driver( &
! Input water/cloud species and liquid+ice CCN [NACTL+NACTI (#/m^3)]
RAD_QV, RAD_QL, RAD_QR, RAD_QI, RAD_QS, RAD_QG, RAD_CF, (NACTL+NACTI), &
! convective portions
QICN, QLCN, CLCN, &
! Output tendencies
DQVDTmic, DQLDTmic, DQRDTmic, DQIDTmic, &
DQSDTmic, DQGDTmic, DQADTmic, DTDTmic, &
Expand Down Expand Up @@ -889,64 +891,4 @@ subroutine GFDL_1M_Run (GC, IMPORT, EXPORT, CLOCK, RC)

end subroutine GFDL_1M_Run

subroutine REDISTRIBUTE_CLOUDS(CF, QL, QI, CLCN, CLLS, QLCN, QLLS, QICN, QILS, QV, TE)
real, dimension(:,:,:), intent(inout) :: CF, QL, QI, CLCN, CLLS, QLCN, QLLS, QICN, QILS, QV, TE
! local storage for cnv fraction of condensate/cloud
real :: FCN(size(CF,1),size(CF,2),size(CF,3))

FCN = 0.0
WHERE (QLCN+QLLS > 0.0)
FCN = min(max(QLCN/(QLCN+QLLS), 0.0), 1.0)
END WHERE
WHERE (QL < 1.e-8)
QV = QV + QL
TE = TE - (MAPL_ALHL/MAPL_CP)*QL
QL = 0.0
QLLS = 0.0
QLCN = 0.0
ELSE WHERE
QLCN = FCN*QL
QLLS = MAX(0.0,QL-QLCN)
END WHERE

FCN = 0.0
WHERE (QICN+QILS > 0.0)
FCN = min(max(QICN/(QICN+QILS), 0.0), 1.0)
END WHERE
WHERE (QI < 1.e-8)
QV = QV + QI
TE = TE - (MAPL_ALHS/MAPL_CP)*QI
QI = 0.0
QILS = 0.0
QICN = 0.0
ELSE WHERE
QICN = FCN*QI
QILS = MAX(0.0,QI-QICN)
END WHERE

FCN = 0.0
WHERE (CLCN+CLLS > 0.0)
FCN = min(max(CLCN/(CLCN+CLLS), 0.0), 1.0)
END WHERE
WHERE ( (CF < 1.e-5) .or. (QL+QI < 1.e-8) )
CF = 0.0
CLLS = 0.0
CLCN = 0.0
QV = QV + QL + QI
TE = TE - (MAPL_ALHL/MAPL_CP)*QL - (MAPL_ALHS/MAPL_CP)*QI
QL = 0.0
QLLS = 0.0
QLCN = 0.0
QI = 0.0
QILS = 0.0
QICN = 0.0
ELSE WHERE
CLCN = FCN*CF
CLLS = MAX(0.0,MIN(CF-CLCN,1.0))
END WHERE

end subroutine REDISTRIBUTE_CLOUDS



end module GEOS_GFDL_1M_InterfaceMod
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ subroutine GF_Initialize (MAPL, CLOCK, RC)
call MAPL_GetResource(MAPL, STOCH_TOP , 'STOCH_TOP:' ,default= 2.50, RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource(MAPL, STOCH_BOT , 'STOCH_BOT:' ,default= 0.75, RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource(MAPL, STOCHASTIC_CNV , 'STOCHASTIC_CNV:' ,default= .FALSE.,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetResource(MAPL, GF_MIN_AREA , 'GF_MIN_AREA:' ,default= 0.00, RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, TAU_MID , 'TAU_MID:' ,default= 3600., RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, TAU_DEEP , 'TAU_DEEP:' ,default= 5400., RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, GF_MIN_AREA , 'GF_MIN_AREA:' ,default= -1.e6, RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, TAU_MID , 'TAU_MID:' ,default= 5400., RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, TAU_DEEP , 'TAU_DEEP:' ,default= 10800.,RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, CLEV_GRID , 'CLEV_GRID:' ,default= 1, RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, VERT_DISCR , 'VERT_DISCR:' ,default= 1, RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, USE_FCT , 'USE_FCT:' ,default= 1, RC=STATUS );VERIFY_(STATUS)
Expand All @@ -186,7 +186,7 @@ subroutine GF_Initialize (MAPL, CLOCK, RC)
call MAPL_GetResource(MAPL, C0_DEEP , 'C0_DEEP:' ,default= 2.0e-3,RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, C0_MID , 'C0_MID:' ,default= 2.0e-3,RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, C0_SHAL , 'C0_SHAL:' ,default= 0. ,RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, QRC_CRIT , 'QRC_CRIT:' ,default= 2.e-4, RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, QRC_CRIT , 'QRC_CRIT:' ,default= 2.0e-4,RC=STATUS );VERIFY_(STATUS)
else
call MAPL_GetResource(MAPL, C0_DEEP , 'C0_DEEP:' ,default= 1.5e-3,RC=STATUS );VERIFY_(STATUS)
call MAPL_GetResource(MAPL, C0_MID , 'C0_MID:' ,default= 1.0e-3,RC=STATUS );VERIFY_(STATUS)
Expand Down Expand Up @@ -502,7 +502,11 @@ subroutine GF_Run (GC, IMPORT, EXPORT, CLOCK, RC)
TMP2D = AREA
endwhere
else if (GF_MIN_AREA < 0) then
TMP2D = ABS(GF_MIN_AREA)
where (AREA > ABS(GF_MIN_AREA))
TMP2D = AREA*CNV_FRC + ABS(GF_MIN_AREA)*(1.0-CNV_FRC)
elsewhere
TMP2D = AREA
endwhere
else
TMP2D = AREA
endif
Expand Down
Loading