Opened 11 years ago

Closed 11 years ago

#329 closed defect (fixed)

Pointer allocation warning in ropp_1dvar

Reported by: Ian Culverwell Owned by: Ian Culverwell
Priority: normal Milestone: 7.0
Component: ropp_1dvar Version: 7.0
Keywords: pointer warning Cc: sti

Description

ropp_1dvar says

WARNING (from ropp_1dvar_refrac): Pointer to full matrix already associated - deallocating.

Why? It doesn't (apparently ...) cause any problems, but we should probably get to the bottom of this.

Change history (2)

comment:1 by Ian Culverwell, 11 years ago

The problem appears to be that pointer array covar is allocated before the call to matrix_pp2full_alloc for ropp_1dvar_covar_bg.f90.

! Select covariance matrix with same dimensions as variable sigma ALLOCATE(covar(SIZE(sigma,1),SIZE(sigma,1))) CALL matrix_pp2full_alloc(corcov(idx_lat) % corr, covar)

This means covar is ASSOCIATED. But these routines check (array=covar)

if (associated(array)) then

call message(msg_warn, &

'Pointer to full matrix already associated - deallocating.\n')

deallocate(array)

endif

and hence we get the warning. Solution? Don't allocate covar in the calling routine ropp_ropp_1dvar_covar_bg.f90 (but keep deallocating it afterwards). See r3787 for details.

comment:2 by Ian Culverwell, 11 years ago

Milestone: 8.07.0
Resolution: fixed
Status: newclosed

Seems to work OK: warning messages gone, and nc files bit compatible.

Closing ticket - will be incorporated in ROPP7.0.

Note: See TracTickets for help on using tickets.