Skip to content

Commit

Permalink
Squash commit the following based on Joe's 2022/06/09 commit(#42184e7…
Browse files Browse the repository at this point in the history
…d)+cherry-pick (5544dab - 42184e7)

commit 77bcfb1
Merge: f13ed4e 2d2f1a6
Author: Grant Firl <grant.firl@noaa.gov>
Date:   Fri Jun 3 09:35:42 2022 -0400

    Merge pull request NCAR#903 from lisa-bengtsson/prog_closure

    Add prognostic cumulus closure description in saSAS

commit 2d2f1a6
Merge: 48f4274 f13ed4e
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Fri May 27 13:53:46 2022 +0000

    Merge branch 'main' of https://github.com/NCAR/ccpp-physics into prog_closure

commit f13ed4e
Merge: 6e58242 942f9ad
Author: Grant Firl <grant.firl@noaa.gov>
Date:   Thu May 26 16:34:40 2022 -0400

    Merge pull request NCAR#918 from SamuelTrahanNOAA/ccpp-neptune

    NRL Neptune model 32-bit physics support

commit 48f4274
Merge: fc79cc3 6e58242
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Thu May 26 15:05:43 2022 +0000

    Merge branch 'main' of https://github.com/NCAR/ccpp-physics into prog_closure

commit 942f9ad
Author: samuel.trahan <Samuel.Trahan@noaa.gov>
Date:   Wed May 25 22:08:44 2022 +0000

    correct bug in machine.F

commit 641544c
Merge: d4d0b71 6e58242
Author: samuel.trahan <Samuel.Trahan@noaa.gov>
Date:   Wed May 25 18:40:09 2022 +0000

    Merge remote-tracking branch 'community/main' into ccpp-neptune

commit 6e58242
Merge: 01e3d6b 8dae03a
Author: Grant Firl <grant.firl@noaa.gov>
Date:   Wed May 25 13:54:59 2022 -0400

    Merge pull request NCAR#924 from dustinswales/update_rte_for_CCPP_v6

    Update rte-rrtmgp submodule + SCM-only bugfix

commit d4d0b71
Author: samuel.trahan <Samuel.Trahan@noaa.gov>
Date:   Tue May 24 18:18:45 2022 +0000

    Simplify machine.F and remove unused types.

commit 828f168
Merge: 63020ec 01e3d6b
Author: samuel.trahan <Samuel.Trahan@noaa.gov>
Date:   Mon May 23 18:50:11 2022 +0000

    Merge NCAR main

commit 8dae03a
Merge: b994063 87359d2
Author: dustinswales <dswales@ucar.edu>
Date:   Fri May 20 09:46:35 2022 -0600

    Merge pull request NOAA-GSL#18 from grantfirl/fix_SCM_specified_surface_flux_bug

    Fix scm specified surface flux bug

commit 87359d2
Merge: 49c7096 01e3d6b
Author: Grant Firl <grant.firl@noaa.gov>
Date:   Fri May 20 09:13:55 2022 -0400

    Merge branch 'main' into fix_SCM_specified_surface_flux_bug

commit fc79cc3
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Thu May 19 19:59:43 2022 +0000

    Change intent to inout for conditional variables

commit 96d0d36
Merge: 6f38cc6 01e3d6b
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Thu May 19 00:14:56 2022 +0000

    Merge branch 'main' of https://github.com/NCAR/ccpp-physics into prog_closure

commit 6f38cc6
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Wed May 18 23:58:09 2022 +0000

    address some review comments, fix decomposition error, correct bug in initialization

commit b994063
Author: Dustin Swales <dustin.swales@noaa.gov>
Date:   Mon May 16 09:16:30 2022 -0600

    Update rte-rrtmgp submodule

commit 49c7096
Author: Grant Firl <grant.firl@noaa.gov>
Date:   Tue May 10 13:49:55 2022 -0400

    make sure that tsfc_wat is calculated when wet = T

commit 63020ec
Author: samuel.trahan <Samuel.Trahan@noaa.gov>
Date:   Thu May 5 22:46:10 2022 +0000

    Switch to another version of the code that works with 64 bit

commit 3dec4e6
Merge: be534e7 3405ff1
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Thu May 5 04:20:02 2022 +0000

    Merge branch 'main' of https://github.com/NCAR/ccpp-physics into prog_closure

commit be534e7
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Thu May 5 04:08:06 2022 +0000

    addressing some review comments

commit e7c42c7
Author: samuel.trahan <Samuel.Trahan@noaa.gov>
Date:   Thu May 5 00:43:21 2022 +0000

    Move some code to modules

commit de90593
Merge: 6871a93 3405ff1
Author: samuel.trahan <Samuel.Trahan@noaa.gov>
Date:   Wed May 4 22:12:14 2022 +0000

    Merge remote-tracking branch 'community/main' into sing_prec_from_main

commit 6871a93
Author: Samuel Trahan <Samuel.Trahan@noaa.gov>
Date:   Wed May 4 17:32:24 2022 +0000

    Changes needed for 32-bit physics

commit 527e1b9
Author: samuel.trahan <Samuel.Trahan@noaa.gov>
Date:   Mon May 2 22:11:42 2022 +0000

    Pass -DCCPP_SINGLE_PRECISION from cmake to -DSINGLE_PREC in cpp

commit aff574b
Merge: 239710b 7e35351
Author: samuel.trahan <Samuel.Trahan@noaa.gov>
Date:   Mon May 2 16:02:18 2022 +0000

    Merge remote-tracking branch 'community/main' into sing_prec_from_main

commit 8b815e0
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Fri Apr 29 03:03:46 2022 +0000

    address some bugs caught by debug flag

commit e2d5a2a
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Wed Apr 27 22:40:40 2022 +0000

    cleaning out some print statements

commit 0200e2d
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Wed Apr 27 18:48:38 2022 +0000

    addressing some review comments

commit e969672
Merge: a9b439f 7e35351
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Fri Apr 22 21:10:40 2022 +0000

    merge with upstream

commit a9b439f
Merge: fc7e7a0 860245c
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Fri Apr 22 04:07:35 2022 +0000

    Merge branch 'main' of https://github.com/NCAR/ccpp-physics into prog_closure

commit fc7e7a0
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Fri Apr 22 04:00:31 2022 +0000

    addressing some review comments

commit 89eaad9
Merge: b530db1 e2806f0
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Thu Apr 21 15:05:15 2022 +0000

    Merge branch 'main' of https://github.com/NCAR/ccpp-physics into prog_closure

commit b530db1
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Wed Apr 20 01:29:13 2022 +0000

    cleaning some diagnostics

commit 4f84ed7
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Tue Apr 19 19:22:53 2022 +0000

    add shallow convection closure updates, add ntsigma in generic files

commit 842eae3
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Mon Apr 18 15:05:40 2022 +0000

    Ensuring the moisture budget is correct via PBL, microphysics coupling

commit 235ec38
Author: Lisa Bengtsson <Lisa.Bengtsson@noaa.gov>
Date:   Wed Apr 13 17:44:27 2022 +0000

    add progsigma_calc

commit 239710b
Merge: b17a7e7 8500cea
Author: Grant Firl <grant.firl@noaa.gov>
Date:   Thu Jan 13 11:06:52 2022 -0700

    Merge branch 'main' into sing_prec_from_main

commit b17a7e7
Merge: 805c62c 623feaa
Author: Grant Firl <grant.firl@noaa.gov>
Date:   Tue Dec 7 11:00:17 2021 -0700

    Merge branch 'main' into sing_prec_from_main

commit 805c62c
Author: Grant Firl <grant.firl@noaa.gov>
Date:   Tue Dec 7 10:39:05 2021 -0700

    add single precision code changes from michalakes fork, jm-nrl-32bitfp-24cc09e branch
  • Loading branch information
guoqing-noaa committed Feb 22, 2023
1 parent 638dd45 commit 7b4c766
Show file tree
Hide file tree
Showing 49 changed files with 1,177 additions and 201 deletions.
6 changes: 3 additions & 3 deletions physics/GFS_DCNV_generic_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, &
index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv, gq0, save_q, &
cnvw, cnvc, cnvw_phy_f3d, cnvc_phy_f3d, flag_for_dcnv_generic_tend, &
ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl, &
ntgnc, nthl, nthnc, nthv, ntgv, ntrac,clw, &
ntgnc, nthl, nthnc, nthv, ntgv, ntsigma, ntrac,clw, &
satmedmf, trans_trac, errmsg, errflg)


Expand Down Expand Up @@ -45,7 +45,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, &
integer, intent(in) :: dtidx(:,:), index_of_process_dcnv, index_of_temperature, &
index_of_x_wind, index_of_y_wind, ntqv
integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl, &
ntgnc, nthl, nthnc, nthv, ntgv, ntrac
ntgnc, nthl, nthnc, nthv, ntgv, ntsigma, ntrac
real(kind=kind_phys), dimension(:,:,:), intent(in) :: clw


Expand Down Expand Up @@ -112,7 +112,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, &
n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. &
n /= ntsnc .and. n /= ntgl .and. n /= ntgnc .and. &
n /= nthl .and. n /= nthnc .and. n /= nthv .and. &
n /= ntgv ) then
n /= ntgv .and. n /= ntsigma) then
tracers = tracers + 1
idtend = dtidx(100+n,index_of_process_dcnv)
if(idtend>0) then
Expand Down
7 changes: 7 additions & 0 deletions physics/GFS_DCNV_generic_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,13 @@
dimensions = ()
type = logical
intent = in
[ntsigma]
standard_name = index_of_updraft_area_fraction_in_tracer_concentration_array
long_name = tracer index of updraft_area_fraction
units = index
dimensions = ()
type = integer
intent = in
[ntcw]
standard_name = index_of_cloud_liquid_water_mixing_ratio_in_tracer_concentration_array
long_name = tracer index for cloud condensate (or liquid water)
Expand Down
8 changes: 4 additions & 4 deletions physics/GFS_DCNV_generic_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc
gu0, gv0, gt0, gq0, nsamftrac, ntqv, &
save_u, save_v, save_t, save_q, clw, &
ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl, &
ntgnc, nthl, nthnc, nthv, ntgv, &
ntgnc, nthl, nthnc, nthv, ntgv,ntsigma, &
cscnv, satmedmf, trans_trac, ras, ntrac, &
dtidx, index_of_process_dcnv, errmsg, errflg)

Expand All @@ -22,7 +22,7 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc
implicit none

integer, intent(in) :: im, levs, nsamftrac, ntqv, index_of_process_dcnv, dtidx(:,:), &
ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntrac,ntgnc,nthl,nthnc,nthv,ntgv
ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntrac,ntgnc,nthl,nthnc,nthv,ntgv,ntsigma
logical, intent(in) :: ldiag3d, qdiag3d, do_cnvgwd, cplchm
real(kind=kind_phys), dimension(:,:), intent(in) :: gu0
real(kind=kind_phys), dimension(:,:), intent(in) :: gv0
Expand Down Expand Up @@ -68,7 +68,7 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc
n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. &
n /= ntsnc .and. n /= ntgl .and. n /= ntgnc .and. &
n /= nthl .and. n /= nthnc .and. n /= nthv .and. &
n /= ntgv ) then
n /= ntgv .and. n/= ntsigma) then
tracers = tracers + 1
if(dtidx(100+n,index_of_process_dcnv)>0) then
save_q(:,:,n) = clw(:,:,tracers)
Expand All @@ -87,4 +87,4 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc

end subroutine GFS_DCNV_generic_pre_run

end module GFS_DCNV_generic_pre
end module GFS_DCNV_generic_pre
7 changes: 7 additions & 0 deletions physics/GFS_DCNV_generic_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@
dimensions = ()
type = logical
intent = in
[ntsigma]
standard_name = index_of_updraft_area_fraction_in_tracer_concentration_array
long_name = tracer index of updraft_area_fraction
units = index
dimensions = ()
type = integer
intent = in
[ntcw]
standard_name = index_of_cloud_liquid_water_mixing_ratio_in_tracer_concentration_array
long_name = tracer index for cloud condensate (or liquid water)
Expand Down
30 changes: 24 additions & 6 deletions physics/GFS_MP_generic_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,24 @@ module GFS_MP_generic_post
!> @{
subroutine GFS_MP_generic_post_run( &
im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_nssl, &
imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, con_g, rainmin, dtf, frain, rainc, &
imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, progsigma, con_g, rainmin, dtf, frain, rainc, &
rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, rain0, ice0, snow0,&
graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, &
totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, pwat, &
drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, &
graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, &
dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d, lssav, num_dfi_radar, fh_dfi_radar, &
index_of_process_dfi_radar, ix_dfi_radar, dfi_radar_tten, radar_tten_limits, fhour, errmsg, errflg)
dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d,dqdt_qmicro, lssav, num_dfi_radar, &
fh_dfi_radar,index_of_process_dfi_radar, ix_dfi_radar, dfi_radar_tten, radar_tten_limits, fhour, prevsq, &
errmsg, errflg)
!
use machine, only: kind_phys

use calpreciptype_mod, only: calpreciptype
implicit none

integer, intent(in) :: im, levs, kdt, nrcm, nncl, ntcw, ntrac, num_dfi_radar, index_of_process_dfi_radar
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires
integer, intent(in) :: imp_physics_nssl
logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm
logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, progsigma
integer, intent(in) :: index_of_temperature,index_of_process_mp

integer :: dfi_radar_max_intervals
Expand Down Expand Up @@ -80,7 +81,8 @@ subroutine GFS_MP_generic_post_run(
real(kind=kind_phys), dimension(:), intent(inout) :: diceprv
real(kind=kind_phys), dimension(:), intent(inout) :: dsnowprv
real(kind=kind_phys), dimension(:), intent(inout) :: dgraupelprv

real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdt_qmicro
real(kind=kind_phys), dimension(:,:), intent(inout) :: prevsq
real(kind=kind_phys), intent(in) :: dtp

! CCPP error handling
Expand Down Expand Up @@ -352,6 +354,15 @@ subroutine GFS_MP_generic_post_run(
endif if_tendency_diagnostics
endif if_save_fields

!If prognostic updraft area fraction is used in saSAS
if(progsigma)then
do k=1,levs
do i=1,im
dqdt_qmicro(i,k)=(gq0(i,k,1)-save_q(i,k,1))/dtp
enddo
enddo
endif

if (cplflx .or. cplchm) then
do i = 1, im
dsnow_cpl(i)= max(zero, rain(i) * srflag(i))
Expand Down Expand Up @@ -387,6 +398,13 @@ subroutine GFS_MP_generic_post_run(
pwat(i) = pwat(i) * onebg
enddo

if(progsigma)then
do k = 1, levs
do i=1, im
prevsq(i,k) = gq0(i,k,1)
enddo
enddo
endif

end subroutine GFS_MP_generic_post_run
!> @}
Expand Down
23 changes: 23 additions & 0 deletions physics/GFS_MP_generic_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@
dimensions = ()
type = logical
intent = in
[progsigma]
standard_name = do_prognostic_updraft_area_fraction
long_name = flag for prognostic sigma in cumulus scheme
units = flag
dimensions = ()
type = logical
intent = in
[con_g]
standard_name = gravitational_acceleration
long_name = gravitational acceleration
Expand Down Expand Up @@ -724,6 +731,22 @@
dimensions = ()
type = logical
intent = in
[dqdt_qmicro]
standard_name = instantaneous_tendency_of_specific_humidity_due_to_microphysics
long_name = moisture tendency due to microphysics
units = kg kg-1 s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[prevsq]
standard_name = specific_humidity_on_previous_timestep
long_name = specific_humidity_on_previous_timestep
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[lssav]
standard_name = flag_for_diagnostics
long_name = logical flag for storing diagnostics
Expand Down
6 changes: 3 additions & 3 deletions physics/GFS_SCNV_generic_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, &
rainc, cnvprcp, cnvprcpb, cnvw_phy_f3d, cnvc_phy_f3d, &
dtend, dtidx, index_of_temperature, index_of_x_wind, index_of_y_wind, &
index_of_process_scnv, ntqv, flag_for_scnv_generic_tend, &
ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc, &
ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc,ntsigma, &
imfshalcnv, imfshalcnv_sas, imfshalcnv_samf, ntrac, &
cscnv, satmedmf, trans_trac, ras, errmsg, errflg)

Expand All @@ -23,7 +23,7 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, &
implicit none

integer, intent(in) :: im, levs, nn, ntqv, nsamftrac
integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc,ntrac
integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc,ntsigma,ntrac
logical, intent(in) :: lssav, ldiag3d, qdiag3d, flag_for_scnv_generic_tend
real(kind=kind_phys), intent(in) :: frain
real(kind=kind_phys), dimension(:,:), intent(in) :: gu0, gv0, gt0
Expand Down Expand Up @@ -103,7 +103,7 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, &
do n=2,ntrac
if ( n /= ntcw .and. n /= ntiw .and. n /= ntclamt .and. &
n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. &
n /= ntsnc .and. n /= ntgl .and. n /= ntgnc) then
n /= ntsnc .and. n /= ntgl .and. n /= ntgnc .and. n /= ntsigma) then
tracers = tracers + 1
idtend = dtidx(100+n,index_of_process_scnv)
if(idtend>0) then
Expand Down
7 changes: 7 additions & 0 deletions physics/GFS_SCNV_generic_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,13 @@
dimensions = ()
type = logical
intent = in
[ntsigma]
standard_name = index_of_updraft_area_fraction_in_tracer_concentration_array
long_name = tracer index of updraft_area_fraction
units = index
dimensions = ()
type = integer
intent = in
[ntcw]
standard_name = index_of_cloud_liquid_water_mixing_ratio_in_tracer_concentration_array
long_name = tracer index for cloud condensate (or liquid water)
Expand Down
8 changes: 4 additions & 4 deletions physics/GFS_SCNV_generic_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ module GFS_SCNV_generic_pre
subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, gq0, &
save_u, save_v, save_t, save_q, ntqv, nsamftrac, flag_for_scnv_generic_tend, &
dtidx, index_of_process_scnv, ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc, &
cscnv, satmedmf, trans_trac, ras, ntrac, clw, errmsg, errflg)
ntsigma, cscnv, satmedmf, trans_trac, ras, ntrac, clw, errmsg, errflg)

use machine, only: kind_phys

implicit none

integer, intent(in) :: im, levs, ntqv, nsamftrac, index_of_process_scnv, dtidx(:,:)
integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc,ntrac
integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc, ntsigma,ntrac
logical, intent(in) :: ldiag3d, qdiag3d, flag_for_scnv_generic_tend
real(kind=kind_phys), dimension(:,:), intent(in) :: gu0, gv0, gt0
real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0
Expand Down Expand Up @@ -49,7 +49,7 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0,
do n=2,ntrac
if ( n /= ntcw .and. n /= ntiw .and. n /= ntclamt .and. &
n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. &
n /= ntsnc .and. n /= ntgl .and. n /= ntgnc) then
n /= ntsnc .and. n /= ntgl .and. n /= ntgnc .and. n /= ntsigma) then
tracers = tracers + 1
if(dtidx(100+n,index_of_process_scnv)>0) then
save_q(:,:,n) = clw(:,:,tracers)
Expand All @@ -70,4 +70,4 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0,
end subroutine GFS_SCNV_generic_pre_run


end module GFS_SCNV_generic_pre
end module GFS_SCNV_generic_pre
7 changes: 7 additions & 0 deletions physics/GFS_SCNV_generic_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@
dimensions = ()
type = logical
intent = in
[ntsigma]
standard_name = index_of_updraft_area_fraction_in_tracer_concentration_array
long_name = tracer index of updraft_area_fraction
units = index
dimensions = ()
type = integer
intent = in
[ntcw]
standard_name = index_of_cloud_liquid_water_mixing_ratio_in_tracer_concentration_array
long_name = tracer index for cloud condensate (or liquid water)
Expand Down
37 changes: 32 additions & 5 deletions physics/GFS_suite_interstitial_3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ module GFS_suite_interstitial_3
!! \htmlinclude GFS_suite_interstitial_3_run.html
!!
subroutine GFS_suite_interstitial_3_run (otsptflag, &
im, levs, nn, cscnv, &
im, levs, nn, cscnv,imfshalcnv, imfdeepcnv, &
imfshalcnv_samf, imfdeepcnv_samf,progsigma, &
first_time_step, restart, &
satmedmf, trans_trac, do_shoc, ltaerosol, ntrac, ntcw, &
ntiw, ntclamt, ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, &
xlon, xlat, gt0, gq0, imp_physics, imp_physics_mg, &
xlon, xlat, gt0, gq0, sigmain,sigmaout,qmicro, &
imp_physics, imp_physics_mg, &
imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, &
imp_physics_gfdl, imp_physics_thompson, dtidx, ntlnc, &
imp_physics_wsm6, imp_physics_fer_hires, prsi, ntinc, &
Expand All @@ -33,8 +36,9 @@ subroutine GFS_suite_interstitial_3_run (otsptflag, &
imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6,imp_physics_fer_hires, &
imp_physics_nssl, me, index_of_process_conv_trans
integer, intent(in ), dimension(:) :: islmsk, kpbl, kinver
logical, intent(in ) :: cscnv, satmedmf, trans_trac, do_shoc, ltaerosol, ras

logical, intent(in ) :: cscnv, satmedmf, trans_trac, do_shoc, ltaerosol, ras, progsigma
logical, intent(in ) :: first_time_step, restart
integer, intent(in ) :: imfshalcnv, imfdeepcnv, imfshalcnv_samf,imfdeepcnv_samf
integer, intent(in) :: ntinc, ntlnc
logical, intent(in) :: ldiag3d, qdiag3d
integer, dimension(:,:), intent(in) :: dtidx
Expand All @@ -48,6 +52,8 @@ subroutine GFS_suite_interstitial_3_run (otsptflag, &
real(kind=kind_phys), intent(in ), dimension(:,:) :: gt0
real(kind=kind_phys), intent(in ), dimension(:,:,:) :: gq0

real(kind=kind_phys), intent(inout ), dimension(:,:) :: sigmain
real(kind=kind_phys), intent(inout ), dimension(:,:) :: sigmaout,qmicro
real(kind=kind_phys), intent(inout), dimension(:,:) :: rhc, save_qc
! save_qi is not allocated for Zhao-Carr MP
real(kind=kind_phys), intent(inout), dimension(:,:) :: save_qi
Expand All @@ -73,6 +79,27 @@ subroutine GFS_suite_interstitial_3_run (otsptflag, &
errmsg = ''
errflg = 0

! In case of using prognostic updraf area fraction, initialize area fraction here
! since progsigma_calc is called from both deep and shallow schemes.
if(((imfshalcnv == imfshalcnv_samf) .or. (imfdeepcnv == imfdeepcnv_samf)) &
.and. progsigma)then
if(first_time_step .and. .not. restart)then
do k=1,levs
do i=1,im
sigmain(i,k)=0.0
sigmaout(i,k)=0.0
qmicro(i,k)=0.0
enddo
enddo
endif
do k=1,levs
do i=1,im
sigmaout(i,k)=0.0
enddo
enddo
endif


if (cscnv .or. satmedmf .or. trans_trac .or. ras) then
tracers = 2
do n=2,ntrac
Expand Down Expand Up @@ -192,4 +219,4 @@ subroutine GFS_suite_interstitial_3_run (otsptflag, &

end subroutine GFS_suite_interstitial_3_run

end module GFS_suite_interstitial_3
end module GFS_suite_interstitial_3
Loading

0 comments on commit 7b4c766

Please sign in to comment.