47 n_ax,n_bx,alpha_x,c_x,d_x,g_x,a_x,b_x,gamma1,gamma2, &
51 integer,
intent(in) :: npoints,nlevels,ncolumns
52 real,
intent(in),
dimension(Npoints,Nlevels) :: p,t,flux
53 real,
intent(in),
dimension(Npoints,Ncolumns,Nlevels) :: prec_frac
54 real,
intent(in) :: n_ax,n_bx,alpha_x,c_x,d_x,g_x,a_x,b_x,gamma1,gamma2,prec_type
56 real,
intent(out),
dimension(Npoints,Ncolumns,Nlevels) :: mxratio
59 real :: sigma,one_over_xip1,xi,rho0,rho
66 xi = d_x/(alpha_x + b_x - n_bx + 1.0)
68 sigma = (gamma2/(gamma1*c_x))*(n_ax*a_x*gamma2)**xi
69 one_over_xip1 = 1.0/(xi + 1.0)
74 if ((prec_frac(
i,
j,
k)==prec_type).or.(prec_frac(
i,
j,
k)==3.))
then
75 rho = p(
i,
k)/(287.05*t(
i,
k))
76 mxratio(
i,
j,
k)=(flux(
i,
k)*((rho/rho0)**g_x)*sigma)**one_over_xip1
77 mxratio(
i,
j,
k)=mxratio(
i,
j,
k)/rho
89 ELEMENTAL SUBROUTINE zero_int(x,y01,y02,y03,y04,y05,y06,y07,y08,y09,y10, &
90 y11,y12,y13,y14,y15,y16,y17,y18,y19,y20, &
91 y21,y22,y23,y24,y25,y26,y27,y28,y29,y30)
93 integer,
intent(inout) ::
x
94 integer,
intent(inout),
optional :: y01,y02,y03,y04,y05,y06,y07,y08,y09,y10, &
95 y11,y12,y13,y14,y15,y16,y17,y18,y19,y20, &
96 y21,y22,y23,y24,y25,y26,y27,y28,y29,y30
98 if (present(y01)) y01 = 0
99 if (present(y02)) y02 = 0
100 if (present(y03)) y03 = 0
101 if (present(y04)) y04 = 0
102 if (present(y05)) y05 = 0
103 if (present(y06)) y06 = 0
104 if (present(y07)) y07 = 0
105 if (present(y08)) y08 = 0
106 if (present(y09)) y09 = 0
107 if (present(y10)) y10 = 0
108 if (present(y11)) y11 = 0
109 if (present(y12)) y12 = 0
110 if (present(y13)) y13 = 0
111 if (present(y14)) y14 = 0
112 if (present(y15)) y15 = 0
113 if (present(y16)) y16 = 0
114 if (present(y17)) y17 = 0
115 if (present(y18)) y18 = 0
116 if (present(y19)) y19 = 0
117 if (present(y20)) y20 = 0
118 if (present(y21)) y21 = 0
119 if (present(y22)) y22 = 0
120 if (present(y23)) y23 = 0
121 if (present(y24)) y24 = 0
122 if (present(y25)) y25 = 0
123 if (present(y26)) y26 = 0
124 if (present(y27)) y27 = 0
125 if (present(y28)) y28 = 0
126 if (present(y29)) y29 = 0
127 if (present(y30)) y30 = 0
133 ELEMENTAL SUBROUTINE zero_real(x,y01,y02,y03,y04,y05,y06,y07,y08,y09,y10, &
134 y11,y12,y13,y14,y15,y16,y17,y18,y19,y20, &
135 y21,y22,y23,y24,y25,y26,y27,y28,y29,y30)
137 real,
intent(inout) ::
x
138 real,
intent(inout),
optional :: y01,y02,y03,y04,y05,y06,y07,y08,y09,y10, &
139 y11,y12,y13,y14,y15,y16,y17,y18,y19,y20, &
140 y21,y22,y23,y24,y25,y26,y27,y28,y29,y30
142 if (present(y01)) y01 = 0.0
143 if (present(y02)) y02 = 0.0
144 if (present(y03)) y03 = 0.0
145 if (present(y04)) y04 = 0.0
146 if (present(y05)) y05 = 0.0
147 if (present(y06)) y06 = 0.0
148 if (present(y07)) y07 = 0.0
149 if (present(y08)) y08 = 0.0
150 if (present(y09)) y09 = 0.0
151 if (present(y10)) y10 = 0.0
152 if (present(y11)) y11 = 0.0
153 if (present(y12)) y12 = 0.0
154 if (present(y13)) y13 = 0.0
155 if (present(y14)) y14 = 0.0
156 if (present(y15)) y15 = 0.0
157 if (present(y16)) y16 = 0.0
158 if (present(y17)) y17 = 0.0
159 if (present(y18)) y18 = 0.0
160 if (present(y19)) y19 = 0.0
161 if (present(y20)) y20 = 0.0
162 if (present(y21)) y21 = 0.0
163 if (present(y22)) y22 = 0.0
164 if (present(y23)) y23 = 0.0
165 if (present(y24)) y24 = 0.0
166 if (present(y25)) y25 = 0.0
167 if (present(y26)) y26 = 0.0
168 if (present(y27)) y27 = 0.0
169 if (present(y28)) y28 = 0.0
170 if (present(y29)) y29 = 0.0
171 if (present(y30)) y30 = 0.0
178 real,
intent(in) :: mdi
179 real,
dimension(:,:),
intent(inout) ::
z
196 real,
intent(in) :: mdi
197 real,
dimension(:,:,:),
intent(inout) ::
z
214 real,
intent(in) :: mdi
215 real,
dimension(:,:,:,:),
intent(inout) ::
z
233 character(len=*) :: vname
234 real,
intent(inout) ::
x(:)
235 real,
intent(in),
optional :: min_val,max_val
236 logical :: l_min,l_max
237 character(len=128) :: pro_name=
'COSP_CHECK_INPUT_1D'
242 if (present(min_val))
then
244 if (any(
x < min_val))
then
251 if (present(max_val))
then
253 if (any(
x > max_val))
then
261 if (l_min) print *,
'----- WARNING: '//trim(pro_name)//
': minimum value of '//trim(vname)//
' set to: ',min_val
262 if (l_max) print *,
'----- WARNING: '//trim(pro_name)//
': maximum value of '//trim(vname)//
' set to: ',max_val
268 character(len=*) :: vname
269 real,
intent(inout) ::
x(:,:)
270 real,
intent(in),
optional :: min_val,max_val
271 logical :: l_min,l_max
272 character(len=128) :: pro_name=
'COSP_CHECK_INPUT_2D'
277 if (present(min_val))
then
279 if (any(
x < min_val))
then
286 if (present(max_val))
then
288 if (any(
x > max_val))
then
296 if (l_min) print *,
'----- WARNING: '//trim(pro_name)//
': minimum value of '//trim(vname)//
' set to: ',min_val
297 if (l_max) print *,
'----- WARNING: '//trim(pro_name)//
': maximum value of '//trim(vname)//
' set to: ',max_val
303 character(len=*) :: vname
304 real,
intent(inout) ::
x(:,:,:)
305 real,
intent(in),
optional :: min_val,max_val
306 logical :: l_min,l_max
307 character(len=128) :: pro_name=
'COSP_CHECK_INPUT_3D'
312 if (present(min_val))
then
314 if (any(
x < min_val))
then
321 if (present(max_val))
then
323 if (any(
x > max_val))
then
331 if (l_min) print *,
'----- WARNING: '//trim(pro_name)//
': minimum value of '//trim(vname)//
' set to: ',min_val
332 if (l_max) print *,
'----- WARNING: '//trim(pro_name)//
': maximum value of '//trim(vname)//
' set to: ',max_val