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

a collection of WRFDA fixes related to ensdim_alpha use cases #1603

Merged

Conversation

jamiebresch
Copy link
Contributor

@jamiebresch jamiebresch commented Dec 17, 2021

TYPE: bug fix

KEYWORDS: WRFDA, ensdim_alpha

SOURCE: Jamie Bresch and Craig Schwartz (NCAR), Yi-Chuan Lo (Central Weather Bureau, Taiwan)

DESCRIPTION OF CHANGES:
The PR includes multiple bug fixes that are somewhat intertwined and related to the use of ensembles under not-usually-used scenarios.
The root cause of the various problems (reported by Craig Schwartz and Yi-Chuan Lo) is the inclusion of alpha control variable in the ill-designed be data structure.
The list of fixes:

  1. fix minimization for precondition_cg=true (default is false) and orthonorm_gradient=true (default is false) when ensdim_alpha>0. The fix also helps with offline varbc (related to unallocated be%cv_mz when use_background_errors=false).
  2. fix for 3DEns-FGAT (num_fgat_time>0 and ensdim_alpha>0 and je_factor=1.0). The bug was introduced when trying to fix a bug for 4D-EnVar (commit b449e865).
  3. fix offline varbc when use_background_errors=false (commit d69d7bb breaks this capability) by still allocating be%cv_mz when use_background_errors=false to avoid memory segmentation fault. A bonus fix is to skip updating analysis and writing out wrfvar_output for offline varbc (VARBC.out is the only meaningful output) to save computing resources.
  4. skip reading be.dat when ensdim_alpha>0 and je_factor=1.0 (i.e. full ensemble mode) to avoid the hassle of providing a climatology be.dat that is not actually used in assimilation.

LIST OF MODIFIED FILES:
M var/da/da_main/da_solve.inc
M var/da/da_minimisation/da_calculate_gradj.inc
M var/da/da_minimisation/da_calculate_j.inc
M var/da/da_minimisation/da_minimise_cg.inc
M var/da/da_minimisation/da_transform_vtod_wpec.inc
M var/da/da_minimisation/da_transform_vtod_wpec_adj.inc
M var/da/da_minimisation/da_transform_vtoy.inc
M var/da/da_minimisation/da_transform_vtoy_adj.inc
M var/da/da_setup_structures/da_setup_be_regional.inc
M var/da/da_vtox_transforms/da_transform_vpatox.inc
M var/da/da_vtox_transforms/da_transform_vpatox_adj.inc
M var/da/da_vtox_transforms/da_transform_vptox.inc
M var/da/da_vtox_transforms/da_transform_vptox_adj.inc
M var/da/da_vtox_transforms/da_transform_vtox.inc
M var/da/da_vtox_transforms/da_transform_vtox_adj.inc
M var/da/da_vtox_transforms/da_vtox_transforms.f90

TESTS CONDUCTED:

  1. the fixed code (implemented in different versions of WRFDA) has been used extensively in different applications
  2. WRFDA regression test would be needed, but I didn't do it
  3. Jenkins tests all passed

RELEASE NOTE: WRFDA has been fixed and enhanced for applications related to offline varbc (use_background_errors=false), 3DEns-FGAT (num_fgat_time>0 and ensdim_alpha>0 and je_factor=1.0), precondition_cg=true and orthonorm_gradient=true when ensdim_alpha>0, full-ensemble mode (ensdim_alpha>0 and je_factor=1.0).

The bug was introduced when trying to fix a bug for 4D-EnVar (commit wrf-model@b449e865).
Allocate be%cv_mz when use_background_errors=false to avoid memory segmentation fault.
Also skip updating analysis and writing out wrfvar_output for offline varbc.
@jamiebresch
Copy link
Contributor Author

Please find result of the WRF regression test cases in the attachment. This build is for Commit ID: 8cb7a42, requested by: jamiebresch for PR: https://github.com/scala-computing/WRF/pull/1603. For any query please send e-mail to David Gill.

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           58
Number of Simulations  : 159           155        0
Number of Comparisons  : 96           93        0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

@liujake
Copy link
Contributor

liujake commented Dec 17, 2021

Will look into this early this afternoon.

Copy link
Contributor

@liujake liujake 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. WRFDA regression tests passed.

@liujake
Copy link
Contributor

liujake commented Dec 17, 2021

@davegill I approved 4 PRs by Jamie. You may give another approval when you have a chance.

@davegill davegill self-requested a review December 17, 2021 23:53
@jamiebresch jamiebresch merged commit 933cf8c into wrf-model:develop Dec 18, 2021
@jamiebresch jamiebresch deleted the fixes_wrt_non_zero_ensdim_alpha branch December 18, 2021 00:28
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
…del#1603)

TYPE: bug fix

KEYWORDS: WRFDA, ensdim_alpha

SOURCE: Jamie Bresch and Craig Schwartz (NCAR), Yi-Chuan Lo (Central Weather Bureau, Taiwan)

DESCRIPTION OF CHANGES:
The PR includes multiple bug fixes that are somewhat intertwined and related to the use of ensembles under not-usually-used scenarios.
The root cause of the various problems (reported by Craig Schwartz and Yi-Chuan Lo) is the inclusion of alpha control variable in the ill-designed `be` data structure.
The list of fixes:
1. fix minimization for precondition_cg=true (default is false) and orthonorm_gradient=true (default is false) when ensdim_alpha>0. The fix also helps with offline varbc (related to unallocated be%cv_mz when use_background_errors=false).
2. fix for 3DEns-FGAT (num_fgat_time>0 and ensdim_alpha>0 and je_factor=1.0). The bug was introduced when trying to fix a bug for 4D-EnVar (commit wrf-model@b449e865).
3. fix offline varbc when use_background_errors=false (commit wrf-model@d69d7bb breaks this capability) by still allocating be%cv_mz when use_background_errors=false to avoid memory segmentation fault. A bonus fix is to skip updating analysis and writing out wrfvar_output for offline varbc (VARBC.out is the only meaningful output) to save computing resources.
4. skip reading be.dat when ensdim_alpha>0 and je_factor=1.0 (i.e. full ensemble mode) to avoid the hassle of providing a climatology be.dat that is not actually used in assimilation.

LIST OF MODIFIED FILES:
M       var/da/da_main/da_solve.inc
M       var/da/da_minimisation/da_calculate_gradj.inc
M       var/da/da_minimisation/da_calculate_j.inc
M       var/da/da_minimisation/da_minimise_cg.inc
M       var/da/da_minimisation/da_transform_vtod_wpec.inc
M       var/da/da_minimisation/da_transform_vtod_wpec_adj.inc
M       var/da/da_minimisation/da_transform_vtoy.inc
M       var/da/da_minimisation/da_transform_vtoy_adj.inc
M       var/da/da_setup_structures/da_setup_be_regional.inc
M       var/da/da_vtox_transforms/da_transform_vpatox.inc
M       var/da/da_vtox_transforms/da_transform_vpatox_adj.inc
M       var/da/da_vtox_transforms/da_transform_vptox.inc
M       var/da/da_vtox_transforms/da_transform_vptox_adj.inc
M       var/da/da_vtox_transforms/da_transform_vtox.inc
M       var/da/da_vtox_transforms/da_transform_vtox_adj.inc
M       var/da/da_vtox_transforms/da_vtox_transforms.f90

TESTS CONDUCTED:
1. the fixed code (implemented in different versions of WRFDA) has been used extensively in different applications
2. WRFDA regression tests (done by @liujake) passed
2. Jenkins tests all passed

RELEASE NOTE: WRFDA has been fixed and enhanced for applications related to offline varbc (use_background_errors=false), 3DEns-FGAT (num_fgat_time>0 and ensdim_alpha>0 and je_factor=1.0), precondition_cg=true and orthonorm_gradient=true when ensdim_alpha>0, full-ensemble mode (ensdim_alpha>0 and je_factor=1.0).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants