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

add ability to taper analysis perts near top of model #729

Merged
merged 10 commits into from
Mar 29, 2024

Conversation

jswhit
Copy link
Contributor

@jswhit jswhit commented Mar 24, 2024

Fixes #728

Addresses issue #728 by adding a logical taperanalperts to the namelist. The vertical profile of the taper profile

log(ak(k) - ak_top)/log(ak_bot - ak_top)

is controlled by parameters taperanalperts_aktop and taperanalperts_akbot. Default values are 500 and -1, which results in a taper that starts at level 19 and has a value of 0.11 at level 1 for the 127 level GFS.

@CatherineThomas-NOAA - I decided it would be simpler and less intrusive to the workflow to include this functionality in the EnKF code instead of the recentering utility.

TODO: implement for regional models

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing tests pass with my changes
  • Any dependent changes have been merged and published

@RussTreadon-NOAA
Copy link
Contributor

@jswhit , who might we ask to review these changes? We need a minimum of two peer reviewers and approvals.

@jswhit2
Copy link
Contributor

jswhit2 commented Mar 25, 2024

@jswhit , who might we ask to review these changes? We need a minimum of two peer reviewers and approvals.

I suggest @CatherineThomas-NOAA and @TingLei-NOAA

@RussTreadon-NOAA
Copy link
Contributor

Thanks @jswhit . Cathy and Ting have been added as peer reviewers.

@TingLei-NOAA
Copy link
Contributor

@jswhit I am a little confused on the profile generated by

log(ak(k) - ak_top)/log(ak_bot - ak_top)

For example, as ak(k) approaches ak_top from the positive side (always such case), with a difference from ak_top less than 1, the magnitude of log(ak(k)-ak_top) would increase, while it is a negative number. Such values are not what we expect for the tamper coefficients, right? While "(log(ak(k))-log(ak_top))/(log(ak_bot/ak_top) seems to be no such issues with 0 on ak_top. Wondering if you would have better profiles. Please let me know if I missed any implicit properties for ak. Your further clarification will be appreciated.

@jswhit2
Copy link
Contributor

jswhit2 commented Mar 26, 2024

@Ting.Lee the default values of akbot and aktop are 500 and -1. log(akbot-aktop) = 6.21. For 500<ak<-1, log(ak-aktop) is decreases from 6.21 to about 7 for ak=1 (the top level of the model). Thus the taper profile decreases from 1 when ak=500 to about 0.1 when ak=1.

@TingLei-NOAA
Copy link
Contributor

@jswhit Thanks for this explanation. With the aktop=-1 , this indeed works as your described.

@RussTreadon-NOAA
Copy link
Contributor

Orion ctests

Clone jswhit:taperanalperts on Orion and merge develop at b53740a into working copy. Run ctests with following results

Test project /work2/noaa/da/rtreadon/git/gsi/pr729/build
    Start 1: global_4denvar
    Start 2: rtma
    Start 3: rrfs_3denvar_glbens
    Start 4: netcdf_fv3_regional
    Start 5: hafs_4denvar_glbens
    Start 6: hafs_3denvar_hybens
    Start 7: global_enkf
1/7 Test #3: rrfs_3denvar_glbens ..............   Passed  786.10 sec
2/7 Test #4: netcdf_fv3_regional ..............   Passed  844.88 sec
3/7 Test #7: global_enkf ......................   Passed  909.35 sec
4/7 Test #2: rtma .............................   Passed  1269.14 sec
5/7 Test #6: hafs_3denvar_hybens ..............   Passed  1404.80 sec
6/7 Test #5: hafs_4denvar_glbens ..............   Passed  1641.61 sec
7/7 Test #1: global_4denvar ...................   Passed  2043.23 sec

100% tests passed, 0 tests failed out of 7

Total Test time (real) = 2043.25 sec

All tests pass. This is expected.. This PR only changes files in src/enkf. All updat and contrl gsi.x based tests should be identical since the source code is identical. We also do not expect any difference in the enkf.x test. The taper option added by the PR is off by default. src/enkf/params.f90 contains

logical, public :: taperanalperts = .false.

Thus, the global_enkf analysis results should be identical. The Orion tests confirm this.

@RussTreadon-NOAA
Copy link
Contributor

Hercules ctests

Repeat Orion test on Hercules with the following results

Test project /work/noaa/da/rtreadon/git/gsi/pr729/build
    Start 1: global_4denvar
    Start 2: rtma
    Start 3: rrfs_3denvar_glbens
    Start 4: netcdf_fv3_regional
    Start 5: hafs_4denvar_glbens
    Start 6: hafs_3denvar_hybens
    Start 7: global_enkf
1/7 Test #4: netcdf_fv3_regional ..............   Passed  482.88 sec
2/7 Test #3: rrfs_3denvar_glbens ..............   Passed  484.93 sec
3/7 Test #7: global_enkf ......................   Passed  725.90 sec
4/7 Test #2: rtma .............................   Passed  964.86 sec
5/7 Test #6: hafs_3denvar_hybens ..............   Passed  1090.78 sec
6/7 Test #5: hafs_4denvar_glbens ..............***Failed  1095.93 sec
7/7 Test #1: global_4denvar ...................   Passed  1741.54 sec

86% tests passed, 1 tests failed out of 7

Total Test time (real) = 1741.64 sec

The following tests FAILED:
          5 - hafs_4denvar_glbens (Failed)

hafs_4denvar_glbens failed due to

The fv3_dynvars are reproducible
The fv3_sfcdata are reproducible
The results between the two runs (hafs_4denvar_glbens_loproc_updat and hafs_4denvar_glbens_loproc_contrl) are not reproducible. Thus, the case has Failed siganl of the regression tests.

Comparison of the loproc_contrl and loproc_updat fv3_tracer output files shows very small differences in the o3mr field

o3mr min/max 1=1.4650413e-08,1.6894655e-05 min/max 2=1.4650413e-08,1.6894655e-05 max abs diff=0.0000000450

Interestingly, the hiproc_updat fv3_tracer file is identical to the fv3_tracer file generated by the loproc_contrl and hiproc_contrl runs. The loproc_updat is the anomalous run. Non-reproducibility in regional analysis files is a known problem on Hercules.

All other ctests Passed on Hercules.

@RussTreadon-NOAA
Copy link
Contributor

Hera ctests

Repeat Hercules test on Hera with the following results

Test project /scratch1/NCEPDEV/da/Russ.Treadon/git/gsi/pr729/build
    Start 1: global_4denvar
    Start 2: rtma
    Start 3: rrfs_3denvar_glbens
    Start 4: netcdf_fv3_regional
    Start 5: hafs_4denvar_glbens
    Start 6: hafs_3denvar_hybens
    Start 7: global_enkf
1/7 Test #3: rrfs_3denvar_glbens ..............   Passed  550.06 sec
2/7 Test #4: netcdf_fv3_regional ..............   Passed  608.17 sec
3/7 Test #7: global_enkf ......................***Failed  998.36 sec
4/7 Test #2: rtma .............................   Passed  1149.47 sec
5/7 Test #6: hafs_3denvar_hybens ..............   Passed  1223.71 sec
6/7 Test #5: hafs_4denvar_glbens ..............   Passed  1348.94 sec
7/7 Test #1: global_4denvar ...................   Passed  1986.77 sec

86% tests passed, 1 tests failed out of 7

Total Test time (real) = 1986.81 sec

The following tests FAILED:
          7 - global_enkf (Failed)

global_enkf failed due to the time threshold test.

The runtime for global_enkf_loproc_updat is 168.053597 seconds.  This has exceeded maximum allowable threshold time of 163.541045 seconds, resulting in Failure timethresh of the regression test.

A check of enkf.x wall times returns

global_enkf_hiproc_contrl/stdout:The total amount of wall time                        = 125.916447
global_enkf_hiproc_updat/stdout:The total amount of wall time                        = 128.483509
global_enkf_loproc_contrl/stdout:The total amount of wall time                        = 149.715914
global_enkf_loproc_updat/stdout:The total amount of wall time                        = 170.181588

While the loproc_updat enkf.x wall time is higher than the loproc_contrl is it not anomalously larger. This is not a fatal fail.

@RussTreadon-NOAA
Copy link
Contributor

WCOSS2 (Dogwood) ctests

Repeat Hera test on Dogwood with the following results

Test project /lfs/h2/emc/da/noscrub/russ.treadon/git/gsi/pr729/build
    Start 1: global_4denvar
    Start 2: rtma
    Start 3: rrfs_3denvar_glbens
    Start 4: netcdf_fv3_regional
    Start 5: hafs_4denvar_glbens
    Start 6: hafs_3denvar_hybens
    Start 7: global_enkf
1/7 Test #4: netcdf_fv3_regional ..............   Passed  604.61 sec
2/7 Test #3: rrfs_3denvar_glbens ..............   Passed  665.51 sec
3/7 Test #7: global_enkf ......................   Passed  970.00 sec
4/7 Test #6: hafs_3denvar_hybens ..............   Passed  1212.18 sec
5/7 Test #2: rtma .............................   Passed  1327.94 sec
6/7 Test #5: hafs_4denvar_glbens ..............   Passed  1392.89 sec
7/7 Test #1: global_4denvar ...................   Passed  1862.29 sec

100% tests passed, 0 tests failed out of 7

Total Test time (real) = 1862.30 sec

As expected, all tests pass.

@RussTreadon-NOAA
Copy link
Contributor

@jswhit , when you have time, please merge recent commits to the authoritative develop into jswhit:taperanalperts. Your branch is currently 3 commits behind develop.

I am on leave 4/1 through 4/11. Hence my running ctests with the hope of merging this PR into develop before COB 3/29 pending approval from peer reviewers.

@jswhit2
Copy link
Contributor

jswhit2 commented Mar 27, 2024

@jswhit , when you have time, please merge recent commits to the authoritative develop into jswhit:taperanalperts. Your branch is currently 3 commits behind develop.

I am on leave 4/1 through 4/11. Hence my running ctests with the hope of merging this PR into develop before COB 3/29 pending approval from peer reviewers.

done!

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. Review comments are minor and fall into the nitpick category - nothing serious or major.

src/enkf/gridinfo_fv3reg.f90 Outdated Show resolved Hide resolved
src/enkf/gridinfo_fv3reg.f90 Outdated Show resolved Hide resolved
src/enkf/gridinfo_fv3reg.f90 Show resolved Hide resolved
src/enkf/gridinfo_gfs.f90 Show resolved Hide resolved
src/enkf/gridinfo_gfs.f90 Outdated Show resolved Hide resolved
src/enkf/gridinfo_nmmb.f90 Show resolved Hide resolved
src/enkf/gridinfo_wrf.f90 Show resolved Hide resolved
src/enkf/inflation.f90 Outdated Show resolved Hide resolved
src/enkf/params.f90 Outdated Show resolved Hide resolved
src/enkf/params.f90 Outdated Show resolved Hide resolved
@CatherineThomas-NOAA
Copy link
Collaborator

@jswhit Just want to confirm that the description:

is controlled by parameters taperanalperts_aktop and taperanalperts_akbot. Default values are 500 and -1,

is swapped, correct? aktop=-1 and ak_bot=500? This is what's in the code and what mathematically makes sense.

@RussTreadon-NOAA
Copy link
Contributor

Rerun ctests on Hera Rocky 8 nodes using taperanalperts at 87af1e2. All tests pass on rerun.

Test project /scratch1/NCEPDEV/da/Russ.Treadon/git/gsi/pr729b/build
    Start 1: global_4denvar
    Start 2: rtma
    Start 3: rrfs_3denvar_glbens
    Start 4: netcdf_fv3_regional
    Start 5: hafs_4denvar_glbens
    Start 6: hafs_3denvar_hybens
    Start 7: global_enkf
1/7 Test #3: rrfs_3denvar_glbens ..............   Passed  1330.32 sec
2/7 Test #4: netcdf_fv3_regional ..............   Passed  1387.52 sec
3/7 Test #7: global_enkf ......................   Passed  1522.12 sec
4/7 Test #6: hafs_3denvar_hybens ..............   Passed  1821.52 sec
5/7 Test #2: rtma .............................   Passed  2052.07 sec
6/7 Test #5: hafs_4denvar_glbens ..............   Passed  2068.81 sec
7/7 Test #1: global_4denvar ...................   Passed  3967.34 sec

100% tests passed, 0 tests failed out of 7

Total Test time (real) = 3967.40 sec

@jswhit2
Copy link
Contributor

jswhit2 commented Mar 28, 2024

@jswhit Just want to confirm that the description:

is controlled by parameters taperanalperts_aktop and taperanalperts_akbot. Default values are 500 and -1,

is swapped, correct? aktop=-1 and ak_bot=500? This is what's in the code and what mathematically makes sense.

yes, it is swapped - sorry about that

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.

Thank you @jswhit for patiently responding to my nitpicks. Looks good. Just two more lines which need precision specified in params.f90. I missed this on my first sweep. Sorry.

src/enkf/params.f90 Outdated Show resolved Hide resolved
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.

Great! Thank you @jswhit for the quick commit.

Approve.

Copy link
Collaborator

@CatherineThomas-NOAA CatherineThomas-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 to me. Thanks @jswhit for adding this!

@RussTreadon-NOAA RussTreadon-NOAA merged commit b2fc4fd into NOAA-EMC:develop Mar 29, 2024
4 checks passed
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.

Add ability to taper analysis perturbations near top of model
5 participants