source: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/tourpot_loc.F90 @ 5159

Last change on this file since 5159 was 5159, checked in by abarral, 7 weeks ago

Put dimensions.h and paramet.h into 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
File size: 2.1 KB
Line 
1SUBROUTINE tourpot_loc( vcov, ucov, massebxy, vorpot )
2
3!-------------------------------------------------------------------------------
4! Authors: P. Le Van.
5!-------------------------------------------------------------------------------
6! Purpose: Compute potential vorticity.
7  USE parallel_lmdz
8  USE lmdz_filtreg_p
9  USE lmdz_comgeom
10
11USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
12  USE lmdz_paramet
13  IMPLICIT NONE
14
15
16!===============================================================================
17! Arguments:
18  REAL, INTENT(IN)  :: vcov    (ijb_v:ije_v,llm)
19  REAL, INTENT(IN)  :: ucov    (ijb_u:ije_u,llm)
20  REAL, INTENT(IN)  :: massebxy(ijb_v:ije_v,llm)
21  REAL, INTENT(OUT) :: vorpot  (ijb_v:ije_v,llm)
22!===============================================================================
23! Method used:
24!   vorpot = ( Filtre( d(vcov)/dx - d(ucov)/dy ) + fext ) /psbarxy
25!===============================================================================
26! Local variables:
27  INTEGER :: l, ij, ije, ijb, jje, jjb
28  REAL    :: rot(ijb_v:ije_v,llm)
29!===============================================================================
30
31  ijb=ij_begin-iip1
32  ije=ij_end
33  IF(pole_nord) ijb=ij_begin
34
35!--- Wind vorticity ; correction: rot(iip1,j,l) = rot(1,j,l)
36!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
37  DO l=1,llm
38    IF(pole_sud) ije=ij_end-iip1-1
39    DO ij=ijb,ije
40      rot(ij,l)=vcov(ij+1,l)-vcov(ij,l)+ucov(ij+iip1,l)-ucov(ij,l)
41    END DO
42    IF(pole_sud) ije=ij_end-iip1
43    DO ij=ijb+iip1-1,ije,iip1; rot(ij,l)=rot(ij-iim,l); END DO
44  END DO
45!$OMP END DO NOWAIT
46
47!--- Filter
48  jjb=jj_begin-1
49  jje=jj_end
50  IF(pole_nord) jjb=jjb+1
51  IF(pole_sud)  jje=jje-1
52  CALL filtreg_p(rot,jjb_v,jje_v,jjb,jje,jjm,llm,2,1,.FALSE.,1)
53
54!--- Potential vorticity ; correction: rot(iip1,j,l) = rot(1,j,l)
55!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
56  DO l=1,llm
57    IF(pole_sud) ije=ij_end-iip1-1
58    DO ij=ijb,ije
59      vorpot(ij,l)=(rot(ij,l)+fext(ij))/massebxy(ij,l)
60    END DO
61    IF(pole_sud) ije=ij_end-iip1
62    DO ij=ijb+iip1-1,ije,iip1; vorpot(ij,l)=vorpot(ij-iim,l); END DO
63  END DO
64!$OMP END DO NOWAIT
65
66END SUBROUTINE tourpot_loc
67
Note: See TracBrowser for help on using the repository browser.