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

Bugzilla 1604 - Executable wafs_upp.x failed ehen compiling with "-check all -ftrapuv" from f000 to f048 #83

Open
YaliMao-NOAA opened this issue Dec 2, 2024 · 9 comments

Comments

@YaliMao-NOAA
Copy link
Collaborator

YaliMao-NOAA commented Dec 2, 2024

From bugzilla 1604

During wafs.v7.0.0 IT test, job wafs_upp failed with with "-check all -ftrapuv" from f000 to f048, but completed from f054 to f120. The output shows bunch of warning messages and eventually aborted:

forrtl: warning (406): fort: (1): In call to ICING_ALGO, an array temporary was created for argument #10 (with all different number)

After compiling with "-check all" flag, the executable failed with following message:

Dummy character variable 'VALIDTIME' has length 13 which is greater than actual variable length -3689348814741910324

No sure how this negative number comes up and only failed from f000 to f048 as well.

Please update the source code to let job run through when compiling "-check all -ftrapuv" flag in next upgrade.
@YaliMao-NOAA YaliMao-NOAA changed the title Bugzilla 1604 - Executable wafs_upp.x failed ehen compiling with "-check all --ftrapuv" from f000 to f048 Bugzilla 1604 - Executable wafs_upp.x failed ehen compiling with "-check all -ftrapuv" from f000 to f048 Dec 3, 2024
@YaliMao-NOAA
Copy link
Collaborator Author

YaliMao-NOAA commented Dec 3, 2024

@aerorahul I debug the issues which are associated with some knowledge that I don't unserstand well.

  1. In call to ICING_ALGO, an array temporary was created for argument ###.
    This is not a runtime warning, it actually gets aborted.
    Reason - passing strided array to a subroutine, for example x(i,j,1:nz)
    Fix - creating a temporary array, y(1:nz)=x(i,j,1:nz), then passing y to the subroutine

  2. Dummy character variable 'VALIDTIME' has length 13 which is greater than actual variable length
    Reason - there is a bug in gtg code to print VALIDTIME though it's not an input for GFS GTG
    Fix - delete the line of printing VALIDTIME in gtg_algo.f90

Question, the grib2 outputs are close to each other but not bit-wise identical when compiling with and without the option "-check all -ftrapuv". Is it normail?

@YaliMao-NOAA
Copy link
Collaborator Author

YaliMao-NOAA commented Dec 3, 2024

Here is the detail to fix temporary arrays for ICING_ALGO. In MDLFLD.f

  1. Add intermediate 1-dimension arrays:
    real, dimension(lm) :: pres,temp,rh1d,height,omega,w,qq,cwat,qww,qii,qrr,qss,qgg
    real, dimension(lm) :: gfip, gfis

  2. Assign strided arrays to the 1-dimension arrays
    pres=pmid(i,j,1:lm)
    temp=T(i,j,1:lm)
    rh1d=RH3D(i,j,1:lm)
    height=ZMID(i,j,1:lm)
    omega=OMGA(i,j,1:lm)
    w=wh(i,j,1:lm)
    qq=q(i,j,1:lm)
    cwat=CWM(I,J,1:lm)
    qww=qqw(i,j,1:lm)
    qii=qqi(i,j,1:lm)
    qrr=qqr(i,j,1:lm)
    qss=qqs(i,j,1:lm)
    qgg=qqg(i,j,1:lm)

  3. Pass the 1-dimension arrays to subroutine ICING_ALGO.
    CALL ICING_ALGO(i,j,pres,temp,rh1d,height,omega,w &
    ,qq,cwat,qww, qii,qrr,qss,qgg &
    ,lm,gdlat(i,j),gdlon(i,j),zint(i,j,lp1) &
    ,prec(i,j),cprate(i,j),cape(i,j),cin(i,j) &
    ,icing_gfip(i,j,1:lm),icing_gfis(i,j,1:lm))
    icing_gfip(i,j,1:lm)=gfip
    icing_gfis(i,j,1:lm)=gfis

@aerorahul
Copy link
Contributor

@YaliMao-NOAA I was going to say, check the updated code in develop of UPP and see if there are any relevant changes there. I know effort was put to eliminate warnings there. @WenMeng-NOAA would know for sure.

@WenMeng-NOAA
Copy link

@YaliMao-NOAA @aerorahul WAFS v7 is using the UPP version from the branch "release/gfs_v16" which hasn't been implemented with CMake.

@aerorahul
Copy link
Contributor

@WenMeng-NOAA I don't think CMake build is needed to address the warnings in the fortran code.
I think comparing the fortran codes MDLFLD.f between the UPP develop and WAFSv7 tag of UPP will lead to identifying the fixes needed.

Also, note to NCO that WAFSv7 is a separation from GFS without making code changes, which may change results. This hopefully will not stop WAFSv7, and hopefully will get resolved when WAFS updates for GFSv17 model output.

@WenMeng-NOAA
Copy link

The UPP develop branch has been implemented "-check all -ftrapuv" for debug mode. (See here)

@aerorahul
Copy link
Contributor

CMake is not needed for WAFSv7. The flags can be added in the makefile_module_wcoss2 by defining DEBUG=-check all -ftrapuv when compiling in debug mode.

@YaliMao-NOAA
Copy link
Collaborator Author

This bugzilla is not for the incoming WAFS separation implementation. It is for the next version of WAFS for the incoming GFSv17, WAFS is going to use the most version of UPP which uses CMake

@WenMeng-NOAA
Copy link

@YaliMao-NOAA You might let NCO know that the issue will be solved in GFS V17 implementation. The fix has already been applied in the UPP develop branch which is targeting GFS V17.

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

No branches or pull requests

3 participants