-
Notifications
You must be signed in to change notification settings - Fork 700
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
Stability function correction for momentum in mos subroutine of SLUCM. #2038
Conversation
The calculations for PSIM in the mos subroutine of module-sf_urban.F has been corrected. The earlier equations has a typo where X (= (1-16\zeta)^1/4) is mentioned instead of X0.
The regression test results:
|
@@ -1133,7 +1133,7 @@ SUBROUTINE urban(LSOLAR, & ! L | |||
|
|||
CALL TDFCND (DF1,SMR(KZ), QUARTZ, SMCMAX ) | |||
DF1 = DF1 * EXP(-2.0 * SHDFAC) | |||
RGR = EPSV*(RX-SIG*(TGRP**4.)/60.) | |||
RGR = EPSV*(RX-SIG*(TA**4.)/60.) |
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.
I think here the original code is correct. We need to use "TGRP" for the green roof surface temperature to compute the outgoing longwave radiation for the greenroof surface not the air. But this RGR does lead to the inconsistence in the "YY" calculation using "TA" a few lines below. I am not quite sure about this yet. this is the reference for this greenroof development: https://link.springer.com/article/10.1007/s10546-014-9991-6
maybe you could contact the original developer: Prof. Jiachuan Yang (HKUST): cejcyang@ust.hk
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.
@cenlinhe I have tried explaining my part in the attachment here. Please let me know if you need further clarification. Also, please correct me if I am terribly wrong.
TA_TGRP_Clarification.pdf
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.
@cenlinhe I believe that for consistency in estimating YY, TA needs to be replaced by TGRP while keeping TGRP in the calculations of RGR (as done for the roof case where TRP is used instead), since an iterative approach is implemented. This may provide better results.
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.
@cenlinhe I believe that for consistency in estimating YY, TA needs to be replaced by TGRP while keeping TGRP in the calculations of RGR (as done for the roof case where TRP is used instead), since an iterative approach is implemented. This may provide better results.
I agree that TA should be replaced by TGRP in YY calculation
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.
@cenlinhe I have tried explaining my part in the attachment here. Please let me know if you need further clarification. Also, please correct me if I am terribly wrong. TA_TGRP_Clarification.pdf
I agree that current code has some inconsistency in RGR, RR1, and YY calculations. From the greenroof surface energy balance perspective, I think TGRP should be used instead of TA in all these three places. Also, the term (theta0 - T0) is missing but I do not know the reason, likely because the assumption that they are the same.
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.
I think the iterative approach is required to achieve the greenroof surface energy flux balance convergence, which means this equation needs to be inside the iteration loop. Could you please do a test to compare the simulations with TGRP and replacing TGRP by TA (based on your proposed solution) to see how much difference it makes?
@cenlinhe Unfortunately, I do not have computing facilities to run a test simulation. I tried on my local computer but it didn't work well. I will keep you posted if anything changes.
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.
Thanks for pointing out the issue. After carefully reviewing the code and the PDF, to be in consistent with the equations, TA shall be used instead of TGRP in the calculation of RGR, RR1, and YY.
For the term (theta0 - T0), their values shall be close at the first atmospheric level, so I ignore that term during the coding process.
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.
Thanks for pointing out the issue. After carefully reviewing the code and the PDF, to be in consistent with the equations, TA shall be used instead of TGRP in the calculation of RGR, RR1, and YY.
For the term (theta0 - T0), their values shall be close at the first atmospheric level, so I ignore that term during the coding process.
@jyang104 Thank you so much for your response and for confirming the inconsistency. Now this makes me wonder that when a similar energy balance is applied to a common roof, wall, and ground shouldn't the
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.
@joshi994 You are correct. Part of the reason for the inconsistency is that the calculation of outgoing longwave in the original sf_urban (i.e, for wall and ground and roof) does not involve evapotranspiration that the equation of \sigma*\theta_s^4 is used. When I implemented the green roof, I followed the sf_noahlsm in general that the surface energy balance used the approximation formula. In this case, it will be easier to just correct the green roof part of the code, rather than fixing the ones for TRP, TWP, or TGP.
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.
@jyang104 @cenlinhe It make sense corecting the green roof part only. However, it would be nice to see the temperature of the green roof calculated using YY and ZZ1, the linear approximation
@@ -1635,7 +1635,7 @@ SUBROUTINE mos(XXX,ALPHA,CD,B1,RIB,Z,Z0,UA,TA,TSF,RHO) | |||
PSIM=ALOG((Z+Z0)/Z0) & | |||
-ALOG((X+1.)**2.*(X**2.+1.)) & | |||
+2.*ATAN(X) & | |||
+ALOG((X+1.)**2.*(X0**2.+1.)) & | |||
+ALOG((X0+1.)**2.*(X0**2.+1.)) & |
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.
This typo is indeed a bug.
I am also bringing @barlage here just in case he has any insights on this problem. |
I'll defer to @cenlinhe. I don't have any history with this. |
I will review the recent discussion one more time. In the meantime, @chenghaow @xuelingbo @doan-van please take a look at this PR discussion and let me know what you think. |
I just went through this thread and agree that this is the correct equation. I also suggest adding a comment here that TA is used because of the linearization to avoid potential future confusion. |
I am also agree with this correction. |
I approve this. |
@cenlinhe @chenghaow @xuelingbo Anyone wants to address Josh's comment in the PR: "Also I am not sure why the term (\theta_0 - T_0) is neglected in the definition of YY (Line/command 1145 WRFv-4.5.2) whereas the equation for the |
TYPE: Bug fix
KEYWORDS: Stability function, Urban canopy model, surface energy balance, Green roof temperature.
SOURCE: Parag Joshi (Brookhaven National Laboratory), Katia Lamer (Brookhaven National Laboratory)
DESCRIPTION OF CHANGES:$\sigma * \theta_s^4 = \sigma T_0^4 (1 + 4((\theta_s - T_0)/T_0)))$ is used, the temperature in the calculations of net flux at the surface should use T_0 (temperature at first atmospheric level). However, in the module TGRP (temperature of the green roof surface at previous time step is used)is used instead of T_0 (please refer to the attached screenshots of the formulation).
Problem: The earlier equations has a typo where X (= (1-16\zeta)^1/4) is mentioned instead of X0. In addition, following the formulation of surface energy balance of OSU1DPBL scheme by Ek and Mahrt 1991, it appears that when the following definition is used
Also I am not sure why the term (\theta_0 - T_0) is neglected in the definition of YY (Line/command 1145 WRFv-4.5.2) whereas the equation for the$\theta_s$ in attached screenshot shows the term. Due to insignficant impact?
Solution:
Following the formulation, the temperature variable has been updated according. Moreover, the mos subroutine is also corrected by replacing X by X0 where X0 is =X*z0/(z+z0) (as per the WRF/phys/module_sf_urban.F).
LIST OF MODIFIED FILES:
M phys/module_sf_urban.F
TESTS CONDUCTED:
For more details, refer to the pages # 47-50 of the document link in the release note.
RELEASE NOTE: Fixes for the calculations for PSIM in the mos subroutine and the temperature used in surface energy balance for the green roof. The later follows the OSU1DPBL document located at:
][https://ftp.emc.ncep.noaa.gov/mmb/gcp/ldas/nceplsm/OSU1DPBL/OSU1DPBL-userguide.pdf]