forked from NASA-LIS/LISF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompute_grid_coord.F90
115 lines (111 loc) · 3.92 KB
/
compute_grid_coord.F90
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
!-----------------------BEGIN NOTICE -- DO NOT EDIT-----------------------
! NASA Goddard Space Flight Center
! Land Information System Framework (LISF)
! Version 7.4
!
! Copyright (c) 2022 United States Government as represented by the
! Administrator of the National Aeronautics and Space Administration.
! All Rights Reserved.
!-------------------------END NOTICE -- DO NOT EDIT-----------------------
!BOP
! !ROUTINE: compute_grid_coord
! \label{compute_grid_coord}
!
! !REVISION HISTORY:
! 04-10-96 Mark Iredell; Initial Specification
! 05-27-04 Sujay Kumar; Modified verision with floating point arithmetic.
!
! !INTERFACE:
subroutine compute_grid_coord(gridDesc,npts,fill,xpts,ypts,rlon,rlat,nret)
! Use:
use LDT_logMod
implicit none
! !ARGUMENTS:
real :: gridDesc(20)
integer :: npts
real :: fill
real :: xpts(npts),ypts(npts)
real :: rlat(npts)
real :: rlon(npts)
integer :: nret
!
! !DESCRIPTION:
! This subroutine computes the grid coordinates (cartesian) of
! the specified domain. This routine is based on the grid
! decoding routines in the ipolates interoplation package.
!
! The input options include :
! The current code recognizes the following projections:
! (gridDesc(1)=000) equidistant cylindrical
! (gridDesc(1)=001) mercator cylindrical
! (gridDesc(1)=003) lambert conformal conical
! (gridDesc(1)=004) gaussian cylindrical
! (gridDesc(1)=005) polar stereographic azimuthal
!
! \begin{description}
! \item[gridDesc]
! grid description parameters
! \item[npts]
! integer maximum number of coordinates
! \item[fill]
! fill value to set invalid output data
! \item[xpts]
! output grid x point coordinates
! \item[ypts]
! output grid y point coordinates
! \item[rlat]
! input latitudes in degrees
! \item[rlon]
! input longitudes in degrees
! \item[nret]
! return code (0-success)
! \end{description}
!
! The routines invoked are:
! \begin{description}
! \item[compute\_grid\_coord\_latlon](\ref{compute_grid_coord_latlon} \newline
! computes the grid coordinates of a latlon grid
! \item[compute\_grid\_coord\_merc](\ref{compute_grid_coord_merc} \newline
! computes the grid coordinates of a mercator grid
! \item[compute\_grid\_coord\_lambert](\ref{compute_grid_coord_lambert} \newline
! computes the grid coordinates of a lambert conformal grid
! \item[compute\_grid\_coord\_gauss](\ref{compute_grid_coord_gauss} \newline
! computes the grid coordinates of a gaussian cylindrical grid
! \item[compute\_grid\_coord\_polar](\ref{compute_grid_coord_polar} \newline
! computes the grid coordinates of a polar stereographic grid
! \end{description}
!EOP
! equidistant cylindrical
if(gridDesc(1).eq.0) then
call compute_grid_coord_latlon(gridDesc,npts,fill,xpts,ypts,&
rlon,rlat,nret)
! mercator
elseif(gridDesc(1).eq.1) then
call compute_grid_coord_merc(gridDesc,npts,fill,xpts,ypts,&
rlon,rlat,nret)
! Lambert Conformal
elseif(gridDesc(1).eq.3) then
call compute_grid_coord_lambert(gridDesc,npts,fill,xpts,ypts,&
rlon,rlat,nret)
! Gaussian cylindrical
elseif(gridDesc(1).eq.4) then
call compute_grid_coord_gauss(gridDesc,npts,fill,xpts,ypts,&
rlon,rlat,nret)
! Polar Stereographic
elseif(gridDesc(1).eq.5) then
call compute_grid_coord_polar(gridDesc,npts,fill,xpts,ypts,&
rlon,rlat,nret)
! HRAP
elseif(gridDesc(1).eq.8) then
call compute_grid_coord_hrap(gridDesc,npts,fill,xpts,ypts,&
rlon,rlat,nret)
! EASE cylindrical
elseif(gridDesc(1).eq.9) then
call compute_grid_coord_ease(gridDesc,npts,fill,xpts,ypts,&
rlon,rlat,nret)
else
write(LDT_logunit,*) '[ERR] Unrecognized Projection .... '
write(LDT_logunit,*) 'Program stopping ..'
call LDT_endrun
endif
end subroutine compute_grid_coord