Skip to content

Bugfix th2m#1517

Merged
mingchen-NOAA merged 4 commits into
NOAA-EMC:developfrom
umr-lops:bugfix_th2m
Oct 28, 2025
Merged

Bugfix th2m#1517
mingchen-NOAA merged 4 commits into
NOAA-EMC:developfrom
umr-lops:bugfix_th2m

Conversation

@mickaelaccensi
Copy link
Copy Markdown
Collaborator

Pull Request Summary

correct TH2M computation

Description

the formula for TH2M is :

E2C(:)=COS((PI/180.)*2*THETA(:))
E2S(:)=SIN((PI/180.)*2*THETA(:))
a2(IK,IP,IT)=SUM(efth(:,IK,IP,IT)*E2C(:))*dtheta
b2(IK,IP,IT)=SUM(efth(:,IK,IP,IT)*E2S(:))*dtheta

th2(IK,IP,IT)=ATAN2(b2(IK,IP,IT),a2(IK,IP,IT))/2.

with

cos(2θ) = 2cos²(θ) - 1
sin(2θ) = 2sin(θ)*cos(θ)

in WW3, we can compute TH2M with formulas :
TH2M(JSEA,IK)= MOD ( 270. - RADE0.5ATAN2(AB2Y(JSEA),AB2X(JSEA)) , 180. )

Issue(s) addressed

issue #1511

Commit Message

correct TH2M computation

Check list

Testing

  • How were these changes tested?
    TH2M and ST2M are not outputed by any regtests, it has benn added in ww3_tp2.3
  • Are the changes covered by regression tests? (If not, why? Do new tests need to be added?) ww3_tp2.3 now
  • Have the matrix regression tests been run (if yes, please note HPC and compiler)? DATARMOR with Intel
  • Please indicate the expected changes in the regression test output, (Note the list of known non-identical tests.)
  • Please provide the summary output of matrix.comp (matrix.Diff.txt, matrixCompFull.txt and matrixCompSummary.txt):
    matrixDiff.txt
    matrixCompSummary.txt
    matrixCompFull.txt

@mickaelaccensi mickaelaccensi added the bug Something isn't working label Oct 27, 2025
@mingchen-NOAA mingchen-NOAA self-requested a review October 27, 2025 15:49
@mingchen-NOAA
Copy link
Copy Markdown
Collaborator

This PR is now under testing on Ursa Intel.

@mingchen-NOAA
Copy link
Copy Markdown
Collaborator

@mickaelaccensi could you update the branch to develop? TY

Copy link
Copy Markdown
Collaborator

@ErickRogers ErickRogers left a comment

Choose a reason for hiding this comment

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

The fixes look good to me. (pending sync with dev) Thanks Mickael.

Copy link
Copy Markdown

@apchoiCMD apchoiCMD left a comment

Choose a reason for hiding this comment

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

I may not be the most suitable reviewer, but as far as I can tell, the code looks good.

@mickaelaccensi
Copy link
Copy Markdown
Collaborator Author

it is merged with develop

@JessicaMeixner-NOAA
Copy link
Copy Markdown
Collaborator

@apchoiCMD Apologies - Mindo and Ming have the first 3 letters and I seem to have tagged the wrong person. Thanks for looking anyways.

@mingchen-NOAA
Copy link
Copy Markdown
Collaborator

All tests passed. No errors or unexpected differences were observed on Ursa Intel.
Known differences:

**********************************************************************
********************* non-identical cases ****************************
**********************************************************************
mww3_test_03/./work_PR3_UNO_MPI_d2                     (14 files differ)
mww3_test_03/./work_PR3_UQ_MPI_e                     (1 files differ)
mww3_test_03/./work_PR3_UNO_MPI_e                     (1 files differ)
mww3_test_03/./work_PR1_MPI_d2                     (15 files differ)
mww3_test_03/./work_PR3_UQ_MPI_e_c                     (1 files differ)
mww3_test_03/./work_PR2_UNO_MPI_d2                     (16 files differ)
mww3_test_03/./work_PR2_UQ_MPI_d2                     (16 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c                     (16 files differ)
mww3_test_03/./work_PR2_UNO_MPI_e                     (1 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2                     (17 files differ)
mww3_test_03/./work_PR1_MPI_e                     (1 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c                     (16 files differ)
mww3_test_03/./work_PR3_UNO_MPI_e_c                     (1 files differ)
mww3_test_09/./work_MPI_ASCII                     (0 files differ)
ww3_tp2.10/./work_MPI_OMPH                     (6 files differ)
ww3_tp2.6/./work_ST4_ASCII                     (0 files differ)
ww3_ufs1.3/./work_a                     (3 files differ)
 
**********************************************************************

Known differences due to the change:

ww3_tp2.3/./work_PR2_UNO                     (6 files differ)
ww3_tp2.3/./work_PR1_MPI                     (6 files differ)
ww3_tp2.3/./work_PR3_UNO_MPI                     (6 files differ)
ww3_tp2.3/./work_PR2_UQ                     (6 files differ)
ww3_tp2.3/./work_PR2_UNO_MPI                     (6 files differ)
ww3_tp2.3/./work_PR3_UNO                     (6 files differ)
ww3_tp2.3/./work_PR3_UQ_MPI                     (6 files differ)
ww3_tp2.3/./work_PR1                     (6 files differ)
ww3_tp2.3/./work_PR3_UQ                     (6 files differ)
ww3_tp2.3/./work_PR2_UQ_MPI                     (6 files differ)

matrixCompFull.txt
matrixCompSummary.txt
matrixDiff.txt

@mingchen-NOAA mingchen-NOAA merged commit c139064 into NOAA-EMC:develop Oct 28, 2025
@apchoiCMD
Copy link
Copy Markdown

@JessicaMeixner-NOAA No need to apology- I was honor to look at the code back again since pandemic!

@mingchen-NOAA
Copy link
Copy Markdown
Collaborator

@mickaelaccensi This PR has been merged. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants