1 |
jahn |
1.1 |
C $Header$ |
2 |
|
|
C $Name$ |
3 |
|
|
|
4 |
|
|
#include "RADTRANS_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CBOP |
7 |
|
|
C !ROUTINE: RADTRANS_LOCALVEC |
8 |
|
|
|
9 |
|
|
C !INTERFACE: ====================================================== |
10 |
|
|
subroutine radtrans_localvec(rad,xlon,ylat, |
11 |
|
|
O up,no,ea) |
12 |
|
|
|
13 |
|
|
C !DESCRIPTION: |
14 |
|
|
c Create arrays of up, north, and east vectors for fixed locations |
15 |
|
|
c corresponding to these nwater indicators. |
16 |
|
|
c |
17 |
|
|
C !USES: =========================================================== |
18 |
|
|
IMPLICIT NONE |
19 |
|
|
|
20 |
|
|
C !INPUT PARAMETERS: =============================================== |
21 |
|
|
_RL rad, xlon,ylat |
22 |
|
|
c INTEGER myThid |
23 |
|
|
|
24 |
|
|
C !OUTPUT PARAMETERS: ============================================== |
25 |
|
|
_RL up(3),no(3),ea(3) |
26 |
|
|
|
27 |
|
|
C !FUNCTIONS: ====================================================== |
28 |
|
|
|
29 |
|
|
C !LOCAL VARIABLES: ================================================ |
30 |
|
|
_RL rlon,cosx,sinx,rlat,cosy,siny,upxy |
31 |
|
|
CEOP |
32 |
|
|
|
33 |
|
|
|
34 |
|
|
c Compute local east, north, and vertical vectors |
35 |
|
|
no = 0.0 |
36 |
|
|
ea = 0.0 |
37 |
|
|
up = 0.0 |
38 |
|
|
c |
39 |
|
|
c Convert geodetic lat/lon to Earth-centered, earth-fixed (ECEF) |
40 |
|
|
c vector (geodetic unit vector) |
41 |
|
|
rlon = xlon/rad |
42 |
|
|
cosx = cos(rlon) |
43 |
|
|
sinx = sin(rlon) |
44 |
|
|
rlat = ylat/rad |
45 |
|
|
cosy = cos(rlat) |
46 |
|
|
siny = sin(rlat) |
47 |
|
|
c |
48 |
|
|
c Compute the local up, East and North unit vectors |
49 |
|
|
up(1) = cosy*cosx |
50 |
|
|
up(2) = cosy*sinx |
51 |
|
|
up(3) = siny |
52 |
|
|
upxy = sqrt(up(1)*up(1)+up(2)*up(2)) |
53 |
|
|
ea(1) = -up(2)/upxy |
54 |
|
|
ea(2) = up(1)/upxy |
55 |
|
|
no(1) = up(2)*ea(3) - up(3)*ea(2) !cross product |
56 |
|
|
no(2) = up(3)*ea(1) - up(1)*ea(3) |
57 |
|
|
no(3) = up(1)*ea(2) - up(2)*ea(1) |
58 |
|
|
write(6,*)'Local pointing vectors' |
59 |
|
|
write(6,*)'no(2) = ',no |
60 |
|
|
write(6,*)'ea(2) = ',ea |
61 |
|
|
write(6,*)'up(2) = ',up |
62 |
|
|
c |
63 |
|
|
return |
64 |
|
|
end |