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