File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ module library_mod
1414 procedure :: add_plan
1515 procedure :: refine
1616 procedure :: show
17+ procedure :: library_t_assignment
18+ generic :: assignment (= ) = > library_t_assignment
1719 end type library_t
1820 public :: library_t
1921contains
@@ -129,5 +131,21 @@ subroutine show(library)
129131 call library% rooms(i)% show()
130132 end do
131133 end subroutine show
134+ subroutine library_t_assignment (lhs , rhs )
135+ class(library_t), intent (out ) :: lhs
136+ class(library_t), intent (in ) :: rhs
137+ integer :: i
138+ if (.not. rhs% inited) return
139+ lhs% inited = .true.
140+ allocate (lhs% rooms(size (rhs% rooms)))
141+ allocate (lhs% plans(size (rhs% plans)))
142+ do i = 1 , size (lhs% rooms)
143+ lhs% rooms(i) = rhs% rooms(i)
144+ end do
145+ do i = 1 , size (lhs% plans)
146+ lhs% plans(i) = rhs% plans(i)
147+ end do
148+ lhs% current_plan = rhs% current_plan
149+ end subroutine library_t_assignment
132150
133151end module library_mod
You can’t perform that action at this time.
0 commit comments