forked from NCAR/ccpp-physics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathradiation_aerosols.f
More file actions
4705 lines (4072 loc) · 188 KB
/
Copy pathradiation_aerosols.f
File metadata and controls
4705 lines (4072 loc) · 188 KB
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
!> \file radiation_aerosols.f
!! This file contains climatological atmospheric aerosol schemes for
!! radiation computations
! ========================================================== !!!!!
! 'module_radiation_aerosols' description !!!!!
! ========================================================== !!!!!
! !
! this module contains climatological atmospheric aerosol schemes for!
! radiation computations. !
! !
! in the module, the externally callable subroutines are : !
! !
! 'aer_init' -- initialization !
! inputs: !
! ( NLAY, me ) !
! outputs: !
! ( errflg, errmsg ) !
! !
! 'aer_update' -- updating aerosol data !
! inputs: !
! ( iyear, imon, me ) !
! outputs: !
! ( errflg, errmsg ) !
! !
! 'setaer' -- mapping aeros profile, compute aeros opticals !
! inputs: !
! (prsi,prsl,prslk,tvly,rhlay,slmsk,tracer,aerfld,xlon,xlat, !
! IMAX,NLAY,NLP1, lsswr,lslwr, !
! outputs: !
! (aerosw,aerolw,aerodp,errmsg,errflg) !
! !
! !
! external modules referenced: !
! 'module module_radsw_parameters' in 'radsw_xxxx#_param.f' !
! 'module module_radlw_parameters' in 'radlw_xxxx#_param.f' !
! 'module module_radlw_cntr_para' in 'radsw_xxxx#_param.f' !
! !
! output variable definitions: !
! aerosw(IMAX,NLAY,NBDSW,1) - aerosols optical depth for sw !
! aerosw(IMAX,NLAY,NBDSW,2) - aerosols single scat albedo for sw !
! aerosw(IMAX,NLAY,NBDSW,3) - aerosols asymmetry parameter for sw!
! !
! aerolw(IMAX,NLAY,NBDLW,1) - aerosols optical depth for lw !
! aerolw(IMAX,NLAY,NBDLW,2) - aerosols single scattering albedo !
! aerolw(IMAX,NLAY,NBDLW,3) - aerosols asymmetry parameter !
! !
! !
! program history: !
! apr 2003 --- y.-t. hou created !
! nov 04, 2003 --- y.-t. hou modified version !
! apr 15, 2005 --- y.-t. hou modified module structure !
! jul 2006 --- y.-t. hou add volcanic forcing !
! feb 2007 --- y.-t. hou add generalized spectral band !
! interpolation for sw aerosol optical properties !
! mar 2007 --- y.-t. hou add generalized spectral band !
! interpolation for lw aerosol optical properties !
! aug 2007 --- y.-t. hou change clim-aer vert domain !
! from pressure reference to sigma reference !
! sep 2007 --- y.-t. hou moving temporary allocatable !
! module variable arrays to subroutine dynamically !
! allocated arrays (eliminate deallocate calls) !
! jan 2010 --- sarah lu add gocart option !
! may 2010 --- sarah lu add geos4-gocart climo !
! jul 2010 -- s. moorthi - merged NEMS version with new GFS !
! version !
! oct 23, 2010 --- Hsin-mu lin modified subr setclimaer to !
! interpolate the 5 degree aerosol data to small domain based on!
! the nearby 4 points instead of previous nearby assignment by !
! using the 5 degree data. this process will eliminate the dsw !
! jagged edges in the east conus where aerosol effect are lagre.!
! dec 2010 --- y.-t. hou modified and optimized bi-linear!
! horizontal interpolation in subr setclimaer. added safe guard !
! measures in lat/lon indexing and added sea/land mask variable !
! slmsk as input field to help aerosol profile selection. !
! jan 2011 --- y.-t. hou divided the program into two !
! separated interchangeable modules: a climatology aerosol !
! module, and a gocart aerosol scheme module. the stratospheric !
! volcanic aerosol part is still within the two driver modules, !
! and may also become a separate one in the further development.!
! unified in/out argument list for both clim and gocart types of!
! schemes and added vertically integrated aer-opt-dep, aerodp, !
! to replace tau_gocart as optional output for various species. !
! aug 2012 --- y.-t. hou changed the initialization subr !
! 'aerinit' into two parts: 'aer_init' is called at the start !
! of run to set up module parameters; and 'aer_update' is !
! called within the time loop to check and update data sets. !
! nov 2012 --- y.-t. hou modified control parameters thru!
! module 'physparam'. !
! jan 2013 --- sarah lu and y.-t. hou reintegrate both !
! opac-clim and gocart schemes into one module to make the !
! program best utilize common components. added aerosol model !
! scheme selection control variable iaer_mdl to the namelist. !
! Aug 2013 --- s. moorthi - merge sarah's gocart changes with!
! yutai's changes !
! 13Feb2014 --- Sarah lu - compute aod at 550nm !
! jun 2018 --- h-m lin and y-t hou updated spectral band !
! mapping method for aerosol optical properties. controled by !
! internal variable lmap_new through namelist variable iaer. !
! may 2019 --- sarah lu, restore the gocart option, allowing !
! aerosol ext, ssa, asy determined from MERRA2 monthly climo !
! with new spectral band mapping method !
! !
! references for opac climatological aerosols: !
! hou et al. 2002 (ncep office note 441) !
! hess et al. 1998 - bams v79 831-844 !
! !
! references for gocart interactive aerosols: !
! chin et al., 2000 - jgr, v105, 24671-24687 !
! colarco et al., 2010 - jgr, v115, D14207 !
! !
! references for merra2 aerosol reanalysis: !
! randles et al., 2017 - jclim, v30, 6823-6850 !
! buchard et al., 2017 - jclim, v30, 6851-6871 !
! !
! references for stratosperic volcanical aerosols: !
! sato et al. 1993 - jgr, v98, d12, 22987-22994 !
! !
! !
!!!!! ========================================================== !!!!!
!!!!! end descriptions !!!!!
!!!!! ========================================================== !!!!!
!> This module contains climatological atmospheric aerosol schemes for
!! radiation computations.
module module_radiation_aerosols
!
use machine, only : kind_phys, kind_io4, kind_io8
use module_iounitdef, only : NIAERCM
use module_radsw_parameters, only : NBDSW, wvnsw1=>wvnum1, &
& NSWSTR, wvnsw2=>wvnum2
use module_radlw_parameters, only : NBDLW, wvnlw1, wvnlw2
!
use funcphys, only : fpkap
use aerclm_def, only : ntrcaerm
!
implicit none
!
private
! --- version tag and last revision date
character(40), parameter :: &
& VTAGAER='NCEP-Radiation_aerosols v5.2 Jan 2013 '
! & VTAGAER='NCEP-Radiation_aerosols v5.1 Nov 2012 '
! & VTAGAER='NCEP-Radiation_aerosols v5.0 Aug 2012 '
! --- general use parameter constants:
!> num of output fields for SW rad
integer, parameter, public :: NF_AESW = 3
!> num of output fields for LW rad
integer, parameter, public :: NF_AELW = 3
!> starting band number in ir region
integer, parameter, public :: NLWSTR = 1
!> num of species for output aod (opnl)
integer, parameter, public :: NSPC = 5
!> total+species
integer, parameter, public :: NSPC1 = NSPC + 1
real (kind=kind_phys), parameter :: f_zero = 0.0
real (kind=kind_phys), parameter :: f_one = 1.0
! --- module control parameters set in subroutine "aer_init"
!> number of actual bands for sw aerosols; calculated according to
!! laswflg setting
integer, save :: NSWBND = NBDSW
!> number of actual bands for lw aerosols; calculated according to
!! lalwflg and lalw1bd settings
integer, save :: NLWBND = NBDLW
!> total number of bands for sw+lw aerosols
integer, save :: NSWLWBD = NBDSW+NBDLW
! LW aerosols effect control flag
! =.true.:aerosol effect is included in LW radiation
! =.false.:aerosol effect is not included in LW radiation
logical, save :: lalwflg = .true.
! SW aerosols effect control flag
! =.true.:aerosol effect is included in SW radiation
! =.false.:aerosol effect is not included in SW radiation
logical, save :: laswflg = .true.
! stratospheric volcanic aerosol effect flag
! =.true.:historical events of stratosphere volcanic aerosol effect
! is included radiation (limited by data availability)
! =.false.:volcanic aerosol effect is not included in radiation
logical, save :: lavoflg = .true.
logical, save :: lmap_new = .true. ! use new mapping method (set in aer_init)
! --------------------------------------------------------------------- !
! section-1 : module variables for spectral band interpolation !
! similar to gfdl-sw treatment (2000 version) !
! --------------------------------------------------------------------- !
! --- parameter constants:
!> num of wvnum regions where solar flux is constant
integer, parameter, public :: NWVSOL = 151
!> total num of wvnum included
integer, parameter, public :: NWVTOT = 57600
!> total num of wvnum in ir range
integer, parameter, public :: NWVTIR = 4000
!> number of wavenumbers in each region where the solar flux is constant
integer, dimension(NWVSOL), save :: nwvns0
data nwvns0 / 100, 11, 14, 18, 24, 33, 50, 83, 12, 12, &
& 13, 15, 15, 17, 18, 20, 21, 24, 26, 30, 32, 37, 42, &
& 47, 55, 64, 76, 91, 111, 139, 179, 238, 333, 41, 42, 45, &
& 46, 48, 51, 53, 55, 58, 61, 64, 68, 71, 75, 79, 84, &
& 89, 95, 101, 107, 115, 123, 133, 142, 154, 167, 181, 197, 217, &
& 238, 263, 293, 326, 368, 417, 476, 549, 641, 758, 909, 101, 103, &
& 105, 108, 109, 112, 115, 117, 119, 122, 125, 128, 130, 134, 137, &
& 140, 143, 147, 151, 154, 158, 163, 166, 171, 175, 181, 185, 190, &
& 196, 201, 207, 213, 219, 227, 233, 240, 248, 256, 264, 274, 282, &
& 292, 303, 313, 325, 337, 349, 363, 377, 392, 408, 425, 444, 462, &
& 483, 505, 529, 554, 580, 610, 641, 675, 711, 751, 793, 841, 891, &
& 947,1008,1075,1150,1231,1323,1425,1538,1667,1633,14300 /
!> solar flux \f$w/m^2\f$ in each wvnumb region where it is constant
real (kind=kind_phys), dimension(NWVSOL), save :: s0intv
data s0intv( 1: 50) / &
& 1.60000E-6, 2.88000E-5, 3.60000E-5, 4.59200E-5, 6.13200E-5, &
& 8.55000E-5, 1.28600E-4, 2.16000E-4, 2.90580E-4, 3.10184E-4, &
& 3.34152E-4, 3.58722E-4, 3.88050E-4, 4.20000E-4, 4.57056E-4, &
& 4.96892E-4, 5.45160E-4, 6.00600E-4, 6.53600E-4, 7.25040E-4, &
& 7.98660E-4, 9.11200E-4, 1.03680E-3, 1.18440E-3, 1.36682E-3, &
& 1.57560E-3, 1.87440E-3, 2.25500E-3, 2.74500E-3, 3.39840E-3, &
& 4.34000E-3, 5.75400E-3, 7.74000E-3, 9.53050E-3, 9.90192E-3, &
& 1.02874E-2, 1.06803E-2, 1.11366E-2, 1.15830E-2, 1.21088E-2, &
& 1.26420E-2, 1.32250E-2, 1.38088E-2, 1.44612E-2, 1.51164E-2, &
& 1.58878E-2, 1.66500E-2, 1.75140E-2, 1.84450E-2, 1.94106E-2 /
data s0intv( 51:100) / &
& 2.04864E-2, 2.17248E-2, 2.30640E-2, 2.44470E-2, 2.59840E-2, &
& 2.75940E-2, 2.94138E-2, 3.13950E-2, 3.34800E-2, 3.57696E-2, &
& 3.84054E-2, 4.13490E-2, 4.46880E-2, 4.82220E-2, 5.22918E-2, &
& 5.70078E-2, 6.19888E-2, 6.54720E-2, 6.69060E-2, 6.81226E-2, &
& 6.97788E-2, 7.12668E-2, 7.27100E-2, 7.31610E-2, 7.33471E-2, &
& 7.34814E-2, 7.34717E-2, 7.35072E-2, 7.34939E-2, 7.35202E-2, &
& 7.33249E-2, 7.31713E-2, 7.35462E-2, 7.36920E-2, 7.23677E-2, &
& 7.25023E-2, 7.24258E-2, 7.20766E-2, 7.18284E-2, 7.32757E-2, &
& 7.31645E-2, 7.33277E-2, 7.36128E-2, 7.33752E-2, 7.28965E-2, &
& 7.24924E-2, 7.23307E-2, 7.21050E-2, 7.12620E-2, 7.10903E-2 /
data s0intv(101:151) / 7.12714E-2, &
& 7.08012E-2, 7.03752E-2, 7.00350E-2, 6.98639E-2, 6.90690E-2, &
& 6.87621E-2, 6.52080E-2, 6.65184E-2, 6.60038E-2, 6.47615E-2, &
& 6.44831E-2, 6.37206E-2, 6.24102E-2, 6.18698E-2, 6.06320E-2, &
& 5.83498E-2, 5.67028E-2, 5.51232E-2, 5.48645E-2, 5.12340E-2, &
& 4.85581E-2, 4.85010E-2, 4.79220E-2, 4.44058E-2, 4.48718E-2, &
& 4.29373E-2, 4.15242E-2, 3.81744E-2, 3.16342E-2, 2.99615E-2, &
& 2.92740E-2, 2.67484E-2, 1.76904E-2, 1.40049E-2, 1.46224E-2, &
& 1.39993E-2, 1.19574E-2, 1.06386E-2, 1.00980E-2, 8.63808E-3, &
& 6.52736E-3, 4.99410E-3, 4.39350E-3, 2.21676E-3, 1.33812E-3, &
& 1.12320E-3, 5.59000E-4, 3.60000E-4, 2.98080E-4, 7.46294E-5 /
real (kind=kind_phys), dimension(NBDSW), save :: wvn_sw1, wvn_sw2
real (kind=kind_phys), dimension(NBDLW), save :: wvn_lw1, wvn_lw2
! --------------------------------------------------------------------- !
! section-2 : module variables for stratospheric volcanic aerosols !
! from historical data (sato et al. 1993) !
! --------------------------------------------------------------------- !
! --- parameter constants:
!> lower limit (year) data available
integer, parameter :: MINVYR = 1850
!> upper limit (year) data available
integer, parameter :: MAXVYR = 1999
!> monthly, 45-deg lat-zone aerosols data set in subroutine 'aer_init'
integer, allocatable, save :: ivolae(:,:,:)
! --- static control variables:
!> starting year of data in the input file
integer :: kyrstr
!> ending year of data in the input file
integer :: kyrend
!> the year of data in use in the input file
integer :: kyrsav
!> the month of data in use in the input file
integer :: kmonsav
! --------------------------------------------------------------------- !
! section-3 : module variables for opac climatological aerosols !
! optical properties (hess et al. 1989) !
! --------------------------------------------------------------------- !
! --- parameters and constants:
!> num of max componets in a profile
integer, parameter :: NXC = 5
!> num of aerosols profile structures
integer, parameter :: NAE = 7
!> num of atmos aerosols domains
integer, parameter :: NDM = 5
!> num of lon-points in glb aeros data set
integer, parameter :: IMXAE = 72
!> num of lat-points in glb aeros data set
integer, parameter :: JMXAE = 37
!> num of bands for clim aer data (opac)
integer, parameter :: NAERBND=61
!> num of rh levels for rh-dep components
integer, parameter :: NRHLEV =8
!> num of rh independent aeros species
integer, parameter :: NCM1 = 6
!> num of rh dependent aeros species
integer, parameter :: NCM2 = 4
integer, parameter :: NCM = NCM1+NCM2
!> predefined relative humidity levels
real (kind=kind_phys), dimension(NRHLEV), save :: rhlev
data rhlev (:) / 0.0, 0.5, 0.7, 0.8, 0.9, 0.95, 0.98, 0.99 /
! --- the following arrays are for climatological data that are
! allocated and read in subroutine 'clim_aerinit'.
! - global aerosol distribution:
! haer (NDM,NAE) - scale height of aerosols (km)
! prsref(NDM,NAE) - ref pressure lev (sfc to toa) in mb (100Pa)
! sigref(NDM,NAE) - ref sigma lev (sfc to toa)
!> scale height of aerosols (km)
real (kind=kind_phys), save, dimension(NDM,NAE) :: haer
!> ref pressure lev (sfc to toa) in mb (100Pa)
real (kind=kind_phys), save, dimension(NDM,NAE) :: prsref
!> ref sigma lev (sfc to toa)
real (kind=kind_phys), save, dimension(NDM,NAE) :: sigref
! --- the following arrays are allocate and setup in subr 'clim_aerinit'
! - for relative humidity independent aerosol optical properties:
! species : insoluble (inso); soot (soot);
! mineral nuc mode (minm); mineral acc mode (miam);
! mineral coa mode (micm); mineral transport(mitr).
! extrhi(NCM1,NSWLWBD) - extinction coefficient for sw+lw spectral band
! scarhi(NCM1,NSWLWBD) - scattering coefficient for sw+lw spectral band
! ssarhi(NCM1,NSWLWBD) - single scattering albedo for sw+lw spectral band
! asyrhi(NCM1,NSWLWBD) - asymmetry parameter for sw+lw spectral band
! - for relative humidity dependent aerosol optical properties:
! species : water soluble (waso); sea salt acc mode(ssam);
! sea salt coa mode(sscm); sulfate droplets (suso).
! rh level: 00%, 50%, 70%, 80%, 90%, 95%, 98%, 99%
! extrhd(NRHLEV,NCM2,NSWLWBD) - extinction coefficient for sw+lw band
! scarhd(NRHLEV,NCM2,NSWLWBD) - scattering coefficient for sw+lw band
! ssarhd(NRHLEV,NCM2,NSWLWBD) - single scattering albedo for sw+lw band
! asyrhd(NRHLEV,NCM2,NSWLWBD) - asymmetry parameter for sw+lw band
! - for stratospheric aerosols optical properties:
! extstra(NSWLWBD) - extinction coefficient for sw+lw band
real (kind=kind_phys), allocatable, save, dimension(:,:) :: &
& extrhi, scarhi, ssarhi, asyrhi
real (kind=kind_phys), allocatable, save, dimension(:,:,:) :: &
& extrhd, scarhd, ssarhd, asyrhd
real (kind=kind_phys), allocatable, save, dimension(:) :: &
& extstra
! --- the following arrays are calculated in subr 'clim_aerinit'
! - for topospheric aerosol profile distibution:
! kprfg ( IMXAE*JMXAE) - aeros profile index
! idxcg (NXC*IMXAE*JMXAE) - aeros component index
! cmixg (NXC*IMXAE*JMXAE) - aeros component mixing ratio
! denng ( 2 *IMXAE*JMXAE) - aerosols number density
!> \name topospheric aerosol profile distribution
!> aeros component mixing ratio
real (kind=kind_phys), dimension(NXC,IMXAE,JMXAE), save :: cmixg
!> aeros number density
real (kind=kind_phys), dimension( 2 ,IMXAE,JMXAE), save :: denng
!> aeros component index
integer, dimension(NXC,IMXAE,JMXAE), save :: idxcg
!> aeros profile index
integer, dimension( IMXAE,JMXAE), save :: kprfg
! --------------------------------------------------------------------- !
! section-4 : module variables for gocart aerosol optical properties !
! --------------------------------------------------------------------- !
!> \name module variables for gocart aerosol optical properties
! --- parameters and constants:
!> num of bands for aer data (gocart)
integer, parameter :: KAERBNDD=61
integer, parameter :: KAERBNDI=56
!> num of rh levels for rh-dep components
integer, parameter :: KRHLEV =36
!> num of gocart rh indep aerosols
integer, parameter :: KCM1 = 5
!> num of gocart rh dep aerosols
integer, parameter :: KCM2 = 10
!> num of gocart aerosols
integer, parameter :: KCM = KCM1 + KCM2
real (kind=kind_phys), dimension(KRHLEV) :: rhlev_grt &
data rhlev_grt (:)/ .00, .05, .10, .15, .20, .25, .30, .35, &
& .40, .45, .50, .55, .60, .65, .70, .75, .80, .81, .82, &
& .83, .84, .85, .86, .87, .88, .89, .90, .91, .92, .93, &
& .94, .95, .96, .97, .98, .99 /
!> \name relative humidity independent aerosol optical properties:
!! species: du001, du002, du003, du004, du005
! extrhi_grt(KCM1,NSWLWBD) - extinction coefficient for sw+lw band
! scarhi_grt(KCM1,NSWLWBD) - scattering coefficient for sw+lw band
! ssarhi_grt(KCM1,NSWLWBD) - single scattering albedo for sw+lw band
! asyrhi_grt(KCM1,NSWLWBD) - asymmetry parameter for sw+lw band
real (kind=kind_phys),allocatable,save,dimension(:,:) :: &
& extrhi_grt, extrhi_grt_550, scarhi_grt, ssarhi_grt, asyrhi_grt
!
!> \name relative humidity dependent aerosol optical properties:
!! species : ss001, ss002, ss003, ss004, ss005, so4,
!! bcphobic, bcphilic, ocphobic, ocphilic
! extrhd_grt(KRHLEV,KCM2,NSWLWBD) - extinction coefficient for sw+lw band
! scarhd_grt(KRHLEV,KCM2,NSWLWBD) - scattering coefficient for sw+lw band
! ssarhd_grt(KRHLEV,KCM2,NSWLWBD) - single scattering albedo for sw+lw band
! asyrhd_grt(KRHLEV,KCM2,NSWLWBD) - asymmetry parameter for sw+lw band
!> extinction coefficient
real (kind=kind_phys),allocatable,save,dimension(:,:,:) :: &
& extrhd_grt, extrhd_grt_550, scarhd_grt, ssarhd_grt, asyrhd_grt
!> gocart species
integer, parameter :: num_gc = 5
character*2 :: gridcomp(num_gc)
integer, dimension (num_gc):: num_radius, radius_lower
integer, dimension (num_gc):: trc_to_aod
data gridcomp /'DU', 'SS', 'SU', 'BC', 'OC'/
data num_radius /5, 5, 1, 2, 2 /
data radius_lower /1, 6, 11, 12, 14 /
data trc_to_aod /1, 5, 4, 2, 3/ ! dust, soot, waso, suso, ssam
! =======================================================================
! --------------------------------------------------------------------- !
! section-5 : module variables for aod diagnostic !
! --------------------------------------------------------------------- !
!! --- the following are for diagnostic purpose to output aerosol optical depth
! aod from 10 components are grouped into 5 major different species:
! 1:dust (inso,minm,miam,micm,mitr); 2:black carbon (soot)
! 3:water soluble (waso); 4:sulfate (suso); 5:sea salt (ssam,sscm)
!
! idxspc (NCM) - index conversion array
! lspcaod - logical flag for aod from individual species
!
!> index conversion array:data idxspc / 1, 2, 1, 1, 1, 1, 3, 5, 5, 4 /
integer, dimension(NCM) :: idxspc
data idxspc / 1, 2, 1, 1, 1, 1, 3, 5, 5, 4 /
!
! - wvn550 is the wavenumber (1/cm) of wavelenth 550nm for diagnostic aod output
! nv_aod is the sw spectral band covering wvn550 (comp in aer_init)
!
!> the wavenumber (\f$cm^-1\f$) of wavelength 550nm for diagnostic aod output
real (kind=kind_phys), parameter :: wvn550 = 1.0e4/0.55
!> the sw spectral band covering wvn550 (comp in aer_init)
integer, save :: nv_aod = 1
integer :: i550,id550
! --- public interfaces
public aer_init, aer_update, setaer
! =================
contains
! =================
!> \defgroup mod_radiation_aerosols Radiation Aerosols Module
!> This module contains climatological atmospheric aerosol schemes for
!! radiation computations.
!!
!!\version NCEP-Radiation_aerosols v5.2 Jan 2013
!!
!!\n This module has three externally callable subroutines:
!! - aer_init() -- initialization; called at the start of run to set up
!! module parameters
!! - aer_update() -- updating aerosol data; called within the time loop
!! to check and update data sets
!! - setaer() -- mapping aeros profile, compute aeros opticals
!!
!!\n References:
!! - OPAC climatological aerosols:
!! Hou et al. 2002 \cite hou_et_al_2002; Hess et al. 1998
!! \cite hess_et_al_1998
!! - GOCART interactive aerosols:
!! Chin et al., 2000 \cite chin_et_al_2000
!! Colarco et al., 2010 - jgr, v115, D14207\cite colarco_et_al_2010
!!
!! - MERRA2 aerosol reanalysis:
!! Randles et al., 2017 - jclim, v30, 6823-6850\cite randles_et_al_2017
!! Buchard et al., 2017 - jclim, v30, 6851-6871\cite buchard_et_al_2017
!!
!! - Stratospheric volcanical aerosols:
!! Sato et al. 1993 \cite sato_et_al_1993
!!
!> The initialization program is to set up necessary parameters and
!! working arrays.
!!
!>\param NLAY number of model vertical layers (not used)
!>\param me print message control flag
!>\section gen_al General Algorithm
!-----------------------------------
subroutine aer_init &
& ( NLAY, me, iaermdl, iaerflg, lalw1bd, aeros_file, con_pi, &
& con_t0c, con_c, con_boltz, con_plnk, errflg, errmsg)
! ================================================================== !
! !
! aer_init is the initialization program to set up necessary !
! parameters and working arrays. !
! !
! inputs: !
! NLAY - number of model vertical layers (not used) !
! me - print message control flag !
! iaermdl - tropospheric aerosol model scheme flag !
! =0 opac-clim; =1 gocart-clim, =2 gocart-prognostic !
! =5 opac-clim new spectral mapping !
! lalw1bd = logical lw aeros propty 1 band vs multi-band cntl flag !
! =t use 1 broad band optical property !
! =f use multi bands optical property !
! !
! outputs: (CCPP error handling) !
! errmsg - CCPP error message !
! errflg - CCPP error flag !
! !
! internal module variables: !
! lalwflg - logical lw aerosols effect control flag !
! =t compute lw aerosol optical prop !
! laswflg - logical sw aerosols effect control flag !
! =t compute sw aerosol optical prop !
! lavoflg - logical stratosphere volcanic aerosol control flag !
! =t include volcanic aerosol effect !
! !
! internal module constants: !
! NWVSOL - num of wvnum regions where solar flux is constant !
! NWVTOT - total num of wave numbers used in sw spectrum !
! NWVTIR - total num of wave numbers used in the ir region !
! NSWBND - total number of sw spectral bands !
! NLWBND - total number of lw spectral bands !
! !
! usage: call aer_init !
! !
! subprograms called: clim_aerinit, gocart_aerinit, !
! wrt_aerlog, set_volcaer, set_spectrum, !
! !
! ================================================================== !
! --- inputs:
integer, intent(in) :: NLAY, me, iaermdl, iaerflg
logical, intent(in) :: lalw1bd
character(len=26),intent(in) :: aeros_file
real(kind_phys), intent(in) :: con_pi,con_t0c, con_c, con_boltz, &
& con_plnk
! --- output:
integer, intent(out) :: errflg
character(len=*), intent(out) :: errmsg
! --- locals:
real (kind=kind_phys), dimension(NWVTOT) :: solfwv ! one wvn sol flux
real (kind=kind_phys), dimension(NWVTIR) :: eirfwv ! one wvn ir flux
!
!===> ... begin here
!
! Initialize CCPP error handling variables
errmsg = ''
errflg = 0
kyrstr = 1
kyrend = 1
kyrsav = 1
kmonsav = 1
laswflg= (mod(iaerflg,10) > 0) ! control flag for sw tropospheric aerosol
lalwflg= (mod(iaerflg/10,10) > 0) ! control flag for lw tropospheric aerosol
lavoflg= (mod(iaerflg/100,10) >0) ! control flag for stratospheric volcanic aeros
!> -# Call wrt_aerlog to write aerosol parameter configuration to output logs.
if ( me == 0 ) then
call wrt_aerlog(iaermdl, iaerflg, lalw1bd, errflg, errmsg) ! write aerosol param info to log file
! --- inputs: (in scope variables)
! --- outputs: (CCPP error handling)
endif
if ( iaerflg == 0 ) return ! return without any aerosol calculations
! --- ... in sw, aerosols optical properties are computed for each radiation
! spectral band; while in lw, optical properties can be calculated
! for either only one broad band or for each of the lw radiation bands
if ( laswflg ) then
NSWBND = NBDSW
else
NSWBND = 0
endif
if ( lalwflg ) then
if ( lalw1bd ) then
NLWBND = 1
else
NLWBND = NBDLW
endif
else
NLWBND = 0
endif
NSWLWBD = NSWBND + NLWBND
wvn_sw1(:) = wvnsw1(:)
wvn_sw2(:) = wvnsw2(:)
wvn_lw1(:) = wvnlw1(:)
wvn_lw2(:) = wvnlw2(:)
! note: for result consistency, the defalt opac-clim aeros setting still use
! old spectral band mapping. use iaermdl=5 to use new mapping method
if ( iaermdl == 0 ) then ! opac-climatology scheme
lmap_new = .false.
wvn_sw1(2:NBDSW-1) = wvn_sw1(2:NBDSW-1) + 1
wvn_lw1(2:NBDLW) = wvn_lw1(2:NBDLW) + 1
else
lmap_new = .true.
endif
if ( iaerflg /= 100 ) then
!> -# Call set_spectrum to set up spectral one wavenumber solar/IR
!! fluxes.
call set_spectrum(con_pi, con_t0c, con_c, con_boltz, con_plnk, &
& errflg, errmsg)
! --- inputs: (module constants)
! --- outputs: (ccpp error handling)
!> -# Call clim_aerinit() to invoke tropospheric aerosol initialization.
if ( iaermdl==0 .or. iaermdl==5 ) then ! opac-climatology scheme
call clim_aerinit &
! --- inputs:
& ( solfwv, eirfwv, me, aeros_file, &
! --- outputs:
& errflg, errmsg)
elseif ( iaermdl==1 .or. iaermdl==2 ) then ! gocart clim/prog scheme
call gocart_aerinit &
! --- inputs:
& ( solfwv, eirfwv, me, &
! --- outputs:
& errflg, errmsg)
else
if ( me == 0 ) then
print *,' !!! ERROR in aerosol model scheme selection', &
& ' iaermdl =',iaermdl
errflg = 1
errmsg = 'ERROR(aer_init): aerosol model scheme selected'// &
& 'is invalid'
return
endif
endif
endif ! end if_iaerflg_block
!> -# Call set_volcaer to invoke stratospheric volcanic aerosol
!! initialization.
if ( lavoflg ) then
call set_volcaer(errflg, errmsg)
! --- inputs: (module variables)
! --- outputs: (module variables: ccpp error handling)
endif ! end if_lavoflg_block
! =================
contains
! =================
!> This subroutine writes aerosol parameter configuration to run log file.
!--------------------------------
subroutine wrt_aerlog(iaermdl, iaerflg, lalw1bd, errflg, errmsg)
! ================================================================== !
! !
! subprogram : wrt_aerlog !
! !
! write aerosol parameter configuration to run log file. !
! !
! ==================== defination of variables =================== !
! !
! internal module variables: !
! lalwflg - toposphere lw aerosol effect: =f:no; =t:yes !
! laswflg - toposphere sw aerosol effect: =f:no; =t:yes !
! lavoflg - stratosphere volcanic aeros effect: =f:no; =t:yes !
! !
! inputs: !
! iaerflg - aerosol effect control flag: 3-digits (volc,lw,sw) !
! iaermdl - tropospheric aerosol model scheme flag !
! !
! outputs: !
! errmsg - CCPP error message !
! errflg - CCPP error flag !
! !
! subroutines called: none !
! !
! usage: call wrt_aerlog !
! !
! ================================================================== !
! --- inputs: ()
integer, intent(in) :: iaermdl, iaerflg
logical, intent(in) :: lalw1bd
! --- output: (CCPP error handling)
integer, intent(out) :: errflg
character(len=*), intent(out) :: errmsg
! --- locals:
!
!===> ... begin here
!
! Initialize CCPP error handling variables
errmsg = ''
errflg = 0
print *, VTAGAER ! print out version tag
if ( iaermdl==0 .or. iaermdl==5 ) then
print *,' - Using OPAC-seasonal climatology for tropospheric', &
& ' aerosol effect'
elseif ( iaermdl == 1 ) then
print *,' - Using GOCART-climatology for tropospheric', &
& ' aerosol effect'
elseif ( iaermdl == 2 ) then
print *,' - Using GOCART-prognostic aerosols for tropospheric', &
& ' aerosol effect'
else
print *,' !!! ERROR in selection of aerosol model scheme', &
& ' IAER_MDL =',iaermdl
errflg = 1
errmsg = 'ERROR(wrt_aerlog): Selected aerosol model scheme is'//&
& 'is invalid'
return
endif ! end_if_iaermdl_block
print *,' IAER=',iaerflg,' LW-trop-aer=',lalwflg, &
& ' SW-trop-aer=',laswflg,' Volc-aer=',lavoflg
if ( iaerflg <= 0 ) then ! turn off all aerosol effects
print *,' - No tropospheric/volcanic aerosol effect included'
print *,' Input values of aerosol optical properties to' &
& ,' both SW and LW radiations are set to zeros'
else
if ( iaerflg >= 100 ) then ! incl stratospheric volcanic aerosols
print *,' - Include stratospheric volcanic aerosol effect'
else ! no stratospheric volcanic aerosols
print *,' - No stratospheric volcanic aerosol effect'
endif
if ( laswflg ) then ! chcek for sw effect
print *,' - Compute multi-band aerosol optical' &
& ,' properties for SW input parameters'
else
print *,' - No SW radiation aerosol effect, values of' &
& ,' aerosol properties to SW input are set to zeros'
endif
if ( lalwflg ) then ! check for lw effect
if ( lalw1bd ) then
print *,' - Compute 1 broad-band aerosol optical' &
& ,' properties for LW input parameters'
else
print *,' - Compute multi-band aerosol optical' &
& ,' properties for LW input parameters'
endif
else
print *,' - No LW radiation aerosol effect, values of' &
& ,' aerosol properties to LW input are set to zeros'
endif
endif ! end if_iaerflg_block
!
return
!................................
end subroutine wrt_aerlog
!--------------------------------
!> This subroutine defines the one wavenumber solar fluxes based on toa
!! solar spectral distribution, and define the one wavenumber IR fluxes
!! based on black-body emission distribution at a predefined temperature.
subroutine set_spectrum(con_pi, con_t0c, con_c, con_boltz, &
& con_plnk, errflg, errmsg)
! ================================================================== !
! !
! subprogram : set_spectrum !
! !
! define the one wavenumber solar fluxes based on toa solar spectral!
! distrobution, and define the one wavenumber ir fluxes based on !
! black-body emission distribution at a predefined temperature. !
! !
! ==================== defination of variables =================== !
! !
!> - inputs: (CCPP Interstitials)
!! - con_pi: Physical constant (pi)
!! - con_t0c: Physical constant (temperature kelvin at zero celcius)
!! - con_c: Physical constant (speed of light)
!! - con_boltz: Physical constant (Boltzmann constant)
!! - con_plnk: Physical constant (Planck constant)
!!
!> - inputs: (in-scope variables)
!! - NWVTOT: total num of wave numbers used in sw spectrum
!! - NWVTIR: total num of wave numbers used in the ir region
!!
!> - outputs: (in-scope variables)
!! - solfwv(NWVTOT): solar flux for each individual wavenumber
!! (\f$W/m^2\f$)
!! - eirfwv(NWVTIR): ir flux(273k) for each individual wavenumber
!! (\f$W/m^2\f$)
!!
!> - outputs: (CCPP error-handling)
!! - errflg: CCPP error flag
!! - errmsg: CCPP error message
! !
! subroutines called: none !
! !
! usage: call set_spectrum !
! !
! ================================================================== !
! --- inputs: (module constants)
! integer :: NWVTOT, NWVTIR
! --- inputs: (CCPP Interstitials)
real(kind_phys),intent(in) :: con_pi, con_t0c, con_c, con_boltz, &
& con_plnk
! --- output: (in-scope variables)
! real (kind=kind_phys), dimension(NWVTOT) :: solfwv ! one wvn sol flux
! real (kind=kind_phys), dimension(NWVTIR) :: eirfwv ! one wvn ir flux
! --- output: (CCPP error-handling)
integer, intent(out) :: errflg
character(len=*), intent(out) :: errmsg
! --- locals:
real (kind=kind_phys) :: soltot, tmp1, tmp2, tmp3
integer :: nb, nw, nw1, nw2, nmax, nmin
! Initialize CCPP error handling variables
errmsg = ''
errflg = 0
!
!===> ... begin here
!
! nmax = min( NWVTOT, nint( maxval(wvnsw2) ))
! nmin = max( 1, nint( minval(wvnsw1) ))
! --- check print
! print *,' MINWVN, MAXWVN = ',nmin, nmax
! --- ... define the one wavenumber solar fluxes based on toa solar
! spectral distribution
! soltot1 = f_zero
! soltot = f_zero
do nb = 1, NWVSOL
if ( nb == 1 ) then
nw1 = 1
else
nw1 = nw1 + nwvns0(nb-1)
endif
nw2 = nw1 + nwvns0(nb) - 1
do nw = nw1, nw2
solfwv(nw) = s0intv(nb)
! soltot1 = soltot1 + s0intv(nb)
! if ( nw >= nmin .and. nw <= nmax ) then
! soltot = soltot + s0intv(nb)
! endif
enddo
enddo
! --- ... define the one wavenumber ir fluxes based on black-body
! emission distribution at a predefined temperature
tmp1 = (con_pi + con_pi) * con_plnk * con_c* con_c
tmp2 = con_plnk * con_c / (con_boltz * con_t0c)
!$omp parallel do private(nw,tmp3)
do nw = 1, NWVTIR
tmp3 = 100.0 * nw
eirfwv(nw) = (tmp1 * tmp3**3) / (exp(tmp2*tmp3) - 1.0)
enddo
!
return
!................................
end subroutine set_spectrum
!--------------------------------
!> The initialization program for stratospheric volcanic aerosols.
!-----------------------------
subroutine set_volcaer(errflg, errmsg)
!.............................
! --- inputs: ( none ) !
! outputs: (CCPP error handling) !
! errflg - CCPP error flag !
! errmsg - CCPP error message !
! ================================================================== !
! !
! subprogram : set_volcaer !
! !
! this is the initialization progrmam for stratospheric volcanic !
! aerosols. !
! !
! subroutines called: none !
! !
! usage: call set_volcaer !
! !
! ================================================================== !
! --- inputs: (none)
! --- output: (CCPP error handling)
! integer :: ivolae(:,:,:)
integer, intent(out) :: errflg
character(len=*), intent(out) :: errmsg
! --- locals:
!
!===> ... begin here
!
! Initialize CCPP error handling variables
errmsg = ''
errflg = 0
! --- allocate data space
if ( .not. allocated(ivolae) ) then
allocate ( ivolae(12,4,10) ) ! for 12-mon,4-lat_zone,10-year
endif
!
return
!................................
end subroutine set_volcaer
!--------------------------------
!
!...................................
end subroutine aer_init
!-----------------------------------
!> This subroutine is the opac-climatology aerosol initialization
!! program to set up necessary parameters and working arrays.
!>\param solfwv (NWVTOT), solar flux for each individual wavenumber
!! \f$(w/m^2)\f$
!!\param eirfwv (NWVTIR), IR flux(273k) for each individual wavenumber
!! \f$(w/m^2)\f$
!!\param me print message control flag
!!
!!\section gen_clim_aerinit General Algorithm
subroutine clim_aerinit &
& ( solfwv, eirfwv, me, aeros_file, & ! --- inputs
& errflg, errmsg) ! --- outputs
! ================================================================== !
! !
! clim_aerinit is the opac-climatology aerosol initialization program !
! to set up necessary parameters and working arrays. !
! !
! inputs: !
! solfwv(NWVTOT) - solar flux for each individual wavenumber (w/m2)!
! eirfwv(NWVTIR) - ir flux(273k) for each individual wavenum (w/m2)!
! me - print message control flag !
! aeros_file - external aerosol data file name !
! !
! outputs: (CCPP error handling) !
! errflg - CCPP error flag !
! errmsg - CCPP error message !
! !
! internal module variables: !
! lalwflg - logical lw aerosols effect control flag !
! =t compute lw aerosol optical prop !
! laswflg - logical sw aerosols effect control flag !
! =t compute sw aerosol optical prop !
! !
! module constants: !
! NWVSOL - num of wvnum regions where solar flux is constant !
! NWVTOT - total num of wave numbers used in sw spectrum !
! NWVTIR - total num of wave numbers used in the ir region !
! NSWBND - total number of sw spectral bands !
! NLWBND - total number of lw spectral bands !
! NAERBND - number of bands for climatology aerosol data !
! NCM1 - number of rh independent aeros species !
! NCM2 - number of rh dependent aeros species !
! !
! usage: call clim_aerinit !
! !
! subprograms called: set_aercoef, optavg !
! !
! ================================================================== !
! --- inputs:
real (kind=kind_phys), dimension(:) :: solfwv ! one wvn sol flux
real (kind=kind_phys), dimension(:) :: eirfwv ! one wvn ir flux