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

test on UST seems not correct in w3iogomd.F90 #1095

Open
mickaelaccensi opened this issue Oct 12, 2023 · 3 comments
Open

test on UST seems not correct in w3iogomd.F90 #1095

mickaelaccensi opened this issue Oct 12, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@mickaelaccensi
Copy link
Collaborator

Describe the bug
AUX1 and AUX2 should only be written if UST(ISEA) and ASF(ISEA) is not UNDEF

        ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 1 ) THEN
          DO ISEA=1, NSEA
            IX     = MAPSF(ISEA,1)
            IY     = MAPSF(ISEA,2)
            IF ( MAPSTA(IY,IX) .EQ. 1 ) THEN
              AUX1(ISEA) = UST(ISEA) * ASF(ISEA) *        &
                   COS(USTDIR(ISEA))
              AUX2(ISEA) = UST(ISEA) * ASF(ISEA) *        &
                   SIN(USTDIR(ISEA))
            ELSE
              AUX1(ISEA) = UNDEF
              AUX2(ISEA) = UNDEF
            END IF
          END DO
          WRITE ( NDSOG ) AUX1
          WRITE ( NDSOG ) AUX2

To Reproduce
running regtests ww3_tp2.6, ww3_ufs1.2, mww3_test_04 should show differences

Expected behavior
IX = MAPSF(ISEA,1)
IY = MAPSF(ISEA,2)
IF ( MAPSTA(IY,IX) .EQ. 1 ) THEN

should be replaced by :

IF ( UST(ISEA) .NE. UNDEF .AND. ASF(ISEA) .NE. UNDEF ) THEN

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@mickaelaccensi mickaelaccensi added the bug Something isn't working label Oct 12, 2023
@JessicaMeixner-NOAA
Copy link
Collaborator

@mickaelaccensi I agree those variables should not be calculated unless those variables are defined. Do we need the additional if MAPSTA(IY,IX) .EQ. 1 as well as the additional check?

I made a branch with your update here: https://github.com/jessicameixner-noaa/ww3/tree/bug/initvalueust

and here are the regtest output:

**********************************************************************
********************* non-identical cases ****************************
**********************************************************************
mww3_test_03/./work_PR1_MPI_e                     (1 files differ)
mww3_test_03/./work_PR3_UNO_MPI_e                     (1 files differ)
mww3_test_03/./work_PR2_UQ_MPI_e                     (1 files differ)
mww3_test_03/./work_PR2_UNO_MPI_e                     (1 files differ)
mww3_test_03/./work_PR2_UNO_MPI_d2                     (16 files differ)
mww3_test_03/./work_PR1_MPI_d2                     (12 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c                     (17 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c                     (14 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2                     (18 files differ)
mww3_test_03/./work_PR2_UQ_MPI_d2                     (15 files differ)
mww3_test_03/./work_PR3_UNO_MPI_e_c                     (1 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2                     (15 files differ)
mww3_test_04/./work_PR1_MPI_d                     (3 files differ)
mww3_test_04/./work_PR2_UNO_MPI_d                     (3 files differ)
mww3_test_04/./work_PR3_UNO_MPI_d_c                     (3 files differ)
mww3_test_04/./work_PR3_UNO_MPI_d                     (3 files differ)
mww3_test_04/./work_PR3_UQ_MPI_d_c                     (3 files differ)
mww3_test_04/./work_PR3_UQ_MPI_d                     (3 files differ)
mww3_test_04/./work_PR2_UQ_MPI_d                     (3 files differ)
ww3_tp2.10/./work_MPI_OMPH                     (7 files differ)
ww3_tp2.16/./work_MPI_OMPH                     (4 files differ)
ww3_tp2.6/./work_ST0                     (3 files differ)
ww3_tp2.6/./work_ST4                     (3 files differ)
ww3_ufs1.2/./work_a                     (2 files differ)
ww3_ufs1.2/./work_c                     (3 files differ)
ww3_ufs1.2/./work_b                     (2 files differ)
ww3_ufs1.3/./work_a                     (3 files differ)

@mickaelaccensi
Copy link
Collaborator Author

Thanks Jessica !
I think test on MAPSTA .EQ. 1 is not needed because we only loop on ISEA points which are 'wet' points in my understanding
Do you see some differences in the output parameter UST and CHA ? If yes it could be good to see if it is improving the result

@JessicaMeixner-NOAA
Copy link
Collaborator

We do see a diff in ust:

***
/scratch1/NCEPDEV/climate/Jessica.Meixner/PR_WW3/bug01/regtests/output/ww3_tp2.6/work_ST0/ww3.201008_ust.nc_diff.txt
***
4055,4058c4055,4056
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
---
>     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, _, _, _, _, _, _, _, _, _, _, _, _, _,
>     _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 1e-05,
4230,4233c4228,4229
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
---
>     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, _, _, _, _, _, _, _, _, _, _, _, _, _,
>     _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 1e-05,
4405,4408c4401,4402
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
---
>     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, _, _, _, _, _, _, _, _, _, _, _, _, _,
>     _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 1e-05,
4580,4583c4574,4575
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
<     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05,
---
>     1e-05, 1e-05, 1e-05, 1e-05, 1e-05, _, _, _, _, _, _, _, _, _, _, _, _, _,
>     _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 1e-05,
4755,4758c4747,4748

Basically the same as the diffs that you see here: #1089 (comment)

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

No branches or pull requests

2 participants