Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NSSL microphysics to fix ORT restart and decomposition tests #904

Merged
merged 8 commits into from
May 11, 2022
2 changes: 1 addition & 1 deletion physics/module_mp_nssl_2mom.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2884,7 +2884,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw
IF ( lccn > 1 .and. is_aerosol_aware .and. flag_qnwfa ) THEN
! not used here
ELSEIF ( present( cn ) .and. lccn > 1 .and. .not. flag_qndrop) THEN
IF ( lccna > 1 .and. .not. present( cna ) ) THEN
IF ( lccna > 1 .and. .not. ( present( cna ) .and. f_cnatmp ) ) THEN
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this change is not directly related to the issue, but it was a logic error found along the way (no effect, because lccna=0 for current uses in CCPP)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to know that you fixed this logic error.

cn(ix,kz,jy) = Max(0.0, an(ix,1,kz,lccna) )
ELSE
cn(ix,kz,jy) = an(ix,1,kz,lccn)
Expand Down
41 changes: 18 additions & 23 deletions physics/mp_nssl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, &
CALL nssl_2mom_init(ims,ime, jms,jme, kms,kme,nssl_params,ipctmp=5,mixphase=0, &
ihvol=ihailv,errmsg=errmsg,errflg=errflg,myrank=mpirank,mpiroot=mpiroot)

! For restart runs, the init is done here
if (restart) then
is_initialized = .true.
return
end if

! Other initialization operation here....

is_initialized = .true.

Expand All @@ -155,7 +161,7 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, &
ccw, crw, cci, csw, chw, chl, vh, vhl, &
tgrs, prslk, prsl, phii, omega, dtp, &
prcp, rain, graupel, ice, snow, sr, &
refl_10cm, do_radar_ref, first_time_step, &
refl_10cm, do_radar_ref, first_time_step, restart, &
re_cloud, re_ice, re_snow, re_rain, &
nleffr, nieffr, nseffr, nreffr, &
imp_physics, convert_dry_rho, &
Expand Down Expand Up @@ -206,6 +212,7 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, &
! Radar reflectivity
real(kind_phys), intent(inout) :: refl_10cm(:,:) !(1:ncol,1:nlev)
logical, intent(in ) :: do_radar_ref, first_time_step
logical, intent(in) :: restart
! Cloud effective radii
real(kind_phys), intent(inout) :: re_cloud(:,:) ! (1:ncol,1:nlev)
real(kind_phys), intent(inout) :: re_ice(:,:) ! (1:ncol,1:nlev)
Expand Down Expand Up @@ -492,7 +499,7 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, &
ntmul = 1
ENDIF

IF ( first_time_step ) THEN
IF ( first_time_step .and. .not. restart ) THEN
itimestep = 0 ! gets incremented to 1 in call loop
IF ( nssl_ccn_on ) THEN
IF ( invertccn ) THEN
Expand Down Expand Up @@ -538,23 +545,16 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, &

IF ( nssl_ccn_on ) THEN
IF ( invertccn ) THEN
! cn_mp = Max(0.0, nssl_qccn - Max(0.0,cccn))
DO k = 1,nlev
DO i = 1,ncol
cn_mp(i,k) = Max(0.0, nssl_qccn - Max(0.0, cccn_mp(i,k)) )
! cn_mp(i,k) = Min(nssl_qccn, nssl_qccn - cccn(i,k) )
ENDDO
ENDDO
! DO k = 1,nlev
! DO i = 1,ncol
! cccn(i,k) = Max(0.0, nssl_qccn - cn_mp(i,k) )
! cn_mp(i,k) = cccn(i,k)
! ENDDO
! ENDDO
! cn_mp = Max(0.0, nssl_qccn - Max(0.0,cccn_mp))
! Flip CCN concentrations from 'activated' to 'unactivated' (allows BC condition to be zero)
cn_mp = nssl_qccn - cccn_mp
cn_mp = Max(0.0_kind_phys, cn_mp)

ELSE
cn_mp = cccn_mp
ENDIF
IF ( ntccna > 0 ) THEN
! not in use yet
! cna_mp = cccna
ELSE
cna_mp = 0
Expand Down Expand Up @@ -688,17 +688,12 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, &

IF ( nssl_ccn_on ) THEN
IF ( invertccn ) THEN
!cccn = Max(0.0, nssl_qccn - cn_mp )
DO k = 1,nlev
DO i = 1,ncol
! cccn(i,k) = Max(0.0, nssl_qccn - cn_mp(i,k) )
cccn_mp(i,k) = nssl_qccn - cn_mp(i,k)
ENDDO
ENDDO
cccn_mp = Max(0.0_kind_phys, nssl_qccn - cn_mp )
! cccn_mp = nssl_qccn - cn_mp
ELSE
cccn_mp = cn_mp
ENDIF
! cccna = cna_mp
! cccna = cna_mp ! cna not in use yet for ccpp
ENDIF

! test code
Expand Down
7 changes: 7 additions & 0 deletions physics/mp_nssl.meta
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,13 @@
dimensions = ()
type = logical
intent = in
[restart]
standard_name = flag_for_restart
long_name = flag for restart (warmstart) or coldstart
units = flag
dimensions = ()
type = logical
intent = in
[re_cloud]
standard_name = effective_radius_of_stratiform_cloud_liquid_water_particle
long_name = eff. radius of cloud liquid water particle in micrometer
Expand Down