@@ -55,19 +55,19 @@ module aircraftinfo
55
55
logical :: aircraft_t_bc_ext ! logical to turn off or on the externally supplied aircraft bias correction
56
56
logical :: cleanup_tail ! logical to remove tail number no longer used
57
57
logical :: upd_aircraft ! indicator if update bias at 06Z & 18Z
58
-
59
- integer (i_kind), parameter :: max_tail = 15000 ! max tail numbers
58
+
59
+ integer (i_kind) max_tail ! max tail numbers
60
60
integer (i_kind) npredt ! predictor number
61
61
integer (i_kind) ntail ! total tail number
62
62
integer (i_kind) ntail_update ! new total tail number
63
- integer (i_kind) mype_airobst ! processor reading in aircraft profile data
63
+ integer (i_kind) mype_airobst ! processor reading in aircraft profile data
64
64
integer (i_kind) nsort ! used in sorting tail number
65
-
66
- character (len= 10 ),dimension (max_tail ):: taillist ! tail number
67
- character (len= 1 ),dimension (max_tail ):: itail_sort ! used in sorting tail number
68
- integer (i_kind),dimension (max_tail ):: idx_tail ! index of tail
69
- integer (i_kind),dimension (max_tail ):: idx_sort ! used in sorting tail number
70
- integer (i_kind),dimension (max_tail ):: timelist ! time stamp
65
+
66
+ character (len= 10 ),allocatable , dimension (: ):: taillist ! tail number
67
+ character (len= 1 ),allocatable , dimension (: ):: itail_sort ! used in sorting tail number
68
+ integer (i_kind),allocatable , dimension (: ):: idx_tail ! index of tail
69
+ integer (i_kind),allocatable , dimension (: ):: idx_sort ! used in sorting tail number
70
+ integer (i_kind),allocatable , dimension (: ):: timelist ! time stamp
71
71
real (r_kind):: biaspredt ! berror var for temperature bias correction coefficients
72
72
real (r_kind):: upd_pred_t ! =1 update bias; =0 no update
73
73
real (r_kind):: hdist_aircraft ! horizontal distance threshold for errormod_aircraft
@@ -94,6 +94,8 @@ subroutine init_aircraft
94
94
! program history log:
95
95
! 2013-05-17 Zhu
96
96
! 2014-03-04 Sienkiewicz - added aircraft_t_bc_ext option
97
+ ! 2024-12-10 Sienkiewicz - arrays dimensioned by 'max_tail' changed to
98
+ ! allocatable arrays so 'max_tail' can be set via a namelist
97
99
!
98
100
! input argument list:
99
101
!
@@ -115,14 +117,16 @@ subroutine init_aircraft
115
117
aircraft_t_bc = .false. ! .true.=turn on bias correction
116
118
aircraft_t_bc_pof = .false. ! .true.=turn on bias correction
117
119
aircraft_t_bc_ext = .false. ! .true.=turn on bias correction
118
- cleanup_tail = .false. ! no removal of tail number
120
+ cleanup_tail = .false. ! no removal of tail number
119
121
mype_airobst = 0
120
122
121
123
upd_aircraft= .true.
122
124
upd_pred_t= one
123
125
124
126
hdist_aircraft= 60000.0_r_kind
125
127
128
+ max_tail = 20000
129
+
126
130
end subroutine init_aircraft
127
131
128
132
@@ -176,7 +180,7 @@ subroutine aircraftinfo_read
176
180
if (verbose .and. mype == 0 )print_verbose= .true.
177
181
! Determine number of entries in aircraft bias file
178
182
inquire (file= ' aircftbias_in' ,exist= pcexist)
179
- if (.not. pcexist) then
183
+ if (.not. pcexist) then
180
184
write (6 ,* )' AIRCRAFTINFO_READ: ***ERROR*** aircftbias_in not found'
181
185
call stop2(340 )
182
186
end if
@@ -204,7 +208,7 @@ subroutine aircraftinfo_read
204
208
write (6 ,120 ) ntail
205
209
120 format (' AIRCRAFTINFO_READ: ntail=' ,1x ,i6)
206
210
endif
207
- if (ntail > max_tail) then
211
+ if (ntail > max_tail) then
208
212
write (6 ,* )' AIRCRAFTINFO_READ: ***ERROR*** ntail exceeds max_tail'
209
213
write (6 ,* )' AIRCRAFTINFO_READ: stop program execution'
210
214
call stop2(340 )
@@ -221,6 +225,9 @@ subroutine aircraftinfo_read
221
225
ostats_t = zero_quad
222
226
rstats_t = zero_quad
223
227
228
+ allocate (taillist(max_tail),itail_sort(max_tail),idx_tail(max_tail), &
229
+ idx_sort(max_tail),timelist(max_tail))
230
+
224
231
j= 0
225
232
do k= 1 ,nlines
226
233
read (lunin,100 ) cflg,crecord
@@ -241,7 +248,7 @@ subroutine aircraftinfo_read
241
248
110 format (a10,1x ,i5,9 (1x ,f12.6 ),1x ,i8)
242
249
243
250
! Do not update aircraft temperature bias at 6Z and 18Z
244
- if (.not. upd_aircraft) then
251
+ if (.not. upd_aircraft) then
245
252
anal_time = iadate(4 )
246
253
if (anal_time== 6 .or. anal_time== 18 ) upd_pred_t = zero
247
254
if (mype== 0 ) print * , ' aircraft_info anal_time upd_pred_t=' , anal_time, upd_pred_t
@@ -258,7 +265,7 @@ subroutine aircraftinfo_read
258
265
itail_sort(isort) = cb
259
266
idx_sort(isort) = k
260
267
cb0 = cb
261
- end if
268
+ end if
262
269
end do
263
270
nsort = isort
264
271
if (mype== 0 ) print * , ' nsort = ' , nsort
@@ -279,6 +286,8 @@ subroutine aircraftinfo_write
279
286
!
280
287
! program history log:
281
288
! 2013-05-17 Yanqiu Zhu
289
+ ! 2024-12-10 Sienkiewicz - arrays dimensioned by 'max_tail' changed to
290
+ ! allocatable arrays so 'max_tail' can be set via a namelist
282
291
!
283
292
! input argument list:
284
293
!
@@ -327,13 +336,13 @@ subroutine aircraftinfo_write
327
336
end do
328
337
do i= 1 ,ntail_update
329
338
csort(i) = taillist(i)
330
- end do
339
+ end do
331
340
! cleanup tailnumber in the aircraft bias file
332
341
obsolete = 0
333
342
if (cleanup_tail) then
334
343
iyyyymm = iadate(1 )* 100 + iadate(2 )
335
344
do i= 1 ,ntail_update
336
- if (abs (iyyyymm- timelist(i))>= 100 ) then
345
+ if (abs (iyyyymm- timelist(i))>= 100 ) then
337
346
csort(i) = ' zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
338
347
obsolete = obsolete+1
339
348
end if
@@ -349,6 +358,7 @@ subroutine aircraftinfo_write
349
358
end do
350
359
351
360
close (lunout)
361
+ deallocate (taillist,itail_sort,idx_tail,idx_sort,timelist)
352
362
deallocate (predt)
353
363
deallocate (ostats_t,rstats_t,varA_t)
354
364
@@ -420,7 +430,7 @@ subroutine indexc40(n,carrin,indx)
420
430
l = n/ 2 + 1
421
431
ir = n
422
432
423
- do
433
+ do
424
434
if (l.gt. 1 ) then
425
435
l = l - 1
426
436
indxt = indx(l)
@@ -439,7 +449,7 @@ subroutine indexc40(n,carrin,indx)
439
449
i = l
440
450
j = l * 2
441
451
442
- do
452
+ do
443
453
if (j.le. ir) then
444
454
if (j.lt. ir) then
445
455
if (carrin(indx(j)).lt. carrin(indx(j+1 ))) j = j + 1
0 commit comments