Skip to content

Commit

Permalink
Merge pull request #2 from climbfuji/gcycle_tanya_update_from_dom_2
Browse files Browse the repository at this point in the history
Increase length of message and update declaration in qcmxmn to avoid writing out of bounds
  • Loading branch information
tanyasmirnova committed Sep 3, 2020
2 parents 7669914 + e19d00d commit 32ffcfb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions physics/sfcsub.F
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ function message(prefix,index)
implicit none
character(len=*), intent(in) :: prefix
integer, intent(in) :: index
character(len=10) :: message
!
! probably need to implement a check that len(prefix) + '-' + length of
! string representation of index <= len(message)
! Safety measure: prevent writing out of bounds, use a longer string
character(len=128) :: message
write(message,fmt='(a,a,i0)') trim(prefix), '-', index
end function message

Expand Down Expand Up @@ -5234,7 +5232,7 @@ subroutine qcmxmn(ttl,fld,slimsk,sno,iceflg, &
& ij,nprt,kmaxs,kmins,i,me,len,mode
parameter(mmprt=2)
!
character*8 ttl
character(len=*) ttl
logical iceflg(len)
real (kind=kind_io8) fld(len),slimsk(len),sno(len), &
& rla(len), rlo(len)
Expand Down

0 comments on commit 32ffcfb

Please sign in to comment.