From a1fe46d936f094f6201c1041716d183e91ff6226 Mon Sep 17 00:00:00 2001
From: "Haiqin.Li" <Haiqin.Li@noaa.gov>
Date: Fri, 24 Mar 2023 02:24:03 +0000
Subject: [PATCH] "to address the comments from the ccpp reviewer"

---
 physics/GFS_rrtmg_pre.F90                  | 16 +++++++++-------
 physics/GFS_rrtmg_pre.meta                 | 12 ++++++++++--
 physics/smoke_dust/rrfs_smoke_postpbl.meta |  4 ++--
 physics/smoke_dust/rrfs_smoke_wrapper.F90  | 18 +++++++++---------
 physics/smoke_dust/rrfs_smoke_wrapper.meta | 20 ++++++++++++++------
 5 files changed, 44 insertions(+), 26 deletions(-)

diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90
index d43e182db..53e1d29b3 100644
--- a/physics/GFS_rrtmg_pre.F90
+++ b/physics/GFS_rrtmg_pre.F90
@@ -44,7 +44,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
         gasvmr_ccl4,  gasvmr_cfc113, aerodp,ext550, clouds6, clouds7, clouds8, &
         clouds9, cldsa, cldfra, cldfra2d, lwp_ex,iwp_ex, lwp_fc,iwp_fc,        &
         faersw1, faersw2, faersw3, faerlw1, faerlw2, faerlw3, alpha,           &
-        aero_dir_fdb, spp_wts_rad, spp_rad, ico2, errmsg, errflg)
+        aero_dir_fdb, fdb_coef, spp_wts_rad, spp_rad, ico2, errmsg, errflg)
 
       use machine,                   only: kind_phys
 
@@ -155,6 +155,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
                                                              clouds2, clouds3, &
                                                              clouds4, clouds5
       real(kind=kind_phys), dimension(:,:), intent(in)  :: qci_conv
+      real(kind=kind_phys), dimension(:),   intent(in)  :: fdb_coef
       real(kind=kind_phys), dimension(:),   intent(out) :: lwp_ex,iwp_ex, &
                                                            lwp_fc,iwp_fc
 
@@ -640,12 +641,13 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
        if (aero_dir_fdb) then
          do k=1,lmk
            do i=1,im
-             aer_nm(i,k,1 )=aer_nm(i,k,1 )+qgrs(i,k,ntdust)*0.33*1.e-9  ! dust bin1
-             aer_nm(i,k,2 )=aer_nm(i,k,2 )+(qgrs(i,k,ntdust)*0.67+qgrs(i,k,ntcoarsepm)*0.02)*1.e-9
-             aer_nm(i,k,3 )=aer_nm(i,k,3 )+qgrs(i,k,ntcoarsepm)*0.13*1.e-9 ! dust bin3
-             aer_nm(i,k,4 )=aer_nm(i,k,4 )+qgrs(i,k,ntcoarsepm)*0.85*1.e-9 ! dust bin4
-             aer_nm(i,k,12)=aer_nm(i,k,12)+qgrs(i,k,ntsmoke)*1.e-9*0.05 !Smoke BC
-             aer_nm(i,k,14)=aer_nm(i,k,14)+qgrs(i,k,ntsmoke)*1.e-9*0.95 !Smoke OA, we may need to revise later for OA vs. OC
+             aer_nm(i,k,1 )=aer_nm(i,k,1 )+ qgrs(i,k,ntdust)*fdb_coef(1)*1.e-9    ! dust bin1
+             aer_nm(i,k,2 )=aer_nm(i,k,2 )+(qgrs(i,k,ntdust)*fdb_coef(2)          &
+                           +qgrs(i,k,ntcoarsepm)*fdb_coef(3))*1.e-9               ! dust bin2
+             aer_nm(i,k,3 )=aer_nm(i,k,3 )+qgrs(i,k,ntcoarsepm)*fdb_coef(4)*1.e-9 ! dust bin3
+             aer_nm(i,k,4 )=aer_nm(i,k,4 )+qgrs(i,k,ntcoarsepm)*fdb_coef(5)*1.e-9 ! dust bin4
+             aer_nm(i,k,12)=aer_nm(i,k,12)+qgrs(i,k,ntsmoke)*fdb_coef(6)*1.e-9    ! Smoke BC
+             aer_nm(i,k,14)=aer_nm(i,k,14)+qgrs(i,k,ntsmoke)*fdb_coef(7)*1.e-9    ! Smoke OA
             enddo
           enddo
        endif
diff --git a/physics/GFS_rrtmg_pre.meta b/physics/GFS_rrtmg_pre.meta
index a8b549bce..82ffd07c2 100644
--- a/physics/GFS_rrtmg_pre.meta
+++ b/physics/GFS_rrtmg_pre.meta
@@ -234,8 +234,8 @@
   type = integer
   intent = in
 [ntcoarsepm]
-  standard_name = index_for_coarse_pm_in_tracer_concentration_array
-  long_name = tracer index for coarse pm
+  standard_name = index_for_coarse_particulate_matter_in_tracer_concentration_array
+  long_name = tracer index for coarse particulate matter
   units = index
   dimensions = ()
   type = integer
@@ -1466,6 +1466,14 @@
   dimensions = ()
   type = logical
   intent = in
+[fdb_coef]
+  standard_name = smoke_dust_direct_fdb_coef
+  long_name = smoke dust direct feedback coefficents
+  units = none
+  dimensions = (7)
+  type = real
+  kind = kind_phys
+  intent = in
 [spp_wts_rad]
   standard_name = spp_weights_for_radiation_scheme
   long_name = spp weights for radiation scheme
diff --git a/physics/smoke_dust/rrfs_smoke_postpbl.meta b/physics/smoke_dust/rrfs_smoke_postpbl.meta
index dab56cddc..50f7afae7 100755
--- a/physics/smoke_dust/rrfs_smoke_postpbl.meta
+++ b/physics/smoke_dust/rrfs_smoke_postpbl.meta
@@ -36,8 +36,8 @@
   type = integer
   intent = in
 [ntcoarsepm]
-  standard_name = index_for_coarse_pm_in_tracer_concentration_array
-  long_name = tracer index for coarse pm
+  standard_name = index_for_coarse_particulate_matter_in_tracer_concentration_array
+  long_name = tracer index for coarse particulate matter
   units = index
   dimensions = ()
   type = integer
diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.F90 b/physics/smoke_dust/rrfs_smoke_wrapper.F90
index 80c43360b..1f9ef6340 100755
--- a/physics/smoke_dust/rrfs_smoke_wrapper.F90
+++ b/physics/smoke_dust/rrfs_smoke_wrapper.F90
@@ -41,8 +41,8 @@ module rrfs_smoke_wrapper
     subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate,          &
                    u10m, v10m, ustar, rlat, rlon, tskin, pb2d, t2m, dpt2m,                 &
                    pr3d, ph3d,phl3d, prl3d, tk3d, us3d, vs3d, spechum, w,                  &
-                   nsoil, smc, vegtype, soiltyp, sigmaf, dswsfc, zorl,snow,                &
-                   julian, idat, rain_cpl, rainc_cpl, exch, hf2d, g, pi, con_cp, con_rd,   &
+                   nsoil, smc, vegtype, soiltyp, sigmaf, dswsfc, zorl, snow, julian,       &
+                   idat, rain_cpl, rainc_cpl, exch, hf2d, g, pi, con_cp, con_rd, con_fv,   &
                    dust12m_in, emi_in, smoke_RRFS, ntrac, qgrs, gq0, chem3d, tile_num,     &
                    ntsmoke, ntdust, ntcoarsepm, imp_physics, imp_physics_thompson,         &
                    nwfa, nifa, emanoc, emdust, emseas,                                     &
@@ -60,7 +60,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate,
 
     integer,        intent(in) :: im,kte,kme,ktau,nsoil,tile_num,jdate(8),idat(8)
     integer,        intent(in) :: ntrac, ntsmoke, ntdust, ntcoarsepm, ndvel
-    real(kind_phys),intent(in) :: dt, julian, g, pi, con_cp, con_rd
+    real(kind_phys),intent(in) :: dt, julian, g, pi, con_cp, con_rd, con_fv
     logical,        intent(in) :: aero_ind_fdb_in,dbg_opt_in
     integer,        intent(in) :: smoke_forecast_in
 
@@ -228,7 +228,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate,
     
 !>- get ready for chemistry run
     call rrfs_smoke_prep(                                               &
-        current_month, current_hour, gmt,                               &
+        current_month, current_hour, gmt, con_rd, con_fv,               &
         u10m,v10m,ustar,land,garea,rlat,rlon,tskin,                     &
         pr3d,ph3d,phl3d,tk3d,prl3d,us3d,vs3d,spechum,exch,w,            &
         nsoil,smc,vegtype,soiltyp,sigmaf,dswsfc,zorl,                   &
@@ -418,8 +418,8 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate,
     do k=kts,kte
      do i=its,ite
        gq0(i,k,ntsmoke )  = min(5000.,max(epsilc,chem(i,k,1,p_smoke ))) 
-       gq0(i,k,ntdust  )  = min(100.,max(epsilc,chem(i,k,1,p_dust_1)))
-       gq0(i,k,ntcoarsepm)= min(1000.,max(epsilc,chem(i,k,1,p_coarse_pm)))
+       gq0(i,k,ntdust  )  = min(200.,max(epsilc,chem(i,k,1,p_dust_1)))
+       gq0(i,k,ntcoarsepm)= min(5000.,max(epsilc,chem(i,k,1,p_coarse_pm)))
      enddo
     enddo
 
@@ -482,7 +482,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate,
  end subroutine rrfs_smoke_wrapper_run
 
  subroutine rrfs_smoke_prep(                                            &
-        current_month,current_hour,gmt,                                 &
+        current_month,current_hour,gmt,con_rd,con_fv,                   &
         u10m,v10m,ustar,land,garea,rlat,rlon,ts2d,                      &
         pr3d,ph3d,phl3d,tk3d,prl3d,us3d,vs3d,spechum,exch,w,            &
         nsoil,smc,vegtype,soiltyp,sigmaf,dswsfc,zorl,                   &
@@ -510,7 +510,7 @@ subroutine rrfs_smoke_prep(                                            &
     integer, intent(in) :: nsoil
     integer, dimension(ims:ime), intent(in) :: land, vegtype, soiltyp
     integer, intent(in) :: ntrac
-    real(kind=kind_phys), intent(in) :: g, pi, gmt
+    real(kind=kind_phys), intent(in) :: g, pi, gmt, con_rd, con_fv
     real(kind=kind_phys), dimension(ims:ime), intent(in) ::                & 
          u10m, v10m, ustar, garea, rlat, rlon, ts2d, sigmaf, dswsfc,       &
          zorl, snow_cpl, pb2d, hf2d
@@ -671,7 +671,7 @@ subroutine rrfs_smoke_prep(                                            &
           p_phy(i,k,j)=prl3d(i,kkp)
           u_phy(i,k,j)=us3d(i,kkp)
           v_phy(i,k,j)=vs3d(i,kkp)
-          rho_phy(i,k,j)=p_phy(i,k,j)/(287.04*t_phy(i,k,j)*(1.+.608*spechum(i,kkp)))
+          rho_phy(i,k,j)=p_phy(i,k,j)/(con_rd*t_phy(i,k,j)*(1.+con_fv*spechum(i,kkp)))
           rri(i,k,j)=1./rho_phy(i,k,j)
           vvel(i,k,j)=-w(i,kkp)*rri(i,k,j)/g 
           moist(i,k,j,:)=0.
diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta
index 2b2be03b6..bf2fddd60 100755
--- a/physics/smoke_dust/rrfs_smoke_wrapper.meta
+++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta
@@ -349,6 +349,14 @@
   type = real
   kind = kind_phys
   intent = in
+[con_fv]
+  standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one
+  long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor)
+  units = none
+  dimensions = ()
+  type = real
+  kind = kind_phys
+  intent = in
 [dust12m_in]
   standard_name = fengsha_dust12m_input
   long_name = fengsha dust input
@@ -426,8 +434,8 @@
   type = integer
   intent = in
 [ntcoarsepm]
-  standard_name = index_for_coarse_pm_in_tracer_concentration_array
-  long_name = tracer index for coarse pm
+  standard_name = index_for_coarse_particulate_matter_in_tracer_concentration_array
+  long_name = tracer index for coarse particulate matter
   units = index
   dimensions = ()
   type = integer
@@ -463,8 +471,8 @@
   kind = kind_phys
   intent = inout
 [emanoc]
-  standard_name = emission_of_anoc_for_thompson_mp
-  long_name = emission of anoc for thompson mp
+  standard_name = emission_of_anothropogenic_for_mp_indir_fdb
+  long_name = emission of anothropogenic for mp indirect feedabck
   units = ug m-2 s-1
   dimensions = (horizontal_loop_extent)
   type = real
@@ -479,8 +487,8 @@
   kind = kind_phys
   intent = inout
 [emseas]
-  standard_name = emission_of_seas_for_smoke
-  long_name = emission of seas for smoke
+  standard_name = emission_of_sea_salt_for_mp_indir_fdb
+  long_name = emission of sea salt for mp indirect feedabck
   units = ug m-2 s-1
   dimensions = (horizontal_loop_extent)
   type = real