-
Notifications
You must be signed in to change notification settings - Fork 169
A bug fix for wet scavenging of aerosols and a minor modification for moisture property calculation #900
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
A bug fix for wet scavenging of aerosols and a minor modification for moisture property calculation #900
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -265,7 +265,7 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & | |
| & dellae(im,km,ntr), | ||
| & dellau(im,km), dellav(im,km), hcko(im,km), | ||
| & ucko(im,km), vcko(im,km), qcko(im,km), | ||
| & ecko(im,km,ntr), | ||
| & ecko(im,km,ntr),ercko(im,km,ntr), | ||
| & eta(im,km), etad(im,km), zi(im,km), | ||
| & qrcko(im,km), qrcdo(im,km), | ||
| & pwo(im,km), pwdo(im,km), c0t(im,km), | ||
|
|
@@ -585,6 +585,7 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & | |
| ctr(i,k,kk) = qtr(i,k,n) | ||
| ctro(i,k,kk) = qtr(i,k,n) | ||
| ecko(i,k,kk) = 0. | ||
| ercko(i,k,kk) = 0. | ||
| ecdo(i,k,kk) = 0. | ||
| endif | ||
| enddo | ||
|
|
@@ -1148,6 +1149,7 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & | |
| if(cnvflg(i)) then | ||
| indx = kb(i) | ||
| ecko(i,indx,n) = ctro(i,indx,n) | ||
| ercko(i,indx,n) = ctro(i,indx,n) | ||
| endif | ||
| enddo | ||
| enddo | ||
|
|
@@ -1199,6 +1201,7 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & | |
| factor = 1. + tem | ||
| ecko(i,k,n) = ((1.-tem)*ecko(i,k-1,n)+tem* | ||
| & (ctro(i,k,n)+ctro(i,k-1,n)))/factor | ||
| ercko(i,k,n) = ecko(i,k,n) | ||
| endif | ||
| endif | ||
| enddo | ||
|
|
@@ -1217,6 +1220,7 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & | |
| factor = 1. + tem | ||
| ecko(i,k,kk) = ((1. - tem) * ecko(i,k-1,kk) + tem * | ||
| & (ctro(i,k,kk) + ctro(i,k-1,kk))) / factor | ||
| ercko(i,k,kk) = ecko(i,k,kk) | ||
| chem_c(i,k,n) = fscav(n) * ecko(i,k,kk) | ||
| tem = chem_c(i,k,n) / (1. + c0t(i,k) * dz) | ||
| chem_pw(i,k,n) = c0t(i,k) * dz * tem * eta(i,k-1) | ||
|
|
@@ -1464,12 +1468,10 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & | |
| qrch = qeso(i,k) | ||
| & + gamma * dbyo(i,k) / (hvap * (1. + gamma)) | ||
| cj | ||
| tem = 0.5 * (xlamue(i,k)+xlamue(i,k-1)) * dz | ||
| tem1 = 0.25 * (xlamud(i,k)+xlamud(i,k-1)) * dz | ||
| tem = 0.25 * (xlamue(i,k)+xlamue(i,k-1)) * dz | ||
| tem = cq * tem | ||
| tem1 = cq * tem1 | ||
| factor = 1. + tem - tem1 | ||
| qcko(i,k) = ((1.-tem1)*qcko(i,k-1)+tem*0.5* | ||
| factor = 1. + tem | ||
| qcko(i,k) = ((1.-tem)*qcko(i,k-1)+tem* | ||
| & (qo(i,k)+qo(i,k-1)))/factor | ||
| qrcko(i,k) = qcko(i,k) | ||
| cj | ||
|
|
@@ -1641,12 +1643,10 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & | |
| qrch = qeso(i,k) | ||
| & + gamma * dbyo(i,k) / (hvap * (1. + gamma)) | ||
| cj | ||
| tem = 0.5 * (xlamue(i,k)+xlamue(i,k-1)) * dz | ||
| tem1 = 0.25 * (xlamud(i,k)+xlamud(i,k-1)) * dz | ||
| tem = 0.25 * (xlamue(i,k)+xlamue(i,k-1)) * dz | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am curious if the in-line SciDoc L1636 should be modified along with code change here, considering detraining parcel is not considered?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are 2 ways to compute a parcel property in updraft and downdraft: one is to consider only entrainment and the other is to take both entrainment and detrainment. For the former, the detrainment effect is taken into account by mass flux which is computed using entrainment and detrainment. Please see slide 4 & 8 for this PR. Note that mass flux divergence calculations are different for the former and the latter meothods. For the moisture transport, I changed the latter method to the former method in order to enhance moisture entrainment more easily (cq=1.3 in the code).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since only entrainment is considered to compute a parcel property in this update, the term "detraining" in Line 1636 and 1461 could be omitted.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get the "detraing" term. Please clarify.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For example, In line 1636, the comments "...For the overshooting convection, calculate the moisture content of the entraining/detraining parcel ...". include "detraining" but the code does not use "xlamud" anymore. We want to make sure if this statement will be valid with this PR, since it will appear in CCPPv6 SciDoc.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the 'detraining' effect is taken into account later in computation of mass flux divergence of moisture, I think the description is still ok. |
||
| tem = cq * tem | ||
| tem1 = cq * tem1 | ||
| factor = 1. + tem - tem1 | ||
| qcko(i,k) = ((1.-tem1)*qcko(i,k-1)+tem*0.5* | ||
| factor = 1. + tem | ||
| qcko(i,k) = ((1.-tem)*qcko(i,k-1)+tem* | ||
| & (qo(i,k)+qo(i,k-1)))/factor | ||
| qrcko(i,k) = qcko(i,k) | ||
| cj | ||
|
|
@@ -1955,17 +1955,10 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & | |
| ! detad = etad(i,k+1) - etad(i,k) | ||
| cj | ||
| dz = zi(i,k+1) - zi(i,k) | ||
| if(k >= kd94(i)) then | ||
| tem = xlamde * dz | ||
| tem1 = 0.5 * xlamdd * dz | ||
| else | ||
| tem = xlamde * dz | ||
| tem1 = 0.5 * (xlamd(i)+xlamdd) * dz | ||
| endif | ||
| tem = 0.5 * xlamde * dz | ||
| tem = cq * tem | ||
| tem1 = cq * tem1 | ||
| factor = 1. + tem - tem1 | ||
| qcdo(i,k) = ((1.-tem1)*qrcdo(i,k+1)+tem*0.5* | ||
| factor = 1. + tem | ||
| qcdo(i,k) = ((1.-tem)*qrcdo(i,k+1)+tem* | ||
| & (qo(i,k)+qo(i,k+1)))/factor | ||
| cj | ||
| ! pwdo(i,k) = etad(i,k+1) * qcdo(i,k+1) - | ||
|
|
@@ -2153,7 +2146,7 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & | |
| if(k > jmin(i)) adw = 0. | ||
| dp = 1000. * del(i,k) | ||
| cj | ||
| tem1 = -eta(i,k) * ecko(i,k,n) | ||
| tem1 = -eta(i,k) * ercko(i,k,n) | ||
| tem2 = -eta(i,k-1) * ecko(i,k-1,n) | ||
| ptem1 = -etad(i,k) * ecdo(i,k,n) | ||
| ptem2 = -etad(i,k-1) * ecdo(i,k-1,n) | ||
|
|
@@ -2512,12 +2505,10 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & | |
| xqrch = qeso(i,k) | ||
| & + gamma * xdby / (hvap * (1. + gamma)) | ||
| cj | ||
| tem = 0.5 * (xlamue(i,k)+xlamue(i,k-1)) * dz | ||
| tem1 = 0.25 * (xlamud(i,k)+xlamud(i,k-1)) * dz | ||
| tem = 0.25 * (xlamue(i,k)+xlamue(i,k-1)) * dz | ||
| tem = cq * tem | ||
| tem1 = cq * tem1 | ||
| factor = 1. + tem - tem1 | ||
| qcko(i,k) = ((1.-tem1)*qcko(i,k-1)+tem*0.5* | ||
| factor = 1. + tem | ||
| qcko(i,k) = ((1.-tem)*qcko(i,k-1)+tem* | ||
| & (qo(i,k)+qo(i,k-1)))/factor | ||
| cj | ||
| dq = eta(i,k) * (qcko(i,k) - xqrch) | ||
|
|
@@ -2603,17 +2594,10 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & | |
| ! detad = etad(i,k+1) - etad(i,k) | ||
| cj | ||
| dz = zi(i,k+1) - zi(i,k) | ||
| if(k >= kd94(i)) then | ||
| tem = xlamde * dz | ||
| tem1 = 0.5 * xlamdd * dz | ||
| else | ||
| tem = xlamde * dz | ||
| tem1 = 0.5 * (xlamd(i)+xlamdd) * dz | ||
| endif | ||
| tem = 0.5 * xlamde * dz | ||
| tem = cq * tem | ||
| tem1 = cq * tem1 | ||
| factor = 1. + tem - tem1 | ||
| qcdo(i,k) = ((1.-tem1)*qrcd(i,k+1)+tem*0.5* | ||
| factor = 1. + tem | ||
| qcdo(i,k) = ((1.-tem)*qrcd(i,k+1)+tem* | ||
| & (qo(i,k)+qo(i,k+1)))/factor | ||
| cj | ||
| ! xpwd = etad(i,k+1) * qcdo(i,k+1) - | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,7 +213,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
| & dellau(im,km), dellav(im,km), hcko(im,km), | ||
| & ucko(im,km), vcko(im,km), qcko(im,km), | ||
| & qrcko(im,km), ecko(im,km,ntr), | ||
| & eta(im,km), | ||
| & ercko(im,km,ntr), eta(im,km), | ||
| & zi(im,km), pwo(im,km), c0t(im,km), | ||
| & sumx(im), tx1(im), cnvwt(im,km) | ||
| &, rhbar(im) | ||
|
|
@@ -510,6 +510,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
| ctr(i,k,kk) = qtr(i,k,n) | ||
| ctro(i,k,kk) = qtr(i,k,n) | ||
| ecko(i,k,kk) = 0. | ||
| ercko(i,k,kk) = 0. | ||
| endif | ||
| enddo | ||
| enddo | ||
|
|
@@ -964,6 +965,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
| if(cnvflg(i)) then | ||
| indx = kb(i) | ||
| ecko(i,indx,n) = ctro(i,indx,n) | ||
| ercko(i,indx,n) = ctro(i,indx,n) | ||
| endif | ||
| enddo | ||
| enddo | ||
|
|
@@ -1014,6 +1016,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
| factor = 1. + tem | ||
| ecko(i,k,n) = ((1.-tem)*ecko(i,k-1,n)+tem* | ||
| & (ctro(i,k,n)+ctro(i,k-1,n)))/factor | ||
| ercko(i,k,n) = ecko(i,k,n) | ||
| endif | ||
| endif | ||
| enddo | ||
|
|
@@ -1032,6 +1035,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
| factor = 1. + tem | ||
| ecko(i,k,kk) = ((1. - tem) * ecko(i,k-1,kk) + tem * | ||
| & (ctro(i,k,kk) + ctro(i,k-1,kk))) / factor | ||
| ercko(i,k,kk) = ecko(i,k,kk) | ||
| chem_c(i,k,n) = escav * fscav(n) * ecko(i,k,kk) | ||
| tem = chem_c(i,k,n) / (1. + c0t(i,k) * dz) | ||
| chem_pw(i,k,n) = c0t(i,k) * dz * tem * eta(i,k-1) | ||
|
|
@@ -1208,12 +1212,10 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
| qrch = qeso(i,k) | ||
| & + gamma * dbyo(i,k) / (hvap * (1. + gamma)) | ||
| cj | ||
| tem = 0.5 * (xlamue(i,k)+xlamue(i,k-1)) * dz | ||
| tem1 = 0.5 * xlamud(i) * dz | ||
| tem = 0.25 * (xlamue(i,k)+xlamue(i,k-1)) * dz | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check SciDoc L1405. |
||
| tem = cq * tem | ||
| tem1 = cq * tem1 | ||
| factor = 1. + tem - tem1 | ||
| qcko(i,k) = ((1.-tem1)*qcko(i,k-1)+tem*0.5* | ||
| factor = 1. + tem | ||
| qcko(i,k) = ((1.-tem)*qcko(i,k-1)+tem* | ||
| & (qo(i,k)+qo(i,k-1)))/factor | ||
| qrcko(i,k) = qcko(i,k) | ||
| cj | ||
|
|
@@ -1376,12 +1378,10 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
| qrch = qeso(i,k) | ||
| & + gamma * dbyo(i,k) / (hvap * (1. + gamma)) | ||
| cj | ||
| tem = 0.5 * (xlamue(i,k)+xlamue(i,k-1)) * dz | ||
| tem1 = 0.5 * xlamud(i) * dz | ||
| tem = 0.25 * (xlamue(i,k)+xlamue(i,k-1)) * dz | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check SciDoc L1371 |
||
| tem = cq * tem | ||
| tem1 = cq * tem1 | ||
| factor = 1. + tem - tem1 | ||
| qcko(i,k) = ((1.-tem1)*qcko(i,k-1)+tem*0.5* | ||
| factor = 1. + tem | ||
| qcko(i,k) = ((1.-tem)*qcko(i,k-1)+tem* | ||
| & (qo(i,k)+qo(i,k-1)))/factor | ||
| qrcko(i,k) = qcko(i,k) | ||
| cj | ||
|
|
@@ -1621,7 +1621,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & | |
| if(k > kb(i) .and. k < ktcon(i)) then | ||
| dp = 1000. * del(i,k) | ||
| cj | ||
| tem1 = -eta(i,k) * ecko(i,k,n) | ||
| tem1 = -eta(i,k) * ercko(i,k,n) | ||
| tem2 = -eta(i,k-1) * ecko(i,k-1,n) | ||
| dellae(i,k,n) = dellae(i,k,n) + (tem1-tem2) * grav/dp | ||
| cj | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls confirm if SciDoc L1461 should be modified too.