source: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/histo_o500_pctau.F90 @ 2404

Last change on this file since 2404 was 1992, checked in by lguez, 11 years ago

Converted to free source form files in libf/phylmd which were still in
fixed source form. The conversion was done using the polish mode of
the NAG Fortran Compiler.

In addition to converting to free source form, the processing of the
files also:

-- indented the code (including comments);

-- set Fortran keywords to uppercase, and set all other identifiers
to lower case;

-- added qualifiers to end statements (for example "end subroutine
conflx", instead of "end");

-- changed the terminating statements of all DO loops so that each
loop ends with an ENDDO statement (instead of a labeled continue).

-- replaced #include by include.

  • 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
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1
2! $Header$
3
4SUBROUTINE histo_o500_pctau(nbreg, pct_ocean, w, histo, histow, nhisto)
5  USE dimphy
6  IMPLICIT NONE
7
8  INTEGER :: ij, k, l, nw
9  INTEGER :: nreg, nbreg
10  ! ym#include "dimensions.h"
11  ! ym#include "dimphy.h"
12  INTEGER, PARAMETER :: kmax = 8, lmax = 8
13  INTEGER, PARAMETER :: kmaxm1 = kmax - 1, lmaxm1 = lmax - 1
14  INTEGER, PARAMETER :: iwmax = 40
15
16  INTEGER, DIMENSION (klon) :: iw
17  REAL, DIMENSION (klon) :: w
18  REAL, PARAMETER :: wmin = -200., pas_w = 10.
19  REAL, DIMENSION (kmaxm1, lmaxm1, iwmax, nbreg) :: histow, nhisto
20  REAL, DIMENSION (klon, kmaxm1, lmaxm1) :: histo
21
22  ! LOGICAL, dimension(klon,nbreg) :: pct_ocean
23  INTEGER, DIMENSION (klon, nbreg) :: pct_ocean
24
25  ! initialisation
26  histow(:, :, :, :) = 0.
27  nhisto(:, :, :, :) = 0.
28
29  ! calcul de l'histogramme de chaque regime dynamique
30  DO nreg = 1, nbreg
31    DO ij = 1, klon
32      iw(ij) = int((w(ij)-wmin)/pas_w) + 1
33      ! IF(pct_ocean(ij,nreg)) THEN
34      ! IF(pct_ocean(ij,nreg).EQ.1) THEN
35      IF (iw(ij)>=1 .AND. iw(ij)<=iwmax) THEN
36        DO l = 1, lmaxm1
37          DO k = 1, kmaxm1
38            IF (histo(ij,k,l)>0.) THEN
39              histow(k, l, iw(ij), nreg) = histow(k, l, iw(ij), nreg) + &
40                histo(ij, k, l)*pct_ocean(ij, nreg)
41              nhisto(k, l, iw(ij), nreg) = nhisto(k, l, iw(ij), nreg) + &
42                pct_ocean(ij, nreg)
43            END IF
44          END DO !k
45        END DO !l
46        ! ELSE IF (iw(ij).LE.0.OR.iw(ij).GT.iwmax) THEN !iw
47        ! PRINT*,'ij,iw=',ij,iw(ij)
48      END IF !iw
49      ! ENDIF !pct_ocean
50    END DO !ij
51    ! normalisation
52    DO nw = 1, iwmax
53      DO l = 1, lmaxm1
54        DO k = 1, kmaxm1
55          IF (nhisto(k,l,nw,nreg)/=0.) THEN
56            histow(k, l, nw, nreg) = 100.*histow(k, l, nw, nreg)/ &
57              nhisto(k, l, nw, nreg)
58            ! PRINT*,'k,l,nw,nreg,histoW',k,l,nw,nreg,
59            ! &     histoW(k,l,nw,nreg)
60          END IF
61        END DO !k
62      END DO !l
63    END DO !nw
64  END DO !nreg
65
66  RETURN
67END SUBROUTINE histo_o500_pctau
Note: See TracBrowser for help on using the repository browser.