-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathGFS_diagnostics.F90
5589 lines (5108 loc) · 178 KB
/
GFS_diagnostics.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
module GFS_diagnostics
!-----------------------------------------------------------------------
! GFS_diagnostics_mod defines a data type and contains the routine
! to populate said type with diagnostics from the GFS physics for
! use by the modeling system for output
!-----------------------------------------------------------------------
use machine, only: kind_phys
!--- GFS_typedefs ---
use GFS_typedefs, only: GFS_control_type, GFS_statein_type, &
GFS_stateout_type, GFS_sfcprop_type, &
GFS_coupling_type, GFS_grid_type, &
GFS_tbd_type, GFS_cldprop_type, &
GFS_radtend_type, GFS_diag_type, &
GFS_init_type
implicit none
private
!--- private data type definition ---
type data_subtype
integer, dimension(:), pointer :: int2 => NULL()
real(kind=kind_phys), dimension(:), pointer :: var2 => NULL()
real(kind=kind_phys), dimension(:), pointer :: var21 => NULL()
real(kind=kind_phys), dimension(:,:), pointer :: var3 => NULL()
end type data_subtype
!--- data type definition for use with GFDL FMS diagnostic manager until write component is working
type GFS_externaldiag_type
integer :: id
integer :: axes
logical :: time_avg
character(len=64) :: time_avg_kind
character(len=64) :: mod_name
character(len=64) :: name
character(len=128) :: desc
character(len=64) :: unit
character(len=64) :: mask
character(len=64) :: intpl_method
real(kind=kind_phys) :: cnvfac
type(data_subtype), dimension(:), allocatable :: data
end type GFS_externaldiag_type
!--- public data type ---
public GFS_externaldiag_type
!--- public interfaces ---
public GFS_externaldiag_populate
CONTAINS
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
! Helper function for GFS_externaldiag_populate to handle the massive dtend(:,:,dtidx(:,:)) array
subroutine add_dtend(Model,ExtDiag,IntDiag,idx,nblks,itrac,iprocess,desc,unit)
implicit none
type(GFS_control_type), intent(in) :: Model
type(GFS_externaldiag_type), intent(inout) :: ExtDiag(:)
type(GFS_diag_type), intent(in) :: IntDiag(:)
integer, intent(in) :: nblks, itrac, iprocess
integer, intent(inout) :: idx
real(kind=kind_phys), pointer :: dtend(:,:,:) ! Assumption: dtend is null iff all(dtidx <= 1)
character(len=*), intent(in), optional :: desc, unit
integer :: idtend, nb
idtend = Model%dtidx(itrac,iprocess)
if(idtend>=1) then
idx = idx + 1
ExtDiag(idx)%axes = 3
ExtDiag(idx)%name = 'dtend_'//trim(Model%dtend_var_labels(itrac)%name)//'_'//trim(Model%dtend_process_labels(iprocess)%name)
ExtDiag(idx)%mod_name = Model%dtend_process_labels(iprocess)%mod_name
ExtDiag(idx)%time_avg = Model%dtend_process_labels(iprocess)%time_avg
if(present(desc)) then
ExtDiag(idx)%desc = desc
else
ExtDiag(idx)%desc = trim(Model%dtend_var_labels(itrac)%desc)//' '//trim(Model%dtend_process_labels(iprocess)%desc)
endif
if(present(unit)) then
ExtDiag(idx)%unit = trim(unit)
else
ExtDiag(idx)%unit = trim(Model%dtend_var_labels(itrac)%unit)
endif
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var3 => IntDiag(nb)%dtend(:,:,idtend)
enddo
endif
end subroutine add_dtend
!-------------------------------------------------------------------------
!--- GFS_externaldiag_populate ---
!-------------------------------------------------------------------------
! creates and populates a data type with GFS physics diagnostic
! variables which is then handed off to the IPD for use by the model
! infrastructure layer to output as needed. The data type includes
! names, units, conversion factors, etc. There is no copying of data,
! but instead pointers are associated to the internal representation
! of each individual physics diagnostic.
!-------------------------------------------------------------------------
subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop, Coupling, &
Grid, Tbd, Cldprop, Radtend, IntDiag, Init_parm)
!---------------------------------------------------------------------------------------------!
! DIAGNOSTIC_METADATA !
! ExtDiag%id [integer ] switch to turn on/off variable output !
! ExtDiag%axes [integer ] dimensionality of variable (2 or 3) !
! ExtDiag%time_avg [logical ] bucketed accumulation time average !
! ExtDiag%time_avg_kind [char*64 ] time average period !
! ExtDiag%mod_name [char*64 ] classification of the variable !
! ExtDiag%name [char*64 ] output name for variable !
! ExtDiag%desc [char*128] long description of field !
! ExtDiag%unit [char*64 ] units associated with field !
! ExtDiag%mask [char*64 ] description of mask-type !
! ExtDiag%intpl_method [char*64 ] method to use for interpolation !
! ExtDiag%cnvfac [real*8 ] conversion factor to output specified units !
! ExtDiag%data(nb)%int2(:) [integer ] pointer to 2D data [=> null() for a 3D field] !
! ExtDiag%data(nb)%var2(:) [real*8 ] pointer to 2D data [=> null() for a 3D field] !
! ExtDiag%data(nb)%var21(:) [real*8 ] pointer to 2D data for ratios !
! ExtDiag%data(nb)%var3(:,:) [real*8 ] pointer to 3D data [=> null() for a 2D field] !
!---------------------------------------------------------------------------------------------!
use parse_tracers, only: get_tracer_index
implicit none
!
! --- interface variables
type(GFS_externaldiag_type), intent(inout) :: ExtDiag(:)
type(GFS_control_type), intent(in) :: Model
type(GFS_statein_type), intent(in) :: Statein(:)
type(GFS_stateout_type), intent(in) :: Stateout(:)
type(GFS_sfcprop_type), intent(in) :: Sfcprop(:)
type(GFS_coupling_type), intent(in) :: Coupling(:)
type(GFS_grid_type), intent(in) :: Grid(:)
type(GFS_tbd_type), intent(in) :: Tbd(:)
type(GFS_cldprop_type), intent(in) :: Cldprop(:)
type(GFS_radtend_type), intent(in) :: Radtend(:)
type(GFS_diag_type), intent(in) :: IntDiag(:)
type(GFS_init_type), intent(in) :: Init_parm
!--- local variables
integer :: idt, idx, num, nb, nblks, NFXR, idtend, ichem, itrac, iprocess, i
character(len=2) :: xtra
real(kind=kind_phys), parameter :: cn_one = 1._kind_phys
real(kind=kind_phys), parameter :: cn_100 = 100._kind_phys
real(kind=kind_phys), parameter :: cn_th = 1000._kind_phys
real(kind=kind_phys), parameter :: cn_hr = 3600._kind_phys
character(len=30) :: namestr, descstr
NFXR = Model%NFXR
nblks = size(Statein)
ExtDiag(:)%id = -99
ExtDiag(:)%axes = -99
ExtDiag(:)%cnvfac = cn_one
ExtDiag(:)%time_avg = .FALSE.
ExtDiag(:)%time_avg_kind = ''
ExtDiag(:)%mask = ''
ExtDiag(:)%name = ''
ExtDiag(:)%intpl_method = 'nearest_stod'
idx = 0
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'cldfra2d'
ExtDiag(idx)%desc = 'instantaneous 2D (max-in-column) cloud fraction'
ExtDiag(idx)%unit = 'frac'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%cldfra2d(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'total_albedo'
ExtDiag(idx)%desc = 'total sky albedo at toa'
ExtDiag(idx)%unit = 'frac'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%total_albedo(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'lwp_ex'
ExtDiag(idx)%desc = 'total liquid water path from explicit microphysics'
ExtDiag(idx)%unit = 'kg m-2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%lwp_ex(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'iwp_ex'
ExtDiag(idx)%desc = 'total ice water path from explicit microphysics'
ExtDiag(idx)%unit = 'kg m-2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%iwp_ex(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'lwp_fc'
ExtDiag(idx)%desc = 'total liquid water path from cloud fraction scheme'
ExtDiag(idx)%unit = 'kg m-2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%lwp_fc(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'iwp_fc'
ExtDiag(idx)%desc = 'total ice water path from cloud fraction scheme'
ExtDiag(idx)%unit = 'kg m-2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%iwp_fc(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'ALBDO_ave'
ExtDiag(idx)%desc = 'surface albedo'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_100
ExtDiag(idx)%mask = 'positive_flux'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,3)
ExtDiag(idx)%data(nb)%var21 => IntDiag(nb)%fluxr(:,4)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'DLWRF'
ExtDiag(idx)%desc = 'surface downward longwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_one
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%dlwsfc(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'DLWRFI'
ExtDiag(idx)%desc = 'instantaneous surface downward longwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%dlwsfci(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'ULWRF'
ExtDiag(idx)%desc = 'surface upward longwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_one
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%ulwsfc(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'DSWRFItoa'
ExtDiag(idx)%desc = 'instantaneous top of atmos downward shortwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_one
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,23)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'USWRFItoa'
ExtDiag(idx)%desc = 'instantaneous top of atmos upward shortwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_one
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,2)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'ULWRFItoa'
ExtDiag(idx)%desc = 'instantaneous top of atmos upward longwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_one
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,1)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'ULWRFI'
ExtDiag(idx)%desc = 'instantaneous surface upward longwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%ulwsfci(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'DSWRF'
ExtDiag(idx)%desc = 'averaged surface downward shortwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_one
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,4)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'DSWRFI'
ExtDiag(idx)%desc = 'instantaneous surface downward shortwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%dswsfci(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'USWRF'
ExtDiag(idx)%desc = 'averaged surface upward shortwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_one
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,3)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'USWRFI'
ExtDiag(idx)%desc = 'instantaneous surface upward shortwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%uswsfci(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'duvb_ave'
ExtDiag(idx)%desc = 'UV-B Downward Solar Flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,21)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'cduvb_ave'
ExtDiag(idx)%desc = 'Clear sky UV-B Downward Solar Flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,22)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'vbdsf_ave'
ExtDiag(idx)%desc = 'Visible Beam Downward Solar Flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,24)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'vddsf_ave'
ExtDiag(idx)%desc = 'Visible Diffuse Downward Solar Flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,25)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'nbdsf_ave'
ExtDiag(idx)%desc = 'Near IR Beam Downward Solar Flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,26)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'nddsf_ave'
ExtDiag(idx)%desc = 'Near IR Diffuse Downward Solar Flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,27)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'csulf_avetoa'
ExtDiag(idx)%desc = 'Clear Sky Upward Long Wave Flux at toa'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_lw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,28)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'csusf_avetoa'
ExtDiag(idx)%desc = 'Clear Sky Upward Short Wave Flux at toa'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,29)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'csdlf_ave'
ExtDiag(idx)%desc = 'Clear Sky Downward Long Wave Flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_lw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,30)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'csusf_ave'
ExtDiag(idx)%desc = 'Clear Sky Upward Short Wave Flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,31)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'csdsf_ave'
ExtDiag(idx)%desc = 'Clear Sky Downward Short Wave Flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,32)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'csulf_ave'
ExtDiag(idx)%desc = 'Clear Sky Upward Long Wave Flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_lw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,33)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'DSWRFtoa'
ExtDiag(idx)%desc = 'top of atmos downward shortwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_one
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,23)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'USWRFtoa'
ExtDiag(idx)%desc = 'top of atmos upward shortwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_one
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_sw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,2)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'ULWRFtoa'
ExtDiag(idx)%desc = 'top of atmos upward longwave flux'
ExtDiag(idx)%unit = 'W/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_one
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_lw'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,1)
enddo
! if(mpp_pe()==mpp_root_pe())print *,'in gfdl_diag_register,bf ULWRFtoa,idx=',idx
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'TCDC_aveclm'
ExtDiag(idx)%desc = 'atmos column total cloud cover'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_100
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,17)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'TCDC_avebndcl'
ExtDiag(idx)%desc = 'boundary layer cloud layer total cloud cover'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_100
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,18)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'TCDCcnvcl'
ExtDiag(idx)%desc = 'convective cloud layer total cloud cover'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_100
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => Cldprop(nb)%cv(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'PREScnvclt'
ExtDiag(idx)%desc = 'pressure at convective cloud top level'
ExtDiag(idx)%unit = 'pa'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%mask = 'cldmask'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => Cldprop(nb)%cvt(:)
ExtDiag(idx)%data(nb)%var21 => Cldprop(nb)%cv(:)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'PREScnvclb'
ExtDiag(idx)%desc = 'pressure at convective cloud bottom level'
ExtDiag(idx)%unit = 'pa'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%mask = 'cldmask'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => Cldprop(nb)%cvb(:)
ExtDiag(idx)%data(nb)%var21 => Cldprop(nb)%cv(:)
enddo
! if(mpp_pe()==mpp_root_pe())print *,'in gfdl_diag_register,af PREScnvclb,idx=',idx
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'TCDC_avehcl'
ExtDiag(idx)%desc = 'high cloud level total cloud cover'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_100
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,5)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'PRES_avehct'
ExtDiag(idx)%desc = 'pressure high cloud top level'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
ExtDiag(idx)%mask = "cldmask_ratio"
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,8)
ExtDiag(idx)%data(nb)%var21 => IntDiag(nb)%fluxr(:,5)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'PRES_avehcb'
ExtDiag(idx)%desc = 'pressure high cloud bottom level'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
ExtDiag(idx)%mask = "cldmask_ratio"
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,11)
ExtDiag(idx)%data(nb)%var21 => IntDiag(nb)%fluxr(:,5)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'TEMP_avehct'
ExtDiag(idx)%desc = 'temperature high cloud top level'
ExtDiag(idx)%unit = 'K'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
ExtDiag(idx)%mask = "cldmask_ratio"
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,14)
ExtDiag(idx)%data(nb)%var21 => IntDiag(nb)%fluxr(:,5)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'TCDC_avemcl'
ExtDiag(idx)%desc = 'mid cloud level total cloud cover'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_100
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,6)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'PRES_avemct'
ExtDiag(idx)%desc = 'pressure middle cloud top level'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
ExtDiag(idx)%mask = "cldmask_ratio"
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,9)
ExtDiag(idx)%data(nb)%var21 => IntDiag(nb)%fluxr(:,6)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'PRES_avemcb'
ExtDiag(idx)%desc = 'pressure middle cloud bottom level'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
ExtDiag(idx)%mask = "cldmask_ratio"
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,12)
ExtDiag(idx)%data(nb)%var21 => IntDiag(nb)%fluxr(:,6)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'TEMP_avemct'
ExtDiag(idx)%desc = 'temperature middle cloud top level'
ExtDiag(idx)%unit = 'K'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
ExtDiag(idx)%mask = "cldmask_ratio"
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,15)
ExtDiag(idx)%data(nb)%var21 => IntDiag(nb)%fluxr(:,6)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'TCDC_avelcl'
ExtDiag(idx)%desc = 'low cloud level total cloud cover'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%cnvfac = cn_100
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,7)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'PRES_avelct'
ExtDiag(idx)%desc = 'pressure low cloud top level'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
ExtDiag(idx)%mask = "cldmask_ratio"
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,10)
ExtDiag(idx)%data(nb)%var21 => IntDiag(nb)%fluxr(:,7)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'PRES_avelcb'
ExtDiag(idx)%desc = 'pressure low cloud bottom level'
ExtDiag(idx)%unit = '%'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
ExtDiag(idx)%mask = "cldmask_ratio"
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,13)
ExtDiag(idx)%data(nb)%var21 => IntDiag(nb)%fluxr(:,7)
enddo
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'TEMP_avelct'
ExtDiag(idx)%desc = 'temperature low cloud top level'
ExtDiag(idx)%unit = 'K'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%time_avg = .TRUE.
ExtDiag(idx)%time_avg_kind = 'rad_swlw_min'
ExtDiag(idx)%mask = "cldmask_ratio"
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,16)
ExtDiag(idx)%data(nb)%var21 => IntDiag(nb)%fluxr(:,7)
enddo
!--- aerosol diagnostics ---
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'AOD_550'
ExtDiag(idx)%desc = 'total aerosol optical depth at 550 nm'
ExtDiag(idx)%unit = 'numerical'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,34)
enddo
!--- aerosol diagnostics ---
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'DU_AOD_550'
ExtDiag(idx)%desc = 'dust aerosol optical depth at 550 nm'
ExtDiag(idx)%unit = 'numerical'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,35)
enddo
!--- aerosol diagnostics ---
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'BC_AOD_550'
ExtDiag(idx)%desc = 'soot aerosol optical depth at 550 nm'
ExtDiag(idx)%unit = 'numerical'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,36)
enddo
!--- aerosol diagnostics ---
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'OC_AOD_550'
ExtDiag(idx)%desc = 'waso aerosol optical depth at 550 nm'
ExtDiag(idx)%unit = 'numerical'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,37)
enddo
!--- aerosol diagnostics ---
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'SU_AOD_550'
ExtDiag(idx)%desc = 'suso aerosol optical depth at 550 nm'
ExtDiag(idx)%unit = 'numerical'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,38)
enddo
!--- aerosol diagnostics ---
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'SS_AOD_550'
ExtDiag(idx)%desc = 'salt aerosol optical depth at 550 nm'
ExtDiag(idx)%unit = 'numerical'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,39)
enddo
!--- air quality diagnostics ---
if (Model%cplaqm) then
if (associated(IntDiag(1)%aod)) then
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'aod'
ExtDiag(idx)%desc = 'total aerosol optical depth at 550 nm'
ExtDiag(idx)%unit = 'numerical'
ExtDiag(idx)%mod_name = 'gfs_phys'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%aod
enddo
endif
endif
!
!
!--- accumulated diagnostics ---
do num = 1,NFXR
write (xtra,'(I2.2)') num
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'fluxr_'//trim(xtra)
ExtDiag(idx)%desc = 'fluxr diagnostic '//trim(xtra)//' - GFS radiation'
ExtDiag(idx)%unit = 'XXX'
ExtDiag(idx)%mod_name = 'gfs_phys'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%fluxr(:,num)
enddo
enddo
!--- the next two appear to be appear to be coupling fields in gloopr
!--- each has four elements
!rab do num = 1,4
!rab write (xtra,'(I1)') num
!rab idx = idx + 1
!rab ExtDiag(idx)%axes = 2
!rab ExtDiag(idx)%name = 'dswcmp_'//trim(xtra)
!rab ExtDiag(idx)%desc = 'dswcmp dagnostic '//trim(xtra)//' - GFS radiation'
!rab ExtDiag(idx)%unit = 'XXX'
!rab ExtDiag(idx)%mod_name = 'gfs_phys'
!rab do nb = 1,nblks
!rab ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%dswcmp(:,num)
!rab enddo
!rab enddo
!rab
!rab do num = 1,4
!rab write (xtra,'(I1)') num
!rab idx = idx + 1
!rab ExtDiag(idx)%axes = 2
!rab ExtDiag(idx)%name = 'uswcmp_'//trim(xtra)
!rab ExtDiag(idx)%desc = 'uswcmp dagnostic '//trim(xtra)//' - GFS radiation'
!rab ExtDiag(idx)%unit = 'XXX'
!rab ExtDiag(idx)%mod_name = 'gfs_phys'
!rab do nb = 1,nblks
!rab ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%uswcmp(:,num)
!rab enddo
!rab enddo
! DH gfortran cannot point to members of arrays of derived types such
! as IntDiag(nb)%topfsw(:)%upfxc (the compilation succeeds, but the
! pointers do not reference the correct data and the output either
! contains garbage (Inf, NaN), or the netCDF I/O layer crashes.
#ifndef __GFORTRAN__
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'sw_upfxc'