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

Correction to the effective layer top and bottom calculation. #358

Merged
merged 18 commits into from
Sep 2, 2021

Conversation

EdwardColon-NOAA
Copy link
Contributor

Correction to the effective layer top and bottom calculation. The key modifications are constrained to the following subprograms

MISCLN.f
UPP_PHYSICS.f
TTBLEX.f

Code description::
(1) TTBLEX.f (line 120 ~ 240): a new routine TTBLEX1D was added (specifically used for subroutine CALCAPE1D), based on original routine TTBLEX which is CALCAPE for air parcels in 2-D plane.
(2) UPP_PHYSICS.f (line 2580 ~ 3014): adding a new routine CALCAPE1D
(3) MISCLN.f (line 3419 ~ 3749):
adding code to search for the effective layer.
scheme 1: line 3438 ~ 3491. Using CALCAPE to compute CAPE/CIN for all air parcels level by level
scheme 2: line 3492 ~ 3688. Finding air-parcel with max theta-e along the sounding profile/column on each grid box for sanity check first, then compute cape/cin of the all 1-D air parcels along that each profile if the sanity check is passed for this column/profile.
line 3689 ~ 3749: additional output to print out the profiles, positions of EL, etc for code debugging.

line:3934 ~ 3943: Array LLOW and LUPP are used to store the base and top of EL for other related variables (like helicity).

!--- IF USSING EL BASE & TOP COMPUTED BY NEW SCHEME FOR THE RELATED VARIABLES
IF ( EL_SCHEME > 0 ) THEN
!$omp parallel do private(i,j)
DO J=JSTA,JEND
DO I=1,IM
LLOW(I,J) = EL_BASE(I,J)
LUPP(I,J) = EL_TOPS(I,J)
ENDDO
ENDDO
END IF
So if set EL_SCHEME =1 or 2 in the beginning of code, then the EL found by new scheme is used, otherwise the EL of old scheme is used.

Usage:
In MISCLN.f:
line 199: debugprint = .TRUE. (if set to .FALSE., then no additional output. Those outputs are in text format and very huge, better turned off after further testing.)
line 200: EL_SCHEME = 1
any negative number , or 0--> OLD scheme;
1 --> scheme 1;
2 --> scheme 2
Note: if set EL_SCHEME =1 or 2 in the beginning of code, then the EL found by new scheme is used, otherwise the EL of old scheme is used.

@EdwardColon-NOAA EdwardColon-NOAA changed the title Feature/3 drtma8 Correction to the effective layer top and bottom calculation. The key modifications are constrained to the following subprograms Aug 6, 2021
@EdwardColon-NOAA EdwardColon-NOAA changed the title Correction to the effective layer top and bottom calculation. The key modifications are constrained to the following subprograms Correction to the effective layer top and bottom calculation. Aug 6, 2021

END DO ! L
!
ELSE IF ( EL_SCHEME == 2 ) THEN

Choose a reason for hiding this comment

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

When I developed the code to search for Effective-Layer, I made two schemes. So the two schemes could compare to each other and verify against each other. After the testing in HWT SFE 2021, it seems that Scheme 1 had been working well and SPC was satisfied with it.
So to make the code management and maintenance simple and easy, I suggest to set Scheme 1 as the only scheme for Effective-Layer, and remove the code related to Scheme 2 (in this MISCLN.f, and in UPP_PHYSICS.f and in TTBLEX.f). Just my suggestion. These code still can be kept.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@EdwardColon-NOAA and @GangZhao-NOAA If scheme 2 is used only by 3DRTMA, I would agree with Gang that keeping scheme 1 only.

!
!

SUBROUTINE CALCAPE1D(P_A,T_A,Q_A,ZINT_A,LPAR0,PSFC,LMASK,CAPE,CINS, &

Choose a reason for hiding this comment

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

Same as what I comment in MISCLN.f for scheme 2 and in TTBLEX.f for subroutine TTBLEX1D,
"After the testing in HWT SFE 2021, it seems that Scheme 1 had been working well and SPC was satisfied with it. So to make the code management and maintenance simple and easy, I suggest to set Scheme 1 as the only scheme for Effective-Layer, and remove the code related to Scheme 2 (in this MISCLN.f, and in UPP_PHYSICS.f and in TTBLEX.f). Just my suggestion. These code still can be kept."
This subroutine CALCAPE1D is used only for scheme 2 in MISCLN.f for searching for the Effective-Layer. It could be removed for code clean if scheme 2 is not necessary.

Copy link

@GangZhao-NOAA GangZhao-NOAA left a comment

Choose a reason for hiding this comment

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

I have one question and one comment:

  1. one question is about the reason of changing "im to lm" in some code. This is same question as Wen Meng already asked Ed for the reason.
  2. One comment is about whether to keep Scheme 2 (searching for Effective-Layer) in MISCLN.f or remove Scheme 2.
    As what I comment in MISCLN.f, in TTBLEX.f and in UPP_PHYSCIS.f for scheme 2,
    "After the testing in HWT SFE 2021, it seems that Scheme 1 had been working well and SPC was satisfied with it. So to make the code management and maintenance simple and easy, I suggest to set Scheme 1 as the only scheme for Effective-Layer, and remove the code related to Scheme 2 (in this MISCLN.f, and in UPP_PHYSICS.f and in TTBLEX.f). Just my suggestion. These code still can be kept if you like."

The subroutine TTBLEX1D (in TTBLEX.f) , subroutine CALCAPE1D (in UPP_PHYSCIS.f) and code for scheme 2 in (MISCLN.f) are used only for scheme 2 to search for the Effective-Layer. It could be removed for code clean if scheme 2 is not necessary.

If you would like to remove these code related to Scheme 2, I can help to clean it.

Thank you!

  • Gang

@@ -2910,7 +2938,8 @@ SUBROUTINE MISCLN
EGRID1(I,J) = LOG(PMID(I,J,LM)/EGRID2(I,J)) &
/ LOG(PMID(I,J,LM)/PMID(I,J,LM-1))

IF (MODELNAME == 'GFS' .OR. MODELNAME == 'FV3R') THEN
IF (MODELNAME == 'GFS' .OR. MODELNAME == 'FV3R' &
.OR. MODELNAME == 'FV3R') THEN
Copy link
Collaborator

Choose a reason for hiding this comment

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

@EdwardColon-NOAA The model name "FV3R" is duplicated here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This duplication was resolved.

@WenMeng-NOAA WenMeng-NOAA linked an issue Aug 16, 2021 that may be closed by this pull request
i loop indices corrected.
Removed EL_SCHEME flag and the EL_SCHEME 2 as it was intended as a method of validating the output of EL_SCHEME effective layer top and bottom calculations. The HWT/SFE confirmed that the EL_SCHEME 1 computations were viable making EL_SCHEME 2 superfluous. The debugprint flag was also set to false as it currently not needed in the execution of the MISCLN subprogram, however, it may be switch on at any point it becomes necessary to trace a problem.
Removed the definition of CALCAPE1D which was invoked in MISCLN.f as the CAPE/CIN computational routine used in EL_SCHEME 2. It is now a defunct option.
@WenMeng-NOAA
Copy link
Collaborator

@EdwardColon-NOAA Could you sync your branch with upstream/develop and solve the conflicts in parm/ppst_avbflds.xml so I can conduct the tests?

@EdwardColon-NOAA
Copy link
Contributor Author

EdwardColon-NOAA commented Aug 17, 2021 via email

@WenMeng-NOAA
Copy link
Collaborator

@EdwardColon-NOAA Now your branch is in a good shape. Thanks!

@WenMeng-NOAA
Copy link
Collaborator

@EdwardColon-NOAA My tests indicate that EFHL in hrrr/rap datasets have changed results like:
163:149027926:EFHL:surface:rpn_corr=0.238913:rpn_rms=37.7674

Do you think what would cause EFHL change?

@EdwardColon-NOAA
Copy link
Contributor Author

EdwardColon-NOAA commented Aug 17, 2021 via email

@EdwardColon-NOAA
Copy link
Contributor Author

EdwardColon-NOAA commented Aug 18, 2021 via email

@WenMeng-NOAA
Copy link
Collaborator

@EdwardColon-NOAA The first way would be the one to get this PR merged quickly. We use separate algorithms for hrrr/rap and 3Drtma. For the long term solution, you might prepare the evaluation of these two algorithms and coordinate with hrrr/rap developers Geoffrey Manikin and Ming Hu for unification. Please let me know if this proposal is working for you.

@EdwardColon-NOAA
Copy link
Contributor Author

EdwardColon-NOAA commented Aug 18, 2021 via email

@WenMeng-NOAA
Copy link
Collaborator

@EdwardColon-NOAA Sounds good to me. Thanks!

@WenMeng-NOAA
Copy link
Collaborator

@EdwardColon-NOAA I would like to know if the scheme 2 mentioned in Gang's comments is removed.

@EdwardColon-NOAA
Copy link
Contributor Author

EdwardColon-NOAA commented Aug 20, 2021 via email

@WenMeng-NOAA
Copy link
Collaborator

@EdwardColon-NOAA Thanks for clarifying. I conducted the regression tests. The hrrr/rap look good. But the 3drtma test failed as:
get_postfilename,post_fname=WRFTWO.GrbF00npset= 1 num_pset=
3 iSF_SURFACE_PHYSICS= 3
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
upp.x 00000000014C018D Unknown Unknown Unknown
libpthread-2.17.s 00002AAB9B936630 Unknown Unknown Unknown
upp.x 0000000000A1AAD9 miscln_ 3943 MISCLN.f
upp.x 0000000000706547 process_ 116 PROCESS.f
upp.x 000000000065FA79 MAIN__ 865 WRFPOST.f
upp.x 000000000040755E Unknown Unknown Unknown
libc-2.17.so 00002AAB9C220555 __libc_start_main Unknown Unknown
upp.x 0000000000407469 Unknown Unknown Unknown
953 42 1 0

Can you take a look at it?

@WenMeng-NOAA
Copy link
Collaborator

@EdwardColon-NOAA You had updated your PR yesterday. Will the current version be working in rtma regression tests, or your tweaking is not done yet?

@EdwardColon-NOAA
Copy link
Contributor Author

EdwardColon-NOAA commented Sep 1, 2021 via email

@WenMeng-NOAA
Copy link
Collaborator

@EdwardColon-NOAA Thanks for updating and clarifying. I will resume my tests.

@WenMeng-NOAA
Copy link
Collaborator

@EdwardColon-NOAA Now my rtma tests can be run through. Can you sync your branch with upstream/develop and add change logs with your name in the modified fortran code?

@WenMeng-NOAA
Copy link
Collaborator

@EdwardColon-NOAA Can you verify the new rtma GRIB2 datasets from my test at /u/Wen.Meng/ptmp/rtma_2020113000 on Mars? Thanks!

@EdwardColon-NOAA
Copy link
Contributor Author

EdwardColon-NOAA commented Sep 2, 2021 via email

@WenMeng-NOAA
Copy link
Collaborator

@EdwardColon-NOAA Thanks! I will recreate the baseline for rtma with this PR merged.

@WenMeng-NOAA
Copy link
Collaborator

The UPP regression tests were conducted on WCOSS-Dell, WCOSS-Cray and Hera. With this PR merged, the baseline for rtma will be recreated.

@WenMeng-NOAA WenMeng-NOAA merged commit 9e2e758 into NOAA-EMC:develop Sep 2, 2021
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.

Correction to the effective layer top and bottom calculation
3 participants