source: LMDZ6/trunk/libf/dyn3d_common/flumass.f90 @ 5403

Last change on this file since 5403 was 5285, checked in by abarral, 6 weeks ago

As discussed internally, remove generic ONLY: ... for new _mod_h modules

  • 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.8 KB
Line 
1SUBROUTINE flumass (massebx,masseby, vcont, ucont, pbaru, pbarv )
2!
3!-------------------------------------------------------------------------------
4! Authors: P. Le Van , Fr. Hourdin.
5!-------------------------------------------------------------------------------
6! Purpose: Compute mass flux at s levels.
7  USE comgeom_mod_h
8  USE dimensions_mod, ONLY: iim, jjm, llm, ndm
9USE paramet_mod_h
10IMPLICIT NONE
11
12
13!===============================================================================
14! Arguments:
15  REAL, INTENT(IN)  :: massebx(ip1jmp1,llm)
16  REAL, INTENT(IN)  :: masseby(ip1jm  ,llm)
17  REAL, INTENT(IN)  :: vcont  (ip1jm  ,llm)
18  REAL, INTENT(IN)  :: ucont  (ip1jmp1,llm)
19  REAL, INTENT(OUT) :: pbaru  (ip1jmp1,llm)
20  REAL, INTENT(OUT) :: pbarv  (ip1jm  ,llm)
21!===============================================================================
22! Method used:   A 2 equations system is solved.
23!   * 1st one describes divergence computation at pole point nr. i (i=1 to im):
24!     (0.5*(pbaru(i)-pbaru(i-1))-pbarv(i))/aire(i) = - SUM(pbarv(n))/aire pole
25!   * 2nd one specifies that mean mass flux at pole is equal to 0:
26!     SUM(pbaru(n)*local_area(n))=0
27! This way, we determine additive constant common to pbary elements representing
28!   pbaru(0,j,l) in divergence computation equation for point i=1. (i=1 to im)
29!===============================================================================
30! Local variables:
31  REAL    :: sairen, saireun, ctn, ctn0, apbarun(iip1)
32  REAL    :: saires, saireus, cts, cts0, apbarus(iip1)
33  INTEGER :: l, i
34!===============================================================================
35  DO l=1,llm
36    pbaru(iip2:ip1jm,l)=massebx(iip2:ip1jm,l)*ucont(iip2:ip1jm,l)
37    pbarv(   1:ip1jm,l)=masseby(   1:ip1jm,l)*vcont(   1:ip1jm,l)
38  END DO
39
40  !--- NORTH POLE
41  sairen =SUM(aire (1:iim))
42  saireun=SUM(aireu(1:iim))
43  DO l = 1,llm
44    ctn=SUM(pbarv(1:iim,l))/sairen
45    pbaru(1,l)= pbarv(1,l)-ctn*aire(1)
46    DO i=2,iim
47      pbaru(i,l)=pbaru(i-1,l)+pbarv(i,l)-ctn*aire(i)
48    END DO
49    DO i=1,iim
50      apbarun(i)=aireu(i)*pbaru(i,l)
51    END DO
52    ctn0 = -SUM(apbarun(1:iim))/saireun
53    DO i = 1,iim
54      pbaru(i,l)=2.*(pbaru(i,l)+ctn0)
55    END DO
56    pbaru(iip1,l)=pbaru(1,l)
57  END DO
58
59  !--- SOUTH POLE
60  saires =SUM(aire (ip1jm+1:ip1jmp1-1))
61  saireus=SUM(aireu(ip1jm+1:ip1jmp1-1))
62  DO l = 1,llm
63    cts=SUM(pbarv(ip1jmi1+1:ip1jm-1,l))/saires
64    pbaru(1+ip1jm,l)=-pbarv(1+ip1jmi1,l)+cts*aire(1+ip1jm)
65    DO i=2,iim
66      pbaru(i+ip1jm,l)=pbaru(i-1+ip1jm,l)-pbarv(i+ip1jmi1,l)+cts*aire(i+ip1jm)
67    END DO
68    DO i=1,iim
69      apbarus(i)=aireu(i+ip1jm)*pbaru(i+ip1jm,l)
70    END DO
71    cts0 = -SUM(apbarus(1:iim))/saireus
72    DO i = 1,iim
73      pbaru(i+ip1jm,l)=2.*(pbaru(i+ip1jm,l)+cts0)
74    END DO
75    pbaru(ip1jmp1,l)=pbaru(1+ip1jm,l)
76  END DO
77
78END SUBROUTINE flumass
Note: See TracBrowser for help on using the repository browser.