GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: dyn3d_common/tourpot.F90 Lines: 11 11 100.0 %
Date: 2023-06-30 12:51:15 Branches: 12 12 100.0 %

Line Branch Exec Source
1
1729
SUBROUTINE tourpot ( vcov, ucov, massebxy, vorpot )
2
!
3
!-------------------------------------------------------------------------------
4
! Authors: P. Le Van.
5
!-------------------------------------------------------------------------------
6
! Purpose: Compute potential vorticity.
7
  IMPLICIT NONE
8
  include "dimensions.h"
9
  include "paramet.h"
10
  include "comgeom.h"
11
!===============================================================================
12
! Arguments:
13
  REAL, INTENT(IN)  :: vcov    (ip1jm,  llm)
14
  REAL, INTENT(IN)  :: ucov    (ip1jmp1,llm)
15
  REAL, INTENT(IN)  :: massebxy(ip1jm,  llm)
16
  REAL, INTENT(OUT) :: vorpot  (ip1jm,  llm)
17
!===============================================================================
18
! Method used:
19
!   vorpot = ( Filtre( d(vcov)/dx - d(ucov)/dy ) + fext ) /psbarxy
20
!===============================================================================
21
! Local variables:
22
  INTEGER :: l, ij
23
  REAL    :: rot(ip1jm,llm)
24
!===============================================================================
25
26
!--- Wind vorticity ; correction: rot(iip1,j,l) = rot(1,j,l)
27
69160
  DO l=1,llm
28
71207136
    DO ij=1,ip1jm-1
29
71207136
      rot(ij,l)=vcov(ij+1,l)-vcov(ij,l)+ucov(ij+iip1,l)-ucov(ij,l)
30
    END DO
31
2159521
    DO ij=iip1,ip1jm,iip1; rot(ij,l)=rot(ij-iim,l); END DO
32
  END DO
33
34
!--- Filter
35
1729
  CALL  filtreg(rot,jjm,llm,2,1,.FALSE.,1)
36
37
!--- Potential vorticity ; correction: rot(iip1,j,l) = rot(1,j,l)
38
69160
  DO l=1,llm
39
71207136
    DO ij=1,ip1jm-1
40
71207136
      vorpot(ij,l)=(rot(ij,l)+fext(ij))/massebxy(ij,l)
41
    END DO
42
2159521
    DO ij=iip1,ip1jm,iip1; vorpot(ij,l)=vorpot(ij-iim,l); END DO
43
  END DO
44
45
1729
END SUBROUTINE tourpot