-
Notifications
You must be signed in to change notification settings - Fork 11
/
GFS_radiation_driver.F90
2195 lines (1973 loc) · 113 KB
/
GFS_radiation_driver.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
!> \file grrad.f This file is the radiation driver module. It prepares
!! the atmospheric profiles and invokes the main radiation calculation.
!> \defgroup rad RRTMG Shortwave/Longwave Radiation Scheme
!> @{
!! \brief The GFS radiation scheme
!! \details Radiative processes are among the most complex and
!! computationally intensive parts of all model physics. As an
!! essential component of modeling the atmosphere, radiation directly
!! and indirectly connects all physics processes with model dynamics,
!! and it regulates the overall earth-atmosphere energy exchanges and
!! transformations.
!!
!! The radiation package in GFS physics has standardized component
!! modules (Table 1). The radiation driver module (\ref
!! module_radiation_driver) is the interface with the Interoperable
!! Physics Driver (IPD) for NGGPS, and it has three subroutines called
!! by IPD (Figure 1):
!! - radinit() is called in subroutine nuopc_phys_init to set up
!! radiation related fixed parameters.
!! - radupdate() is called in subroutine nuopc_rad_update to update
!! values between timesteps.
!! - grrad() is called in subroutine nuopc_rad_run, and it is the
!! driver of radiation calculation.
!! \image html ipd_rad.png "Figure 1: Schematic illustration of the communication between the GFS radiation package and IPD " width=10cm
!!
!! The schematic radiation module structure is shown in Table 1.
!! \image html schematic_Rad_mod.png "Table 1: Schematic Radiation Module Structure" width=10cm
!!
!> GFS radiation package is intended to provide a fast and accurate
!! method of determining the total radiative flux at any given
!! location. These calculations provide both the total radiative flux
!! at the ground surface, which is needed to establish the surface
!! energy budget, and the vertical radiative flux divergence, which is
!! used to calculate the radiative heating and cooling rates of a given
!! atmospheric layer. The magnitude of the terms in the surface energy
!! budget can set the stage for moist deep convection and are crucial
!! to the formation of low-level clouds. In addition, the vertical
!! radiative flux divergence can produce substantial cooling,
!! particularly at the tops of clouds, which can have strong dynamical
!! effects on cloud evolution.
!!
!! It uses a correlated-k distribution method and a transmittance lookup
!! table that is linearly scaled by optical depth to achieve high
!! accuracy and efficiency. The algorithm contains 140 unevenly
!! distributed quadrature points (reduced from the original set of 256)
!! to integrate the cumulative probability distribution functions of
!! absorption over 16 spectral bands. It employs the
!! Clough-Kneizys-Davies (CKD_2.4) continuum model (Clough et al. 1992
!! \cite clough_et_al_1992) to compute absorption by water vapor at the
!! continuum band. Longwave cloud radiative properties external to the
!! RRTM depend on cloud liquid/ice water path and the effective radius
!! of ice particles and water droplets (Hu and Stamnes 1993 \cite
!! hu_and_stamnes_1993; Ebert and Curry 1992 \cite ebert_and_curry_1992).
!!
!! Changes to Radiation Parameterization since 2007:
!! \n The longwave (LW) and the shortwave (SW) radiation
!! parameterizations in NCEP's operational GFS are both modified and
!! optimized versions of the Rapid Radiative Transfer Model for GCMs
!! (RRTMG_LW v2.3 and RRTMG_SW v2.3, respectively) developed at AER
!! (Iacono et al. 2008 \cite iacono_et_al_2008,Mlawer et al. 1997
!! \cite mlawer_et_al_1997, Iacono et al., 2000 \cite iacono_et_al_2000,
!! Clough et al., 2005 \cite clough_et_al_2005). The LW algorithm
!! contains 140 unevenly distributed g-points (quadrature points) in 16
!! broad spectral bands, while the SW algorithm includes 112 g-points
!! in 14 bands. In addition to the major atmospheric absorbing gases of
!! ozone, water vapor, and carbon dioxide, the algorithm also includes
!! various minor absorbing species such as methane, nitrous oxide,
!! oxygen, and in the longwave up to four types of halocarbons (CFCs).
!! To represent statistically the unresolved subgrid cloud variability
!! when dealing multi layered clouds, a Monte-Carlo Independent Column
!! Approximation (McICA) method is used in the RRTMG radiative transfer.
!! A maximum-random cloud overlap method is used in both LW and SW
!! radiation calculations. Cloud condensate path and effective radius
!! for water and ice are used for the calculation of cloud-radiative
!! properties. Hu and Stamnes's method (1993) \cite hu_and_stamnes_1993
!! is used to treat water clouds in both LW and SW parameterizations.
!! For ice clouds. Fu's parameterizations (1996,1998) \cite fu_1996
!! \cite fu_et_al_1998 are used in the SW and LW, respectively.
!!
!! In the operational GFS, a climatological tropospheric aerosol with
!! a 5-degree horizontal resolution is used in both LW and SW
!! radiations. A generalized spectral mapping formulation was developed
!! to compute radiative properties of various aerosol components for
!! each of the radiation spectral bands. A separate stratospheric
!! volcanic aerosol parameterization was added that is capable of
!! handling volcanic events. In SW, a new table of incoming solar
!! constants is derived covering time period of 1850-2019 (Vandendool,
!! personal communivation). An eleven-year solar cycle approximation
!! will be used for time out of the window period in long term climate
!! simulations. The SW albedo parameterization uses surface vegetation
!! type based seasonal climatology similar to that described in the
!! NCEP OFFICE Note 441 (Hou et al. 2002 \cite hou_et_al_2002) but with
!! a modification in the treatment of solar zenith angle dependency over
!! snow-free land surface (Yang et al. 2008 \cite yang_et_al_2008).
!! Similarly, vegetation type based non-black-body surface emissivity
!! is used for the LW radiation. Concentrations of atmospheric
!! greenhouse gases are either obtained from global network
!! measurements, such as carbon dioxide (CO2), or taking the
!! climatological constants, the actual CO2 value for the forecast time
!! is an estimation based on the most recent five-year observations. In
!! the lower atmosphere (<3km) a monthly mean CO2 distribution in 15
!! degree horizontal resolution is used, while a global mean monthly
!! value is used in the upper atmosphere.
!!
!> \defgroup module_radiation_driver module_radiation_driver
!> @{
!! \brief The GFS radiation driver module
!! \details module_radiation_driver prepares the atmospheric profile,
!! invokes the main radiation calculations, and computes radiative
!! fluxes and heating rates for some arbitrary number of vertical
!! columns. This module also regulates the logistic running flow of
!! the computations, such as data initialization and update accordance
!! with forecast timing progress, the sequential order of subroutine
!! calls, and sorting results for final output.
!! There are three externally accessible subroutines:
!! - radinit(): the initialization subroutine of radiation calculations
!! It is invoked by the model's initialization process and is independent
!! with forecat time progress.
!! - radupdate(): calls many update subroutines to check and update
!! radiation required but time varying data sets and module variables.
!! It is placed inside a model's time advancing loop.
!! - grrad(): the driver of radiation calculation subroutines. It sets
!! up profile variables for radiation input, including clouds, surface
!! albedos, atmospheric aerosols, ozone, etc. It is located inside the
!! timing loop, and control the sequence of the radiative process
!! calculations.
!! \version NCEP-Radiation_driver v5.2 Jan 2013
! ========================================================== !!!!!
! 'module_radiation_driver' descriptions !!!!!
! ========================================================== !!!!!
! !
! this is the radiation driver module. it prepares atmospheric !
! profiles and invokes main radiation calculations. !
! !
! in module 'module_radiation_driver' there are twe externally !
! callable subroutine: !
! !
! 'radinit' -- initialization routine !
! input: !
! ( si, NLAY, me ) !
! output: !
! ( none ) !
! !
! 'radupdate' -- update time sensitive data used by radiations !
! input: !
! ( idate,jdate,deltsw,deltim,lsswr, me ) !
! output: !
! ( slag,sdec,cdec,solcon ) !
! !
! 'grrad' -- setup and invoke main radiation calls !
! input: !
! ( prsi,prsl,prslk,tgrs,qgrs,tracer,vvl,slmsk, !
! xlon,xlat,tsfc,snowd,sncovr,snoalb,zorl,hprim, !
! alvsf,alnsf,alvwf,alnwf,facsf,facwf,fice,tisfc, !
! sinlat,coslat,solhr,jdate,solcon, !
! cv,cvt,cvb,fcice,frain,rrime,flgmin, !
! icsdsw,icsdlw, ntcw,ncld,ntoz, NTRAC,NFXR, !
! dtlw,dtsw, lsswr,lslwr,lssav, !
! IX, IM, LM, me, lprnt, ipt, kdt,deltaq,sup,cnvw,cnvc, !
! output: !
! htrsw,topfsw,sfcfsw,dswcmp,uswcmp,sfalb,coszen,coszdg, !
! htrlw,topflw,sfcflw,tsflw,semis,cldcov, !
! input/output: !
! fluxr !
! optional output: !
! htrlw0,htrsw0,htrswb,htrlwb !
! !
! !
! external modules referenced: !
! 'module physparam' in 'physparam.f' !
! 'module funcphys' in 'funcphys.f' !
! 'module physcons' in 'physcons.f' !
! !
! 'module module_radiation_gases' in 'radiation_gases.f' !
! 'module module_radiation_aerosols' in 'radiation_aerosols.f' !
! 'module module_radiation_surface' in 'radiation_surface.f' !
! 'module module_radiation_clouds' in 'radiation_clouds.f' !
! !
! 'module module_radsw_cntr_para' in 'radsw_xxxx_param.f' !
! 'module module_radsw_parameters' in 'radsw_xxxx_param.f' !
! 'module module_radsw_main' in 'radsw_xxxx_main.f' !
! !
! 'module module_radlw_cntr_para' in 'radlw_xxxx_param.f' !
! 'module module_radlw_parameters' in 'radlw_xxxx_param.f' !
! 'module module_radlw_main' in 'radlw_xxxx_main.f' !
! !
! where xxxx may vary according to different scheme selection !
! !
! !
! program history log: !
! mm-dd-yy ncep - created program grrad !
! 08-12-03 yu-tai hou - re-written for modulized radiations !
! 11-06-03 yu-tai hou - modified !
! 01-18-05 s. moorthi - NOAH/ICE model changes added !
! 05-10-05 yu-tai hou - modified module structure !
! 12-xx-05 s. moorthi - sfc lw flux adj by mean temperature !
! 02-20-06 yu-tai hou - add time variation for co2 data, and !
! solar const. add sfc emiss change !
! 03-21-06 s. Moorthi - added surface temp over ice !
! 07-28-06 yu-tai hou - add stratospheric vocanic aerosols !
! 03-14-07 yu-tai hou - add generalized spectral band interp !
! for aerosol optical prop. (sw and lw) !
! 04-10-07 yu-tai hou - spectral band sw/lw heating rates !
! 05-04-07 yu-tai hou - make options for clim based and modis !
! based (h. wei and c. marshall) albedo !
! 09-05-08 yu-tai hou - add the initial date and time 'idate' !
! and control param 'ICTM' to the passing param list!
! to handel different time/date requirements for !
! external data (co2, aeros, solcon, ...) !
! 10-10-08 yu-tai hou - add the ICTM=-2 option for combining !
! initial condition data with seasonal cycle from !
! climatology. !
! 03-12-09 yu-tai hou - use two time stamps to keep tracking !
! dates for init cond and fcst time. remove volcanic!
! aerosols data in climate hindcast (ICTM=-2). !
! 03-16-09 yu-tai hou - included sub-column clouds approx. !
! control flags isubcsw/isubclw in initialization !
! subroutine. passed auxiliary cloud control arrays !
! icsdsw/icsdlw (if isubcsw/isubclw =2, it will be !
! the user provided permutation seeds) to the sw/lw !
! radiation calculation programs. also moved cloud !
! overlapping control flags iovrsw/iovrlw from main !
! radiation routines to the initialization routines.!
! 04-02-09 yu-tai hou - modified surface control flag iems to !
! have additional function of if the surface-air !
! interface have the same or different temperature !
! for radiation calculations. !
! 04-03-09 yu-tai hou - modified to add lw surface emissivity !
! as output variable. changed the sign of sfcnsw to !
! be positive value denote solar flux goes into the !
! ground (this is needed to reduce sign confusion !
! in other part of model) !
! 09-09-09 fanglin yang (thru s.moorthi) added QME5 QME6 to E-20!
! 01-09-10 sarah lu - added gocart option, revised grrad for!
! gocart coupling. calling argument modifed: ldiag3 !
! removed; cldcov/fluxr sequence changed; cldcov is !
! changed from accumulative to instant field and !
! from input/output to output field !
! 01-24-10 sarah lu - added aod to fluxr, added prslk and !
! oz to setaer input argument (for gocart coupling),!
! added tau_gocart to setaer output argument (for, !
! aerosol diag by index of nv_aod) !
! 07-08-10 s.moorthi - updated the NEMS version for new physics !
! 07-28-10 yu-tai hou - changed grrad interface to allow all !
! components of sw/lw toa/sfc instantaneous values !
! being passed to the calling program. moved the !
! computaion of sfc net sw flux (sfcnsw) to the !
! calling program. merged carlos' nmmb modification.!
! 07-30-10 s. moorthi - corrected some errors associated with !
! unit changes !
! 12-02-10 s. moorthi/y. hou - removed the use of aerosol flags !
! 'iaersw' 'iaerlw' from radiations and replaced !
! them by using the runtime variable laswflg and !
! lalwflg defined in module radiation_aerosols. !
! also replaced param nspc in grrad with the use of !
! max_num_gridcomp in module radiation_aerosols. !
! jun 2012 yu-tai hou - added sea/land madk 'slmsk' to the !
! argument list of subrotine setaer call for the !
! newly modified horizontal bi-linear interpolation !
! in climatological aerosols schem. also moved the !
! virtual temperature calculations in subroutines !
! 'radiation_clouds' and 'radiation_aerosols' to !
! 'grrad' to reduce repeat comps. renamed var oz as !
! tracer to reflect that it carries various prog !
! tracer quantities. !
! - modified to add 4 compontents of sw !
! surface downward fluxes to the output. (vis/nir; !
! direct/diffused). re-arranged part of the fluxr !
! variable fields and filled the unused slots for !
! the new components. added check print of select !
! data (co2 value for now). !
! - changed the initialization subrution !
! 'radinit' into two parts: 'radinit' is called at !
! the start of model run to set up radiation related!
! fixed parameters; and 'radupdate' is called in !
! the time-loop to update time-varying data sets !
! and module variables. !
! sep 2012 h-m lin/y-t hou added option of extra top layer for !
! models with low toa ceiling. the extra layer will !
! help ozone absorption at higher altitude. !
! nov 2012 yu-tai hou - modified control parameters through !
! module 'physparam'. !
! jan 2013 yu-tai hou - updated subr radupdate for including !
! options of annual/monthly solar constant table. !
! mar 2013 h-m lin/y-t hou corrected a bug in extra top layer !
! when using ferrier microphysics. !
! may 2013 s. mooorthi - removed fpkapx !
! jul 2013 r. sun - added pdf cld and convective cloud water and!
! cover for radiation !
! aug 2013 s. moorthi - port from gfs to nems !
! 13Feb2014 sarah lu - add aerodp to fluxr !
! Apr 2014 Xingren Wu - add sfc SW downward fluxes nir/vis and !
! sfcalb to export for A/O/I coupling !
! jun 2014 y-t hou - revised code to include surface up and !
! down spectral components sw fluxes as output. !
! !
!!!!! ========================================================== !!!!!
!!!!! end descriptions !!!!!
!!!!! ========================================================== !!!!!
!========================================!
module module_radiation_driver !
!........................................!
!
use physparam
use physcons, only: eps => con_eps, &
& epsm1 => con_epsm1, &
& fvirt => con_fvirt &
&, rocp => con_rocp, &
& con_g, &
& con_amd, &
& con_amw
use funcphys, only: fpvs
use module_radiation_astronomy,only: sol_init, sol_update, coszmn
use module_radiation_gases, only: NF_VGAS, getgases, getozn, &
& gas_init, gas_update
use module_radiation_aerosols, only: NF_AESW, NF_AELW, setaer, &
& aer_init, aer_update, &
& NSPC1
use module_radiation_surface, only: NF_ALBD, sfc_init, setalb, &
& setemis
use module_radiation_clouds, only: NF_CLDS, cld_init, &
& progcld1, progcld2, &
& progcld3, progcld4, &
& progcld5, progcld6, &
& progclduni, diagcld1
use module_radsw_parameters, only: topfsw_type, sfcfsw_type, &
& profsw_type,cmpfsw_type,NBDSW
use module_radsw_main, only: rswinit, swrad
use module_radlw_parameters, only: topflw_type, sfcflw_type, &
& proflw_type, NBDLW
use module_radlw_main, only: rlwinit, lwrad
use GFS_typedefs, only: GFS_statein_type, &
GFS_stateout_type, &
GFS_sfcprop_type, &
GFS_coupling_type, &
GFS_control_type, &
GFS_grid_type, &
GFS_tbd_type, &
GFS_cldprop_type, &
GFS_radtend_type, &
GFS_diag_type
!
implicit none
!
private
! --- version tag and last revision date
character(40), parameter :: &
& VTAGRAD='NCEP-Radiation_driver v5.2 Jan 2013 '
! & VTAGRAD='NCEP-Radiation_driver v5.1 Nov 2012 '
! & VTAGRAD='NCEP-Radiation_driver v5.0 Aug 2012 '
!>\name Constant values
!> lower limit of saturation vapor pressure (=1.0e-10)
real (kind=kind_phys) :: QMIN
!> lower limit of specific humidity (=1.0e-7)
real (kind=kind_phys) :: QME5
!> lower limit of specific humidity (=1.0e-7)
real (kind=kind_phys) :: QME6
!> EPSQ=1.0e-12
real (kind=kind_phys) :: EPSQ
! parameter (QMIN=1.0e-10, QME5=1.0e-5, QME6=1.0e-6, EPSQ=1.0e-12)
parameter (QMIN=1.0e-10, QME5=1.0e-7, QME6=1.0e-7, EPSQ=1.0e-12)
! parameter (QMIN=1.0e-10, QME5=1.0e-20, QME6=1.0e-20, EPSQ=1.0e-12)
!> lower limit of toa pressure value in mb
real, parameter :: prsmin = 1.0e-6
!> control flag for LW surface temperature at air/ground interface
!! (default=0, the value will be set in subroutine radinit)
integer :: itsfc =0
!> new data input control variables (set/reset in subroutines radinit/radupdate):
integer :: month0=0, iyear0=0, monthd=0
!> control flag for the first time of reading climatological ozone data
!! (set/reset in subroutines radinit/radupdate, it is used only if the
!! control parameter ioznflg=0)
logical :: loz1st =.true.
!> optional extra top layer on top of low ceiling models
!!\n LTP=0: no extra top layer
integer, parameter :: LTP = 0 ! no extra top layer
! integer, parameter :: LTP = 1 ! add an extra top layer
!> control flag for extra top layer
logical, parameter :: lextop = (LTP > 0)
! --- publicly accessible module programs:
public radinit, radupdate, GFS_radiation_driver
! =================
contains
! =================
!> This subroutine initialize a model's radiation process through
!! calling of specific initialization subprograms that directly
!! related to radiation calculations. This subroutine needs to be
!! invoked only once at the start stage of a model's run, and the
!! call is placed outside of both the time advancement loop and
!! horizontal grid loop.
!> \param si model vertical sigma interface
!> \param nlay number of model vertical layers
!> \param me print control flag
!> \section gen_radinit General Algorithm
!> @{
!-----------------------------------
subroutine radinit( si, NLAY, me )
!...................................
! --- inputs:
! & ( si, NLAY, me )
! --- outputs:
! ( none )
! ================= subprogram documentation block ================ !
! !
! subprogram: radinit initialization of radiation calculations !
! !
! usage: call radinit !
! !
! attributes: !
! language: fortran 90 !
! machine: wcoss !
! !
! ==================== definition of variables ==================== !
! !
! input parameters: !
! si : model vertical sigma interface !
! NLAY : number of model vertical layers !
! me : print control flag !
! !
! outputs: (none) !
! !
! external module variables: (in module physparam) !
! isolar : solar constant cntrol flag !
! = 0: use the old fixed solar constant in "physcon" !
! =10: use the new fixed solar constant in "physcon" !
! = 1: use noaa ann-mean tsi tbl abs-scale with cycle apprx!
! = 2: use noaa ann-mean tsi tbl tim-scale with cycle apprx!
! = 3: use cmip5 ann-mean tsi tbl tim-scale with cycl apprx!
! = 4: use cmip5 mon-mean tsi tbl tim-scale with cycl apprx!
! iaerflg : 3-digit aerosol flag (abc for volc, lw, sw) !
! a:=0 use background stratospheric aerosol !
! =1 include stratospheric vocanic aeros !
! b:=0 no topospheric aerosol in lw radiation !
! =1 compute tropspheric aero in 1 broad band for lw !
! =2 compute tropspheric aero in multi bands for lw !
! c:=0 no topospheric aerosol in sw radiation !
! =1 include tropspheric aerosols for sw !
! ico2flg : co2 data source control flag !
! =0: use prescribed global mean co2 (old oper) !
! =1: use observed co2 annual mean value only !
! =2: use obs co2 monthly data with 2-d variation !
! ictmflg : =yyyy#, external data ic time/date control flag !
! = -2: same as 0, but superimpose seasonal cycle !
! from climatology data set. !
! = -1: use user provided external data for the !
! forecast time, no extrapolation. !
! = 0: use data at initial cond time, if not !
! available, use latest, no extrapolation. !
! = 1: use data at the forecast time, if not !
! available, use latest and extrapolation. !
! =yyyy0: use yyyy data for the forecast time, !
! no further data extrapolation. !
! =yyyy1: use yyyy data for the fcst. if needed, do !
! extrapolation to match the fcst time. !
! ioznflg : ozone data source control flag !
! =0: use climatological ozone profile !
! =1: use interactive ozone profile !
! ialbflg : albedo scheme control flag !
! =0: climatology, based on surface veg types !
! =1: modis retrieval based surface albedo scheme !
! iemsflg : emissivity scheme cntrl flag (ab 2-digit integer) !
! a:=0 set sfc air/ground t same for lw radiation !
! =1 set sfc air/ground t diff for lw radiation !
! b:=0 use fixed sfc emissivity=1.0 (black-body) !
! =1 use varying climtology sfc emiss (veg based) !
! =2 future development (not yet) !
! icldflg : cloud optical property scheme control flag !
! =0: use diagnostic cloud scheme !
! =1: use prognostic cloud scheme (default) !
! icmphys : cloud microphysics scheme control flag !
! =1 zhao/carr/sundqvist microphysics scheme !
! =3 zhao/carr/sundqvist microphysics+pdf cloud & cnvc,cnvw!
! =4 GFDL cloud microphysics !
! =5 GFDL cloud microphysics + pdf cloud & cnvc and cnvw !
! iovrsw : control flag for cloud overlap in sw radiation !
! iovrlw : control flag for cloud overlap in lw radiation !
! =0: random overlapping clouds !
! =1: max/ran overlapping clouds !
! isubcsw : sub-column cloud approx control flag in sw radiation !
! isubclw : sub-column cloud approx control flag in lw radiation !
! =0: with out sub-column cloud approximation !
! =1: mcica sub-col approx. prescribed random seed !
! =2: mcica sub-col approx. provided random seed !
! lcrick : control flag for eliminating CRICK !
! =t: apply layer smoothing to eliminate CRICK !
! =f: do not apply layer smoothing !
! lcnorm : control flag for in-cld condensate !
! =t: normalize cloud condensate !
! =f: not normalize cloud condensate !
! lnoprec : precip effect in radiation flag (ferrier microphysics) !
! =t: snow/rain has no impact on radiation !
! =f: snow/rain has impact on radiation !
! ivflip : vertical index direction control flag !
! =0: index from toa to surface !
! =1: index from surface to toa !
! !
! subroutines called: sol_init, aer_init, gas_init, cld_init, !
! sfc_init, rlwinit, rswinit !
! !
! usage: call radinit !
! !
! =================================================================== !
!
implicit none
! --- inputs:
integer, intent(in) :: NLAY, me
real (kind=kind_phys), intent(in) :: si(:)
! --- outputs: (none, to module variables)
! --- locals:
!
!===> ... begin here
!
!> -# Set up control variables and external module variables in
!! module physparam
itsfc = iemsflg / 10 ! sfc air/ground temp control
loz1st = (ioznflg == 0) ! first-time clim ozone data read flag
month0 = 0
iyear0 = 0
monthd = 0
if (me == 0) then
! print *,' NEW RADIATION PROGRAM STRUCTURES -- SEP 01 2004'
print *,' NEW RADIATION PROGRAM STRUCTURES BECAME OPER. ', &
& ' May 01 2007'
print *, VTAGRAD !print out version tag
print *,' - Selected Control Flag settings: ICTMflg=',ictmflg, &
& ' ISOLar =',isolar, ' ICO2flg=',ico2flg,' IAERflg=',iaerflg, &
& ' IALBflg=',ialbflg,' IEMSflg=',iemsflg,' ICLDflg=',icldflg, &
& ' ICMPHYS=',icmphys,' IOZNflg=',ioznflg
print *,' IVFLIP=',ivflip,' IOVRSW=',iovrsw,' IOVRLW=',iovrlw, &
& ' ISUBCSW=',isubcsw,' ISUBCLW=',isubclw
! write(0,*)' IVFLIP=',ivflip,' IOVRSW=',iovrsw,' IOVRLW=',iovrlw,&
! & ' ISUBCSW=',isubcsw,' ISUBCLW=',isubclw
print *,' LCRICK=',lcrick,' LCNORM=',lcnorm,' LNOPREC=',lnoprec
print *,' LTP =',LTP,', add extra top layer =',lextop
if ( ictmflg==0 .or. ictmflg==-2 ) then
print *,' Data usage is limited by initial condition!'
print *,' No volcanic aerosols'
endif
if ( isubclw == 0 ) then
print *,' - ISUBCLW=',isubclw,' No McICA, use grid ', &
& 'averaged cloud in LW radiation'
elseif ( isubclw == 1 ) then
print *,' - ISUBCLW=',isubclw,' Use McICA with fixed ', &
& 'permutation seeds for LW random number generator'
elseif ( isubclw == 2 ) then
print *,' - ISUBCLW=',isubclw,' Use McICA with random ', &
& 'permutation seeds for LW random number generator'
else
print *,' - ERROR!!! ISUBCLW=',isubclw,' is not a ', &
& 'valid option '
stop
endif
if ( isubcsw == 0 ) then
print *,' - ISUBCSW=',isubcsw,' No McICA, use grid ', &
& 'averaged cloud in SW radiation'
elseif ( isubcsw == 1 ) then
print *,' - ISUBCSW=',isubcsw,' Use McICA with fixed ', &
& 'permutation seeds for SW random number generator'
elseif ( isubcsw == 2 ) then
print *,' - ISUBCSW=',isubcsw,' Use McICA with random ', &
& 'permutation seeds for SW random number generator'
else
print *,' - ERROR!!! ISUBCSW=',isubcsw,' is not a ', &
& 'valid option '
stop
endif
if ( isubcsw /= isubclw ) then
print *,' - *** Notice *** ISUBCSW /= ISUBCLW !!!', &
& isubcsw, isubclw
endif
endif
!> -# Initialization
!! - astronomy initialization routine:
!! call module_radiation_astronomy::sol_init()
!! - aerosols initialization routine:
!! call module_radiation_aerosols::aer_init()
!! - CO2 and other gases intialization routine:
!! call module_radiation_gases::gas_init()
!! - surface intialization routine:
!! call module_radiation_surface::sfc_init()
!! - cloud initialization routine:
!! call module_radiation_clouds::cld_init()
!! - LW radiation initialization routine:
!! call module_radlw_main::rlwinit()
!! - SW radiation initialization routine:
!! call module_radsw_main::rswinit()
! Initialization
call sol_init ( me ) ! --- ... astronomy initialization routine
call aer_init ( NLAY, me ) ! --- ... aerosols initialization routine
call gas_init ( me ) ! --- ... co2 and other gases initialization routine
call sfc_init ( me ) ! --- ... surface initialization routine
call cld_init ( si, NLAY, me) ! --- ... cloud initialization routine
call rlwinit ( me ) ! --- ... lw radiation initialization routine
call rswinit ( me ) ! --- ... sw radiation initialization routine
!
return
!...................................
end subroutine radinit
!-----------------------------------
!> @}
!> This subroutine checks and updates time sensitive data used by
!! radiation computations. This subroutine needs to be placed inside
!! the time advancement loop but outside of the horizontal grid loop.
!! It is invoked at radiation calling frequncy but before any actual
!! radiative transfer computations.
!! \param idate NCEP absolute date and time of intial condition
!! (year,month,day,time-zone,hour,minute,second,
!! mil-second)
!! \param jdate NCEP absolute date and time at forecast time
!! (year,month,day,time-zone,hour,minute,second,
!! mil-second)
!! \param deltsw SW radiation calling time interval in seconds
!! \param deltim model advancing time-step duration in seconds
!! \param lsswr logical control flag for SW radiation calculations
!! \param me print control flag
!! \param slag equation of time in radians
!! \param sdec,cdec sine and cosine of the solar declination angle
!! \param solcon solar constant adjusted by sun-earth distance \f$(W/m^2)\f$
!> \section gen_radupdate General Algorithm
!> @{
!-----------------------------------
subroutine radupdate( idate,jdate,deltsw,deltim,lsswr, me, &
& slag,sdec,cdec,solcon, fixed_date)
!...................................
! ================= subprogram documentation block ================ !
! !
! subprogram: radupdate calls many update subroutines to check and !
! update radiation required but time varying data sets and module !
! variables. !
! !
! usage: call radupdate !
! !
! attributes: !
! language: fortran 90 !
! machine: ibm sp !
! !
! ==================== definition of variables ==================== !
! !
! input parameters: !
! idate(8) : ncep absolute date and time of initial condition !
! (yr, mon, day, t-zone, hr, min, sec, mil-sec) !
! jdate(8) : ncep absolute date and time at fcst time !
! (yr, mon, day, t-zone, hr, min, sec, mil-sec) !
! deltsw : sw radiation calling frequency in seconds !
! deltim : model timestep in seconds !
! lsswr : logical flags for sw radiation calculations !
! me : print control flag !
! fixed_date : use a fixed date for astronomical calculations !
! does not affect solar angle calculation !
! !
! outputs: !
! slag : equation of time in radians !
! sdec, cdec : sin and cos of the solar declination angle !
! solcon : sun-earth distance adjusted solar constant (w/m2) !
! !
! external module variables: !
! isolar : solar constant cntrl (in module physparam) !
! = 0: use the old fixed solar constant in "physcon" !
! =10: use the new fixed solar constant in "physcon" !
! = 1: use noaa ann-mean tsi tbl abs-scale with cycle apprx!
! = 2: use noaa ann-mean tsi tbl tim-scale with cycle apprx!
! = 3: use cmip5 ann-mean tsi tbl tim-scale with cycl apprx!
! = 4: use cmip5 mon-mean tsi tbl tim-scale with cycl apprx!
! ictmflg : =yyyy#, external data ic time/date control flag !
! = -2: same as 0, but superimpose seasonal cycle !
! from climatology data set. !
! = -1: use user provided external data for the !
! forecast time, no extrapolation. !
! = 0: use data at initial cond time, if not !
! available, use latest, no extrapolation. !
! = 1: use data at the forecast time, if not !
! available, use latest and extrapolation. !
! =yyyy0: use yyyy data for the forecast time, !
! no further data extrapolation. !
! =yyyy1: use yyyy data for the fcst. if needed, do !
! extrapolation to match the fcst time. !
! !
! module variables: !
! loz1st : first-time clim ozone data read flag !
! !
! subroutines called: sol_update, aer_update, gas_update !
! !
! =================================================================== !
!
implicit none
! --- inputs:
integer, intent(in) :: idate(:), jdate(:), me
logical, intent(in) :: lsswr, fixed_date
real (kind=kind_phys), intent(in) :: deltsw, deltim
! --- outputs:
real (kind=kind_phys), intent(out) :: slag, sdec, cdec, solcon
! --- locals:
integer :: iyear, imon, iday, ihour
integer :: kyear, kmon, kday, khour
logical :: lmon_chg ! month change flag
logical :: lco2_chg ! cntrl flag for updating co2 data
logical :: lsol_chg ! cntrl flag for updating solar constant
!
!===> ... begin here
!
!> -# Set up time stamp at fcst time and that for green house gases
!! (currently co2 only)
! --- ... time stamp at fcst time
iyear = jdate(1)
imon = jdate(2)
iday = jdate(3)
ihour = jdate(5)
! --- ... set up time stamp used for green house gases (** currently co2 only)
if ( ictmflg==0 .or. ictmflg==-2 ) then ! get external data at initial condition time
kyear = idate(1)
kmon = idate(2)
kday = idate(3)
khour = idate(5)
else ! get external data at fcst or specified time
kyear = iyear
kmon = imon
kday = iday
khour = ihour
endif ! end if_ictmflg_block
if ( month0 /= imon ) then
lmon_chg = .true.
month0 = imon
else
lmon_chg = .false.
endif
!> -# Call module_radiation_astronomy::sol_update(), yearly update, no
!! time interpolation.
if (lsswr) then
if ( isolar == 0 .or. isolar == 10 ) then
lsol_chg = .false.
elseif ( iyear0 /= iyear ) then
lsol_chg = .true.
else
lsol_chg = ( isolar==4 .and. lmon_chg )
endif
iyear0 = iyear
if ( fixed_date ) then
!This uses astronomy at the initial time but does not
! alter solar angle?
call sol_update &
! --- inputs:
& ( jdate,idate,kyear,deltsw,deltim,lsol_chg, me, &
! --- outputs:
& slag,sdec,cdec,solcon &
& )
else
call sol_update &
! --- inputs:
& ( jdate,jdate,kyear,deltsw,deltim,lsol_chg, me, &
! --- outputs:
& slag,sdec,cdec,solcon &
& )
endif
endif ! end_if_lsswr_block
!> -# Call module_radiation_aerosols::aer_update(), monthly update, no
!! time interpolation
if ( lmon_chg ) then
call aer_update ( iyear, imon, me )
endif
!> -# Call co2 and other gases update routine:
!! module_radiation_gases::gas_update()
if ( monthd /= kmon ) then
monthd = kmon
lco2_chg = .true.
else
lco2_chg = .false.
endif
call gas_update ( kyear,kmon,kday,khour,loz1st,lco2_chg, me )
if ( loz1st ) loz1st = .false.
!> -# Call surface update routine (currently not needed)
! call sfc_update ( iyear, imon, me )
!> -# Call clouds update routine (currently not needed)
! call cld_update ( iyear, imon, me )
!
return
!...................................
end subroutine radupdate
!-----------------------------------
!> @}
!> This subroutine is the driver of main radiation calculations. It
!! sets up column profiles, such as pressure, temperature, moisture,
!! gases, clouds, aerosols, etc., as well as surface radiative
!! characteristics, such as surface albedo, and emissivity. The call
!! of this subroutine is placed inside both the time advancing loop
!! and the horizontal grid loop.
!! \param prsi model level pressure in Pa
!! \param prsl model layer mean pressure in Pa
!! \param prslk exner function = \f$ (p/p0)^{rocp} \f$
!! \param tgrs model layer mean temperature in K
!! \param qgrs layer specific humidity in gm/gm
!! \param tracer layer prognostic tracer amount mixing-ratio,
!! including: ozone,cloud condensate,aerosols,etc
!! \param vvl layer mean vertical velocity in pa/sec
!! (used only for the legacy diagnostic style of
!! cloud scheme)
!! \param slmsk sea/land mask array (sea:0,land:1,sea-ice:2)
!! \param xlon grid longitude in radians,ok for both 0->2pi or
!! -pi->+pi ranges
!! \param xlat grid latitude in radians, default to pi/2->-pi/2
!! range, otherwise need to adjust in the called
!! subroutine
!! \param tsfc surface temperature in K
!! \param snowd snow depth water equivalent in mm (used when
!! control flag ialbflg=1)
!! \param sncovr snow cover in fraction (used when contrl flag
!! ialbflg=1)
!! \param snoalb maximum snow albedo in fraction (used when control
!! flag ialbflg=1)
!! \param zorl surface roughness in cm
!! \param hprim topographic standard deviation in m
!! \param alvsf ialbflg=0: uv+visible albedo with strong cosz
!! dependency (z=60)
!!\n ialbflg=1: uv+visible black sky albedo (z=60 degree)
!! \param alnsf ialbflg=0: near IR albedo with strong cosz
!! dependency (z=60)
!!\n ialbflg=1: near IR black sky albedo (z=60 degree)
!! \param alvwf ialbflg=0: uv+visible albedo with weak cosz
!! dependency (z=60)
!!\n ialbflg=1: uv+visible white sky albedo
!! \param alnwf ialbflg=0: near IR albedo with weak cosz
!! dependency (z=60)
!!\n ialbflg=1: near IR white sky albedo
!! \param facsf fractional coverage with strong cosz dependency
!! \param facwf fractional coverage with weak cosz dependency
!! \param fice fraction ice cover over open water grid
!! \param tisfc surface temperature over ice cover in K
!! \param sinlat sine of latitude for the model grid
!! \param coslat cosine of latitude for the model grid
!! \param solhr hour time after 00z at the current time-step
!! \param jdate current forecast date and time (year, month,
!! day,time-zone,hour, minute, second, mil-second)
!! \param solcon solar constant (sun-earth distant adjusted) in \f$W/m^2\f$
!! \param cv fraction of convective cloud cover
!! (for diagnostic clouds only)
!! \param cvt,cvb convective cloud top/bottom pressure in pa
!! (for diagnostic clouds only)
!! \param fcice fraction of cloud ice content
!! (for Ferrier microphysics scheme only)
!! \param frain fraction of rain water
!! (for Ferrier microphysics scheme only)
!! \param rrime mass ratio of total to unrimed ice content
!! (>= 1, for Ferrier microphysics scheme only)
!! \param flgmin minimum large ice fraction
!! (for Ferrier microphysics scheme only)
!! \param icsdsw,icsdlw auxiliary cloud control arrays for radiations
!! if isubcsw/isubclw (\ref physparam) are set to 2,
!! the arrays contains random seeds for the sub-column
!! cloud overlap scheme, McICA, used in SW/LW radiations
!! \param ntcw =0: no cloud condensate calculated;
!!\n >0: tracer array location index for cloud condensate
!! \param ncld only used when ntcw>0
!! \param ntoz =0: use climatological ozone profile
!!\n >0: use interactive ozone profile
!! \param NTRAC number of tracers
!! \param NFXR number of fields (second dimension) of I/O array fluxr
!! \param dtlw,dtsw time durations for LW/SW radiation calls in second
!! \param lsswr,lslwr logical control flags for SW/LW radiation calls
!! \param lssav logical control flag for storing 3-d cloud field
!! \param IX,IM horizontal dimension and number of used points
!! \param LM vertical layer dimension
!! \param me control flag for parallel process
!! \param lprnt control flag for diagnostic printout
!! \param ipt grid-point index for diagnostic printout (debugging)
!! \param kdt time-step sequential number
!! \param deltaq half width of pdf cloud uniform total water distribution
!! (for pdf cloud cover scheme)
!! \param sup supersaturation in pdf cloud when t is very low
!! (for pdf cloud cover scheme)
!! \param cnvw layer convective cloud water content
!! (for pdf cloud scheme)
!! \param cnvc layer convective cloud cover
!! (for pdf cloud scheme)
!! \param htrsw total sky SW heating rate in k/sec
!! \param topfsw derived type, SW radiation fluxes at TOA, components:
!! (check module_radsw_parameters for definition)
!! \n %upfxc - total-sky upward SW flux at toa (\f$W/m^2\f$)
!! \n %dnflx - total-sky downward SW flux at toa (\f$W/m^2\f$)
!! \n %upfx0 - clear-sky upward SW flux at toa (\f$W/m^2\f$)
!! \param sfcfsw derived type, SW radiation fluxes at surface, components:
!! (check module_radsw_parameters for definition)
!! \n %upfxc - total-sky upward SW flux at sfc (\f$W/m^2\f$)
!! \n %dnfxc - total-sky downward SW flux at sfc (\f$W/m^2\f$)
!! \n %upfx0 - clear-sky upward SW flux at sfc (\f$W/m^2\f$)
!! \n %dnfx0 - clear-sky downward SW flux at sfc (\f$W/m^2\f$)
!! \param dswcmp downward surface SW spectral components:
!! \n (:, 1) - total-sky sfc downward nir direct flux
!! \n (:, 2) - total-sky sfc downward nir diffused flux
!! \n (:, 3) - total-sky sfc downward uv+vis direct flux
!! \n (:, 4) - total-sky sfc downward uv+vis diffused flux
!! \param uswcmp upward surface SW spectral components:
!! \n (:, 1) - total-sky sfc upward nir direct flux
!! \n (:, 2) - total-sky sfc upward nir diffused flux
!! \n (:, 3) - total-sky sfc upward uv+vis direct flux
!! \n (:, 4) - total-sky sfc upward uv+vis diffused flux
!! \param sfalb mean surface diffused albedo for SW radiation
!! \param coszen mean cosine of solar zenith angle over radiation calling period
!! \param coszdg daytime mean cosine of zenith angle over the radiation
!! calling period
!! \param htrlw total-sky LW heating rate in k/sec
!! \param topflw derived type, LW radiation fluxes at TOA, component:
!! (check module_radlw_paramters for definition)
!! \n %upfxc - total-sky upward LW flux at toa (\f$W/m^2\f$)
!! \n %upfx0 - clear-sky upward LW flux at toa (\f$W/m^2\f$)
!! \param sfcflw derived type, LW radiation fluxes at surface, component:
!! (check module_radlw_paramters for definition)
!! \n %upfxc - total-sky upward LW flux at sfc (\f$W/m^2\f$)
!! \n %upfx0 - clear-sky upward LW flux at sfc (\f$W/m^2\f$)
!! \n %dnfxc - total-sky downward LW flux at sfc (\f$W/m^2\f$)
!! \n %dnfx0 - clear-sky downward LW flux at sfc (\f$W/m^2\f$)
!! \param tsflw surface air temp during LW calculation call in K
!! \param semis surface emissivity in fraction for LW radiation
!! \param cldcov 3-d cloud fraction
!! \param fluxr array for saving time accumulated 2-d fields that are
!! defined as:
!! \n (:, 1) - toa total-sky upward LW radiation flux
!! \n (:, 2) - toa total-sky upward SW radiation flux
!! \n (:, 3) - sfc total-sky upward SW radiation flux
!! \n (:, 4) - sfc total-sky downward SW radiation flux
!! \n (:, 5) - high domain cloud fraction
!! \n (:, 6) - mid domain cloud fraction
!! \n (:, 7) - low domain cloud fraction
!! \n (:, 8) - high domain mean cloud top pressure
!! \n (:, 9) - mid domain mean cloud top pressure
!! \n (:,10) - low domain mean cloud top pressure
!! \n (:,11) - high domain mean cloud base pressure
!! \n (:,12) - mid domain mean cloud base pressure
!! \n (:,13) - low domain mean cloud base pressure
!! \n (:,14) - high domain mean cloud top temperature
!! \n (:,15) - mid domain mean cloud top temperature
!! \n (:,16) - low domain mean cloud top temperature
!! \n (:,17) - total cloud fraction
!! \n (:,18) - boundary layer domain cloud fraction
!! \n (:,19) - sfc total-sky downward LW radiation flux
!! \n (:,20) - sfc total-sky upward LW radiation flux