source: LMDZ5/trunk/libf/dyn3dmem/flumass_loc.F90 @ 3411

Last change on this file since 3411 was 2336, checked in by dcugnet, 9 years ago
  • Add parallel capability for ce0l.
  • Small bug in grid_noro fixed (smoothed topography was used instead of unsmoothed one for geopotential computation at north pole).
  • Removed average of mass at poles in etat0dyn_netcdf after start_init_dyn => different results in the zoomed grid case.
  • ok_etat0=n and ok_limit=y combination now works fine (if no initial state is needed, but only limit.nc file). This required:
    • to move grid_noro0 and start_init_noro0 subroutines from etat0dyn_netcdf.F90 to limit_netcdf.F90
    • to create init_ssrf_m.F90 file, so that sub-surfaces can be initialized from limit_netcdf.F90 without any etat0*_netcdf routines call).
  • Simplified somehow the corresponding code, in particular: 1) removed obsolete flags "oldice". 2) removed flag "ibar": barycentric interpolation is used everywhere (except in start_init_subsurf, still calling grille_m - to be changed soon). 3) removed useless CPP_PHY precompilation directives, considering the possibility to run ce0l without physics is useless (ce0l is dedicated to Earth physics).
  • 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: 3.2 KB
Line 
1SUBROUTINE flumass_loc(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 parallel_lmdz
8  IMPLICIT NONE
9  include "dimensions.h"
10  include "paramet.h"
11  include "comgeom.h"
12!===============================================================================
13! Arguments:
14  REAL, INTENT(IN)  :: massebx(ijb_u:ije_u,llm)
15  REAL, INTENT(IN)  :: masseby(ijb_v:ije_v,llm)
16  REAL, INTENT(IN)  :: vcont  (ijb_v:ije_v,llm)
17  REAL, INTENT(IN)  :: ucont  (ijb_u:ije_u,llm)
18  REAL, INTENT(OUT) :: pbaru  (ijb_u:ije_u,llm)
19  REAL, INTENT(OUT) :: pbarv  (ijb_v:ije_v,llm)
20!===============================================================================
21! Method used:   A 2 equations system is solved.
22!   * 1st one describes divergence computation at pole point nr. i (i=1 to im):
23!     (0.5*(pbaru(i)-pbaru(i-1))-pbarv(i))/aire(i) = - SUM(pbarv(n))/aire pole
24!   * 2nd one specifies that mean mass flux at pole is equal to 0:
25!     SUM(pbaru(n)*local_area(n))=0
26! This way, we determine additive constant common to pbary elements representing
27!   pbaru(0,j,l) in divergence computation equation for point i=1. (i=1 to im)
28!===============================================================================
29! Local variables:
30  REAL    :: sairen, saireun, ctn, ctn0, apbarun(iim)
31  REAL    :: saires, saireus, cts, cts0, apbarus(iim)
32  INTEGER :: l, i, ij, ijb, ije
33!===============================================================================
34!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
35  DO l=1,llm
36
37    ijb=ij_begin
38    ije=ij_end+iip1
39    IF(pole_nord) ijb=ij_begin+iip1
40    IF(pole_sud)  ije=ij_end-iip1
41    pbaru(ijb:ije,l)=massebx(ijb:ije,l)*ucont(ijb:ije,l)
42
43    ijb=ij_begin-iip1
44    ije=ij_end+iip1
45    IF(pole_nord) ijb=ij_begin
46    IF(pole_sud)  ije=ij_end-iip1
47    pbarv(ijb:ije,l)=masseby(ijb:ije,l)*vcont(ijb:ije,l)
48
49  END DO
50!$OMP END DO NOWAIT
51
52  !--- North pole
53  IF(pole_nord) THEN
54    sairen =SUM(aire (1:iim))
55    saireun=SUM(aireu(1:iim))
56!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
57    DO l=1,llm
58      ctn=SUM(pbarv(1:iim,l))/sairen
59      pbaru(1,l)= pbarv(1,l)-ctn*aire(1)
60      DO i=2,iim
61        pbaru(i,l)=pbaru(i-1,l)+pbarv(i,l)-ctn*aire(i)
62      END DO
63      apbarun(:)=aireu(1:iim)*pbaru(1:iim,l)
64      ctn0 = -SUM(apbarun)/saireun
65      pbaru(1:iim,l)=2.*(pbaru(1:iim,l)+ctn0)
66      pbaru(iip1,l)=pbaru(1,l)
67    END DO
68!$OMP END DO NOWAIT             
69  END IF
70
71  !--- South pole
72  IF(pole_sud) THEN
73    saires =SUM(aire (ip1jm+1:ip1jmp1-1))
74    saireus=SUM(aireu(ip1jm+1:ip1jmp1-1))
75!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
76    DO l=1,llm
77      cts=SUM(pbarv(1+ip1jmi1:ip1jm-1,l))/saires
78      pbaru(1+ip1jm,l)=-pbarv(1+ip1jmi1,l)+cts*aire(1+ip1jm)
79      DO i=2,iim
80        pbaru(i+ip1jm,l)=pbaru(i-1+ip1jm,l)-pbarv(i+ip1jmi1,l)+cts*aire(i+ip1jm)
81      END DO
82      apbarus(:)=aireu(1+ip1jm:ip1jmp1-1)*pbaru(1+ip1jm:ip1jmp1-1,l)
83      cts0 = -SUM(apbarus)/saireus
84      pbaru(1+ip1jm:ip1jmp1-1,l)=2.*(pbaru(1+ip1jm:ip1jmp1-1,l)+cts0)
85      pbaru(ip1jmp1,l)=pbaru(1+ip1jm,l)
86    END DO
87!$OMP END DO NOWAIT         
88  END IF
89
90END SUBROUTINE flumass_loc
91
Note: See TracBrowser for help on using the repository browser.