Last change
on this file since 4772 was
1907,
checked in by lguez, 11 years ago
|
Added a copyright property to every file of the distribution, except
for the fcm files (which have their own copyright). Use svn propget on
a file to see the copyright. For instance:
$ svn propget copyright libf/phylmd/physiq.F90
Name of program: LMDZ
Creation date: 1984
Version: LMDZ5
License: CeCILL version 2
Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
See the license file in the root directory
Also added the files defining the CeCILL version 2 license, in French
and English, at the top of the LMDZ tree.
|
-
Property copyright set to
Name of program: LMDZ Creation date: 1984 Version: LMDZ5 License: CeCILL version 2 Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539 See the license file in the root directory
|
File size:
1.1 KB
|
Rev | Line | |
---|
[1765] | 1 | MODULE poly_term_m |
---|
| 2 | |
---|
| 3 | IMPLICIT NONE |
---|
| 4 | |
---|
| 5 | INTEGER, PARAMETER, private:: NPAR_POLYTERM=8 |
---|
| 6 | |
---|
| 7 | INTERFACE poly_term |
---|
| 8 | MODULE PROCEDURE poly_term_rr, poly_term_cc |
---|
| 9 | END INTERFACE |
---|
| 10 | |
---|
| 11 | private poly_term_rr,poly_term_cc |
---|
| 12 | |
---|
| 13 | CONTAINS |
---|
| 14 | |
---|
| 15 | RECURSIVE FUNCTION poly_term_rr(a,b) RESULT(u) |
---|
| 16 | REAL, DIMENSION(:), INTENT(IN) :: a |
---|
| 17 | REAL, INTENT(IN) :: b |
---|
| 18 | REAL, DIMENSION(size(a)) :: u |
---|
| 19 | INTEGER n,j |
---|
| 20 | n=size(a) |
---|
| 21 | if (n <= 0) RETURN |
---|
| 22 | u(1)=a(1) |
---|
| 23 | if (n < NPAR_POLYTERM) then |
---|
| 24 | do j=2,n |
---|
| 25 | u(j)=a(j)+b*u(j-1) |
---|
| 26 | end do |
---|
| 27 | else |
---|
| 28 | u(2:n:2)=poly_term_rr(a(2:n:2)+a(1:n-1:2)*b,b*b) |
---|
| 29 | u(3:n:2)=a(3:n:2)+b*u(2:n-1:2) |
---|
| 30 | end if |
---|
| 31 | END FUNCTION poly_term_rr |
---|
| 32 | !BL |
---|
| 33 | RECURSIVE FUNCTION poly_term_cc(a,b) RESULT(u) |
---|
| 34 | COMPLEX, DIMENSION(:), INTENT(IN) :: a |
---|
| 35 | COMPLEX, INTENT(IN) :: b |
---|
| 36 | COMPLEX, DIMENSION(size(a)) :: u |
---|
| 37 | INTEGER n,j |
---|
| 38 | n=size(a) |
---|
| 39 | if (n <= 0) RETURN |
---|
| 40 | u(1)=a(1) |
---|
| 41 | if (n < NPAR_POLYTERM) then |
---|
| 42 | do j=2,n |
---|
| 43 | u(j)=a(j)+b*u(j-1) |
---|
| 44 | end do |
---|
| 45 | else |
---|
| 46 | u(2:n:2)=poly_term_cc(a(2:n:2)+a(1:n-1:2)*b,b*b) |
---|
| 47 | u(3:n:2)=a(3:n:2)+b*u(2:n-1:2) |
---|
| 48 | end if |
---|
| 49 | END FUNCTION poly_term_cc |
---|
| 50 | |
---|
| 51 | END MODULE poly_term_m |
---|
Note: See
TracBrowser
for help on using the repository browser.