1 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
2 | !--------------- SUBROUTINE READ_COSP_OUTPUT_NL ------------------------- |
---|
3 | !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
4 | SUBROUTINE READ_COSP_OUTPUT_NL(cosp_nl,cfg) |
---|
5 | USE MOD_COSP_CONSTANTS |
---|
6 | USE MOD_COSP_TYPES |
---|
7 | character(len=*),intent(in) :: cosp_nl |
---|
8 | type(cosp_config),intent(out) :: cfg |
---|
9 | ! Local variables |
---|
10 | integer :: i |
---|
11 | |
---|
12 | logical, save :: Lradar_sim,Llidar_sim,Lisccp_sim,Lmisr_sim,Lrttov_sim, & |
---|
13 | Lalbisccp,Latb532,Lboxptopisccp,Lboxtauisccp,Lcfad_dbze94, & |
---|
14 | Lcfad_lidarsr532,Lclcalipso2,Lclcalipso,Lclhcalipso,Lclisccp2,Lcllcalipso, & |
---|
15 | Lclmcalipso,Lcltcalipso,Lcltlidarradar,Lctpisccp,Ldbze94,Ltauisccp,Ltclisccp, & |
---|
16 | Llongitude,Llatitude,Lparasol_refl,LclMISR,Lmeantbisccp,Lmeantbclrisccp, & |
---|
17 | Lfrac_out,Lbeta_mol532,Ltbrttov |
---|
18 | namelist/COSP_OUTPUT/Lradar_sim,Llidar_sim,Lisccp_sim,Lmisr_sim,Lrttov_sim, & |
---|
19 | Lalbisccp,Latb532,Lboxptopisccp,Lboxtauisccp,Lcfad_dbze94, & |
---|
20 | Lcfad_lidarsr532,Lclcalipso2,Lclcalipso,Lclhcalipso,Lclisccp2, & |
---|
21 | Lcllcalipso,Lclmcalipso,Lcltcalipso,Lcltlidarradar,Lctpisccp,Ldbze94,Ltauisccp, & |
---|
22 | Ltclisccp,Llongitude,Llatitude,Lparasol_refl,LclMISR,Lmeantbisccp,Lmeantbclrisccp, & |
---|
23 | Lfrac_out,Lbeta_mol532,Ltbrttov |
---|
24 | |
---|
25 | do i=1,N_OUT_LIST |
---|
26 | cfg%out_list(i)='' |
---|
27 | enddo |
---|
28 | open(10,file=cosp_nl,status='old') |
---|
29 | read(10,nml=cosp_output) |
---|
30 | close(10) |
---|
31 | |
---|
32 | ! print*,' Cles sorties cosp :' |
---|
33 | ! print*,' Lradar_sim,Llidar_sim,Lisccp_sim,Lmisr_sim,Lrttov_sim', & |
---|
34 | ! Lradar_sim,Llidar_sim,Lisccp_sim,Lmisr_sim,Lrttov_sim |
---|
35 | |
---|
36 | ! Deal with dependencies |
---|
37 | if (.not.Lradar_sim) then |
---|
38 | Lcfad_dbze94 = .false. |
---|
39 | Lclcalipso2 = .false. |
---|
40 | Lcltlidarradar = .false. |
---|
41 | Ldbze94 = .false. |
---|
42 | endif |
---|
43 | if (.not.Llidar_sim) then |
---|
44 | Latb532 = .false. |
---|
45 | Lcfad_lidarsr532 = .false. |
---|
46 | Lclcalipso2 = .false. |
---|
47 | Lclcalipso = .false. |
---|
48 | Lclhcalipso = .false. |
---|
49 | Lcllcalipso = .false. |
---|
50 | Lclmcalipso = .false. |
---|
51 | Lcltcalipso = .false. |
---|
52 | Lcltlidarradar = .false. |
---|
53 | Lparasol_refl = .false. |
---|
54 | Lbeta_mol532 = .false. |
---|
55 | endif |
---|
56 | if (.not.Lisccp_sim) then |
---|
57 | Lalbisccp = .false. |
---|
58 | Lboxptopisccp = .false. |
---|
59 | Lboxtauisccp = .false. |
---|
60 | Lclisccp2 = .false. |
---|
61 | Lctpisccp = .false. |
---|
62 | Ltauisccp = .false. |
---|
63 | Ltclisccp = .false. |
---|
64 | Lmeantbisccp = .false. |
---|
65 | Lmeantbclrisccp = .false. |
---|
66 | endif |
---|
67 | if (.not.Lmisr_sim) then |
---|
68 | LclMISR = .false. |
---|
69 | endif |
---|
70 | if (.not.Lrttov_sim) then |
---|
71 | Ltbrttov = .false. |
---|
72 | endif |
---|
73 | if ((.not.Lradar_sim).and.(.not.Llidar_sim).and. & |
---|
74 | (.not.Lisccp_sim).and.(.not.Lmisr_sim)) then |
---|
75 | Lfrac_out = .false. |
---|
76 | endif |
---|
77 | |
---|
78 | ! Diagnostics that use Radar and Lidar |
---|
79 | if (((Lclcalipso2).or.(Lcltlidarradar)).and.((Lradar_sim).or.(Llidar_sim))) then |
---|
80 | Lclcalipso2 = .true. |
---|
81 | Lcltlidarradar = .true. |
---|
82 | Llidar_sim = .true. |
---|
83 | Lradar_sim = .true. |
---|
84 | endif |
---|
85 | |
---|
86 | cfg%Lstats = .false. |
---|
87 | if ((Lradar_sim).or.(Llidar_sim).or.(Lisccp_sim)) cfg%Lstats = .true. |
---|
88 | |
---|
89 | ! Copy instrument flags to cfg structure |
---|
90 | cfg%Lradar_sim = Lradar_sim |
---|
91 | cfg%Llidar_sim = Llidar_sim |
---|
92 | cfg%Lisccp_sim = Lisccp_sim |
---|
93 | cfg%Lmisr_sim = Lmisr_sim |
---|
94 | cfg%Lrttov_sim = Lrttov_sim |
---|
95 | |
---|
96 | ! Flag to control output to file |
---|
97 | cfg%Lwrite_output = .false. |
---|
98 | if (cfg%Lstats.or.cfg%Lmisr_sim.or.cfg%Lrttov_sim) then |
---|
99 | cfg%Lwrite_output = .true. |
---|
100 | endif |
---|
101 | |
---|
102 | ! Output diagnostics |
---|
103 | i = 1 |
---|
104 | if (Lalbisccp) cfg%out_list(i) = 'albisccp' |
---|
105 | i = i+1 |
---|
106 | if (Latb532) cfg%out_list(i) = 'atb532' |
---|
107 | i = i+1 |
---|
108 | if (Lboxptopisccp) cfg%out_list(i) = 'boxptopisccp' |
---|
109 | i = i+1 |
---|
110 | if (Lboxtauisccp) cfg%out_list(i) = 'boxtauisccp' |
---|
111 | i = i+1 |
---|
112 | if (Lcfad_dbze94) cfg%out_list(i) = 'cfad_dbze94' |
---|
113 | i = i+1 |
---|
114 | if (Lcfad_lidarsr532) cfg%out_list(i) = 'cfad_lidarsr532' |
---|
115 | i = i+1 |
---|
116 | if (Lclcalipso2) cfg%out_list(i) = 'clcalipso2' |
---|
117 | i = i+1 |
---|
118 | if (Lclcalipso) cfg%out_list(i) = 'clcalipso' |
---|
119 | i = i+1 |
---|
120 | if (Lclhcalipso) cfg%out_list(i) = 'clhcalipso' |
---|
121 | i = i+1 |
---|
122 | if (Lclisccp2) cfg%out_list(i) = 'clisccp2' |
---|
123 | i = i+1 |
---|
124 | if (Lcllcalipso) cfg%out_list(i) = 'cllcalipso' |
---|
125 | i = i+1 |
---|
126 | if (Lclmcalipso) cfg%out_list(i) = 'clmcalipso' |
---|
127 | i = i+1 |
---|
128 | if (Lcltcalipso) cfg%out_list(i) = 'cltcalipso' |
---|
129 | i = i+1 |
---|
130 | if (Lcltlidarradar) cfg%out_list(i) = 'cltlidarradar' |
---|
131 | i = i+1 |
---|
132 | if (Lctpisccp) cfg%out_list(i) = 'ctpisccp' |
---|
133 | i = i+1 |
---|
134 | if (Ldbze94) cfg%out_list(i) = 'dbze94' |
---|
135 | i = i+1 |
---|
136 | if (Ltauisccp) cfg%out_list(i) = 'tauisccp' |
---|
137 | i = i+1 |
---|
138 | if (Ltclisccp) cfg%out_list(i) = 'tclisccp' |
---|
139 | i = i+1 |
---|
140 | if (Llongitude) cfg%out_list(i) = 'lon' |
---|
141 | i = i+1 |
---|
142 | if (Llatitude) cfg%out_list(i) = 'lat' |
---|
143 | i = i+1 |
---|
144 | if (Lparasol_refl) cfg%out_list(i) = 'parasol_refl' |
---|
145 | i = i+1 |
---|
146 | if (LclMISR) cfg%out_list(i) = 'clMISR' |
---|
147 | i = i+1 |
---|
148 | if (Lmeantbisccp) cfg%out_list(i) = 'meantbisccp' |
---|
149 | i = i+1 |
---|
150 | if (Lmeantbclrisccp) cfg%out_list(i) = 'meantbclrisccp' |
---|
151 | i = i+1 |
---|
152 | if (Lfrac_out) cfg%out_list(i) = 'frac_out' |
---|
153 | i = i+1 |
---|
154 | if (Lbeta_mol532) cfg%out_list(i) = 'beta_mol532' |
---|
155 | i = i+1 |
---|
156 | if (Ltbrttov) cfg%out_list(i) = 'tbrttov' |
---|
157 | |
---|
158 | if (i /= N_OUT_LIST) then |
---|
159 | print *, 'COSP_IO: wrong number of output diagnostics' |
---|
160 | stop |
---|
161 | endif |
---|
162 | |
---|
163 | ! Copy diagnostic flags to cfg structure |
---|
164 | cfg%Lalbisccp = Lalbisccp |
---|
165 | cfg%Latb532 = Latb532 |
---|
166 | cfg%Lboxptopisccp = Lboxptopisccp |
---|
167 | cfg%Lboxtauisccp = Lboxtauisccp |
---|
168 | cfg%Lcfad_dbze94 = Lcfad_dbze94 |
---|
169 | cfg%Lcfad_lidarsr532 = Lcfad_lidarsr532 |
---|
170 | cfg%Lclcalipso2 = Lclcalipso2 |
---|
171 | cfg%Lclcalipso = Lclcalipso |
---|
172 | cfg%Lclhcalipso = Lclhcalipso |
---|
173 | cfg%Lclisccp2 = Lclisccp2 |
---|
174 | cfg%Lcllcalipso = Lcllcalipso |
---|
175 | cfg%Lclmcalipso = Lclmcalipso |
---|
176 | cfg%Lcltcalipso = Lcltcalipso |
---|
177 | cfg%Lcltlidarradar = Lcltlidarradar |
---|
178 | cfg%Lctpisccp = Lctpisccp |
---|
179 | cfg%Ldbze94 = Ldbze94 |
---|
180 | cfg%Ltauisccp = Ltauisccp |
---|
181 | cfg%Ltclisccp = Ltclisccp |
---|
182 | cfg%Llongitude = Llongitude |
---|
183 | cfg%Llatitude = Llatitude |
---|
184 | cfg%Lparasol_refl = Lparasol_refl |
---|
185 | cfg%LclMISR = LclMISR |
---|
186 | cfg%Lmeantbisccp = Lmeantbisccp |
---|
187 | cfg%Lmeantbclrisccp = Lmeantbclrisccp |
---|
188 | cfg%Lfrac_out = Lfrac_out |
---|
189 | cfg%Lbeta_mol532 = Lbeta_mol532 |
---|
190 | cfg%Ltbrttov = Ltbrttov |
---|
191 | |
---|
192 | END SUBROUTINE READ_COSP_OUTPUT_NL |
---|
193 | |
---|