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

code stability test failed in exec/hafs_ww3_outp.x #249

Open
BinLiu-NOAA opened this issue Nov 30, 2023 · 8 comments
Open

code stability test failed in exec/hafs_ww3_outp.x #249

BinLiu-NOAA opened this issue Nov 30, 2023 · 8 comments
Assignees
Labels
Bugzilla Operational HAFS bugzilla items enhancement New feature or request

Comments

@BinLiu-NOAA
Copy link
Collaborator

Description

Provide a clear and concise description of the requested feature/capability.
From NCO SPA:
During the HAFS v1.0 code stability test, to recompile HAFS code with ‘-check all’ and ‘-ftrapuv’ flag, or using "-check bounds" only.

The code stability test of exec/hafs_ww3_outp.x failed in either with ‘-check all’ or "-check bounds". Please investigate this failure and address it at the next upgrade.

Here are the detailed info -
/lfs/h1/ops/test/packages/hafs.v1.0.3/sorc.chkall - builds with '-check all'
/lfs/h1/ops/test/packages/hafs.v1.0.3/exec.chk.all - exec with '-check all'/lfs/h1/ops/test/packages/hafs.v1.0.3/sorc.chk.bounds - builds with '-check bounds'
/lfs/h1/ops/test/packages/hafs.v1.0.3/exec.chk.bounds - exec with '-check bounds'

Failed with '-check all' -
/lfs/h1/ops/test/output/20230613/hfsa1_wav_post_00_NHC_09L_IAN_2022092400.o63095776
forrtl: warning (406): fort: (33): Shape mismatch: The extent of dimension 1 of array HSP is 80 and the corresponding extent of array XPART is 2
Image PC Routine Line Source
hafs_ww3_outp.x 0000000000B84DDF Unknown Unknown Unknown
hafs_ww3_outp.x 00000000006A2E34 w3bullmd_mp_w3bul 289 w3bullmd.F90
hafs_ww3_outp.x 00000000004853BD w3outp_IP_w3expo_ 2471 ww3_outp.F90

Failed with '-check bounds' -
/lfs/h1/ops/test/output/20230612/hfsa1_wav_post_00_NHC_09L_IAN_2022092400.o62893668
forrtl: error (73): floating divide by zero
Image PC Routine Line Source
hafs_ww3_outp.x 0000000000A6B22B Unknown Unknown Unknown
libpthread-2.31.s 00001544CD7EA8C0 Unknown Unknown Unknown
hafs_ww3_outp.x 00000000006548A6 w3bullmd_mp_w3bul 291 w3bullmd.F90
hafs_ww3_outp.x 000000000046F062 w3outp_IP_w3expo_ 2471 ww3_outp.F90

Proposed solution

How should the new feature/capability be added? If you have thoughts on the implementation strategy, please share them here.

Status (optional)

Do you (or a colleague) plan to work on adding this feature?

Related to (optional)

Directly reference any related issues or PRs in this or other repositories, and describe how they are related. Examples:

  • fixed by hafs-community/hafs/pull/<pr_number>
@BinLiu-NOAA BinLiu-NOAA added enhancement New feature or request Bugzilla Operational HAFS bugzilla items labels Nov 30, 2023
@BijuThomas-NOAA
Copy link
Contributor

@BinLiu-NOAA The issue is fixed with minor code changes, but would like to discuss it with the WW3 group. Is Jessica the right person to contact?

@BinLiu-NOAA
Copy link
Collaborator Author

@BijuThomas-NOAA, I think @JessicaMeixner-NOAA and @MatthewMasarik-NOAA would be proper POCs since they are WW3 code managers. Could you please point them to your code changes?

P.S., including @saeideh.banihashemi@noaa.gov here as well since she might have encountered/resolved this from other WW3 applications already.

@MatthewMasarik-NOAA
Copy link

Hi @BijuThomas-NOAA, how can I help?

@MatthewMasarik-NOAA
Copy link

@BijuThomas-NOAA, I'm about to go on leave, but you can catch me here for the next ~20 mins. @JessicaMeixner-NOAA will be handling the CM duties while I'm away. I return Jan 22nd. In the meantime you might also create an issue on NOAA-EMC/WW3 with a tag to this issue, so our team can track it.

@BijuThomas-NOAA
Copy link
Contributor

BijuThomas-NOAA commented Jan 12, 2024

@MatthewMasarik-NOAA Thanks!

The debug build for ww3_outp failed with two issues(in w3bullmd.F90) [1173 ]:

Issue 1.

  • Shape mismatch: The extent of dimension 1 of array HSP is 80 and the corresponding extent of array XPART is 1
  • Shape mismatch: The extent of dimension 1 of array TPP is 80 and the corresponding extent of array XPART is 1
    The relevant lines in w3bullmd.F90 are
HSP = XPART(1,1:NPART)
TPP = XPART(2,1:NPART)

Issue 2.

IPG1 is not initialized in w3bullmd.F90
The relevant line in w3bullmd.F90 is
IPI(IFLD)=IPG1+1

Please let me know the following fixes make sense:

diff --git a/model/src/w3bullmd.F90 b/model/src/w3bullmd.F90
index 10301e8c..af749549 100644
--- a/model/src/w3bullmd.F90
+++ b/model/src/w3bullmd.F90
@@ -268,8 +268,8 @@ CONTAINS
     !
     CSVBLINE      = BLANK2
     !
+    IPG1 = 0
     IF (IOUT .EQ. 1) THEN
-      IPG1 = 0
       DO IP=1, NPTAB
         HST(IP,1) = -99.9
         TPT(IP,1) = -99.9
@@ -286,10 +286,12 @@ CONTAINS
     !
     HSTOT  = XPART(1,0)
     TP     = XPART(2,0)
-    HSP = XPART(1,1:NPART)
-    TPP = XPART(2,1:NPART)
-    WNP = TPI / XPART(3,1:NPART)
-    DMP = MOD( XPART(4,1:NPART) + 180., 360.)
+    DO IP=1, NPART
+      HSP(IP) = XPART(1,IP)
+      TPP(IP) = XPART(2,IP)
+      WNP(IP) = TPI / XPART(3,IP)
+      DMP(IP) = MOD( XPART(4,IP) + 180., 360.)
+    ENDDO
 
     NZERO = 0
     NZERO = COUNT( HSP <= BHSMIN .AND. HSP /= 0.  )

The HAFS repository that I am testing is
https://github.com/hafs-community/WW3/tree/c96ce38f460fee42601b763a5d9027a8350c70fb/model/src

Much appreciated!

@BinLiu-NOAA
Copy link
Collaborator Author

@MatthewMasarik-NOAA, I thinks this is not too urgent. No worries if you are taking leave. We can see if @JessicaMeixner-NOAA or Saeideh can have a chance to help to take a look at this next week. Thanks and have a nice long weekend!

@MatthewMasarik-NOAA
Copy link

@MatthewMasarik-NOAA, I thinks this is not too urgent. No worries if you are taking leave. We can see if @JessicaMeixner-NOAA or Saeideh can have a chance to help to take a look at this next week. Thanks and have a nice long weekend!

Okay, that sounds good. Since it just needs to be addressed before the next upgrade we should have some time. It would still be useful to replicate what you have above at: https://github.com/NOAA-EMC/WW3/issues.

@sbanihash
Copy link

sbanihash commented Feb 28, 2024

@BijuThomas-NOAA I will be working on this issue today and will test your suggestion as well. I'll let you know by tomorrow if these fixes could be implemented. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugzilla Operational HAFS bugzilla items enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants