source: LMDZ6/branches/IPSL-CM6A-MR/tools/Max_diff_nc_with_lib/NR_util/diagmult.f90

Last change on this file 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: 774 bytes
Line 
1MODULE diagmult_m
2
3  IMPLICIT NONE
4
5  INTERFACE diagmult
6     MODULE PROCEDURE diagmult_rv,diagmult_r
7  END INTERFACE
8
9  private diagmult_rv,diagmult_r
10
11CONTAINS
12
13  SUBROUTINE diagmult_rv(mat,diag)
14    use assert_eq_m, only: assert_eq
15    REAL, DIMENSION(:,:), INTENT(INOUT) :: mat
16    REAL, DIMENSION(:), INTENT(IN) :: diag
17    INTEGER j,n
18    n = assert_eq(size(diag),min(size(mat,1),size(mat,2)),'diagmult_rv')
19    do j=1,n
20       mat(j,j)=mat(j,j)*diag(j)
21    end do
22  END SUBROUTINE diagmult_rv
23  !BL
24  SUBROUTINE diagmult_r(mat,diag)
25    REAL, DIMENSION(:,:), INTENT(INOUT) :: mat
26    REAL, INTENT(IN) :: diag
27    INTEGER j,n
28    n = min(size(mat,1),size(mat,2))
29    do j=1,n
30       mat(j,j)=mat(j,j)*diag
31    end do
32  END SUBROUTINE diagmult_r
33
34END MODULE diagmult_m
Note: See TracBrowser for help on using the repository browser.