[1765] | 1 | MODULE array_copy_m |
---|
| 2 | |
---|
| 3 | IMPLICIT NONE |
---|
| 4 | |
---|
| 5 | INTERFACE array_copy |
---|
| 6 | MODULE PROCEDURE array_copy_r, array_copy_d, array_copy_i |
---|
| 7 | END INTERFACE |
---|
| 8 | |
---|
| 9 | private array_copy_r, array_copy_d, array_copy_i |
---|
| 10 | |
---|
| 11 | CONTAINS |
---|
| 12 | |
---|
| 13 | SUBROUTINE array_copy_r(src,dest,n_copied,n_not_copied) |
---|
| 14 | REAL, DIMENSION(:), INTENT(IN) :: src |
---|
| 15 | REAL, DIMENSION(:), INTENT(OUT) :: dest |
---|
| 16 | INTEGER, INTENT(OUT) :: n_copied, n_not_copied |
---|
| 17 | n_copied=min(size(src),size(dest)) |
---|
| 18 | n_not_copied=size(src)-n_copied |
---|
| 19 | dest(1:n_copied)=src(1:n_copied) |
---|
| 20 | END SUBROUTINE array_copy_r |
---|
| 21 | !BL |
---|
| 22 | SUBROUTINE array_copy_d(src,dest,n_copied,n_not_copied) |
---|
| 23 | double precision, DIMENSION(:), INTENT(IN) :: src |
---|
| 24 | double precision, DIMENSION(:), INTENT(OUT) :: dest |
---|
| 25 | INTEGER, INTENT(OUT) :: n_copied, n_not_copied |
---|
| 26 | n_copied=min(size(src),size(dest)) |
---|
| 27 | n_not_copied=size(src)-n_copied |
---|
| 28 | dest(1:n_copied)=src(1:n_copied) |
---|
| 29 | END SUBROUTINE array_copy_d |
---|
| 30 | !BL |
---|
| 31 | SUBROUTINE array_copy_i(src,dest,n_copied,n_not_copied) |
---|
| 32 | INTEGER, DIMENSION(:), INTENT(IN) :: src |
---|
| 33 | INTEGER, DIMENSION(:), INTENT(OUT) :: dest |
---|
| 34 | INTEGER, INTENT(OUT) :: n_copied, n_not_copied |
---|
| 35 | n_copied=min(size(src),size(dest)) |
---|
| 36 | n_not_copied=size(src)-n_copied |
---|
| 37 | dest(1:n_copied)=src(1:n_copied) |
---|
| 38 | END SUBROUTINE array_copy_i |
---|
| 39 | |
---|
| 40 | END MODULE array_copy_m |
---|