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 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
|
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 STRLAT( OLDLAT, STRETCH, KFLAG, NEWLAT, MFACTOR)
C
C---->
C**** STRLAT
C
C PURPOSE
C _______
C
C This routine transforms between stretched and real latitudes
C and calculates the map factor.
C
C INTERFACE
C _________
C
C CALL STRLAT( OLDLAT, STRETCH, KFLAG, NEWLAT, MFACTOR)
C
C Input parameters
C ________________
C
C OLDLAT - Input latitude
C STRETCH - Stretching factor
C KFLAG - Flag to show direction of transform (real <-> stretched)
C 0 = transform from real latitudes to stretched latitudes
C 1 = transform from stretched latitudes to real latitudes
C
C Output parameters
C ________________
C
C NEWLAT - Input latitude
C MFACTOR - Map factor
C
C
C Common block usage
C __________________
C
C None
C
C Method
C ______
C
C Stretching factor S
C
C Map factor, m = S**2 + 1 + (S**2 -1)*mu
C -----------------------
C 2*S
C
C where mu = sin(lat) on the real sphere
C
C mu = (S**2+1)*md + (S**2-1)
C ----------------------
C (S**2+1) + (S**2-1)*md
C
C where md = sin(lat) on the stretched sphere.
C
C By rearrangement:
C
C md = (S**2+1)*mu - (S**2-1)
C ----------------------
C (S**2+1) - (S**2-1)*mu
C
C Wind U and V components are transformed as
C
C vreal = m * vtransformed
C
C Vorticity and divergence fields are transformed as
C
C vreal = (m*m) * vtransformed
C
C
C Externals
C _________
C
C None
C
C
C Reference
C _________
C
C None
C
C
C Comments
C ________
C
C None.
C
C
C AUTHOR
C ______
C
C J.D.Chambers ECMWF July 1999
C
C
C MODIFICATIONS
C _____________
C
C None
C
C----<
C _______________________________________________________
C
C
IMPLICIT NONE
C
C Subroutine arguments
C
REAL OLDLAT, STRETCH, NEWLAT, MFACTOR, MSCALE
INTEGER KFLAG
C
C Parameters
C
INTEGER JPRL2TR
PARAMETER (JPRL2TR = 0)
REAL PPI, DEG2RAD, RAD2DEG
PARAMETER ( PPI = 3.14159265358979 )
PARAMETER (DEG2RAD = PPI / 180.0)
PARAMETER (RAD2DEG = 180.0 / PPI)
C
C Local variables
C
REAL A, B, ANGLE, MU, MUPRIME
C _______________________________________________________
C
C* Section 1. Initialization.
C _______________________________________________________
C
100 CONTINUE
C
A = STRETCH * STRETCH + 1
B = A - 2
ANGLE = OLDLAT * DEG2RAD
C
C _______________________________________________________
C
C* Section 2. Work out geometry
C _______________________________________________________
C
200 CONTINUE
C
C Transform from real latitudes to stretched latitudes
C
IF( KFLAG.EQ.JPRL2TR ) THEN
MUPRIME = SIN(ANGLE)
MU = (A*MUPRIME + B) / (A + B*MUPRIME)
NEWLAT = ASIN(MU) * RAD2DEG
C
C Transform from stretched latitudes to real latitudes
C
ELSE
MU = SIN(ANGLE)
MUPRIME = (A*MU - B) / (A - B*MU)
NEWLAT = ASIN(MUPRIME) * RAD2DEG
ENDIF
C
C Calculate the map factor
C
MFACTOR = (A + B*MU) / (2*STRETCH)
C
C _______________________________________________________
C
C* Section 9. Return to calling routine.
C _______________________________________________________
C
RETURN
END
|