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

Feature/enkf q2 #568

Merged
merged 13 commits into from
Jun 27, 2023
Merged

Conversation

TingLei-daprediction
Copy link
Contributor

@TingLei-daprediction TingLei-daprediction commented May 4, 2023

Resubmit PR for cleaning the unneeded item in the previous PR
In correspondence to the EMC GSI Issue#566, this PR contains a quick adding of the clipping of negative values of sphum (q) in the analysis of FV3-LAM EnKF.
This part of codes are not tested in the current GSI regression tests, which, hence, are not run.
The current codes are verified using local FV3-LAM case. It is found the differences from this changes exist for sphum ( maximum values about 0.003 (units) and 0.3 K for T (sensible T). The latter is because the sphum would be used when the analysis TV is converted to T. All differences are on spontaneous points and values are reasonable as expected.
Hence, the code is regarded as verified.

Fixes #566

DUE DATE for this PR is 6/15/2023. If this PR is not merged into develop by this date, the PR will be closed and returned to the developer.

@ShunLiu-NOAA
Copy link
Contributor

Chunhua, David and Jeff,

Could you please review the change of limiting the negative values of sphum (q) in EnKF analysis?

Thank you.

Shun

chunhuazhou
chunhuazhou previously approved these changes May 5, 2023
Copy link
Collaborator

@chunhuazhou chunhuazhou left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@daviddowellNOAA
Copy link
Collaborator

In the GFS (GDAS), are negative values of sphum corrected in the code / scripts? Would the change to the EnKF code proposed here affect the GFS (GDAS)?

@TingLei-daprediction
Copy link
Contributor Author

TingLei-daprediction commented May 5, 2023

@daviddowellNOAA In EnKF for GFS, the clipping of negative values for Q is already implemented ( in gridio_gfs.f90).
The change in this PR would not affect GDAS.

@daviddowellNOAA
Copy link
Collaborator

Ting, thanks for proposing these code changes and testing them. As I understand things, the background specific humidity is clipped (to ensure values > 0) before the computation of virtual temperature, and then the analysis specific humidity is clipped before being output to a file. Clipping makes sense in both instances, and I also see some parallels to how things are done in gridio_gfs.f90. Looking at the code gave me some questions about future work. Meanwhile, I support the changes in the current PR.

@daviddowellNOAA
Copy link
Collaborator

The comments below are beyond the scope of the current PR. I'm providing them here for reference in future PRs.

(1) The EnKF for the global system (gridio_gfs.f90) appears to do clipping of the input values, before the analysis. Should we consider the same for regional FV3? I can see arguments for and against.

(2) Our current RRFS EnKF analyses (with radar-reflectivity DA) can produce negative values of precipitating hydrometeors. Note that the clipping of precipitating hydrometeors in gridio_fv3reg.f90 only happens if l_use_enkf_directZDA is true, but l_use_enkf_directZDA is actually false in our system. In the future, we should discuss if clipping should always happen for precipitating hydrometeors, no matter what the value of l_use_enkf_directZDA is.

@TingLei-daprediction
Copy link
Contributor Author

@daviddowellNOAA Good points. I will leave 1 for future discussions but I think I can do 2 for this PR, namely, do clipping without dbz analysis being done.

…ve moisture values in the analysis of EnKF for FV3-LAM

also remove the condition of l_use_enkf_directZDA=.true. for clipping of negative values for hydrometeors when cliptracers=.true.
@TingLei-daprediction
Copy link
Contributor Author

TingLei-daprediction commented May 5, 2023

@daviddowellNOAA it is done as you commented , namely , changing " if (l_use_enkf_directZDA .and. cliptracers) then " to "if (cliptracers)".
@chunhuazhou there is a new change --very simple while meaningful. Your further reviewing is appreciated.

@ShunLiu-NOAA
Copy link
Contributor

ShunLiu-NOAA commented May 12, 2023 via email

@ShunLiu-NOAA
Copy link
Contributor

@chunhuazhou Could you have a look at this new change when you have a chance?

@ShunLiu-NOAA
Copy link
Contributor

ShunLiu-NOAA commented May 13, 2023 via email

@TingLei-daprediction
Copy link
Contributor Author

@ShunLiu-NOAA I have just merged the current EMC develop branch to this PR and re-ran the verification for the fv3-lam EnKF. It was as described in the previous verification, because in my case, the hydrometeors are not updated and hence the Yes/No to apply clipping to them doesn't affect the results. @daviddowellNOAA would you consider to run an enkf using dbz and see if the clipping of hydrometeors works as we expect ? Thanks.

@TingLei-NOAA
Copy link
Contributor

@RussTreadon-NOAA removing all extra space before "cliptracer" as you suggested. Thanks.
The code compiled successfully but no regression tests is done for the reasons I talked about in the previous conversion.

@ShunLiu-NOAA
Copy link
Contributor

@TingLei-daprediction and @RussTreadon-NOAA I can do a regression test on WCOSS2.

@TingLei-NOAA
Copy link
Contributor

@ShunLiu-NOAA Thanks a lot!

@RussTreadon-NOAA
Copy link
Contributor

Thank you, @ShunLiu-NOAA , for running the ctests on WCOSS2. As mentioned before, our current suite of ctests do not exercise the modified code. If we will be exercising the enkf in regional mode in operations, we should add a regional enkf regression test.

@TingLei-daprediction , you did not answer my question. On which machine did you run the ctests?

Also, a fresh clone of TingLei-daprediction:feature/enkf_q2 at 99c6286 now shows a variety of spacing on the if cliptracers lines in src/enkf/gridio_fv3reg.f90

Below is a listing of all if lines with cliptracers in gridio_fv3reg.f90.

Orion-login-1:/work2/noaa/da/rtreadon/git/gsi/pr568$ grep -n "cliptracer" src/enkf/gridio_fv3reg.f90 | grep if
857:              if (cliptracers ) where (qworkvar3d < clip) qworkvar3d = clip
872:                 if (cliptracers ) where (qworkvar3d < clip) qworkvar3d = clip
939:             if (cliptracers ) where (workvar3d < clip) workvar3d = clip
959:              if (cliptracers ) where (workvar3d < clip) workvar3d = clip
979:             if (cliptracers ) where (workvar3d < clip) workvar3d = clip
999:             if (cliptracers ) where (workvar3d < clip) workvar3d = clip
1019:             if (  cliptracers ) where (workvar3d < clip) workvar3d = clip
1038:             if (  cliptracers ) where (workvar3d < clip) workvar3d = clip
2162:                  if (cliptracers ) where (qworkvar3d < clip) qworkvar3d = clip
2176:                     if (cliptracers ) where (qworkvar3d < clip) qworkvar3d = clip
2272:                if (cliptracers ) where (workvar3d < clip) workvar3d = clip
2303:                 if (  cliptracers ) where (workvar3d < clip) workvar3d = clip
2334:                 if (cliptracers ) where (workvar3d < clip) workvar3d = clip
2365:                 if (cliptracers ) where (workvar3d < clip) workvar3d = clip
2396:                if (  cliptracers ) where (workvar3d < clip) workvar3d = clip
2426:                if (cliptracers ) where (workvar3d < clip) workvar3d = clip

There is a double space between if ( and cliptracers on lines 1019, 1038, 2303, and 2396. The is no spacing between if ( and cliptracers on lines 857, 872, 939, 959, 979, 999, 2162, 2176, 2272, 2334, 2365, and 2426.

It looks like you misunderstood my request. I only wanted the double space on lines 1019, 1038, 2303, and 2396 changed to a single space. The other lines did not need to be changed. We want to see if ( cliptracers ). There is one space before cliptracers and one space after cliptracers.

@ShunLiu-NOAA
Copy link
Contributor

ShunLiu-NOAA commented Jun 16, 2023 via email

@TingLei-NOAA
Copy link
Contributor

@RussTreadon-NOAA Please if the current changes do the formatting as you requested. Thanks.

@TingLei-NOAA
Copy link
Contributor

@ShunLiu-NOAA I think a repeated regional enkf using dbz ob (from your operational runs) should work for the regression test purpose ( go through the dbz related change).

@ShunLiu-NOAA
Copy link
Contributor

@RussTreadon-NOAA Do you think it is acceptable if I run a test case with regional ensembles from realtime parallel without adding a new regression test? At the same time, we will work on prepare regional enkf regression test case for future ctest.

@RussTreadon-NOAA
Copy link
Contributor

@TingLei-daprediction , a fresh clone of 40a6fd0 shows the desired spacing on the if ( cliptracers ) lines.

As an aside, the way you update your forked branch TingLei-daprediction:feature/enkf_q2 is problematic. I should be able to git pull in my working copy of TingLei-daprediction:feature/enkf_q2 after you update it. I can't. I get conflicts. I suspect that you are not doing the update correctly. The end result, however is OK.

@RussTreadon-NOAA
Copy link
Contributor

@RussTreadon-NOAA Do you think it is acceptable if I run a test case with regional ensembles from realtime parallel without adding a new regression test? At the same time, we will work on prepare regional enkf regression test case for future ctest.

What you propose is fine. My ctest comment was looking ahead to ensure that future GSI PRs do not break the regional enkf or alter regional enkf output in unexpected ways. We will be running the enkf in the operational RRFS, right? If true, we should have a ctest which tests this future operational functionality.

Copy link
Contributor

@RussTreadon-NOAA RussTreadon-NOAA left a comment

Choose a reason for hiding this comment

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

Changes look good.

@TingLei-NOAA
Copy link
Contributor

TingLei-NOAA commented Jun 16, 2023

@TingLei-daprediction , a fresh clone of 40a6fd0 shows the desired spacing on the if ( cliptracers ) lines.

As an aside, the way you update your forked branch TingLei-daprediction:feature/enkf_q2 is problematic. I should be able to git pull in my working copy of TingLei-daprediction:feature/enkf_q2 after you update it. I can't. I get conflicts. I suspect that you are not doing the update correctly. The end result, however is OK.

@RussTreadon-NOAA not sure why. I used "git push --force " to surpress some complaints from git. I will try to resolve those complaints before using " git push " without "--force option to see if that could avoid the "conflict" complaints on your side.
Thanks.

@RussTreadon-NOAA
Copy link
Contributor

@TingLei-daprediction , you should not use --force. Let's not push any more changes to this PR unless necessary.

@TingLei-NOAA
Copy link
Contributor

@RussTreadon-NOAA Ok. Thanks

Copy link
Contributor

@RussTreadon-NOAA RussTreadon-NOAA left a comment

Choose a reason for hiding this comment

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

Approve

@ShunLiu-NOAA
Copy link
Contributor

@RussTreadon-NOAA Thank you for approving this. I will merge the change after I complete my regional EnKF test.

@RussTreadon-NOAA
Copy link
Contributor

Jeff's and Chunhua's reviews and approvals along with yours are what really matter. My input is secondary. Thank you @ShunLiu-NOAA for running a regional enkf test.

We need to get a regional enkf test into the suite of ctests. Additionally, since HAFSv1 is being implemented next week we should consider dropping the d2 and d3 HWRF tests in lieu of a new HAFS test.

@RussTreadon-NOAA
Copy link
Contributor

This PR is 11 days past its 6/15/2023 due date. This PR will be closed and returned to the developer tomorrow, 6/27/2023 unless it is finalized and merged into develop before then.

@ShunLiu-NOAA
Copy link
Contributor

ShunLiu-NOAA commented Jun 26, 2023 via email

@RussTreadon-NOAA
Copy link
Contributor

Thank you @ShunLiu-NOAA for the update. Testing delays are understood. TingLei-daprediction:feature/enkf_q2 will need to be updated as other PRs enter develop. ctests and others tests will need to be rerun with the new baseline to ensure acceptable performance of the features added in this PR as well as not altering existing behavior in unexpected or unexplained ways.

@ShunLiu-NOAA
Copy link
Contributor

Sure. If there is other PR merged in develop. We will run regression test again. By the way, we had regression tests on Friday. We also had an issue opened for regional EnKF test.

@RussTreadon-NOAA
Copy link
Contributor

Yes, I saw GSI issue #586. We should remove obsolete ctests as we add new tests. We want to keep the total number of ctests at a reasonable number.

Who will replace the soon to be obsolete HWRF d2 and d3 ctests with a HAFS based ctest? Do we need to update the RTMA test? When can we retire the netcdf_fv3_regional test?

@ShunLiu-NOAA
Copy link
Contributor

ShunLiu-NOAA commented Jun 26, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A quick enhancement for clipping negative Q in the analysis of EnKF for fv3-lam
7 participants