Skip to content

Commit

Permalink
Fix Out of Bound Exception in GFSPOST.F (NOAA-EMC#100)
Browse files Browse the repository at this point in the history
* Fix out-of-bound error in tpause routine in GFSPOST.F

* Fix use of undefined variables.
  • Loading branch information
DusanJovic-NOAA authored and fossell committed Mar 12, 2020
1 parent cf9db90 commit 937946f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sorc/ncep_post.fd/GFSPOST.F
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ subroutine tpause(km,p,u,v,t,h,ptp,utp,vtp,ttp,htp,shrtp)
integer klim(2),k,kd,ktp
! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
! find tropopause level
call rsearch1(km-2,p(2),2,ptplim(1),klim(1))
call rsearch1(km-2,p(2),2,ptplim,klim)
klim(1)=klim(1)+1
klim(2)=klim(2)+2
! klim(1) > klim(2) or loops does not run ; klim(2) has a
Expand Down Expand Up @@ -519,7 +519,7 @@ subroutine mxwind(km,p,u,v,t,h,pmw,umw,vmw,tmw,hmw)
real spd(km),spdmw,wmw,dhd,dhu,shrd,shru,dhmw,ub,vb,spdb
! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
! find maximum wind level
call rsearch1(km,p(1),2,pmwlim(1),klim(1))
call rsearch1(km,p(1),2,pmwlim,klim)
! klim(1)=klim(1)+1
klim(2)=klim(2)+1
! spd(klim(1):klim(2))=sqrt(u(klim(1):klim(2))**2+v(klim(1):klim(2))**2)
Expand Down
4 changes: 2 additions & 2 deletions sorc/ncep_post.fd/INITPOST_GFS_NETCDF.f
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ SUBROUTINE INITPOST_GFS_NETCDF(ncid3d)
! DECLARE VARIABLES.
!
! REAL fhour
integer nfhour ! forecast hour from nems io file
! integer nfhour ! forecast hour from nems io file
integer fhzero !bucket
real dtp !physics time step
REAL RINC(5)
Expand Down Expand Up @@ -573,7 +573,7 @@ SUBROUTINE INITPOST_GFS_NETCDF(ncid3d)
deallocate(glat1d,glon1d)

print*,'idate = ',(idate(i),i=1,7)
!print*,'nfhour = ',nfhour
! print*,'nfhour = ',nfhour

! sample print point
ii = im/2
Expand Down

0 comments on commit 937946f

Please sign in to comment.