Skip to content

Commit 32b7768

Browse files
authored
Merge pull request #255 from GEOS-ESM/develop
GitFlow: Merge develop into main for release
2 parents b840c52 + 85eaba1 commit 32b7768

File tree

2 files changed

+69
-61
lines changed

2 files changed

+69
-61
lines changed

DynCore_GridCompMod.F90

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7043,106 +7043,108 @@ subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC )
70437043
if (.not. ADIABATIC) then
70447044
_ASSERT(nwat >= 1, 'expecting water species (nwat) to match')
70457045
endif
7046+
7047+
select case(nwat)
7048+
case(1)
7049+
sphum = 1
7050+
liq_wat = -1
7051+
ice_wat = -1
7052+
rainwat = -1
7053+
snowwat = -1
7054+
graupel = -1
7055+
case(3)
7056+
sphum = 1
7057+
liq_wat = 2
7058+
ice_wat = 3
7059+
rainwat = -1
7060+
snowwat = -1
7061+
graupel = -1
7062+
case(6:7)
7063+
sphum = 1
7064+
liq_wat = 2
7065+
ice_wat = 3
7066+
rainwat = 4
7067+
snowwat = 5
7068+
graupel = 6
7069+
end select
7070+
70467071
if (nwat >= 1) then
70477072
ALLOCATE( Q(is:ie,js:je,1:km,nwat) )
70487073
ALLOCATE( CVM(is:ie,js:je,1:km) )
70497074
Q(:,:,:,:) = 0.0
70507075
call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName='Q', RC=rc )
70517076
if (DYN_COLDSTART .and. overwrite_Q .and. (.not. ADIABATIC)) then
70527077
! USE Q computed by FV3
7053-
call getQ(Q(:,:,:,1), 'Q')
7078+
call getQ(Q(:,:,:,sphum), 'Q')
70547079
overwrite_Q=.false.
70557080
call WRITE_PARALLEL("Using QV from FV3 Initial Conditions")
70567081
fac = 1.0
7057-
call prt_maxmin('AI Q', Q(:,:,:,1), is, ie, js, je, 0, km, fac)
7082+
call prt_maxmin('AI Q', Q(:,:,:,sphum), is, ie, js, je, 0, km, fac)
70587083
if ( (qqq%is_r4) .and. (associated(qqq%content_r4)) ) then
7059-
if (size(Q(:,:,:,1))==size(qqq%content_r4)) qqq%content_r4 = Q(:,:,:,1)
7084+
if (size(Q(:,:,:,sphum))==size(qqq%content_r4)) qqq%content_r4 = Q(:,:,:,sphum)
70607085
elseif (associated(qqq%content)) then
7061-
if (size(Q(:,:,:,1))==size(qqq%content)) qqq%content = Q(:,:,:,1)
7086+
if (size(Q(:,:,:,sphum))==size(qqq%content)) qqq%content = Q(:,:,:,sphum)
70627087
endif
70637088
else
70647089
! Grab QV from imports
70657090
if ( (qqq%is_r4) .and. (associated(qqq%content_r4)) ) then
7066-
if (size(Q(:,:,:,1))==size(qqq%content_r4)) Q(:,:,:,1) = qqq%content_r4
7091+
if (size(Q(:,:,:,sphum))==size(qqq%content_r4)) Q(:,:,:,sphum) = qqq%content_r4
70677092
elseif (associated(qqq%content)) then
7068-
if (size(Q(:,:,:,1))==size(qqq%content)) Q(:,:,:,1) = qqq%content
7093+
if (size(Q(:,:,:,sphum))==size(qqq%content)) Q(:,:,:,sphum) = qqq%content
70697094
endif
70707095
endif
70717096
endif
70727097
if (nwat >= 3) then
70737098
! Grab QLIQ from imports
70747099
call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName='QLLS', RC=rc )
70757100
if ( (qqq%is_r4) .and. (associated(qqq%content_r4)) ) then
7076-
if (size(Q(:,:,:,2))==size(qqq%content_r4)) Q(:,:,:,2) = Q(:,:,:,2) + qqq%content_r4
7101+
if (size(Q(:,:,:,liq_wat))==size(qqq%content_r4)) Q(:,:,:,liq_wat) = Q(:,:,:,liq_wat) + qqq%content_r4
70777102
elseif (associated(qqq%content)) then
7078-
if (size(Q(:,:,:,2))==size(qqq%content)) Q(:,:,:,2) = Q(:,:,:,2) + qqq%content
7103+
if (size(Q(:,:,:,liq_wat))==size(qqq%content)) Q(:,:,:,liq_wat) = Q(:,:,:,liq_wat) + qqq%content
70797104
endif
70807105
call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName='QLCN', RC=rc )
70817106
if ( (qqq%is_r4) .and. (associated(qqq%content_r4)) ) then
7082-
if (size(Q(:,:,:,2))==size(qqq%content_r4)) Q(:,:,:,2) = Q(:,:,:,2) + qqq%content_r4
7107+
if (size(Q(:,:,:,liq_wat))==size(qqq%content_r4)) Q(:,:,:,liq_wat) = Q(:,:,:,liq_wat) + qqq%content_r4
70837108
elseif (associated(qqq%content)) then
7084-
if (size(Q(:,:,:,2))==size(qqq%content)) Q(:,:,:,2) = Q(:,:,:,2) + qqq%content
7109+
if (size(Q(:,:,:,liq_wat))==size(qqq%content)) Q(:,:,:,liq_wat) = Q(:,:,:,liq_wat) + qqq%content
70857110
endif
70867111
! Grab QICE from imports
70877112
call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName='QILS', RC=rc )
70887113
if ( (qqq%is_r4) .and. (associated(qqq%content_r4)) ) then
7089-
if (size(Q(:,:,:,3))==size(qqq%content_r4)) Q(:,:,:,3) = Q(:,:,:,3) + qqq%content_r4
7114+
if (size(Q(:,:,:,ice_wat))==size(qqq%content_r4)) Q(:,:,:,ice_wat) = Q(:,:,:,ice_wat) + qqq%content_r4
70907115
elseif (associated(qqq%content)) then
7091-
if (size(Q(:,:,:,3))==size(qqq%content)) Q(:,:,:,3) = Q(:,:,:,3) + qqq%content
7116+
if (size(Q(:,:,:,ice_wat))==size(qqq%content)) Q(:,:,:,ice_wat) = Q(:,:,:,ice_wat) + qqq%content
70927117
endif
70937118
call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName='QICN', RC=rc )
70947119
if ( (qqq%is_r4) .and. (associated(qqq%content_r4)) ) then
7095-
if (size(Q(:,:,:,3))==size(qqq%content_r4)) Q(:,:,:,3) = Q(:,:,:,3) + qqq%content_r4
7120+
if (size(Q(:,:,:,ice_wat))==size(qqq%content_r4)) Q(:,:,:,ice_wat) = Q(:,:,:,ice_wat) + qqq%content_r4
70967121
elseif (associated(qqq%content)) then
7097-
if (size(Q(:,:,:,3))==size(qqq%content)) Q(:,:,:,3) = Q(:,:,:,3) + qqq%content
7122+
if (size(Q(:,:,:,ice_wat))==size(qqq%content)) Q(:,:,:,ice_wat) = Q(:,:,:,ice_wat) + qqq%content
70987123
endif
70997124
endif
71007125
if (nwat >= 6) then
71017126
! Grab RAIN from imports
71027127
call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName='QRAIN', RC=rc )
71037128
if ( (qqq%is_r4) .and. (associated(qqq%content_r4)) ) then
7104-
if (size(Q(:,:,:,4))==size(qqq%content_r4)) Q(:,:,:,4) = qqq%content_r4
7129+
if (size(Q(:,:,:,rainwat))==size(qqq%content_r4)) Q(:,:,:,rainwat) = qqq%content_r4
71057130
elseif (associated(qqq%content)) then
7106-
if (size(Q(:,:,:,4))==size(qqq%content)) Q(:,:,:,4) = qqq%content
7131+
if (size(Q(:,:,:,rainwat))==size(qqq%content)) Q(:,:,:,rainwat) = qqq%content
71077132
endif
71087133
! Grab SNOW from imports
71097134
call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName='QSNOW', RC=rc )
71107135
if ( (qqq%is_r4) .and. (associated(qqq%content_r4)) ) then
7111-
if (size(Q(:,:,:,5))==size(qqq%content_r4)) Q(:,:,:,5) = qqq%content_r4
7136+
if (size(Q(:,:,:,snowwat))==size(qqq%content_r4)) Q(:,:,:,snowwat) = qqq%content_r4
71127137
elseif (associated(qqq%content)) then
7113-
if (size(Q(:,:,:,5))==size(qqq%content)) Q(:,:,:,5) = qqq%content
7138+
if (size(Q(:,:,:,snowwat))==size(qqq%content)) Q(:,:,:,snowwat) = qqq%content
71147139
endif
71157140
! Grab GRAUPEL from imports
71167141
call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName='QGRAUPEL', RC=rc )
71177142
if ( (qqq%is_r4) .and. (associated(qqq%content_r4)) ) then
7118-
if (size(Q(:,:,:,6))==size(qqq%content_r4)) Q(:,:,:,6) = qqq%content_r4
7143+
if (size(Q(:,:,:,graupel))==size(qqq%content_r4)) Q(:,:,:,graupel) = qqq%content_r4
71197144
elseif (associated(qqq%content)) then
7120-
if (size(Q(:,:,:,6))==size(qqq%content)) Q(:,:,:,6) = qqq%content
7145+
if (size(Q(:,:,:,graupel))==size(qqq%content)) Q(:,:,:,graupel) = qqq%content
71217146
endif
71227147
endif
7123-
select case(nwat)
7124-
case(1)
7125-
sphum = 1
7126-
liq_wat = -1
7127-
ice_wat = -1
7128-
rainwat = -1
7129-
snowwat = -1
7130-
graupel = -1
7131-
case(3)
7132-
sphum = 1
7133-
liq_wat = 2
7134-
ice_wat = 3
7135-
rainwat = -1
7136-
snowwat = -1
7137-
graupel = -1
7138-
case(6:7)
7139-
sphum = 1
7140-
liq_wat = 2
7141-
ice_wat = 3
7142-
rainwat = 4
7143-
snowwat = 5
7144-
graupel = 6
7145-
end select
71467148

71477149
if ( (.not. ADIABATIC) .and. (DO_ADD_INCS) ) then
71487150

FV_StateMod.F90

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ subroutine FV_Setup(GC,LAYOUT_FILE, RC)
490490
! when reading the tracer bundle in fv_first_run
491491
FV_Atm(1)%flagstruct%nwat = 0
492492
! Trigger to enable autoconversion/cloud processes on the fv_mapz step
493-
FV_Atm(1)%flagstruct%do_sat_adj = .false. ! only valid when nwat >= 6
493+
FV_Atm(1)%flagstruct%do_sat_adj = .false.
494494
! Veritical resolution dependencies
495495
FV_Atm(1)%flagstruct%external_eta = .true.
496496
if (FV_Atm(1)%flagstruct%npz >= 70) then
@@ -544,6 +544,9 @@ subroutine FV_Setup(GC,LAYOUT_FILE, RC)
544544
! Rayleigh & Divergence Damping
545545
if (index(FV3_CONFIG,"HWT") > 0) then
546546
FV_Atm(1)%flagstruct%fv_sg_adj = min(3600.0,DT*4.0)
547+
if (FV_Atm(1)%flagstruct%npz >= 71) then
548+
FV_Atm(1)%flagstruct%n_zfilter = 37 ! ~100mb
549+
endif
547550
if (FV_Atm(1)%flagstruct%npz >= 90) then
548551
FV_Atm(1)%flagstruct%n_zfilter = 46 ! ~100mb
549552
endif
@@ -553,11 +556,15 @@ subroutine FV_Setup(GC,LAYOUT_FILE, RC)
553556
if (FV_Atm(1)%flagstruct%npz >= 180) then
554557
FV_Atm(1)%flagstruct%n_zfilter = 92 ! ~100mb
555558
endif
556-
FV_Atm(1)%flagstruct%do_sat_adj = .true. ! only valid when nwat >= 6
559+
FV_Atm(1)%flagstruct%do_sat_adj = .false. ! only valid when nwat >= 6
557560
FV_Atm(1)%flagstruct%dz_min = 6.0
558561
FV_Atm(1)%flagstruct%RF_fast = .true.
559-
FV_Atm(1)%flagstruct%tau = 2.0
560-
FV_Atm(1)%flagstruct%rf_cutoff = 10.e2
562+
if (FV_Atm(1)%flagstruct%npz == 72) then
563+
FV_Atm(1)%flagstruct%tau = 0.0
564+
else
565+
FV_Atm(1)%flagstruct%tau = 2.0
566+
endif
567+
FV_Atm(1)%flagstruct%rf_cutoff = 0.35e2
561568
! 6th order default damping options
562569
FV_Atm(1)%flagstruct%nord = 3
563570
FV_Atm(1)%flagstruct%dddmp = 0.1
@@ -653,7 +660,7 @@ subroutine FV_Setup(GC,LAYOUT_FILE, RC)
653660
FV_Atm(1)%flagstruct%d_con = 0.
654661
else
655662
! Non-Monotonic advection
656-
if (FV_Atm(1)%flagstruct%stretch_fac > 1.0) then
663+
if (index(FV3_CONFIG,"HWT") > 0) then
657664
FV_Atm(1)%flagstruct%hord_mt = 6
658665
FV_Atm(1)%flagstruct%hord_vt = 6
659666
FV_Atm(1)%flagstruct%hord_tm = 6
@@ -730,7 +737,9 @@ subroutine FV_Setup(GC,LAYOUT_FILE, RC)
730737
endif
731738

732739
!! Setup GFDL microphysics module
733-
call gfdl_cloud_microphys_init()
740+
if (FV_Atm(1)%flagstruct%do_sat_adj) then
741+
call gfdl_cloud_microphys_init()
742+
endif
734743

735744
_ASSERT(DT > 0.0, 'DT must be greater than zero')
736745

@@ -1326,9 +1335,6 @@ subroutine FV_Run (STATE, EXPORT, CLOCK, GC, RC)
13261335
endif
13271336
if (nwat_tracers >= 10) FV_Atm(1)%flagstruct%nwat = 6 ! Tell FV3 about QV, QLIQ, QICE, QRAIN, QSNOW, QGRAUPEL plus QCLD
13281337
endif
1329-
!if (FV_Atm(1)%flagstruct%do_sat_adj) then
1330-
! _ASSERT(FV_Atm(1)%flagstruct%nwat >= 6, 'when using fv saturation adjustment NWAT must >= 6')
1331-
!endif
13321338
STATE%VARS%nwat = FV_Atm(1)%flagstruct%nwat
13331339
endif
13341340
#ifdef VERIFY_GRID
@@ -1485,7 +1491,7 @@ subroutine FV_Run (STATE, EXPORT, CLOCK, GC, RC)
14851491
endif
14861492
endif
14871493
if (qlcnf /= -1) then ! QLCN
1488-
if (fv_first_run) call WRITE_PARALLEL( trim(STATE%VARS%TRACER(n)%TNAME) )
1494+
if (fv_first_run) call WRITE_PARALLEL( trim('QLCNF') )
14891495
QLCN_FILLED = .TRUE.
14901496
nn = nn+1
14911497
if (state%vars%tracer(n)%is_r4) then
@@ -1538,7 +1544,7 @@ subroutine FV_Run (STATE, EXPORT, CLOCK, GC, RC)
15381544
endif
15391545
endif
15401546
if (qicnf /= -1) then ! QICN
1541-
if (fv_first_run) call WRITE_PARALLEL( trim(STATE%VARS%TRACER(n)%TNAME) )
1547+
if (fv_first_run) call WRITE_PARALLEL( trim('QICNF') )
15421548
QICN_FILLED = .TRUE.
15431549
nn = nn+1
15441550
if (state%vars%tracer(n)%is_r4) then
@@ -1622,7 +1628,7 @@ subroutine FV_Run (STATE, EXPORT, CLOCK, GC, RC)
16221628
endif
16231629
endif
16241630
if (clcnf /= -1) then ! CLCN
1625-
if (fv_first_run) call WRITE_PARALLEL( trim(STATE%VARS%TRACER(n)%TNAME) )
1631+
if (fv_first_run) call WRITE_PARALLEL( trim('CLCNF') )
16261632
CLCN_FILLED = .TRUE.
16271633
nn = nn+1
16281634
if (state%vars%tracer(n)%is_r4) then
@@ -1733,7 +1739,7 @@ subroutine FV_Run (STATE, EXPORT, CLOCK, GC, RC)
17331739
select case (FV_Atm(1)%flagstruct%nwat)
17341740
case (0)
17351741
do n=1,STATE%GRID%NQ
1736-
if (fv_first_run) call WRITE_PARALLEL( trim(STATE%VARS%TRACER(n)%TNAME) )
1742+
if (fv_first_run) call WRITE_PARALLEL( trim('--'//STATE%VARS%TRACER(n)%TNAME) )
17371743
nn = nn+1
17381744
if (state%vars%tracer(n)%is_r4) then
17391745
FV_Atm(1)%q(isc:iec,jsc:jec,1:npz,nn) = state%vars%tracer(n)%content_r4(:,:,:)
@@ -1748,7 +1754,7 @@ subroutine FV_Run (STATE, EXPORT, CLOCK, GC, RC)
17481754
(TRIM(state%vars%tracer(n)%tname) /= 'QLLS' ) .and. &
17491755
(TRIM(state%vars%tracer(n)%tname) /= 'QICN' ) .and. &
17501756
(TRIM(state%vars%tracer(n)%tname) /= 'QILS' ) ) then
1751-
if (fv_first_run) call WRITE_PARALLEL( trim(STATE%VARS%TRACER(n)%TNAME) )
1757+
if (fv_first_run) call WRITE_PARALLEL( trim('--'//STATE%VARS%TRACER(n)%TNAME) )
17521758
nn=nn+1
17531759
if (state%vars%tracer(n)%is_r4) then
17541760
FV_Atm(1)%q(isc:iec,jsc:jec,1:npz,nn) = state%vars%tracer(n)%content_r4(:,:,:)
@@ -1764,7 +1770,7 @@ subroutine FV_Run (STATE, EXPORT, CLOCK, GC, RC)
17641770
(TRIM(state%vars%tracer(n)%tname) /= 'QLLS' ) .and. &
17651771
(TRIM(state%vars%tracer(n)%tname) /= 'QICN' ) .and. &
17661772
(TRIM(state%vars%tracer(n)%tname) /= 'QILS' ) ) then
1767-
if (fv_first_run) call WRITE_PARALLEL( trim(STATE%VARS%TRACER(n)%TNAME) )
1773+
if (fv_first_run) call WRITE_PARALLEL( trim('--'//STATE%VARS%TRACER(n)%TNAME) )
17681774
nn=nn+1
17691775
if (state%vars%tracer(n)%is_r4) then
17701776
FV_Atm(1)%q(isc:iec,jsc:jec,1:npz,nn) = state%vars%tracer(n)%content_r4(:,:,:)
@@ -1785,7 +1791,7 @@ subroutine FV_Run (STATE, EXPORT, CLOCK, GC, RC)
17851791
(TRIM(state%vars%tracer(n)%tname) /= 'QRAIN' ) .and. &
17861792
(TRIM(state%vars%tracer(n)%tname) /= 'QSNOW' ) .and. &
17871793
(TRIM(state%vars%tracer(n)%tname) /= 'QGRAUPEL') ) then
1788-
if (fv_first_run) call WRITE_PARALLEL( trim(STATE%VARS%TRACER(n)%TNAME) )
1794+
if (fv_first_run) call WRITE_PARALLEL( trim('--'//STATE%VARS%TRACER(n)%TNAME) )
17891795
nn=nn+1
17901796
if (state%vars%tracer(n)%is_r4) then
17911797
FV_Atm(1)%q(isc:iec,jsc:jec,1:npz,nn) = state%vars%tracer(n)%content_r4(:,:,:)
@@ -2593,7 +2599,7 @@ subroutine State_To_FV ( STATE )
25932599

25942600
if ( FV_Atm(1)%flagstruct%range_warn ) then
25952601
call range_check('T_S2F', FV_Atm(1)%pt, isc, iec, jsc, jec, ng, km, FV_Atm(1)%gridstruct%agrid, &
2596-
130., 335., bad_range=bad_range_T)
2602+
100., 335., bad_range=bad_range_T)
25972603
endif
25982604

25992605
!------------
@@ -2660,7 +2666,7 @@ subroutine FV_To_State ( STATE )
26602666
!-----------------------------------
26612667
!if ( FV_Atm(1)%flagstruct%range_warn ) then
26622668
! call range_check('T_F2S', FV_Atm(1)%pt, isc, iec, jsc, jec, ng, km, FV_Atm(1)%gridstruct%agrid, &
2663-
! 130., 335., bad_range)
2669+
! 100., 335., bad_range)
26642670
!endif
26652671
STATE%VARS%PT = FV_Atm(1)%pt(isc:iec,jsc:jec,:)
26662672

0 commit comments

Comments
 (0)