source: LMDZ5/trunk/libf/dyn3dmem/enercin_loc.F90 @ 2933

Last change on this file since 2933 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: 2.6 KB
Line 
1SUBROUTINE enercin_loc ( vcov, ucov, vcont, ucont, ecin )
2!
3!-------------------------------------------------------------------------------
4! Authors: P. Le Van.
5!-------------------------------------------------------------------------------
6! Purpose: Compute kinetic energy at sigma 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)  :: vcov    (ijb_v:ije_v,llm)
15  REAL, INTENT(IN)  :: ucov    (ijb_u:ije_u,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) :: ecin    (ijb_u:ije_u,llm)
19!===============================================================================
20! Notes:
21!                 . V
22!                i,j-1
23!
24!      alpha4 .       . alpha1
25!
26!
27!        U .      . P     . U
28!       i-1,j    i,j      i,j
29!
30!      alpha3 .       . alpha2
31!
32!
33!                 . V
34!                i,j
35!
36! Kinetic energy at scalar point P(i,j) (excluding poles) is:
37!       Ecin = 0.5 * U(i-1,j)**2 *( alpha3 + alpha4 )  +
38!              0.5 * U(i  ,j)**2 *( alpha1 + alpha2 )  +
39!              0.5 * V(i,j-1)**2 *( alpha1 + alpha4 )  +
40!              0.5 * V(i,  j)**2 *( alpha2 + alpha3 )
41!===============================================================================
42! Local variables:
43  INTEGER :: l, ij, i, ijb, ije
44  REAL    :: ecinni(iim), ecinsi(iim), ecinpn, ecinps
45!===============================================================================
46!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
47  DO l=1,llm
48
49    ijb=ij_begin
50    ije=ij_end+iip1
51
52    IF(pole_nord) ijb=ij_begin+iip1
53    IF(pole_sud)  ije=ij_end-iip1
54
55    DO ij = ijb,ije-1
56      ecin(ij+1,l)=0.5*(ucov(ij    ,l)*ucont(ij    ,l)*alpha3p4(ij +1)          &
57                      + ucov(ij+1  ,l)*ucont(ij+1  ,l)*alpha1p2(ij +1)          &
58                      + vcov(ij-iim,l)*vcont(ij-iim,l)*alpha1p4(ij +1)          &
59                      + vcov(ij+1  ,l)*vcont(ij+1  ,l)*alpha2p3(ij +1) )
60    END DO
61
62    !--- Correction: ecin(1,j,l)= ecin(iip1,j,l)
63    DO ij=ijb,ije,iip1; ecin(ij,l) = ecin(ij+iim,l); END DO
64
65    !--- North pole
66    IF(pole_nord) THEN
67      ecinni(:) = vcov(1:iim,l)*vcont(1:iim,l)*aire(1:iim)
68      ecinpn = 0.5*SUM(ecinni)/apoln
69      ecin(1:iip1,l)=ecinpn
70    END IF
71
72    !--- South pole
73    IF(pole_sud) THEN
74      DO i=1,iim
75        ecinsi(i) = vcov(i+ip1jmi1,l)*vcont(i+ip1jmi1,l)*aire(i+ip1jm)
76      END DO
77      ecinps = 0.5*SUM(ecinsi)/apols
78      ecin(1+ip1jm:ip1jmp1,l)=ecinps
79    END IF
80  END DO
81!$OMP END DO NOWAIT
82
83END SUBROUTINE enercin_loc
84
Note: See TracBrowser for help on using the repository browser.