File: jwscal.F

package info (click to toggle)
emoslib 000380%2Bdfsg-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 47,712 kB
  • ctags: 11,551
  • sloc: fortran: 89,643; ansic: 24,200; makefile: 370; sh: 355
file content (152 lines) | stat: -rwxr-xr-x 3,764 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
C Copyright 1981-2007 ECMWF
C 
C Licensed under the GNU Lesser General Public License which
C incorporates the terms and conditions of version 3 of the GNU
C General Public License.
C See LICENSE and gpl-3.0.txt for details.
C

      SUBROUTINE JWSCAL( PZFA, KLATS, KLONS, KFIRST, PLATS)
C
C---->
C**** JWSCAL
C
C     PURPOSE
C     _______
C
C     This routine applies a scale factor to all latitudes except
C     the poles
C
C     INTERFACE
C     _________
C
C     CALL JWSCAL( PZFA, KLATS, KLONS, KFIRST, PLATS)
C
C     Input parameters
C     ________________
C
C     PZFA     - Array of wind field (U or V) fourier coefficients
C     KLATS    - Number of latitude lines in PZFA
C     KLONS    - Number of longitude points in each line of latitude
C     KFIRST   - First latitude to process in PLATS
C     PLATS    - Array of gaussian latitudes (degrees)
C
C     Output parameters
C     ________________
C
C     PZFA     - Modified array of fourier coefficients
C
C     Common block usage
C     __________________
C
C     None.
C
C     Method
C     ______
C
C     Apply latitude-dependent scale factor to all coefficients.
C     It is assumed that no latitude is at the North or South pole.
C
C     Externals
C     _________
C
C     SSCAL  - Apply scalar correction to row of values
C
C
C     Reference
C     _________
C
C     None
C
C
C     Comments
C     ________
C
C     PZFA contains pairs of north/south latitudes.
C
C
C     AUTHOR
C     ______
C
C     J.D.Chambers      *ECMWF*      Jan 1994
C
C     MODIFICATIONS
C     _____________
C
C     None.
C
C----<
C     _______________________________________________________
C
C*    Section 0. Definition of variables.
C     _______________________________________________________
C
C*    Prefix conventions for variable names
C
C     Logical      L (but not LP), global or common.
C                  O, dummy argument
C                  G, local variable
C                  LP, parameter.
C     Character    C, global or common.
C                  H, dummy argument
C                  Y (but not YP), local variable
C                  YP, parameter.
C     Integer      M and N, global or common.
C                  K, dummy argument
C                  I, local variable
C                  J (but not JP), loop control
C                  JP, parameter.
C     Real         A to F and Q to X, global or common.
C                  P (but not PP), dummy argument
C                  Z, local variable
C                  PP, parameter.
C
      IMPLICIT NONE
C
#include "jparams.h"
C
C     Subroutine arguments
C
      REAL   PZFA
      DIMENSION PZFA(JPLONO+2, 64)
      INTEGER   KLATS, KLONS, KFIRST
      REAL      PLATS
      DIMENSION PLATS(*)
C
C     Local variables
C
      INTEGER JNEXTLAT, INORTH, ISOUTH
      REAL ZCOSI, ZLAT, ZPIBY2, ZDEGR
C     _______________________________________________________
C
C*    Section 1.    Initialization.
C     _______________________________________________________
C
  100 CONTINUE
      ZPIBY2 = PPI / 2.0
      ZDEGR  = PPI / 180.0
C
C     _______________________________________________________
C
C*    Section 2.    Apply scale factor to all latitudes.
C     _______________________________________________________
C
 200  CONTINUE
      INORTH = -1
      DO 220 JNEXTLAT = 1, KLATS
        ZLAT  = PLATS( KFIRST + JNEXTLAT - 1 )
        INORTH = INORTH + 2
        ISOUTH = INORTH + 1
        ZCOSI = 1.0 / COS( ZLAT * ZDEGR )
        CALL SSCAL( KLONS, ZCOSI, PZFA( 2, INORTH), 1)
        CALL SSCAL( KLONS, ZCOSI, PZFA( 2, ISOUTH), 1)
 220  CONTINUE
C     _______________________________________________________
C
C*    Section 9. Return to calling routine.
C     _______________________________________________________
C
 900  CONTINUE
C
      RETURN
      END