hafs-community / HAFS

Hurricane Analysis and Forecast System
Other
36 stars 57 forks source link

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

Open BinLiu-NOAA opened 10 months ago

BinLiu-NOAA commented 10 months ago

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_IPw3expo 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_IPw3expo 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:

BijuThomas-NOAA commented 9 months ago

@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 commented 9 months ago

@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 commented 9 months ago

Hi @BijuThomas-NOAA, how can I help?

MatthewMasarik-NOAA commented 9 months ago

@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 commented 9 months ago

@MatthewMasarik-NOAA Thanks!

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

Issue 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 commented 9 months ago

@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 commented 9 months ago

@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 commented 7 months ago

@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!