Skip to content

Commit

Permalink
using field table instead of code change for mraerosol
Browse files Browse the repository at this point in the history
  • Loading branch information
AnningCheng-NOAA committed Oct 18, 2021
1 parent 95c67d3 commit 88bcfd7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 28 deletions.
20 changes: 3 additions & 17 deletions physics/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, &
real(kind=kind_phys), dimension(im,lm+LTP+1) :: tem2db, hz

real(kind=kind_phys), dimension(im,lm+LTP,min(4,ncnd)) :: ccnd
real(kind=kind_phys), dimension(im,lm+LTP,2:ntrac) :: tracer1
real(kind=kind_phys), dimension(im,lm+LTP,2:ntrac+2) :: tracer1
real(kind=kind_phys), dimension(im,lm+LTP,NF_CLDS) :: clouds
real(kind=kind_phys), dimension(im,lm+LTP,NF_VGAS) :: gasvmr
real(kind=kind_phys), dimension(im,lm+LTP,NBDSW,NF_AESW) :: faersw
Expand Down Expand Up @@ -305,7 +305,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, &
enddo

!--- recast remaining all tracers (except sphum) forcing them all to be positive
do j = 2, ntrac
do j = 2, ntrac
do k = 1, LM
k1 = k + kd
k2 = k + lsk
Expand Down Expand Up @@ -636,7 +636,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, &
enddo
enddo
! for Thompson MP - prepare variables for calc_effr
if_thompson: if (imp_physics == imp_physics_thompson .and. ltaerosol) then
if_thompson: if (imp_physics == imp_physics_thompson .and. (ltaerosol .or. mraerosol)) then
do k=1,LMK
do i=1,IM
qvs = qlyr(i,k)
Expand All @@ -651,20 +651,6 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, &
nwfa (i,k) = tracer1(i,k,ntwa)
enddo
enddo
else if (imp_physics == imp_physics_thompson .and. mraerosol) then
do k=1,LMK
do i=1,IM
qvs = qlyr(i,k)
qv_mp (i,k) = qvs/(1.-qvs)
rho (i,k) = con_eps*plyr(i,k)*100./(con_rd*tlyr(i,k)*(qv_mp(i,k)+con_eps))
orho (i,k) = 1.0/rho(i,k)
qc_mp (i,k) = tracer1(i,k,ntcw)/(1.-qvs)
qi_mp (i,k) = tracer1(i,k,ntiw)/(1.-qvs)
qs_mp (i,k) = tracer1(i,k,ntsw)/(1.-qvs)
nc_mp (i,k) = tracer1(i,k,ntlnc)/(1.-qvs)
ni_mp (i,k) = tracer1(i,k,ntinc)/(1.-qvs)
enddo
enddo

elseif (imp_physics == imp_physics_thompson) then
do k=1,LMK
Expand Down
16 changes: 6 additions & 10 deletions physics/mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,6 @@ subroutine mp_thompson_init(ncol, nlev, con_g, con_rd, con_eps, &
where(qs<0) qs = 0.0
where(qg<0) qg = 0.0

if (merra2_aerosol_aware) then
call get_niwfa(aerfld, nifa, nwfa, ncol, nlev)
end if

!> - Convert specific humidity to water vapor mixing ratio.
!> - Also, hydrometeor variables are mass or number mixing ratio
!> - either kg of species per kg of dry air, or per kg of (dry + vapor).
Expand Down Expand Up @@ -218,6 +214,8 @@ subroutine mp_thompson_init(ncol, nlev, con_g, con_rd, con_eps, &
nwfa(i,k) = naCCN1+naCCN0*exp(-((hgt(i,k)-hgt(i,1))/1000.)*niCCN3)
enddo
enddo
else if (merra2_aerosol_aware) then
call get_niwfa(aerfld, nifa, nwfa, ncol, nlev)
else
if (mpirank==mpiroot) write(*,*) ' Apparently initial CCN aerosols are present.'
if (MAXVAL(nwfa2d) .lt. eps) then
Expand Down Expand Up @@ -520,7 +518,6 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
errflg = 1
return
end if

! Set reduced time step if subcycling is used
if (nsteps>1) then
dtstep = dtp/real(nsteps, kind=kind_phys)
Expand All @@ -544,7 +541,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
' nc, nwfa, nifa, nwfa2d, nifa2d'
errflg = 1
return
else if (is_aerosol_aware .and. .not. (present(nc) .and. &
else if (merra2_aerosol_aware .and. .not. (present(nc) .and. &
present(nwfa) .and. &
present(nifa) )) then
write(errmsg,fmt='(*(a))') 'Logic error in mp_thompson_run:', &
Expand All @@ -555,9 +552,6 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
end if
end if

if (merra2_aerosol_aware) then
call get_niwfa(aerfld, nifa, nwfa, ncol, nlev)
end if

!> - Convert specific humidity to water vapor mixing ratio.
!> - Also, hydrometeor variables are mass or number mixing ratio
Expand Down Expand Up @@ -702,7 +696,9 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
ncten3 => diag3d(:,:,36:36)
qcten3 => diag3d(:,:,37:37)
end if set_extended_diagnostic_pointers

if (merra2_aerosol_aware) then
call get_niwfa(aerfld, nifa, nwfa, ncol, nlev)
end if
!> - Call mp_gt_driver() with or without aerosols
if (is_aerosol_aware .or. merra2_aerosol_aware) then
if (do_effective_radii) then
Expand Down
2 changes: 1 addition & 1 deletion physics/rte-rrtmgp
Submodule rte-rrtmgp updated 42 files
+1 −0 .github/workflows/containerized-ci.yml
+1 −0 .github/workflows/continuous-integration.yml
+88 −0 .github/workflows/self-hosted-ci.yml
+7 −0 .gitignore
+1 −1 README.md
+0 −80 azure-pipelines.yml
+21 −7 build/Makefile
+13 −0 environment.yml
+1 −5 examples/all-sky/README.md
+1 −2 examples/all-sky/mo_garand_atmos_io.F90
+1 −1 examples/all-sky/mo_load_cloud_coefficients.F90
+14 −7 examples/all-sky/rrtmgp_allsky.F90
+4 −4 examples/mo_load_coefficients.F90
+17 −26 examples/mo_simple_netcdf.F90
+1 −1 examples/rfmip-clear-sky/Makefile
+7 −9 examples/rfmip-clear-sky/Readme.md
+28 −22 examples/rfmip-clear-sky/mo_rfmip_io.F90
+29 −25 extensions/cloud_optics/mo_cloud_optics.F90
+5 −5 extensions/cloud_optics/mo_cloud_sampling.F90
+8 −0 extensions/mo_rrtmgp_clr_all_sky.F90
+5 −3 rrtmgp/Make.depends
+3 −1 rrtmgp/data/README.md
+ rrtmgp/data/rrtmgp-data-lw-g128-210809.nc
+ rrtmgp/data/rrtmgp-data-sw-g112-210809.nc
+ rrtmgp/data/rrtmgp-data-sw-g224-2018-12-04.nc
+22 −20 rrtmgp/kernels-openacc/mo_gas_optics_kernels.F90
+4 −4 rrtmgp/kernels/mo_gas_optics_kernels.F90
+3 −41 rrtmgp/kernels/mo_rrtmgp_util_reorder_kernels.F90
+31 −20 rrtmgp/mo_gas_optics_rrtmgp.F90
+2 −12 rrtmgp/mo_rrtmgp_util_reorder.F90
+6 −4 rte/Make.depends
+89 −93 rte/kernels-openacc/mo_optical_props_kernels.F90
+548 −618 rte/kernels-openacc/mo_rte_solver_kernels.F90
+432 −433 rte/kernels/mo_rte_solver_kernels.F90
+55 −35 rte/mo_optical_props.F90
+226 −152 rte/mo_rte_lw.F90
+168 −167 rte/mo_rte_sw.F90
+4 −4 rte/mo_rte_util_array.F90
+3 −3 tests/Makefile
+102 −13 tests/clear_sky_regression.F90
+12 −8 tests/validation-plots.py
+20 −12 tests/verification.py

0 comments on commit 88bcfd7

Please sign in to comment.