UPP (develop)
Loading...
Searching...
No Matches
SELECT_CHANNELS.f
Go to the documentation of this file.
1
18!----------------------------------------------------------------------
26 subroutine select_channels(channelinfo,nchannels,channels)
27
28 use crtm_channelinfo_define, only: crtm_channelinfo_type
29 implicit none
30
31 type(crtm_channelinfo_type),intent(inout) :: channelinfo
32 integer, intent(in) :: nchannels,channels(nchannels)
33 integer :: i,j
34 integer :: temp(nchannels)
35
36 if(nchannels>channelinfo%n_channels) then
37 write(6,*) 'ERROR*** tried to use more channels than sensor has'
38 write(6,*) ' ',nchannels,' > ',channelinfo%n_channels
39 stop 18
40 endif
41
42 check: do i=1,nchannels
43 if(channels(i)<1 .or. channels(i)>channelinfo%n_channels) then
44 write(6,*) 'ERROR*** invalid channel id: ',channels(i)
45 write(6,*) ' in SELECT_CHANNELS at index ',i
46 stop 19
47 endif
48 temp(i)=channelinfo%Channel_Index(channels(i))
49 enddo check
50
51 channelinfo%n_channels=nchannels
52 channelinfo%Channel_Index(1:nchannels)=temp
53
54 end subroutine select_channels
55
56!-----------------------------------------------------------------------
67!-----------------------------------------------------------------------
68
69 subroutine select_channels_l(channelinfo,nchannels,channels,L,igot)
70
71! 2014-12-09: WM LEWIS ADDED THIS SUBROUTINE TO SELECT CHANNELS
72! USING LEVEL ENTRIES FROM WRF_CNTRL.PARM
73
74 use crtm_channelinfo_define, only: crtm_channelinfo_type
75 implicit none
76
77 type(crtm_channelinfo_type),intent(inout) :: channelinfo
78 integer, intent(in) :: nchannels,channels(nchannels)
79 integer :: i,j,k,m
80 integer :: temp(nchannels)
81 integer :: L(nchannels)
82 integer :: igot
83
84 if(nchannels>channelinfo%n_channels) then
85 write(6,*) 'ERROR*** tried to use more channels than sensor has'
86 write(6,*) ' ',nchannels,' > ',channelinfo%n_channels
87 stop 18
88 endif
89
90 k=0
91 do i=1,nchannels
92 if(channels(i)<1 .or. channels(i)>channelinfo%n_channels) then
93 write(6,*) 'ERROR*** invalid channel id: ',channels(i)
94 write(6,*) ' in SELECT_CHANNELS at index ',i
95 stop 19
96 endif
97 if(l(i)==1)then
98 k=k+1
99 temp(k)=channelinfo%Channel_Index(channels(i))
100 endif
101 if(l(i)==0)then
102 channelinfo%Process_Channel(channels(i))=.false. ! turn off channel processing
103 endif
104 enddo
105
106! if no channels were selected, then set igot=0
107 if(k==0)then
108 igot=0
109 return
110! else
111! channelinfo%n_channels=k
112! channelinfo%Channel_Index(1:k)=temp(1:k)
113 endif
114
115 end subroutine select_channels_l
116
subroutine select_channels(channelinfo, nchannels, channels)
select_channels() verifies channel information; no longer used.
subroutine select_channels_l(channelinfo, nchannels, channels, l, igot)
select_channels_L() verifies channel information.