Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
a43637f
update standard names to move Xgrs to physics_timestep_initial* and r…
grantfirl Dec 12, 2024
e2cef59
fix a few unchanged standard names
grantfirl Dec 12, 2024
203aef1
change some timestep_initial variables to general variables; make sat…
grantfirl Jan 23, 2025
47b965d
Refactor physics tendency calculations
VanderleiVargas-NOAA Mar 6, 2025
ff51106
update unified_ugwp, ugwpv1, and drag_suite to use new tendency code
grantfirl Mar 6, 2025
e559c20
Merge branch 'main' into feature/tendency_cleanup
grantfirl Mar 6, 2025
71985f6
Merge remote-tracking branch 'vanderlei-fork/feature/tendency_cleanup…
grantfirl Mar 19, 2025
f61a5cc
save tendency work with GFS_photochemistry
grantfirl Mar 20, 2025
99cb1c1
add tracer tendency changes to convection; fix typos in GFS_photochem…
grantfirl Apr 3, 2025
0ad605e
Merge branch 'main' into feature/tendency_cleanup
grantfirl Apr 3, 2025
01ece2b
fix typo in samfdeepcnv.f
grantfirl Apr 3, 2025
2273a40
save tendency work with Thompson MP
grantfirl Apr 8, 2025
ae5341b
save tendency work with radiation
grantfirl Apr 10, 2025
fe637c5
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Apr 16, 2025
3d7f1bd
add FMS to ccpp-physics CMakeLists.txt for fv3
grantfirl Apr 17, 2025
4d853a2
add initial setting of state in GFS_time_vary_pre.fv3; fix horizontal…
grantfirl Apr 22, 2025
f2f0b13
fix metadata in GFS_time_vary_pre.fv3
grantfirl Apr 22, 2025
2d5a574
add momentum tendency output to mp_thompson and fix intent in metadata
grantfirl Apr 23, 2025
d9a86d4
fix array size bug in mp_thompson.F90; cleanup dtend code using new t…
grantfirl May 8, 2025
6366fb1
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl May 8, 2025
8c11d83
fix improperly-merged conflict resolution in GFS_photochemistry.F90
grantfirl May 8, 2025
6457217
fix access of ntlnc/ntinc access of tracer array when missing
grantfirl May 8, 2025
02994ba
convert many RAD, PBL, GWD, CONV, and MP schemes to return tendencies
grantfirl Jun 3, 2025
989c365
Merge branch 'main' into feature/tendency_cleanup
grantfirl Jun 3, 2025
054823f
convert MG micro and Arakawa-Wu adjustment schemes
grantfirl Jun 6, 2025
777141e
convert MYNNEDMF PBL scheme to return tendencies
grantfirl Jun 6, 2025
040dff6
add changes to MYNN EDMF PBL
grantfirl Jun 12, 2025
9af54df
Merge branch 'ufs-dev-PR278' into feature/tendency_cleanup
grantfirl Jun 18, 2025
e4173ff
add back divide-by-zero bugfix in module_sf_noahmp_glacier.F90 that w…
grantfirl Jun 18, 2025
3008f45
remove obsolete interstitial schemes
grantfirl Jul 9, 2025
baa7823
Merge branch 'feature/tendency_cleanup_save' into feature/tendency_cl…
grantfirl Jul 9, 2025
a8abf69
fix 2 minor compilation issues after testing with UFS RTs
grantfirl Jul 10, 2025
6900e2e
fix bug in MG MP
grantfirl Jul 10, 2025
e04588d
Merge branch 'ufs/dev' into feature/tendency_cleanup_20250710
grantfirl Jul 10, 2025
1207a1c
fix near-surface air temperature standard name in GFS_surface_composi…
grantfirl Jul 10, 2025
36fd667
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Jul 14, 2025
ebac15b
apply tendency cleanup to GFDLMPv3 and TEMPO
grantfirl Jul 16, 2025
f240be4
fix compilation error
grantfirl Jul 16, 2025
c277d27
fix typo in TEMPO
grantfirl Jul 16, 2025
59b0a31
debug sgscloud_radpre/post
grantfirl Jul 25, 2025
40aa0a1
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Sep 18, 2025
cb21c7a
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Dec 17, 2025
3432d52
remove tendency application code from rrtmg_lw/sw_post
grantfirl Dec 18, 2025
1a78061
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Dec 18, 2025
5d02db8
change thmpsn to thompson to fix compilation error
grantfirl Dec 18, 2025
e13abcd
fix compilation errors in GFS_radiation_post.F90
grantfirl Dec 18, 2025
6cd1e1a
remove Zhao-Carr cloud schemes and combine Xu-Randall cloud fraction …
Qingfu-Liu Jan 5, 2026
a11f2e5
fix array size problem in cs_conv.F90
grantfirl Jan 5, 2026
49c1919
refactor RAS tendencies
grantfirl Jan 6, 2026
908cdcf
fix compilation error in rascnv.F90
grantfirl Jan 6, 2026
1270b9e
Merge remote-tracking branch 'upstream/ufs/dev' into Zhao_Carr_cloud
Qingfu-Liu Jan 7, 2026
83191f3
change Xu-Randall cloud fraction scheme to be elemental
Qingfu-Liu Jan 7, 2026
3a66ae6
Fixed too-high lower bound for SMC
ClaraDraper-NOAA Jan 7, 2026
a0f2f28
use new cld_frac_XuRandall function from module_radiation_clouds in R…
Qingfu-Liu Jan 7, 2026
66fedab
Merge branch 'ufs/dev' into fix/stc_check
ClaraDraper-NOAA Jan 7, 2026
bbf9cff
Tidy-up for PR.
ClaraDraper-NOAA Jan 7, 2026
ca7e392
modify the cld_frac_XuRandall function call in RRTMGP scheme
Qingfu-Liu Jan 8, 2026
8415ad5
Changes to the post L-IAU checks:
ClaraDraper-NOAA Jan 12, 2026
979e121
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Jan 22, 2026
78140f8
Merge remote-tracking branch 'upstream/ufs/dev' into Zhao_Carr_cloud
Qingfu-Liu Jan 27, 2026
565d62c
add the repository update to this PR
Qingfu-Liu Jan 27, 2026
c580309
Revert "add the repository update to this PR"
Qingfu-Liu Jan 27, 2026
e7a1bc3
fix bug in GFDLMPv3 tendency implementation
grantfirl Jan 27, 2026
954b749
remove the printing tests
Qingfu-Liu Jan 28, 2026
49276b5
remove Zhao-Carr schemes from modules in the UFS_SCM_NEPTUNE directory
Qingfu-Liu Feb 2, 2026
5ce727f
remove Zhao-Carr microphysics scheme from physics/MP directory
Qingfu-Liu Feb 2, 2026
293f5c2
Merge remote-tracking branch 'upstream/ufs/dev' into Zhao_Carr_cloud
Qingfu-Liu Feb 11, 2026
1307210
fix hail tendency changes from reviewer suggestions
grantfirl Feb 11, 2026
55e658d
fix indexing bug in cu_tiedtke caught in code review
grantfirl Feb 11, 2026
a018a00
changes to RAS tendency application update code from code review
grantfirl Feb 12, 2026
2483645
check for flag_for_generic_tendency_due_to_gravity_wave_drag before c…
grantfirl Feb 12, 2026
b561b7e
fix diagnostic tendency bug in physics/GWD/ugwpv1_gsldrag.F90
grantfirl Feb 12, 2026
5cb0f01
remove unused arguments in physics/GWD/ugwpv1_gsldrag_post.F90
grantfirl Feb 12, 2026
5a5f4dc
fix tendency diagnostics in physics/GWD/unified_ugwp.F90
grantfirl Feb 12, 2026
4e0cd0b
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Feb 12, 2026
b8af973
fix merge problem in mp_thompson.meta
grantfirl Feb 12, 2026
d234ec9
add arguments to drag_suite_run called outside of ccpp entry point
grantfirl Feb 12, 2026
7537db1
initialize dclw variables in cu_ntiedtke
grantfirl Feb 18, 2026
1b720c9
fix loop bounds for ten_q in cu_gf_driver.F90
grantfirl Feb 19, 2026
02b8783
fix loop bounds in cu_c3_driver
grantfirl Feb 19, 2026
a5dbd4f
Merge remote-tracking branch 'upstream/ufs/dev' into Zhao_Carr_cloud
Qingfu-Liu Feb 25, 2026
9e70979
Merge pull request #350 from noaa-oar-arl/feature/aqm_canopy_vdf
grantfirl Feb 27, 2026
6022ddf
fix new_q typo in mp_fer_hires.F90
grantfirl Mar 2, 2026
bc08cc3
deallocate locally-allocated variables in MP schemes
grantfirl Mar 2, 2026
b6ef6af
update zeroing logic in m_micro_post after review
grantfirl Mar 2, 2026
6ea47ed
Merge branch 'ufs/dev' into fix/stc_check
ClaraDraper-NOAA Mar 3, 2026
579eb97
Update for 10m wind option in fire_behavior module
mkavulich Mar 3, 2026
ff9f553
Merge branch 'ufs/dev' into Zhao_Carr_cloud
grantfirl Mar 4, 2026
90f266d
remove non-ASCII character in canopy_levs.F90 (from previous PR)
grantfirl Mar 4, 2026
e673808
Updates to progomega option of saSAS convection scheme
lisa-bengtsson Mar 6, 2026
cd6a29d
Correction
lisa-bengtsson Mar 6, 2026
c2991ab
correction 2
lisa-bengtsson Mar 6, 2026
b09af5d
Merge pull request #337 from Qingfu-Liu/Zhao_Carr_cloud
grantfirl Mar 6, 2026
fbfd8bb
fix line in SHOC where a tracer was being updated directly
grantfirl Mar 10, 2026
66814cb
remove old_ozone array since it was not being used
grantfirl Mar 10, 2026
16c6886
Merge branch 'ufs/dev' into fix/stc_check
ClaraDraper-NOAA Mar 10, 2026
f7aea58
deallocate local variables in satmedmfvdifq at end of run phase
grantfirl Mar 10, 2026
07a6da7
save temperature before modification to pass in to diagnostics in GFS…
grantfirl Mar 10, 2026
c8311ff
Remove goto in physics/MP/Morrison_Gettelman/aer_cloud.F
NickSzapiro-NOAA Mar 12, 2026
7223e0b
Remove goto in physics/Radiation/radiation_clouds.f
NickSzapiro-NOAA Mar 12, 2026
6d6bab2
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Mar 12, 2026
3069b05
Merge remote-tracking branch 'upstream/ufs/dev' into new_fire_wind_opt
mkavulich Mar 12, 2026
68e8b6d
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
lisa-bengtsson Mar 16, 2026
e3d5f64
Merge pull request #363 from mkavulich/new_fire_wind_opt
rhaesung Mar 16, 2026
b334a18
Merge branch 'ufs/dev' into fix/stc_check
ClaraDraper-NOAA Mar 17, 2026
223d093
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
lisa-bengtsson Mar 18, 2026
ea1ae85
Merge pull request #339 from ClaraDraper-NOAA/fix/stc_check
grantfirl Mar 19, 2026
5ff0004
fix diagnostic temp tendency in GFS_MP_generic.F90 for when radar is/…
grantfirl Mar 19, 2026
e841285
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
lisa-bengtsson Mar 20, 2026
f2fbb17
Correct parameter setting in samfshalcnv to pass debug runs
lisa-bengtsson Mar 20, 2026
b60ff55
Name END DO
NickSzapiro-NOAA Mar 21, 2026
078512b
Remove goto physics/MP/calpreciptype.f90
NickSzapiro-NOAA Mar 21, 2026
2987e94
Remove goto physics/MP/Morrison_Gettelman/cldwat2m_micro.F
NickSzapiro-NOAA Mar 21, 2026
ce691fe
Start goto physics/SFC_Models/Land/RUC/module_sf_ruclsm.F90
NickSzapiro-NOAA Mar 21, 2026
a5775e7
Remove goto physics/SFC_Layer/UFS/module_nst_model.f90
NickSzapiro-NOAA Mar 21, 2026
9551c41
Merge branch 'ufs-community:ufs/dev' into remove_goto
NickSzapiro-NOAA Mar 21, 2026
e5ebf60
address saturation vapor pressure out of bounds error in hafs_4_nest RT
lisa-bengtsson Mar 23, 2026
958b6e0
update long names to remove 'updated by physics'; change prognostic u…
grantfirl Mar 23, 2026
8d8eac6
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Mar 23, 2026
9d3bd17
remove additional references to Zhao-Carr microphysics
grantfirl Mar 23, 2026
a7e1122
remove Zhao-Carr references from GFS_scnv_generic_post
grantfirl Mar 23, 2026
6be9617
fix deallocation statement in Thompson MP
grantfirl Mar 23, 2026
eee1edf
Merge pull request #364 from lisa-bengtsson/updraft
rhaesung Mar 25, 2026
f1b526d
Remove go to physics/CONV/C3/cu_c3_sh.F90
NickSzapiro-NOAA Mar 25, 2026
eb69729
Remove go to physics/PBL/MYJ/module_BL_MYJPBL.F90
NickSzapiro-NOAA Mar 25, 2026
05d3799
Remove goto physics/MP/Morrison_Gettelman/wv_saturation.F
NickSzapiro-NOAA Mar 25, 2026
87394b6
Again physics/MP/Morrison_Gettelman/wv_saturation.F
NickSzapiro-NOAA Mar 25, 2026
b3ac6fc
physics/MP/Morrison_Gettelman/wv_saturation.F
NickSzapiro-NOAA Mar 25, 2026
5425ccb
Typo
NickSzapiro-NOAA Mar 25, 2026
a96e26a
Merge branch 'ufs-community:ufs/dev' into remove_goto
NickSzapiro-NOAA Mar 25, 2026
ba9c131
Remove goto physics/CONV/C3/cu_c3_deep.F90
NickSzapiro-NOAA Mar 25, 2026
90e7442
Remove go to physics/CONV/RAS/rascnv.F90
NickSzapiro-NOAA Mar 25, 2026
f312aa6
Typo rascnv.F90
NickSzapiro-NOAA Mar 25, 2026
cdc7944
physics/SFC_Layer/GFDL/gfdl_sfc_layer.F90
NickSzapiro-NOAA Mar 25, 2026
6e78728
physics/CONV/Grell_Freitas/cu_gf_sh.F90
NickSzapiro-NOAA Mar 25, 2026
c6ab119
Typo module_BL_MYJPBL.F90
NickSzapiro-NOAA Mar 25, 2026
68ebd2c
physics/SFC_Layer/MYJ/module_SF_JSFC.F90
NickSzapiro-NOAA Mar 25, 2026
1ae9e3b
First pass physics/CONV/Grell_Freitas/cu_gf_deep.F90
NickSzapiro-NOAA Mar 25, 2026
ad9d897
Merge branch 'ufs/dev' into feature/tendency_cleanup
grantfirl Mar 25, 2026
d1d9f04
physics/CONV/Grell_Freitas/cu_gf_deep.F90
NickSzapiro-NOAA Mar 25, 2026
6fc92bb
physics/GWD/ugwp_driver_v0.F
NickSzapiro-NOAA Mar 25, 2026
dee8348
physics/MP/Thompson/module_mp_thompson.F90
NickSzapiro-NOAA Mar 25, 2026
5742786
physics/PBL/MYNN_EDMF/module_bl_mynn.F90
NickSzapiro-NOAA Mar 25, 2026
18c220d
physics/MP/GFDL/v1_2019/gfdl_cloud_microphys_mod.F90
NickSzapiro-NOAA Mar 25, 2026
b3f09dc
physics/MP/GFDL/v3_2022/gfdl_cloud_microphys_v3_mod.F90
NickSzapiro-NOAA Mar 25, 2026
5379927
Fix compile physics/Radiation/radiation_clouds.f
NickSzapiro-NOAA Mar 25, 2026
87a5e0f
Compile fixes
NickSzapiro-NOAA Mar 26, 2026
3fbfa77
Fix for 73 character limit line
NickSzapiro-NOAA Mar 26, 2026
4c7b338
Compile fix
NickSzapiro-NOAA Mar 26, 2026
404904c
Start physics/SFC_Models/Land/RUC/module_sf_ruclsm.F90
NickSzapiro-NOAA Mar 26, 2026
311cb19
physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90
NickSzapiro-NOAA Mar 27, 2026
8cc4713
fix additional warnings
grantfirl Mar 27, 2026
3b5f554
Fix compile hafsw wcoss2
Mar 30, 2026
2fbaa34
Revert rascnv so control_ras_intel b4b on wcoss2
Mar 30, 2026
91d9790
Merge pull request #299 from grantfirl/feature/tendency_cleanup
rhaesung Apr 3, 2026
8a20ac3
Use 10-m intepolated winds in the explicit in-canopy diffusion of tra…
iri01 Apr 7, 2026
8433519
Merge branch 'ufs-community:ufs/dev' into remove_goto
NickSzapiro-NOAA Apr 8, 2026
92cb522
Clean up commented out code. Correct a truncated source line.
iri01 Apr 9, 2026
6392303
Merge pull request #367 from NickSzapiro-NOAA/remove_goto
grantfirl Apr 15, 2026
e640fe2
Merge branch 'ufs-community:ufs/dev' into fix_canopy_vdf
iri01 Apr 16, 2026
737f9a3
Comment out the integrated-canopy meteorology effect. Keep the lines …
iri01 Apr 17, 2026
af24838
Merge branch 'main' into feature/tendency_cleanup
May 28, 2026
43e5cea
Merge branch 'remove_goto' into ufs-dev-PR367
hertneky Jun 2, 2026
13833d4
Merge remote-tracking branch 'arl/fix_canopy_vdf' into ufs-dev-pr371
scrasmussen Jun 2, 2026
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
[submodule "physics/SFC_Layer/MYNN/MYNN"]
path = physics/SFC_Layer/MYNN/MYNN
url = https://github.com/NCAR/MYNN-SFC
branch = main
branch = ccpp/dev
149 changes: 75 additions & 74 deletions physics/CONV/C3/cu_c3_deep.F90
Original file line number Diff line number Diff line change
Expand Up @@ -744,20 +744,18 @@ subroutine cu_c3_deep_run( &
do k=kts,ktf
if(zo_cup(i,k).gt.zkbmax+z1(i))then
kbmax(i)=k
go to 25
exit
endif
enddo
25 continue
!
!> - Compute the level where detrainment for downdraft starts (\p kdet)
!
do k=kts,ktf
if(zo_cup(i,k).gt.z_detr+z1(i))then
kdet(i)=k
go to 26
exit
endif
enddo
26 continue
!
endif
enddo
Expand All @@ -770,7 +768,7 @@ subroutine cu_c3_deep_run( &
!
start_k22=2
!$acc parallel loop
do 36 i=its,itf
do i=its,itf
if(ierr(i).eq.0)then
k22(i)=maxloc(heo_cup(i,start_k22:kbmax(i)+2),1)+start_k22-1
if(k22(i).ge.kbmax(i))then
Expand All @@ -783,7 +781,7 @@ subroutine cu_c3_deep_run( &
kbcon(i)=0
endif
endif
36 continue
end do
!$acc end parallel

!
Expand Down Expand Up @@ -1013,7 +1011,7 @@ subroutine cu_c3_deep_run( &
!$acc end parallel

!$acc kernels
do 37 i=its,itf
do i=its,itf
kzdown(i)=0
if(ierr(i).eq.0)then
zktop=(zo_cup(i,ktop(i))-z1(i))*.6
Expand All @@ -1024,11 +1022,11 @@ subroutine cu_c3_deep_run( &
if(zo_cup(i,k).gt.zktop)then
kzdown(i)=k
kzdown(i)=min(kzdown(i),kstabi(i)-1) !
go to 37
exit
endif
enddo
endif
37 continue
end do
!$acc end kernels

!
Expand Down Expand Up @@ -2670,8 +2668,8 @@ subroutine cup_dd_edt(ierr,us,vs,z,ktop,kbcon,edt,p,pwav, &
edtc(i,1)=0.
enddo
do kk = kts,ktf-1
do 62 i=its,itf
if(ierr(i).ne.0)go to 62
do i=its,itf
if(ierr(i).ne.0) cycle
if (kk .le. min0(ktop(i),ktf) .and. kk .ge. kbcon(i)) then
vws(i) = vws(i)+ &
(abs((us(i,kk+1)-us(i,kk))/(z(i,kk+1)-z(i,kk))) &
Expand All @@ -2680,7 +2678,7 @@ subroutine cup_dd_edt(ierr,us,vs,z,ktop,kbcon,edt,p,pwav, &
sdp(i) = sdp(i) + p(i,kk) - p(i,kk+1)
endif
if (kk .eq. ktf-1)vshear(i) = 1.e3 * vws(i) / sdp(i)
62 continue
end do
end do
do i=its,itf
if(ierr(i).eq.0)then
Expand Down Expand Up @@ -3632,13 +3630,13 @@ subroutine cup_kbcon(ierrc,cap_inc,iloop_in,k22,kbcon,he_cup,hes_cup, &
!$acc end kernels

!$acc parallel loop
do 27 i=its,itf
do i=its,itf
kbcon(i)=1
!
! reset iloop for mid level convection
if(cap_max(i).gt.200 .and. imid.eq.1)iloop(i)=5
!
if(ierr(i).ne.0)go to 27
if(ierr(i).ne.0) cycle
start_level(i)=k22(i)
kbcon(i)=k22(i)+1
if(iloop(i).eq.5)kbcon(i)=k22(i)
Expand All @@ -3654,70 +3652,73 @@ subroutine cup_kbcon(ierrc,cap_inc,iloop_in,k22,kbcon,he_cup,hes_cup, &
enddo
!==

go to 32
31 continue
kbcon(i)=kbcon(i)+1
if(kbcon(i).gt.kbmax(i)+2)then
if(iloop(i).ne.4)then
ierr(i)=3
find_kbcon_loop: do

hetest=hcot(i,kbcon(i)) !hkb(i) ! he_cup(i,k22(i))
if(hetest.lt.hes_cup(i,kbcon(i)))then
kbcon(i)=kbcon(i)+1
if(kbcon(i).gt.kbmax(i)+2)then
if(iloop(i).ne.4)then
ierr(i)=3
#ifndef _OPENACC
ierrc(i)="could not find reasonable kbcon in cup_kbcon"
ierrc(i)="could not find reasonable kbcon in cup_kbcon"
#endif
endif
go to 27
endif
32 continue
hetest=hcot(i,kbcon(i)) !hkb(i) ! he_cup(i,k22(i))
if(hetest.lt.hes_cup(i,kbcon(i)))then
go to 31
endif
endif
exit find_kbcon_loop
endif
cycle find_kbcon_loop
endif

! cloud base pressure and max moist static energy pressure
! i.e., the depth (in mb) of the layer of negative buoyancy
if(kbcon(i)-k22(i).eq.1)go to 27
if(iloop(i).eq.5 .and. (kbcon(i)-k22(i)).le.2)go to 27
pbcdif=-p_cup(i,kbcon(i))+p_cup(i,k22(i))
plus=max(25.,cap_max(i)-float(iloop(i)-1)*cap_inc(i))
if(iloop(i).eq.4)plus=cap_max(i)
! cloud base pressure and max moist static energy pressure
! i.e., the depth (in mb) of the layer of negative buoyancy
if(kbcon(i)-k22(i).eq.1) exit find_kbcon_loop
if(iloop(i).eq.5 .and. (kbcon(i)-k22(i)).le.2) exit find_kbcon_loop

pbcdif=-p_cup(i,kbcon(i))+p_cup(i,k22(i))
plus=max(25.,cap_max(i)-float(iloop(i)-1)*cap_inc(i))
if(iloop(i).eq.4)plus=cap_max(i)
!
! for shallow convection, if cap_max is greater than 25, it is the pressure at pbltop
if(iloop(i).eq.5)plus=150.
if(iloop(i).eq.5.and.cap_max(i).gt.200)pbcdif=-p_cup(i,kbcon(i))+cap_max(i)
if(pbcdif.le.plus)then
go to 27
elseif(pbcdif.gt.plus)then
k22(i)=k22(i)+1
kbcon(i)=k22(i)+1
!== since k22 has be changed, hkb has to be re-calculated
x_add = xlv*zqexec(i)+cp*ztexec(i)
call get_cloud_bc(kte,he_cup (i,1:kte),hkb (i),k22(i),x_add)

start_level(i)=k22(i)
! if(iloop_in.eq.5)start_level(i)=kbcon(i)
hcot(i,1:start_level(i)) = hkb(i)
if(iloop(i).eq.5)plus=150.
if(iloop(i).eq.5.and.cap_max(i).gt.200)pbcdif=-p_cup(i,kbcon(i))+cap_max(i)

if(pbcdif.le.plus)then
exit find_kbcon_loop
elseif(pbcdif.gt.plus)then
k22(i)=k22(i)+1
kbcon(i)=k22(i)+1
!== since k22 has be changed, hkb has to be re-calculated
x_add = xlv*zqexec(i)+cp*ztexec(i)
call get_cloud_bc(kte,he_cup (i,1:kte),hkb (i),k22(i),x_add)

start_level(i)=k22(i)
! if(iloop_in.eq.5)start_level(i)=kbcon(i)
hcot(i,1:start_level(i)) = hkb(i)
!$acc loop seq
do k=start_level(i)+1,kbmax(i)+3
dz=z_cup(i,k)-z_cup(i,k-1)
do k=start_level(i)+1,kbmax(i)+3
dz=z_cup(i,k)-z_cup(i,k-1)

hcot(i,k)= ( (1.-0.5*entr_rate(i)*dz)*hcot(i,k-1) &
+ entr_rate(i)*dz*heo(i,k-1) )/ &
(1.+0.5*entr_rate(i)*dz)
enddo
!==
hcot(i,k)= ( (1.-0.5*entr_rate(i)*dz)*hcot(i,k-1) &
+ entr_rate(i)*dz*heo(i,k-1) )/ &
(1.+0.5*entr_rate(i)*dz)
enddo
!==

if(iloop(i).eq.5)kbcon(i)=k22(i)
if(kbcon(i).gt.kbmax(i)+2)then
if(iloop(i).ne.4)then
ierr(i)=3
if(iloop(i).eq.5)kbcon(i)=k22(i)
if(kbcon(i).gt.kbmax(i)+2)then
if(iloop(i).ne.4)then
ierr(i)=3
#ifndef _OPENACC
ierrc(i)="could not find reasonable kbcon in cup_kbcon"
ierrc(i)="could not find reasonable kbcon in cup_kbcon"
#endif
endif
go to 27
endif
exit find_kbcon_loop
endif
cycle find_kbcon_loop
endif
go to 32
endif
27 continue
end do find_kbcon_loop

end do
!$acc end parallel

end subroutine cup_kbcon
Expand Down Expand Up @@ -3946,7 +3947,7 @@ subroutine neg_check(name,j,dt,q,outq,outt,outu,outv, &
,intent (in ) :: &
dt
real(kind=kind_phys) :: names,scalef,thresh,qmem,qmemf,qmem2,qtest,qmem1
integer :: icheck
integer :: icheck, i, k
!
! first do check on vertical heating rate
!
Expand Down Expand Up @@ -4815,17 +4816,18 @@ subroutine rates_up_pdf(rand_vmas,ipr,name,ktop,ierr,p_cup,entr_rate_2d,hkbo,heo
enddo
ktopdby(i)=maxloc(dby(:),1)
kklev=maxloc(dbm(:),1)

kfinalzu=ktf-2
ktop(i)=kfinalzu
!$acc loop seq
do k=maxloc(dby(:),1)+1,ktf-2
if(dby(k).lt.dbythresh*maxval(dby))then
kfinalzu=k - 1
ktop(i)=kfinalzu
go to 412
exit
endif
enddo
kfinalzu=ktf-2
ktop(i)=kfinalzu
412 continue

ktop(i)=ktopdby(i) ! HCB
kklev=min(kklev+3,ktop(i)-2)
!
Expand Down Expand Up @@ -5774,10 +5776,9 @@ subroutine get_cloud_top(name,ktop,ierr,p_cup,entr_rate_2d,hkbo,heo,heso_cup,z_c
kfinalzu = k - 1
ktop(i) = kfinalzu
!print*,'hco4=',k,kfinalzu,ktop(i),kbcon(i)+1;call flush(6)
go to 412
exit
endif
enddo
412 continue
else
do k=start_level(i)+1,ktf-2
!~ print*,'hco31=',k,dby(k),dbythresh*maxval(dby)
Expand Down
48 changes: 34 additions & 14 deletions physics/CONV/C3/cu_c3_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
fhour,fh_dfi_radar,ix_dfi_radar,num_dfi_radar,cap_suppress, &
dfi_radar_max_intervals,ldiag3d,qci_conv,do_cap_suppress, &
sigmaout,maxupmf,maxMF,do_mynnedmf,ichoice_in,ichoicem_in, &
ichoice_s_in,errmsg,errflg)
ichoice_s_in,ten_t,ten_u,ten_v,ten_q,dcliw,dclcw,errmsg,errflg)
!-------------------------------------------------------------
implicit none
integer, parameter :: maxiens=1
Expand Down Expand Up @@ -120,11 +120,11 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
real(kind=kind_phys), dimension( : , : ), intent(in ), optional :: forcet,forceqv_spechum
real(kind=kind_phys), dimension( : , : ), intent(in ) :: w,phil,delp
real(kind=kind_phys), dimension ( : , : ), intent(in ), optional :: sigmain,qmicro
real(kind=kind_phys), dimension( : , : ), intent(inout ) :: t,us,vs
real(kind=kind_phys), dimension( : , : ), intent(in ) :: t,us,vs
real(kind=kind_phys), dimension( : , : ), intent(inout ), optional :: qci_conv
real(kind=kind_phys), dimension( : , : ), intent(out ) :: cnvw_moist,cnvc
real(kind=kind_phys), dimension ( : , : ), intent(out ), optional :: sigmaout
real(kind=kind_phys), dimension( : , : ), intent(inout ) :: cliw, clcw
real(kind=kind_phys), dimension( : , : ), intent(in ) :: cliw, clcw
real(kind=kind_phys), dimension ( : , : , :), intent(in ) :: tmf
!$acc declare copyin(forcet,forceqv_spechum,w,phil)
!$acc declare copy(t,us,vs,qci_conv,cliw, clcw)
Expand Down Expand Up @@ -158,7 +158,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
!$acc declare copyout(ud_mf,dd_mf,dt_mf,raincv,cld1d)
! Specific humidity from FV3
real(kind=kind_phys), dimension (:,:), intent(in) :: qv2di_spechum
real(kind=kind_phys), dimension (:,:), intent(inout) :: qv_spechum
real(kind=kind_phys), dimension (:,:), intent(in) :: qv_spechum
real(kind=kind_phys), dimension (:), intent(inout), optional :: aod_gf
!$acc declare copyin(qv2di_spechum) copy(qv_spechum,aod_gf)
! Local water vapor mixing ratios and cloud water mixing ratios
Expand All @@ -172,7 +172,9 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
integer, intent(in ) :: imfshalcnv
integer, dimension(:), intent(inout), optional :: cactiv,cactiv_m
!$acc declare copy(cactiv,cactiv_m)

real(kind_phys), dimension(:,:), intent(out) :: ten_t, ten_u, ten_v, dcliw, dclcw
real(kind_phys), dimension(:,:,:), intent(out) :: ten_q

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

Expand Down Expand Up @@ -225,7 +227,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
! omega (omeg), windspeed (us,vs), and a flag (ierr) to turn off
! convection for this call only and at that particular gridpoint
!
real(kind=kind_phys), dimension (im,km) :: qcheck,zo,t2d,q2d,po,p2d,rhoi,clw_ten
real(kind=kind_phys), dimension (im,km) :: qcheck,zo,t2d,q2d,po,p2d,rhoi,clw_ten,new_qv_spechum,new_cliw,new_clcw
real(kind=kind_phys), dimension (im,km) :: tn,qo,tshall,qshall,dz8w,omeg
real(kind=kind_phys), dimension (im) :: z1,psur,cuten,cutens,cutenm
real(kind=kind_phys), dimension (im) :: umean,vmean,pmean,mc_thresh
Expand Down Expand Up @@ -268,7 +270,16 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
! initialize ccpp error handling variables
errmsg = ''
errflg = 0


ten_t = 0.0
ten_u = 0.0
ten_v = 0.0
ten_q = 0.0
dcliw = 0.0
dclcw = 0.0
new_clcw = clcw
new_cliw = cliw

ichoice = ichoice_in
ichoicem = ichoicem_in
ichoice_s = ichoice_s_in
Expand Down Expand Up @@ -956,11 +967,12 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
cnvw(i,k)=cnvwt(i,k)*xmb(i)*dt+cnvwts(i,k)*xmbs(i)*dt+cnvwtm(i,k)*xmbm(i)*dt
ud_mf(i,k)=cuten(i)*zu(i,k)*xmb(i)*dt
dd_mf(i,k)=cuten(i)*zd(i,k)*edt(i)*xmb(i)*dt
t(i,k)=t(i,k)+dt*(cutens(i)*outts(i,k)+cutenm(i)*outtm(i,k)+outt(i,k)*cuten(i))

ten_t(i,k) = cutens(i)*outts(i,k)+cutenm(i)*outtm(i,k)+outt(i,k)*cuten(i)
qv(i,k)=max(1.e-16,qv(i,k)+dt*(cutens(i)*outqs(i,k)+cutenm(i)*outqm(i,k)+outq(i,k)*cuten(i)))
gdc(i,k,7)=sqrt(us(i,k)**2 +vs(i,k)**2)
us(i,k)=us(i,k)+outu(i,k)*cuten(i)*dt +outum(i,k)*cutenm(i)*dt +outus(i,k)*cutens(i)*dt
vs(i,k)=vs(i,k)+outv(i,k)*cuten(i)*dt +outvm(i,k)*cutenm(i)*dt +outvs(i,k)*cutens(i)*dt
ten_u(i,k) = outu(i,k)*cuten(i) +outum(i,k)*cutenm(i) +outus(i,k)*cutens(i)
ten_v(i,k) = outv(i,k)*cuten(i) +outvm(i,k)*cutenm(i) +outvs(i,k)*cutens(i)

gdc(i,k,1)= max(0.,tun_rad_shall(i)*cupclws(i,k)*cutens(i)) ! my mod
!gdc2(i,k,1)=max(0.,tun_rad_deep(i)*(cupclwm(i,k)*cutenm(i)+cupclw(i,k)*cuten(i)))
Expand Down Expand Up @@ -1005,10 +1017,13 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
)
tem1 = max(0.0, min(1.0, (tcr-t(i,k))*tcrf))
if (clcw(i,k) .gt. -999.0) then
cliw(i,k) = max(0.,cliw(i,k) + tem * tem1) ! ice
clcw(i,k) = max(0.,clcw(i,k) + tem *(1.0-tem1)) ! water
new_cliw(i,k) = max(0.,cliw(i,k) + tem * tem1) ! ice
new_clcw(i,k) = max(0.,clcw(i,k) + tem *(1.0-tem1)) ! water
dcliw(i,k) = (new_cliw(i,k) - cliw(i,k))/dt
dclcw(i,k) = (new_clcw(i,k) - clcw(i,k))/dt
else
cliw(i,k) = max(0.,cliw(i,k) + tem)
new_cliw(i,k) = max(0.,cliw(i,k) + tem)
dcliw(i,k) = (new_cliw(i,k) - cliw(i,k))/dt
endif

enddo
Expand Down Expand Up @@ -1076,9 +1091,14 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
! Scale dry mixing ratios for water wapor and cloud water to specific humidy / moist mixing ratios
!
!$acc kernels
qv_spechum = qv/(1.0_kind_phys+qv)
new_qv_spechum = qv/(1.0_kind_phys+qv)
cnvw_moist = cnvw/(1.0_kind_phys+qv)
!$acc end kernels
do i=its,ite
do k=kts,kte
ten_q(i,k,ntqv) = (new_qv_spechum(i,k) - qv_spechum(i,k))/dt
end do
end do
!
! Diagnostic tendency updates
!
Expand Down
Loading