Skip to content

Commit

Permalink
use progcld5 for F-A in GFS_rrtmg_pre
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhangw committed Sep 17, 2019
1 parent bbbf155 commit 370d49f
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 35 deletions.
86 changes: 62 additions & 24 deletions physics/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,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
!MZ 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 @@ -563,7 +563,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
enddo
enddo
enddo
endif !not FA
!MZ endif !not FA
if (Model%imp_physics == 11 ) then
if (.not. Model%lgfdlmprad) then

Expand Down Expand Up @@ -725,26 +725,32 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
Model%sup, Model%kdt, me, &
clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs

!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 == 15) then ! F-A cloud scheme


! if(Model%me==0) then
! write(0,*)'F-A: progclduni max(cldcov), min(cldcov) =' &
! ,maxval(cldcov),minval(cldcov)
! write(0,*)'F-A: progclduni max(ccnd_c), min(ccnd_c) =' &
! ,maxval(ccnd(:,:,1)),minval(ccnd(:,:,1))
! write(0,*)'F-A: progclduni max(ccnd_i), min(ccnd_i) =' &
! ,maxval(ccnd(:,:,2)),minval(ccnd(:,:,2))
! write(0,*)'F-A: progclduni max(ccnd_r), min(ccnd_r) =' &
! ,maxval(ccnd(:,:,3)),minval(ccnd(:,:,3))
! write(0,*)'F-A: progclduni max(ccnd_s), min(ccnd_s) =' &
! ,maxval(ccnd(:,:,4)),minval(ccnd(:,:,4))
! write(0,*)'F-A:-----------------------------------'
! endif

! call progclduni (plyr, plvl, tlyr, tvly, ccnd, ncndl, & ! --- inputs
! Grid%xlat, Grid%xlon, Sfcprop%slmsk, dz,delp, &
! IM, LMK, LMP, cldcov, &
! effrl, effri, effrr, effrs, Model%effr_in, &
! clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs

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

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

Expand All @@ -770,14 +776,30 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
! clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs
endif

elseif(Model%imp_physics == 8 .or. Model%imp_physics == 6) then ! Thompson / WSM6 cloud micrphysics scheme

! elseif(Model%imp_physics == 8 .or. Model%imp_physics == 6) then ! Thompson / WSM6 cloud micrphysics scheme
!MZ
elseif(Model%imp_physics == 8 .or. Model%imp_physics == 6 .or. &
Model%imp_physics == 15) then
if (Model%kdt == 1) then
Tbd%phy_f3d(:,:,Model%nleffr) = 10.
Tbd%phy_f3d(:,:,Model%nieffr) = 50.
Tbd%phy_f3d(:,:,Model%nseffr) = 250.
endif

if(Model%me==0) then
write(0,*)'F-A: progcld5 max(cldcov), min(cldcov) =' &
,maxval(cldcov),minval(cldcov)
write(0,*)'F-A: progcld5 max(ccnd_c), min(ccnd_c) =' &
,maxval(ccnd(:,:,1)),minval(ccnd(:,:,1))
write(0,*)'F-A: progcld5 max(ccnd_i), min(ccnd_i) =' &
,maxval(ccnd(:,:,2)),minval(ccnd(:,:,2))
write(0,*)'F-A: progcld5 max(ccnd_r), min(ccnd_r) =' &
,maxval(ccnd(:,:,3)),minval(ccnd(:,:,3))
write(0,*)'F-A: progcld5 max(ccnd_s), min(ccnd_s) =' &
,maxval(ccnd(:,:,4)),minval(ccnd(:,:,4))
write(0,*)'F-A:-----------------------------------'
endif

call progcld5 (plyr,plvl,tlyr,qlyr,qstl,rhly,tracer1, & ! --- inputs
Grid%xlat,Grid%xlon,Sfcprop%slmsk,dz,delp, &
ntrac-1, ntcw-1,ntiw-1,ntrw-1, &
Expand All @@ -788,6 +810,22 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
Tbd%phy_f3d(:,:,2), Tbd%phy_f3d(:,:,3), &
clouds,cldsa,mtopa,mbota, de_lgth) ! --- outputs

if(Model%me==0) then
write(0,*)'F-A: progcld5 max(cldsa1), min(cldsa1) =' &
,maxval(cldsa(:,1)),minval(cldsa(:,1))
write(0,*)'F-A: progcld5 max(cldsa2), min(cldsa2) =' &
,maxval(cldsa(:,2)),minval(cldsa(:,2))
write(0,*)'F-A: progcld5 max(cldsa3), min(cldsa3) =' &
,maxval(cldsa(:,3)),minval(cldsa(:,3))
write(0,*)'F-A: progcld5 max(cldsa4), min(cldsa4) =' &
,maxval(cldsa(:,4)),minval(cldsa(:,4))
write(0,*)'F-A: progcld5 max(cldsa5), min(cldsa5) =' &
,maxval(cldsa(:,5)),minval(cldsa(:,5))


write(0,*)'F-A:-----------------------------------'
endif

endif ! end if_imp_physics

! endif ! end_if_ntcw
Expand Down
30 changes: 19 additions & 11 deletions physics/mp_fer_hires.F90
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ end subroutine mp_fer_hires_init
!! | 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 |
!! | 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 | mass_weighted_rime_factor | mass_weighted_rime_factor | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | prec | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | inout | F |
!! | acprec | accumulated_lwe_thickness_of_precipitation_amount | accumulated total precipitation | m | 1 | real | kind_phys | inout | F |
!! | prec | lwe_thickness_of_explicit_precipitation_amount | explicit precipitation (rain, ice, snow, graupel, ...) on physics timestep | m | 1 | real | kind_phys | inout | F |
!! | mpirank | mpi_rank | current MPI-rank | index | 0 | integer | | in | F |
!! | mpiroot | mpi_root | master MPI-rank | index | 0 | integer | | in | F |
!! | threads | omp_threads | number of OpenMP threads available to scheme | count | 0 | integer | | in | F |
Expand All @@ -141,7 +140,7 @@ SUBROUTINE mp_fer_hires_run(NCOL, NLEV, DT &
,TRAIN,SR &
,F_ICE,F_RAIN,F_RIMEF &
,QC,QR,QI,QG &
,PREC,ACPREC &
,PREC &!,ACPREC -MZ:not used
,mpirank, mpiroot, threads &
,refl_10cm &
,RHGRD,dx &
Expand Down Expand Up @@ -184,7 +183,7 @@ SUBROUTINE mp_fer_hires_run(NCOL, NLEV, DT &
real(kind_phys), intent(inout) :: qi(1:ncol,1:nlev)
real(kind_phys), intent(inout) :: qg(1:ncol,1:nlev)
real(kind_phys), intent(inout) :: prec(1:ncol)
real(kind_phys), intent(inout) :: acprec(1:ncol)
! real(kind_phys) :: acprec(1:ncol) !MZ: change to local
real(kind_phys), intent(inout) :: refl_10cm(1:ncol,1:nlev)
real(kind_phys), intent(in ) :: rhgrd
real(kind_phys), intent(in ) :: dx(1:ncol)
Expand Down Expand Up @@ -292,8 +291,7 @@ SUBROUTINE mp_fer_hires_run(NCOL, NLEV, DT &
!*** FILL THE SINGLE-COLUMN INPUT
!-----------------------------------------------------------------------
!
!MZ DO K=LM,1,-1 ! We are moving down from the top in the flipped arrays
DO K=1,LM
DO K=LM,1,-1 ! We are moving down from the top in the flipped arrays

!
! TL(K)=T(I,K)
Expand All @@ -302,11 +300,16 @@ SUBROUTINE mp_fer_hires_run(NCOL, NLEV, DT &
RR(I,K)=P_PHY(I,K)/(R_D*T(I,K)*(P608*AMAX1(Q(I,K),EPSQ)+1.))
PI_PHY(I,K)=(P_PHY(I,K)*1.E-5)**CAPPA
TH_PHY(I,K)=T(I,K)/PI_PHY(I,K)
DZ(I,K)=(PRSI(I,K+1)-PRSI(I,K))*R_G/RR(I,K)
!MZ
! DZ(I,K)=(PRSI(I,K+1)-PRSI(I,K))*R_G/RR(I,K)
DZ(I,K)=(PRSI(I,K)-PRSI(I,K+1))*R_G/RR(I,K)
!
ENDDO !- DO K=LM,1,-1
!
ENDDO !- DO I=IMS,IME
! if (mpirank==mpiroot) write (0,*)'bf fer_hires: max/min(dz) = ', &
! maxval(dz),minval(dz)

!.......................................................................
!MZ$OMP end parallel do
!.......................................................................
Expand Down Expand Up @@ -343,8 +346,9 @@ SUBROUTINE mp_fer_hires_run(NCOL, NLEV, DT &
maxval(qg),minval(qg)
if (mpirank==mpiroot) write (0,*)'bf fer_hires: max/min(f_rimef) = ', &
maxval(f_rimef),minval(f_rimef)
if (mpirank==mpiroot) write (0,*)'bf fer_hires: max/min(dx1) = ', &
dx1
!if (mpirank==mpiroot) write (0,*)'bf fer_hires: max/min(dx1) = ', &
! dx1
if (mpirank==mpiroot) write (0,*)'---------------------------------'


!---------------------------------------------------------------------
Expand Down Expand Up @@ -406,6 +410,10 @@ SUBROUTINE mp_fer_hires_run(NCOL, NLEV, DT &
maxval(qi),minval(qi)
if (mpirank==mpiroot) write(0,*)'af fer_hires: max/min(f_rimef)= ', &
maxval(f_rimef),minval(f_rimef)
if (mpirank==mpiroot) write(0,*)'af fer_hires: max/min(f_ice)= ', &
maxval(f_ice),minval(f_ice)
if (mpirank==mpiroot) write(0,*)'af fer_hires: max/min(f_rain)= ', &
maxval(f_rain),minval(f_rain)
if (mpirank==mpiroot) write(0,*)'af fer_hires: max/min(qg)= ', &
maxval(qg),minval(qg)
if (mpirank==mpiroot) write(0,*)'af fer_hires: max/min(rainnc)= ', &
Expand All @@ -426,9 +434,9 @@ SUBROUTINE mp_fer_hires_run(NCOL, NLEV, DT &
!MZ$OMP parallel do SCHEDULE(dynamic) num_threads(threads) &
!MZ$OMP private(i,pcpcol,prec,acprec)
DO I=IMS,IME
PCPCOL=RAINNCV(I)*1.E-3
PCPCOL=RAINNCV(I)*1.E-3 !MZ:unit:m
PREC(I)=PREC(I)+PCPCOL
ACPREC(I)=ACPREC(I)+PCPCOL
!MZ ACPREC(I)=ACPREC(I)+PCPCOL !MZ: not used
!
! NOTE: RAINNC IS ACCUMULATED INSIDE MICROPHYSICS BUT NMM ZEROES IT OUT ABOVE
! SINCE IT IS ONLY A LOCAL ARRAY FOR NOW
Expand Down

0 comments on commit 370d49f

Please sign in to comment.