ROMS
Loading...
Searching...
No Matches
nrutil::reallocate Interface Reference

Public Member Functions

real(r4) function, dimension(:), pointer reallocate_rv (p, n)
 
real(r4) function, dimension(:,:), pointer reallocate_rm (p, n, m)
 
integer(i8b) function, dimension(:), pointer reallocate_iv (p, n)
 
integer(i8b) function, dimension(:,:), pointer reallocate_im (p, n, m)
 
character(len=1) function, dimension(:), pointer reallocate_hv (p, n)
 

Detailed Description

Definition at line 37 of file nrutil.F.

Member Function/Subroutine Documentation

◆ reallocate_hv()

character (len=1) function, dimension(:), pointer nrutil::reallocate::reallocate_hv ( character (len=1), dimension(:), pointer p,
integer(i8b), intent(in) n )

Definition at line 385 of file nrutil.F.

386!
387!=======================================================================
388! !
389! Reallocate a pointer of a character vector to a new size, !
390! preserving its previous content. !
391! !
392!=======================================================================
393!
394! Imported variable declarations.
395!
396 character (len=1), pointer :: p(:)
397 character (len=1), pointer :: reallocate_hv(:)
398
399 integer(i8b), intent(in) :: n
400!
401! Local variable declarations.
402!
403 integer(i8b) :: nold, ierr
404!
405!-----------------------------------------------------------------------
406! Reallocate pointer for a integer vector.
407!-----------------------------------------------------------------------
408!
409 ALLOCATE (reallocate_hv(n),stat=ierr)
410 IF (ierr.ne.0) &
411 & CALL nrerror ('REALLOCATE_HV: error while allocating memory')
412 IF (.not.ASSOCIATED(p)) RETURN
413 nold=SIZE(p)
414 reallocate_hv(1:min(nold,n))=p(1:min(nold,n))
415 DEALLOCATE (p)
416
417 RETURN

References nrutil::nrerror(), and nrutil::reallocate_hv().

Here is the call graph for this function:

◆ reallocate_im()

integer(i8b) function, dimension(:,:), pointer nrutil::reallocate::reallocate_im ( integer(i8b), dimension(:,:), pointer p,
integer(i8b), intent(in) n,
integer(i8b), intent(in) m )

Definition at line 457 of file nrutil.F.

458!
459!=======================================================================
460! !
461! Reallocate a pointer of a integer matrix to a new size, preserving !
462! its previous content. !
463! !
464!=======================================================================
465!
466! Imported variable declarations.
467!
468 integer(i8b), pointer :: p(:,:)
469 integer(i8b), pointer :: reallocate_im(:,:)
470
471 integer(i8b), intent(in) :: n, m
472!
473! Local variable declarations.
474!
475 integer(i8b) :: nold, mold, ierr
476!
477!-----------------------------------------------------------------------
478! Reallocate pointer for a integer matrix.
479!-----------------------------------------------------------------------
480!
481 ALLOCATE (reallocate_im(n,m), stat=ierr)
482 IF (ierr.ne.0) &
483 & CALL nrerror ('REALLOCATE_IM: error while allocating memory')
484 IF (.not.ASSOCIATED(p)) RETURN
485 nold=SIZE(p,1)
486 mold=SIZE(p,2)
487 reallocate_im(1:min(nold,n),1:min(mold,m))= &
488 & p(1:min(nold,n),1:min(mold,m))
489 DEALLOCATE (p)
490
491 RETURN

References nrutil::nrerror(), and nrutil::reallocate_im().

Here is the call graph for this function:

◆ reallocate_iv()

integer(i8b) function, dimension(:), pointer nrutil::reallocate::reallocate_iv ( integer(i8b), dimension(:), pointer p,
integer(i8b), intent(in) n )

Definition at line 350 of file nrutil.F.

351!
352!=======================================================================
353! !
354! Reallocate a pointer of a integer vector to a new size, preserving !
355! its previous content. !
356! !
357!=======================================================================
358!
359! Imported variable declarations.
360!
361 integer(i8b), pointer :: p(:)
362 integer(i8b), pointer :: reallocate_iv(:)
363
364 integer(i8b), intent(in) :: n
365!
366! Local variable declarations.
367!
368 integer(i8b) :: nold, ierr
369!
370!-----------------------------------------------------------------------
371! Reallocate pointer for a integer vector.
372!-----------------------------------------------------------------------
373!
374 ALLOCATE (reallocate_iv(n), stat=ierr)
375 IF (ierr.ne.0) &
376 & CALL nrerror ('REALLOCATE_IV: error while allocating memory')
377 IF (.not.ASSOCIATED(p)) RETURN
378 nold=SIZE(p)
379 reallocate_iv(1:min(nold,n))=p(1:min(nold,n))
380 DEALLOCATE (p)
381
382 RETURN

References nrutil::nrerror(), and nrutil::reallocate_iv().

Here is the call graph for this function:

◆ reallocate_rm()

real(r4) function, dimension(:,:), pointer nrutil::reallocate::reallocate_rm ( real(r4), dimension(:,:), pointer p,
integer(i8b), intent(in) n,
integer(i8b), intent(in) m )

Definition at line 420 of file nrutil.F.

421!
422!=======================================================================
423! !
424! Reallocate a pointer of a single precision matrix to a new size, !
425! preserving its previous content. !
426! !
427!=======================================================================
428!
429! Imported variable declarations.
430!
431 real(r4), pointer :: p(:,:)
432 real(r4), pointer :: reallocate_rm(:,:)
433
434 integer(i8b), intent(in) :: n, m
435!
436! Local variable declarations.
437!
438 integer(i8b) :: nold, mold, ierr
439!
440!-----------------------------------------------------------------------
441! Reallocate pointer for a single precision matrix.
442!-----------------------------------------------------------------------
443!
444 ALLOCATE (reallocate_rm(n,m), stat=ierr)
445 IF (ierr.ne.0) &
446 & CALL nrerror ('REALLOCATE_RM: error while allocating memory')
447 IF (.not.ASSOCIATED(p)) RETURN
448 nold=SIZE(p,1)
449 mold=SIZE(p,2)
450 reallocate_rm(1:min(nold,n),1:min(mold,m))= &
451 & p(1:min(nold,n),1:min(mold,m))
452 DEALLOCATE (p)
453
454 RETURN

References nrutil::nrerror(), and nrutil::reallocate_rm().

Here is the call graph for this function:

◆ reallocate_rv()

real(r4) function, dimension(:), pointer nrutil::reallocate::reallocate_rv ( real(r4), dimension(:), pointer p,
integer(i8b), intent(in) n )

Definition at line 315 of file nrutil.F.

316!
317!=======================================================================
318! !
319! Reallocate a pointer of a single precision vector to a new size, !
320! preserving its previous content. !
321! !
322!=======================================================================
323!
324! Imported variable declarations.
325!
326 real(r4), pointer :: p(:)
327 real(r4), pointer :: reallocate_rv(:)
328
329 integer(i8b), intent(in) :: n
330!
331! Local variable declarations.
332!
333 integer(i8b) :: nold, ierr
334!
335!-----------------------------------------------------------------------
336! Reallocate pointer for a single precision vector.
337!-----------------------------------------------------------------------
338!
339 ALLOCATE (reallocate_rv(n), stat=ierr)
340 IF (ierr.ne.0) &
341 & CALL nrerror ('REALLOCATE_RV: error while allocating memory')
342 IF (.not.ASSOCIATED(p)) RETURN
343 nold=SIZE(p)
344 reallocate_rv(1:min(nold,n))=p(1:min(nold,n))
345 DEALLOCATE (p)
346
347 RETURN

References nrutil::nrerror(), and nrutil::reallocate_rv().

Here is the call graph for this function:

The documentation for this interface was generated from the following file: