- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a neat way of getting round this or am I confined to calling the copy procedure as a subroutine?
This is the procedure coded up.
module NameFlags
!*********************************************************************
! Name Flags
!*********************************************************************
implicit none
interface assignment (=)
module procedure nm_CopyFlg
end interface
contains
subroutine nm_CopyFlg(flgo,flgin)
!**********************************************************
! Copy Flag Array
!**********************************************************
implicit none
! Arguments
integer(2),allocatable,intent(inout) :: flgo(:)
integer(2),allocatable,intent(in) :: flgin(:)
! Local variables
integer :: ubout
integer :: ubin
integer :: ier
! Initialise
ier = 1
! Check size of output flag array
ubin = ubound(flgin,1)
if(allocated(flgo)) then
! Don't reallocate if it's the same size
ubout = ubound(flgo,1)
if(ubin.ne.ubout) then
deallocate(flgo)
allocate(flgo(ubin),stat=ier)
else
ier = 0
endif
else
allocate(flgo(ubin),stat=ier)
endif
! Copy data
if(ier.eq.0) then
flgo = flgin ! Group Flags
endif
return
end subroutine
end module
Perhaps I am asking too much but it would be much neater to write:pln%flg = pln1%flg
rather than
call nm_CopyFlg(pln%flg,pln1%flg)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page