source: LMDZ6/branches/DYNAMICO-conv-GC/tools/Max_diff_nc_with_lib/NR_util/diagadd.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: 768 bytes
Line 
1MODULE diagadd_m
2
3  IMPLICIT NONE
4
5  INTERFACE diagadd
6     MODULE PROCEDURE diagadd_rv,diagadd_r
7  END INTERFACE
8
9  private diagadd_rv,diagadd_r
10
11CONTAINS
12
13  SUBROUTINE diagadd_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)),'diagadd_rv')
19    do j=1,n
20       mat(j,j)=mat(j,j)+diag(j)
21    end do
22  END SUBROUTINE diagadd_rv
23  !BL
24  SUBROUTINE diagadd_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 diagadd_r
33
34END MODULE diagadd_m
Note: See TracBrowser for help on using the repository browser.