source: LMDZ.3.3/branches/rel-LF/libf/dyn3d/cal_br_st.F @ 546

Last change on this file since 546 was 2, checked in by lmdz, 25 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1      SUBROUTINE cal_br_st(nx,im,jm,px,paire,pxav,pxst)
2      IMPLICIT NONE
3
4c=======================================================================
5c
6c   Auteur:    Frederic Hourdin         01/01/91
7c   -------
8c
9c   Objet:     Decomposition d'un champ meteorologique  sous
10c   ------         x   =  < x >  +   x'
11c              ou < x > est la moyenne zonale du champ
12c
13c              en fait pour un champ x(nlong,nlat) on n'effectue la
14c              moyenne que sur les nomg-1 premiere longitude
15c
16c   Interface:
17c   ----------
18c
19c   Input:
20c   ------
21c
22c      nlong              nombre de longitude
23c      nlat               nombre de latitudes a decomposer
24c      px(nlong,nlat)     champ d'entre
25c
26c   Output:
27c   -------
28c
29c      pxav(nlong,nlat)   champ moyen
30c      pxst(nlong,nlat)   ecart a la moyenne
31c
32c=======================================================================
33
34c-----------------------------------------------------------------------
35c   0.Declarations:
36c   ---------------
37
38c   Arguments:
39c   ----------
40
41#include "dimensions.h"
42      INTEGER im,jm,nx
43      REAL paire(im+1,jm)
44      REAL px(im+1,jm,nx),pxav(jm,nx),pxst(im+1,jm,nx)
45
46c   Local:
47c   ------
48
49      REAL znorm(jjm+1)
50      INTEGER i,j,ix
51      EXTERNAL SSUM
52      REAL SSUM
53
54c-----------------------------------------------------------------------
55c   1. Initialisations:
56c   -------------------
57
58c-----------------------------------------------------------------------
59c   2. Calcul du champ moyen:
60c   -------------------------
61
62      DO j=1,jm
63         znorm(j)=1./SSUM(iim,paire(1,j),1)
64      ENDDO
65      DO ix=1,nx
66         DO j=1,jm
67            pxav(j,ix)=0.
68            DO i=1,im
69               pxav(j,ix)=pxav(j,ix)+paire(i,j)*px(i,j,ix)
70            ENDDO
71            pxav(j,ix)=pxav(j,ix)*znorm(j)
72         ENDDO
73      ENDDO
74
75c-----------------------------------------------------------------------
76c   3. Ecart a la moyenne:
77c   ----------------------
78
79      DO ix=1,nx
80         DO j=1,jm
81            DO i=1,im
82               pxst(i,j,ix)=px(i,j,ix)-pxav(j,ix)
83            ENDDO
84         ENDDO
85      ENDDO
86
87c-----------------------------------------------------------------------
88
89      RETURN
90      END
Note: See TracBrowser for help on using the repository browser.