/[lmdze]/trunk/dyn3d/diverg.f
ViewVC logotype

Annotation of /trunk/dyn3d/diverg.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 81 - (hide annotations)
Wed Mar 5 14:38:41 2014 UTC (10 years, 3 months ago) by guez
Original Path: trunk/dyn3d/diverg.f90
File size: 2154 byte(s)
 Converted to free source form files which were still in fixed source
form. The conversion was done using the polish mode of the NAG Fortran
Compiler.

In addition to converting to free source form, the processing of the
files also:

-- indented the code (including comments);

-- set Fortran keywords to uppercase, and set all other identifiers
to lower case;

-- added qualifiers to end statements (for example "end subroutine
conflx", instead of "end");

-- changed the terminating statements of all DO loops so that each
loop ends with an ENDDO statement (instead of a labeled continue).

1 guez 3
2 guez 81 ! $Header: /home/cvsroot/LMDZ4/libf/dyn3d/diverg.F,v 1.1.1.1 2004/05/19
3     ! 12:53:06 lmdzadmin Exp $
4 guez 3
5 guez 81 SUBROUTINE diverg(klevel, x, y, div)
6    
7     ! P. Le Van
8    
9     ! *********************************************************************
10     ! ... calcule la divergence a tous les niveaux d'1 vecteur de compos.
11     ! x et y...
12     ! x et y etant des composantes covariantes ...
13     ! *********************************************************************
14     USE dimens_m
15     USE paramet_m
16     USE comgeom
17     IMPLICIT NONE
18    
19     ! x et y sont des arguments d'entree pour le s-prog
20     ! div est un argument de sortie pour le s-prog
21    
22    
23     ! ---------------------------------------------------------------------
24    
25     ! ATTENTION : pendant ce s-pg , ne pas toucher au COMMON/scratch/ .
26    
27     ! ---------------------------------------------------------------------
28    
29     ! .......... variables en arguments ...................
30    
31     INTEGER klevel
32     REAL x(ip1jmp1, klevel), y(ip1jm, klevel), div(ip1jmp1, klevel)
33     INTEGER l, ij
34    
35     ! ............... variables locales .........................
36    
37     REAL aiy1(iip1), aiy2(iip1)
38     REAL sumypn, sumyps
39     ! ...................................................................
40    
41     REAL ssum
42    
43    
44     DO l = 1, klevel
45    
46     DO ij = iip2, ip1jm - 1
47     div(ij+1, l) = cvusurcu(ij+1)*x(ij+1, l) - cvusurcu(ij)*x(ij, l) + &
48     cuvsurcv(ij-iim)*y(ij-iim, l) - cuvsurcv(ij+1)*y(ij+1, l)
49     END DO
50    
51     ! .... correction pour div( 1,j,l) ......
52     ! .... div(1,j,l)= div(iip1,j,l) ....
53    
54     ! DIR$ IVDEP
55     DO ij = iip2, ip1jm, iip1
56     div(ij, l) = div(ij+iim, l)
57     END DO
58    
59     ! .... calcul aux poles .....
60    
61     DO ij = 1, iim
62     aiy1(ij) = cuvsurcv(ij)*y(ij, l)
63     aiy2(ij) = cuvsurcv(ij+ip1jmi1)*y(ij+ip1jmi1, l)
64     END DO
65     sumypn = ssum(iim, aiy1, 1)/apoln
66     sumyps = ssum(iim, aiy2, 1)/apols
67    
68     DO ij = 1, iip1
69     div(ij, l) = -sumypn
70     div(ij+ip1jm, l) = sumyps
71     END DO
72     END DO
73    
74    
75     ! cc CALL filtreg( div, jjp1, klevel, 2, 2, .TRUE., 1 )
76    
77    
78     DO l = 1, klevel
79     DO ij = iip2, ip1jm
80     div(ij, l) = div(ij, l)*unsaire(ij)
81     END DO
82     END DO
83    
84     RETURN
85     END SUBROUTINE diverg

  ViewVC Help
Powered by ViewVC 1.1.21