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

Regularized WSM6 and its TL/AD for 4DVar #1768

Merged
merged 10 commits into from
Nov 23, 2022

Conversation

expertyang
Copy link
Contributor

@expertyang expertyang commented Sep 15, 2022

TYPE: new feature

KEYWORDS: WSM6, TL/AD, 4DVAR

Description of Change:
This PR adds a regularized version (i.e., change discontinuous functions to continuous functions) of WSM6 microphysics scheme (MP option 106, named as 'WSM6R') and its tangent linear and adjoint (TL/AD), which enables WRF-4DVar to run with ice-phase hydrometeor analysis variables. Note that the non-linear version of WSM6R is kept just for the code reference of deriving TL/AD, and it is NOT recommended to be used for the WRF model forecast. In addition, there is an improved handling of the file unit related to the background error covariance.

SOURCE: Sen YANG, Deqin LI, Liqiang CHEN (Institute of Atmospheric Environment, China Meteorological Administration, Shenyang)

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M Registry/registry.var
M Registry/registry.wrfplus
M main/depend.common
M phys/Makefile
M phys/module_microphysics_driver.F
A phys/module_mp_wsm6s.F
M var/da/da_setup_structures/da_scale_background_errors.inc
M var/da/da_setup_structures/da_setup_be_regional.inc
M var/da/da_transfer_model/da_transfer_wrftltoxa.inc
M var/da/da_transfer_model/da_transfer_wrftltoxa_adj.inc
M var/da/da_transfer_model/da_transfer_xatowrftl.inc
M var/da/da_transfer_model/da_transfer_xatowrftl_adj.inc
M wrftladj/Makefile
M wrftladj/depend.wrftladj
M wrftladj/module_microphysics_driver_ad.F
M wrftladj/module_microphysics_driver_tl.F
A wrftladj/module_mp_wsm6s_ad.F
A wrftladj/module_mp_wsm6s_tl.F
M wrftladj/solve_em_ad.F
M wrftladj/solve_em_tl.F

TESTS CONDUCTED:

  1. Jenkins tests all passed;
  2. WRFDA regression test passed on Cheyenne;
  3. wrfplus and 4dvar tests succeeded using mp_physics & mp_physics_ad=106.

RELEASE NOTE: Add a regularized version of WSM6 and its TL/AD for 4DVar with ice-phase hydrometeor analysis variables.
Yang, S., D. Q. Li, L. Q. Chen, Z. Liu, X.-Y. Huang, and X. Pan, 2022: The regularized WSM6 microphysical scheme and its validation in WRF 4D-Var. Adv. Atmos. Sci., in press.

expertyang and others added 8 commits July 8, 2021 10:24
This reverts commit 3ec9569.
This reverts commit 00155c1.
 On branch wsm6_tlad
	modified:   .github/CODEOWNERS
	new file:   .gitmodules
	modified:   Makefile
	modified:   README
	modified:   Registry/Registry.EM
	modified:   Registry/Registry.EM_CHEM
	modified:   Registry/Registry.EM_COMMON
	modified:   Registry/Registry.EM_COMMON.var
	deleted:    Registry/Registry.NMM
@expertyang expertyang requested review from a team as code owners September 15, 2022 00:55
@dudhia
Copy link
Collaborator

dudhia commented Sep 15, 2022

It appears that this adds a new scheme called wsm6s. Please say more about why this new scheme is needed and how it differs from WSM6, and add a description in the PR message.

@weiwangncar
Copy link
Collaborator

This passed regression tests:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           58
Number of Simulations  : 158           156        0
Number of Comparisons  : 95           92        0

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

@liujake
Copy link
Contributor

liujake commented Sep 15, 2022

@dudhia I will take care of this PR and add/request more info in PR message.

@liujake liujake requested review from liujake and removed request for a team November 14, 2022 17:26
@liujake liujake changed the title WSM6 tlad Regularized WSM6 and its TL/AD Nov 14, 2022
@liujake liujake changed the title Regularized WSM6 and its TL/AD Regularized WSM6 and its TL/AD for 4DVar Nov 14, 2022
@liujake
Copy link
Contributor

liujake commented Nov 15, 2022

@expertyang

M wrftladj/adBuffer.F
M wrftladj/adStack.c
A wrftladj/adStack.h

I have issues to compile these code with gfortran with quite some error message below:

gfortran -c -ffixed-form -fdefault-real-8 -O0 adBuffer.for
adBuffer.for:232:25:

  232 |          CALL PUSHNARRAY(ads1buf, 512, 1)
      |                         1
......
  273 |          CALL PUSHNARRAY(adbitbuf, 4, 1)
      |                         2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(1)/INTEGER(4)).
adBuffer.for:245:24:

  245 |          CALL POPNARRAY(ads1buf, 512, 1)
      |                        1
......
  286 |          CALL POPNARRAY(adbitbuf, 4, 1)
      |                        2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(1)/INTEGER(4)).

After I recovered the old code. It compiled successfully.

@liujake
Copy link
Contributor

liujake commented Nov 15, 2022

@expertyang How about rename 'WSM6S' to 'WSM6R' meaning 'Regularized WSM6'.

@dudhia
Copy link
Collaborator

dudhia commented Nov 22, 2022

The regressions tests seem to be running slowly. Not sure why.

@liujake
Copy link
Contributor

liujake commented Nov 22, 2022

I compiled Ok 'wrfplus' and 'wrfda-4dvar' on Cheyenne. wrfplus compilation took about 1-h with '-j 2' using gfortran+mpt. 4dvar compilation took about 10 min with '-j 4' using gofrtran+mpt. I am doing WRFDA regression tests now.

@weiwangncar
Copy link
Collaborator

The Jenkins tests have passed according to the email below (but not sure why this page is not updated - have contacted the relevant people and is waiting for an answer):

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           58
Number of Simulations  : 158           156        0
Number of Comparisons  : 95           92        0

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

@liujake
Copy link
Contributor

liujake commented Nov 23, 2022

WRFDA regression tests passed and wrfplus & 4dvar with new wsm6r scheme succeeded. Ready to merge.

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 very good. Ready to merge.

@liujake
Copy link
Contributor

liujake commented Nov 23, 2022

@dudhia I'd like to merge this Today if you approve.

Copy link
Collaborator

@dudhia dudhia left a comment

Choose a reason for hiding this comment

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

Interaction with rest of model looks OK

@liujake liujake merged commit 5fdd007 into wrf-model:develop Nov 23, 2022
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
TYPE: new feature

KEYWORDS: WSM6, TL/AD,  4DVAR

Description of Change:
This PR adds a regularized version (i.e., change discontinuous functions to continuous functions) of WSM6 microphysics scheme (MP option 106, named as 'WSM6R') and its tangent linear and adjoint (TL/AD), which enables WRF-4DVar to run with ice-phase hydrometeor analysis variables. Note that the non-linear version of WSM6R is kept just for the code reference of deriving TL/AD, and it is NOT recommended to be used for the WRF model forecast. In addition, there is an improved handling of the file unit related to the background error covariance.

SOURCE:  Sen YANG, Deqin LI, Liqiang CHEN (Institute of Atmospheric Environment, China Meteorological Administration, Shenyang)

LIST OF MODIFIED FILES: 
M       Registry/Registry.EM_COMMON
M       Registry/registry.var
M       Registry/registry.wrfplus
M       main/depend.common
M       phys/Makefile
M       phys/module_microphysics_driver.F
A       phys/module_mp_wsm6s.F
M       var/da/da_setup_structures/da_scale_background_errors.inc
M       var/da/da_setup_structures/da_setup_be_regional.inc
M       var/da/da_transfer_model/da_transfer_wrftltoxa.inc
M       var/da/da_transfer_model/da_transfer_wrftltoxa_adj.inc
M       var/da/da_transfer_model/da_transfer_xatowrftl.inc
M       var/da/da_transfer_model/da_transfer_xatowrftl_adj.inc
M       wrftladj/Makefile
M       wrftladj/depend.wrftladj
M       wrftladj/module_microphysics_driver_ad.F
M       wrftladj/module_microphysics_driver_tl.F
A       wrftladj/module_mp_wsm6s_ad.F
A       wrftladj/module_mp_wsm6s_tl.F
M       wrftladj/solve_em_ad.F
M       wrftladj/solve_em_tl.F

TESTS CONDUCTED: 
1. Jenkins tests all passed;
2. WRFDA regression test passed on Cheyenne;
3. wrfplus and 4dvar tests succeeded using mp_physics & mp_physics_ad=106.

RELEASE NOTE: Add a regularized version of WSM6 and its TL/AD for 4DVar with ice-phase hydrometeor analysis variables.
Yang, S., D. Q. Li, L. Q. Chen, Z. Liu, X.-Y. Huang, and X. Pan, 2022: The regularized WSM6 microphysical scheme and its validation in WRF 4D-Var. Adv. Atmos. Sci., in press.
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.

5 participants