Skip to content

Commit

Permalink
tracer treatment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhangw committed Aug 31, 2019
1 parent ec729e8 commit 1808226
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 20 deletions.
34 changes: 29 additions & 5 deletions physics/GFS_PBL_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac,
vdftra(i,k,4) = qgrs(i,k,ntoz)
enddo
enddo

! Ferrier-Aligo
elseif (imp_physics == imp_physics_fer_hires) then
do k=1,levs
do i=1,im
vdftra(i,k,1) = qgrs(i,k,ntqv)
vdftra(i,k,2) = qgrs(i,k,ntcw)
vdftra(i,k,3) = qgrs(i,k,ntiw)
vdftra(i,k,4) = qgrs(i,k,ntrw)
vdftra(i,k,5) = qgrs(i,k,ntoz)
enddo
enddo

elseif (imp_physics == imp_physics_thompson) then
! Thompson
if(ltaerosol) then
Expand Down Expand Up @@ -165,9 +178,8 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac,
enddo
enddo
endif
elseif (imp_physics == imp_physics_gfdl .or. &
imp_physics == imp_physics_fer_hires) then
! GFDL MP or F-A MP
elseif (imp_physics == imp_physics_gfdl ) then
! GFDL MP
do k=1,levs
do i=1,im
vdftra(i,k,1) = qgrs(i,k,ntqv)
Expand Down Expand Up @@ -368,6 +380,19 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac,
dqdt(i,k,ntoz) = dvdftra(i,k,4)
enddo
enddo

elseif (imp_physics == imp_physics_fer_hires) then
! Ferrier-Aligo
do k=1,levs
do i=1,im
dqdt(i,k,ntqv) = dvdftra(i,k,1)
dqdt(i,k,ntcw) = dvdftra(i,k,2)
dqdt(i,k,ntiw) = dvdftra(i,k,3)
dqdt(i,k,ntrw) = dvdftra(i,k,4)
dqdt(i,k,ntoz) = dvdftra(i,k,5)
enddo
enddo

elseif (imp_physics == imp_physics_thompson) then
! Thompson
if(ltaerosol) then
Expand Down Expand Up @@ -432,8 +457,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac,
enddo
enddo
endif
elseif (imp_physics == imp_physics_gfdl .or. &
imp_physics == imp_physics_fer_hires ) then
elseif (imp_physics == imp_physics_gfdl) then
! GFDL MP or F-A MP
do k=1,levs
do i=1,im
Expand Down
17 changes: 14 additions & 3 deletions physics/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ end subroutine GFS_rrtmg_pre_init
!! | f_rain | fraction_of_rain_water_cloud | fraction of rain water cloud | frac | 2 | real | kind_phys | in | F |
!! | f_rimef | rime_factor | rime factor | frac | 2 | real | kind_phys | in | F |
!! | flgmin | minimum_large_ice_fraction | minimum large ice fraction in F-A mp scheme | frac | 1 | real | kind_phys | in | F |
!! | cwm | total_cloud_condensate_mixing_ratio_updated_by_physics | total cloud condensate mixing ratio (except water vapor) updated by physics | kg kg-1 | 2 | real | kind_phys | in | F |
!! | cwm | total_cloud_condensate_mixing_ratio_updated_by_physics | total cloud condensate mixing ratio (except water vapor) updated by physics | kg kg-1 | 2 | real | kind_phys | out | F |
!! | lm | number_of_vertical_layers_for_radiation_calculations | number of vertical layers for radiation calculation | count | 0 | integer | | in | F |
!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F |
!! | lmk | adjusted_vertical_layer_dimension_for_radiation | number of vertical layers for radiation | count | 0 | integer | | in | F |
Expand Down Expand Up @@ -153,7 +153,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP), intent(in) :: f_ice
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP), intent(in) :: f_rain
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP), intent(in) :: f_rimef
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP), intent(in) :: cwm
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP), intent(out) :: cwm
real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: flgmin
real(kind=kind_phys), intent(out) :: raddt

Expand Down Expand Up @@ -587,6 +587,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
! --- ... obtain cloud information for radiation calculations

! if (ntcw > 0) then ! prognostic cloud schemes
if (Model%imp_physics .ne. 15) then
ccnd = 0.0_kind_phys
if (Model%ncnd == 1) then ! Zhao_Carr_Sundqvist
do k=1,LMK
Expand Down Expand Up @@ -627,6 +628,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
enddo
enddo
enddo
endif !not FA
if (Model%imp_physics == 11 ) then
if (.not. Model%lgfdlmprad) then

Expand Down Expand Up @@ -791,14 +793,23 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
!MZ
!clw here is total cloud condensate
elseif (Model%imp_physics == 15) then ! F-A cloud scheme

cwm(:,:) = cwm(:,:) + tracer1(:,1:LMK,Model%ntcw) &
+ tracer1(:,1:LMK,Model%ntrw) &
+ tracer1(:,1:LMK,Model%ntiw)

if(Model%me==0) write(0,*)'F-A: progcld2 max(cwm),min(cwm) =' &
,maxval(cwm),minval(cwm)
call progcld2 (plyr, plvl, tlyr, tvly, qlyr, qstl, rhly, &
cwm, & ! --- inputs:
Grid%xlat, Grid%xlon, Sfcprop%slmsk,dz,delp, &
f_ice,f_rain,f_rimef,flgmin, & ! F-A scheme specific
im, lmk, lmp, Model%lmfshal, Model%lmfdeep2, &
clouds,cldsa,mtopa,mbota,de_lgth) ! --- outputs:


if(Model%me==0) write(0,*)'F-A: progcld2 max(clouds(:,:,1)),&
min(clouds(:,:,1)) = ' &
,maxval(clouds(:,:,1)),minval(clouds(:,:,1))

elseif (Model%imp_physics == 11) then ! GFDL cloud scheme

Expand Down
20 changes: 9 additions & 11 deletions physics/module_mp_fer_hires_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ end subroutine mp_fer_hires_pre_finalize
!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional |
!! |----------------|-------------------------------------------------------|--------------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------|
!! | cwm | total_cloud_condensate_mixing_ratio_updated_by_physics| total cloud condensate mixing ratio (except water vapor) updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | f_ice | fraction_of_ice_water_cloud | mass fraction of ice water cloud | frac | 2 | real | kind_phys | inout | F |
!! | f_rain | fraction_of_rain_water_cloud | mass fraction of rain water cloud | frac | 2 | real | kind_phys | inout | F |
!! | f_ice | fraction_of_ice_water_cloud | fraction of ice water cloud | frac | 2 | real | kind_phys | inout | F |
!! | f_rain | fraction_of_rain_water_cloud | fraction of rain water cloud | frac | 2 | real | kind_phys | inout | F |
!! | epsq | minimum_value_of_specific_humidity | floor value for specific humidity | kg kg-1 | 0 | real | kind_phys | in | F |
!! | t | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | inout | F |
!! | qc | cloud_condensed_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of cloud condensed water updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | qr | rain_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of rain water updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | qs | snow_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of snow water updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | qi | ice_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | qg | graupel_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of graupel updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | spec_adv | flag_for_individual_cloud_species_advected | flag for individual cloud species advected | flag | 0 | logical | | in | F |
!! | kdt | index_of_time_step | current forecast interation | index | 0 | integer | | in | F |
!! | lm | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F |
Expand All @@ -46,7 +44,7 @@ end subroutine mp_fer_hires_pre_finalize
!!
subroutine mp_fer_hires_pre_run (CWM,F_ICE,F_RAIN &
,EPSQ &
,T,QC,QR,QS,QI,QG &
,T,QC,QR,QI &
,SPEC_ADV,kdt &
,LM,IME,errmsg,errflg )

Expand All @@ -67,7 +65,7 @@ subroutine mp_fer_hires_pre_run (CWM,F_ICE,F_RAIN &
,F_ICE &
,F_RAIN &
,T,QC,QR &
,QS,QI,QG
,QI !QG QS
!
!--------------------
!-- Local Variables
Expand Down Expand Up @@ -106,11 +104,11 @@ subroutine mp_fer_hires_pre_run (CWM,F_ICE,F_RAIN &
LIQW=(1.-F_ice(I,K))*CWM(I,K)
QC(I,K)=(1.-F_rain(I,K))*LIQW
QR(I,K)=F_rain(I,K)*LIQW
QS(I,K)=F_ice(I,K)*CWM(I,K)
QI(I,K)=F_ice(I,K)*CWM(I,K)
ELSE
QC(I,K)=0.
QR(I,K)=0.
QS(I,K)=0.
QI(I,K)=0.
ENDIF
ENDDO
ENDDO
Expand All @@ -119,9 +117,9 @@ subroutine mp_fer_hires_pre_run (CWM,F_ICE,F_RAIN &
!-- Update CWM,F_ICE,F_RAIN arrays from separate species advection (spec_adv=T)
DO K=1,LM
DO I=1,IME
CWM(I,K)=QC(I,K)+QR(I,K)+QS(I,K)
IF (QS(I,K)>EPSQ) THEN
F_ICE(I,K)=QS(I,K)/CWM(I,K)
CWM(I,K)=QC(I,K)+QR(I,K)+QI(I,K)
IF (QI(I,K)>EPSQ) THEN
F_ICE(I,K)=QI(I,K)/CWM(I,K)
ELSE
F_ICE(I,K)=0.0
ENDIF
Expand Down
2 changes: 1 addition & 1 deletion physics/mp_fer_hires.F90
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ SUBROUTINE mp_fer_hires_run(NCOL, NLEV, DT &
real(kind_phys) :: mprates(1:ncol,1:nlev,d_ss)
real(kind_phys) :: sm(1:ncol), xland(1:ncol)
real(kind_phys) :: DTPHS,PCPCOL,RDTPHS,TNEW
real(kind_phys) :: ql(1:ncol),tl(1:ncol)
real(kind_phys) :: ql(1:nlev),tl(1:nlev)
real(kind_phys) :: rainnc(1:ncol),rainncv(1:ncol)
real(kind_phys) :: snownc(1:ncol),snowncv(1:ncol)
real(kind_phys) :: graupelncv(1:ncol)
Expand Down

0 comments on commit 1808226

Please sign in to comment.