From 121be9905a7267e22c7bb967e4102ec3b0d42caf Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Wed, 20 Apr 2022 12:37:02 -0500 Subject: [PATCH 1/6] Use restart flag for setting local itimestep --- physics/mp_nssl.F90 | 11 +++++++++-- physics/mp_nssl.meta | 7 +++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/physics/mp_nssl.F90 b/physics/mp_nssl.F90 index 7101d50b0..1b1ea874f 100644 --- a/physics/mp_nssl.F90 +++ b/physics/mp_nssl.F90 @@ -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. @@ -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, & @@ -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) @@ -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 diff --git a/physics/mp_nssl.meta b/physics/mp_nssl.meta index 43350fd10..82b5ff739 100644 --- a/physics/mp_nssl.meta +++ b/physics/mp_nssl.meta @@ -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 From ceba3dd64574666fade9a74648268a1ae9a32a64 Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Wed, 20 Apr 2022 21:16:19 -0500 Subject: [PATCH 2/6] Fixed an inconsistency in how 'cn' is written back for output --- physics/module_mp_nssl_2mom.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/module_mp_nssl_2mom.F90 b/physics/module_mp_nssl_2mom.F90 index e6f2ae162..b34fa755e 100644 --- a/physics/module_mp_nssl_2mom.F90 +++ b/physics/module_mp_nssl_2mom.F90 @@ -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 cn(ix,kz,jy) = Max(0.0, an(ix,1,kz,lccna) ) ELSE cn(ix,kz,jy) = an(ix,1,kz,lccn) From 888390cf03128337465790f2fab998c68d5ee815 Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Wed, 20 Apr 2022 23:05:35 -0500 Subject: [PATCH 3/6] Test treating cccn as cna when invertccn=true --- physics/mp_nssl.F90 | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/physics/mp_nssl.F90 b/physics/mp_nssl.F90 index 1b1ea874f..5a49c2acf 100644 --- a/physics/mp_nssl.F90 +++ b/physics/mp_nssl.F90 @@ -546,12 +546,18 @@ 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 + +! 4/20/2022 test turning this off and just use cccn as cccna +! 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 + + cna_mp = cccn_mp + cn_mp = nssl_qccn + ! DO k = 1,nlev ! DO i = 1,ncol ! cccn(i,k) = Max(0.0, nssl_qccn - cn_mp(i,k) ) @@ -599,7 +605,8 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & VHL=vhl_mp, & cn=cn_mp, & ! cna=cna_mp, f_cna=( ntccna > 0 ), & ! for future use - cna=cna_mp, f_cna=.false. , & +! cna=cna_mp, f_cna=.false. , & + cna=cna_mp, f_cna=invertccn , & PII=prslk, & P=prsl, & W=w, & @@ -696,12 +703,14 @@ 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 = cna_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 ELSE cccn_mp = cn_mp ENDIF From e65360a7cca318794262f15d4299d71005e4e8fd Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Thu, 21 Apr 2022 00:00:00 -0500 Subject: [PATCH 4/6] Turn on lccna in nssl_params --- physics/mp_nssl.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/mp_nssl.F90 b/physics/mp_nssl.F90 index 5a49c2acf..122833b04 100644 --- a/physics/mp_nssl.F90 +++ b/physics/mp_nssl.F90 @@ -115,7 +115,7 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & nssl_params(10) = 100. ! nssl_rho_qs nssl_params(11) = 0 ! nssl_ipelec_tmp nssl_params(12) = 11 ! nssl_isaund - nssl_params(13) = 0 ! 1= turn on cccna; 0 = turn off + nssl_params(13) = 1 ! 0 ! 1= turn on cccna; 0 = turn off nssl_qccn = nssl_cccn/1.225 ! if (mpirank==mpiroot) then From 1ff1f161edb15c865a2bbd20e517aaad04a16b8a Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Thu, 21 Apr 2022 08:35:26 -0500 Subject: [PATCH 5/6] Try implicit loop for invertccn --- physics/mp_nssl.F90 | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/physics/mp_nssl.F90 b/physics/mp_nssl.F90 index 122833b04..3f0d136de 100644 --- a/physics/mp_nssl.F90 +++ b/physics/mp_nssl.F90 @@ -115,7 +115,7 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & nssl_params(10) = 100. ! nssl_rho_qs nssl_params(11) = 0 ! nssl_ipelec_tmp nssl_params(12) = 11 ! nssl_isaund - nssl_params(13) = 1 ! 0 ! 1= turn on cccna; 0 = turn off + nssl_params(13) = 0 ! 1= turn on cccna; 0 = turn off nssl_qccn = nssl_cccn/1.225 ! if (mpirank==mpiroot) then @@ -547,17 +547,13 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & IF ( invertccn ) THEN ! cn_mp = Max(0.0, nssl_qccn - Max(0.0,cccn)) -! 4/20/2022 test turning this off and just use cccn as cccna -! 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 +! DO k = 1,nlev +! DO i = 1,ncol + cn_mp = Max(0.0, nssl_qccn - Max(0.0, cccn_mp) ) +! 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 - - cna_mp = cccn_mp - cn_mp = nssl_qccn - +! ENDDO ! DO k = 1,nlev ! DO i = 1,ncol ! cccn(i,k) = Max(0.0, nssl_qccn - cn_mp(i,k) ) @@ -605,8 +601,7 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & VHL=vhl_mp, & cn=cn_mp, & ! cna=cna_mp, f_cna=( ntccna > 0 ), & ! for future use -! cna=cna_mp, f_cna=.false. , & - cna=cna_mp, f_cna=invertccn , & + cna=cna_mp, f_cna=.false. , & PII=prslk, & P=prsl, & W=w, & @@ -703,8 +698,7 @@ 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 ) - - cccn_mp = cna_mp + cccn_mp = nssl_qccn - cn_mp ! DO k = 1,nlev ! DO i = 1,ncol ! ! cccn(i,k) = Max(0.0, nssl_qccn - cn_mp(i,k) ) From 761039653da8dd3bc3181ae7d1caa0617720344c Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Fri, 22 Apr 2022 14:41:43 +0000 Subject: [PATCH 6/6] Fix issue with dcp test related to CCN prediction --- physics/mp_nssl.F90 | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/physics/mp_nssl.F90 b/physics/mp_nssl.F90 index 3f0d136de..c442d204c 100644 --- a/physics/mp_nssl.F90 +++ b/physics/mp_nssl.F90 @@ -545,25 +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 = Max(0.0, nssl_qccn - Max(0.0, cccn_mp) ) -! 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 @@ -697,18 +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 ) - cccn_mp = 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