Skip to content

Commit

Permalink
Fixed the bugs when merged develop-ufs-ccpp-chem with P8
Browse files Browse the repository at this point in the history
Update the aerosol index using consistent names as NASA GOCART and move the smoke folder as P8
  • Loading branch information
zhanglikate committed Feb 18, 2023
1 parent 0023df6 commit b98cd21
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 58 deletions.
4 changes: 2 additions & 2 deletions ccpp/data/CCPP_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ subroutine gfs_interstitial_setup_tracers(Interstitial, Model)
Interstitial%ntrwx = 0

! perform aerosol convective transport and PBL diffusion
Interstitial%trans_aero = Model%cplchm .and. Model%trans_trac
Interstitial%trans_aero = (Model%cplchm .or. Model%cplchp) .and. Model%trans_trac

if (Model%imp_physics == Model%imp_physics_thompson) then
if (Model%ltaerosol) then
Expand Down Expand Up @@ -1112,7 +1112,7 @@ subroutine gfs_interstitial_setup_tracers(Interstitial, Model)
endif
endif

if (Model%cplchm) then
if (Model%cplchm .or. Model%cplchp) then
! Only the following microphysics schemes are supported with coupled chemistry
if (Model%imp_physics == Model%imp_physics_zhao_carr) then
Interstitial%nvdiff = 3
Expand Down
57 changes: 27 additions & 30 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: dqdt_qmicro(:,:) => null() !< instantanious microphysics tendency to be passed from MP to convection
!-- chemistry coupling
real (kind=kind_phys), pointer :: buffer_ebu (:,:,:,:) => null() !<
real (kind=kind_phys), pointer :: faersw_cpl(:,:,:,:) => null() !<
!--- instantaneous total moisture tendency for smoke coupling:
real (kind=kind_phys), pointer :: dqdti (:,:) => null() !< rrfs_smoke=true only; instantaneous total moisture tendency (kg/kg/s)

Expand Down Expand Up @@ -1328,7 +1327,6 @@ module GFS_typedefs
integer :: ntwa !< tracer index for water friendly aerosol
integer :: ntia !< tracer index for ice friendly aerosol
integer :: ntso2 !< tracer index for so2
integer :: ntsulf !< tracer index for sulf
integer :: ntdms !< tracer index for DMS
integer :: ntmsa !< tracer index for msa
integer :: ntpp25 !< tracer index for pp25
Expand Down Expand Up @@ -2846,9 +2844,7 @@ subroutine coupling_create (Coupling, IM, Model)
!-- chemistry coupling buffer
allocate (Coupling%buffer_ebu (IM,Model%levs+1,1,7))
!-- chemistry coupling feedback to radiation
allocate (Coupling%faersw_cpl (IM,Model%levr+LTP,14,3))
Coupling%buffer_ebu = clear_val
Coupling%faersw_cpl = clear_val
endif

! -- additional coupling options for air quality
Expand Down Expand Up @@ -4722,22 +4718,26 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%ntia = get_tracer_index(Model%tracer_names, 'ice_aero', Model%me, Model%master, Model%debug)
Model%ntsmoke = get_tracer_index(Model%tracer_names, 'smoke', Model%me, Model%master, Model%debug)
Model%ntdust = get_tracer_index(Model%tracer_names, 'dust', Model%me, Model%master, Model%debug)
if(Model%cplchp) then

!--- initialize parameters for atmospheric chemistry tracers
call Model%init_chemistry(tracer_types)

if(Model%cplchp .and. Model%ntchm>0) then
Model%ntchs = get_tracer_index(Model%tracer_names, 'so2', Model%me, Model%master, Model%debug)
Model%ntso2 = get_tracer_index(Model%tracer_names, 'so2', Model%me, Model%master, Model%debug)
Model%ntsulf = get_tracer_index(Model%tracer_names, 'sulf', Model%me, Model%master, Model%debug)
Model%ntsu = get_tracer_index(Model%tracer_names, 'sulf', Model%me, Model%master, Model%debug)
Model%ntdms = get_tracer_index(Model%tracer_names, 'dms', Model%me, Model%master, Model%debug)
Model%ntmsa = get_tracer_index(Model%tracer_names, 'msa', Model%me, Model%master, Model%debug)
Model%ntpp25 = get_tracer_index(Model%tracer_names, 'pp25', Model%me, Model%master, Model%debug)
Model%ntbcl = get_tracer_index(Model%tracer_names, 'bc1', Model%me, Model%master, Model%debug)
Model%ntbcb = get_tracer_index(Model%tracer_names, 'bc2', Model%me, Model%master, Model%debug)
Model%ntocl = get_tracer_index(Model%tracer_names, 'oc1', Model%me, Model%master, Model%debug)
Model%ntocb = get_tracer_index(Model%tracer_names, 'oc2', Model%me, Model%master, Model%debug)
Model%ntdu = get_tracer_index(Model%tracer_names, 'dust1', Model%me, Model%master, Model%debug)
Model%ntdu = get_tracer_index(Model%tracer_names, 'dust2', Model%me, Model%master, Model%debug)
Model%ntdu = get_tracer_index(Model%tracer_names, 'dust3', Model%me, Model%master, Model%debug)
Model%ntdu = get_tracer_index(Model%tracer_names, 'dust4', Model%me, Model%master, Model%debug)
Model%ntdu = get_tracer_index(Model%tracer_names, 'dust5', Model%me, Model%master, Model%debug)
Model%ntbcb = get_tracer_index(Model%tracer_names, 'bc1', Model%me, Model%master, Model%debug)
Model%ntbcl = get_tracer_index(Model%tracer_names, 'bc2', Model%me, Model%master, Model%debug)
Model%ntocb = get_tracer_index(Model%tracer_names, 'oc1', Model%me, Model%master, Model%debug)
Model%ntocl = get_tracer_index(Model%tracer_names, 'oc2', Model%me, Model%master, Model%debug)
Model%ntdu1 = get_tracer_index(Model%tracer_names, 'dust1', Model%me, Model%master, Model%debug)
Model%ntdu2 = get_tracer_index(Model%tracer_names, 'dust2', Model%me, Model%master, Model%debug)
Model%ntdu3 = get_tracer_index(Model%tracer_names, 'dust3', Model%me, Model%master, Model%debug)
Model%ntdu4 = get_tracer_index(Model%tracer_names, 'dust4', Model%me, Model%master, Model%debug)
Model%ntdu5 = get_tracer_index(Model%tracer_names, 'dust5', Model%me, Model%master, Model%debug)
Model%ntss1 = get_tracer_index(Model%tracer_names, 'seas1', Model%me, Model%master, Model%debug)
Model%ntss2 = get_tracer_index(Model%tracer_names, 'seas2', Model%me, Model%master, Model%debug)
Model%ntss3 = get_tracer_index(Model%tracer_names, 'seas3', Model%me, Model%master, Model%debug)
Expand All @@ -4746,9 +4746,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%ntpp10 = get_tracer_index(Model%tracer_names, 'pp10', Model%me, Model%master, Model%debug)
endif ! cplchp tracers

!--- initialize parameters for atmospheric chemistry tracers
call Model%init_chemistry(tracer_types)

!--- setup aerosol scavenging factors
call Model%init_scavenging(fscav_aero)

Expand Down Expand Up @@ -4801,7 +4798,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
allocate(Model%dtidx(Model%ntracp100,Model%nprocess))
Model%dtidx = -99

if(Model%ntchm>0) then
if(Model%cplchm .and. Model%ntchm>0) then
Model%ntdu1 = get_tracer_index(Model%tracer_names, 'dust1', Model%me, Model%master, Model%debug)
Model%ntdu2 = get_tracer_index(Model%tracer_names, 'dust2', Model%me, Model%master, Model%debug)
Model%ntdu3 = get_tracer_index(Model%tracer_names, 'dust3', Model%me, Model%master, Model%debug)
Expand Down Expand Up @@ -6395,21 +6392,21 @@ subroutine control_print(Model)
print *, ' ndchs : ', Model%ndchs
print *, ' ndche : ', Model%ndche
print *, ' fscav : ', Model%fscav
if(Model%cplchp) then
if(Model%cplchp .and. Model%ntchm>0) then
print *, ' ntso2 : ', Model%ntso2
print *, ' ntsulf : ', Model%ntsulf
print *, ' ntsu : ', Model%ntsu
print *, ' ntdms : ', Model%ntdms
print *, ' ntmsa : ', Model%ntmsa
print *, ' ntpp25 : ', Model%ntpp25
print *, ' ntbcl : ', Model%ntbc1
print *, ' ntbcb : ', Model%ntbc2
print *, ' ntocl : ', Model%ntoc1
print *, ' ntocb : ', Model%ntoc2
print *, ' ntdu : ', Model%ntdust1
print *, ' ntdu : ', Model%ntdust2
print *, ' ntdu : ', Model%ntdust3
print *, ' ntdu : ', Model%ntdust4
print *, ' ntdu : ', Model%ntdust5
print *, ' ntbcl : ', Model%ntbcl
print *, ' ntbcb : ', Model%ntbcb
print *, ' ntocl : ', Model%ntocl
print *, ' ntocb : ', Model%ntocb
print *, ' ntdu1 : ', Model%ntdu1
print *, ' ntdu2 : ', Model%ntdu2
print *, ' ntdu3 : ', Model%ntdu3
print *, ' ntdu4 : ', Model%ntdu4
print *, ' ntdu5 : ', Model%ntdu5
print *, ' ntss1 : ', Model%ntss1
print *, ' ntss2 : ', Model%ntss2
print *, ' ntss3 : ', Model%ntss3
Expand Down
14 changes: 0 additions & 14 deletions ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -2614,14 +2614,6 @@
type = real
kind = kind_phys
active = (flag_for_chemistry_package_coupling)
[faersw_cpl]
standard_name = gsdchem_aerosol_optical_properties_for_shortwave_bands_01_14
long_name = gsdchem aerosol optical properties for shortwave bands 01-14
units = various
dimensions = (horizontal_loop_extent,adjusted_vertical_layer_dimension_for_radiation,14,3)
type = real
kind = kind_phys
active = (flag_for_chemistry_package_coupling)
[dqdti]
standard_name = instantaneous_water_vapor_specific_humidity_tendency_due_to_convection
long_name = instantaneous moisture tendency due to convection
Expand Down Expand Up @@ -5694,12 +5686,6 @@
units = index
dimensions = ()
type = integer
[ntsulf]
standard_name = index_for_sulf
long_name = tracer index for sulf
units = index
dimensions = ()
type = integer
[ntDMS]
standard_name = index_for_DMS
long_name = tracer index for DMS
Expand Down
2 changes: 1 addition & 1 deletion ccpp/physics
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v15_thompson_mynn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</subcycle>
<!-- Surface iteration loop -->
<subcycle loop="2">
<scheme>mynnsfc_wrapper</scheme>
<scheme>sfc_diff</scheme>
<scheme>GFS_surface_loop_control_part1</scheme>
<scheme>sfc_nst_pre</scheme>
<scheme>sfc_nst</scheme>
Expand Down
93 changes: 93 additions & 0 deletions ccpp/suites/suite_FV3_GFS_v16_coupled_p8_sfcocn.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>

<suite name="FV3_GFS_v16_coupled_p8_sfcocn" version="1">
<!-- <init></init> -->
<group name="fast_physics">
<subcycle loop="1">
<scheme>fv_sat_adj</scheme>
</subcycle>
</group>
<group name="time_vary">
<subcycle loop="1">
<scheme>GFS_time_vary_pre</scheme>
<scheme>GFS_rrtmg_setup</scheme>
<scheme>GFS_rad_time_vary</scheme>
<scheme>GFS_phys_time_vary</scheme>
</subcycle>
</group>
<group name="radiation">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_rad_reset</scheme>
<scheme>GFS_rrtmg_pre</scheme>
<scheme>GFS_radiation_surface</scheme>
<scheme>rad_sw_pre</scheme>
<scheme>rrtmg_sw</scheme>
<scheme>rrtmg_sw_post</scheme>
<scheme>rrtmg_lw_pre</scheme>
<scheme>rrtmg_lw</scheme>
<scheme>rrtmg_lw_post</scheme>
<scheme>GFS_rrtmg_post</scheme>
</subcycle>
</group>
<group name="physics">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_phys_reset</scheme>
<scheme>GFS_suite_stateout_reset</scheme>
<scheme>get_prs_fv3</scheme>
<scheme>GFS_suite_interstitial_1</scheme>
<scheme>GFS_surface_generic_pre</scheme>
<scheme>GFS_surface_composites_pre</scheme>
<scheme>dcyc2t3</scheme>
<scheme>GFS_surface_composites_inter</scheme>
<scheme>GFS_suite_interstitial_2</scheme>
</subcycle>
<!-- Surface iteration loop -->
<subcycle loop="2">
<scheme>sfc_diff</scheme>
<scheme>GFS_surface_loop_control_part1</scheme>
<scheme>sfc_ocean</scheme>
<scheme>noahmpdrv</scheme>
<scheme>sfc_cice</scheme>
<scheme>sfc_sice</scheme>
<scheme>GFS_surface_loop_control_part2</scheme>
</subcycle>
<!-- End of surface iteration loop -->
<subcycle loop="1">
<scheme>GFS_surface_composites_post</scheme>
<scheme>sfc_diag</scheme>
<scheme>sfc_diag_post</scheme>
<scheme>GFS_surface_generic_post</scheme>
<scheme>GFS_PBL_generic_pre</scheme>
<scheme>satmedmfvdifq</scheme>
<scheme>GFS_PBL_generic_post</scheme>
<scheme>GFS_GWD_generic_pre</scheme>
<scheme>ugwpv1_gsldrag</scheme>
<scheme>ugwpv1_gsldrag_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>ozphys_2015</scheme>
<scheme>h2ophys</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
<scheme>samfdeepcnv</scheme>
<scheme>GFS_DCNV_generic_post</scheme>
<scheme>GFS_SCNV_generic_pre</scheme>
<scheme>samfshalcnv</scheme>
<scheme>GFS_SCNV_generic_post</scheme>
<scheme>GFS_suite_interstitial_4</scheme>
<scheme>cnvc90</scheme>
<scheme>GFS_MP_generic_pre</scheme>
<scheme>gfdl_cloud_microphys</scheme>
<scheme>GFS_MP_generic_post</scheme>
<scheme>maximum_hourly_diagnostics</scheme>
<scheme>phys_tend</scheme>
</subcycle>
</group>
<group name="stochastics">
<subcycle loop="1">
<scheme>GFS_stochastics</scheme>
</subcycle>
</group>
<!-- <finalize></finalize> -->
</suite>
20 changes: 10 additions & 10 deletions io/FV3GFS_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ module FV3GFS_io_mod
real(kind=kind_phys), allocatable, target, dimension(:,:,:) :: oro_ls_var, oro_ss_var
real(kind=kind_phys), allocatable, target, dimension(:,:,:,:) :: sfc_var3, phy_var3
character(len=32), allocatable, dimension(:) :: dust12m_name, dust_name, emi_name, emi2_name, gbbepx_name
real(kind=kind_phys), allocatable, target, dimension(:,:,:,:) :: dust12m_var
real(kind=kind_phys), allocatable, target, dimension(:,:,:) :: dust_var, emi_var, gbbepx_var
real(kind=kind_phys), allocatable, target, dimension(:,:,:,:) :: dust12m_var,gbbepx_var
real(kind=kind_phys), allocatable, target, dimension(:,:,:) :: dust_var, emi_var, gbbepx_varv3
real(kind=kind_phys), allocatable, target, dimension(:,:,:,:) :: emi2_var
!--- Noah MP restart containers
real(kind=kind_phys), allocatable, target, dimension(:,:,:,:) :: sfc_var3sn,sfc_var3eq,sfc_var3zn
Expand Down Expand Up @@ -863,7 +863,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta
if (.not. allocated(gbbepx_name)) then
!--- allocate the various containers needed for gbbepx fire data
allocate(gbbepx_name(nvar_gbbepx))
allocate(gbbepx_var(nx,ny,nvar_gbbepx))
allocate(gbbepx_varv3(nx,ny,nvar_gbbepx))

gbbepx_name(1) = 'ebu_bc'
gbbepx_name(2) = 'ebu_oc'
Expand All @@ -875,7 +875,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta
call register_axis( gbbepx_restart, "lat", 'Y' )
!--- register the 2D fields
do num = 1,nvar_gbbepx
var2_p => gbbepx_var(:,:,num)
var2_p => gbbepx_varv3(:,:,num)
call register_restart_field(gbbepx_restart, gbbepx_name(num), var2_p, dimensions=(/'lat ', 'lon '/))
enddo
nullify(var2_p)
Expand All @@ -892,15 +892,15 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta
i = Atm_block%index(nb)%ii(ix) - isc + 1
j = Atm_block%index(nb)%jj(ix) - jsc + 1
!--- assign hprime(1:10) and hprime(15:24) with new oro stat data
Sfcprop(nb)%fire_GBBEPx(ix,1) = gbbepx_var(i,j,1)
Sfcprop(nb)%fire_GBBEPx(ix,2) = gbbepx_var(i,j,2)
Sfcprop(nb)%fire_GBBEPx(ix,3) = gbbepx_var(i,j,3)
Sfcprop(nb)%fire_GBBEPx(ix,4) = gbbepx_var(i,j,4)
Sfcprop(nb)%fire_GBBEPx(ix,5) = gbbepx_var(i,j,5)
Sfcprop(nb)%fire_GBBEPx(ix,1) = gbbepx_varv3(i,j,1)
Sfcprop(nb)%fire_GBBEPx(ix,2) = gbbepx_varv3(i,j,2)
Sfcprop(nb)%fire_GBBEPx(ix,3) = gbbepx_varv3(i,j,3)
Sfcprop(nb)%fire_GBBEPx(ix,4) = gbbepx_varv3(i,j,4)
Sfcprop(nb)%fire_GBBEPx(ix,5) = gbbepx_varv3(i,j,5)
enddo
enddo

deallocate(gbbepx_name, gbbepx_var)
deallocate(gbbepx_name, gbbepx_varv3)
endif !if (Model%cplchp) then


Expand Down

0 comments on commit b98cd21

Please sign in to comment.