source: LMDZ5/trunk/tools/Max_diff_nc_with_lib/NR_util/get_diag.f90 @ 1907

Last change on this file since 1907 was 1907, checked in by lguez, 10 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: 844 bytes
Line 
1MODULE get_diag_m
2
3  IMPLICIT NONE
4
5  INTERFACE get_diag
6     MODULE PROCEDURE get_diag_rv, get_diag_dv
7  END INTERFACE
8
9  private get_diag_rv, get_diag_dv
10
11CONTAINS
12
13  FUNCTION get_diag_rv(mat)
14    use assert_eq_m, only: assert_eq
15    REAL, DIMENSION(:,:), INTENT(IN) :: mat
16    REAL, DIMENSION(size(mat,1)) :: get_diag_rv
17    INTEGER j, n
18    n=assert_eq(size(mat,1),size(mat,2),'get_diag_rv')
19    do j=1, n
20       get_diag_rv(j)=mat(j,j)
21    end do
22  END FUNCTION get_diag_rv
23  !BL
24  FUNCTION get_diag_dv(mat)
25    use assert_eq_m, only: assert_eq
26    DOUBLE PRECISION, DIMENSION(:,:), INTENT(IN) :: mat
27    DOUBLE PRECISION, DIMENSION(size(mat,1)) :: get_diag_dv
28    INTEGER j, n
29    n=assert_eq(size(mat,1),size(mat,2),'get_diag_dv')
30    do j=1, n
31       get_diag_dv(j)=mat(j,j)
32    end do
33  END FUNCTION get_diag_dv
34
35END MODULE get_diag_m
Note: See TracBrowser for help on using the repository browser.