Skip to content

Commit 990ee11

Browse files
Deallocate the "array_lsw" array in read_gps.f90 before allocating it again if it is previously allocated.
1 parent a4a0fea commit 990ee11

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/gsi/read_gps.f90

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,11 @@ subroutine read_gps(nread,ndata,nodata,infile,lunout,obstype,twind, &
335335
if(ncnumgrp(ikx) > 0 )then ! cross validation on
336336
if(mod(nmrecs,ncnumgrp(ikx))== ncgroup(ikx)-1)usage=ncmiter(ikx)
337337
end if
338-
338+
339+
! Deallocate the "array_lsw" array if it is previously allocated
340+
if (allocated(array_lsw)) then
341+
deallocate(array_lsw)
342+
end if
339343
! New LSW Check
340344
allocate(array_lsw(levs),array_fraclsw(levs),array_impact(levs), &
341345
sorted_lsw(levs),sorted_fraclsw(levs),sorted_impact(levs), &

0 commit comments

Comments
 (0)