-
Notifications
You must be signed in to change notification settings - Fork 374
/
ice_shortwave.F90
5413 lines (4768 loc) · 240 KB
/
ice_shortwave.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
! SVN:$Id: ice_shortwave.F90 1182 2017-03-16 19:29:26Z njeffery $
!=======================================================================
!
! The albedo and absorbed/transmitted flux parameterizations for
! snow over ice, bare ice and ponded ice.
!
! Presently, two methods are included:
! (1) CCSM3
! (2) Delta-Eddington
! as two distinct routines.
! Either can be called from the ice driver.
!
! The Delta-Eddington method is described here:
!
! Briegleb, B. P., and B. Light (2007): A Delta-Eddington Multiple
! Scattering Parameterization for Solar Radiation in the Sea Ice
! Component of the Community Climate System Model, NCAR Technical
! Note NCAR/TN-472+STR February 2007
!
! name: originally ice_albedo
!
! authors: Bruce P. Briegleb, NCAR
! Elizabeth C. Hunke and William H. Lipscomb, LANL
! 2005, WHL: Moved absorbed_solar from ice_therm_vertical to this
! module and changed name from ice_albedo
! 2006, WHL: Added Delta Eddington routines from Bruce Briegleb
! 2006, ECH: Changed data statements in Delta Eddington routines (no
! longer hardwired)
! Converted to free source form (F90)
! 2007, BPB: Completely updated Delta-Eddington code, so that:
! (1) multiple snow layers enabled (i.e. nslyr > 1)
! (2) included SSL for snow surface absorption
! (3) added Sswabs for internal snow layer absorption
! (4) variable sea ice layers allowed (i.e. not hardwired)
! (5) updated all inherent optical properties
! (6) included algae absorption for sea ice lowest layer
! (7) very complete internal documentation included
! 2007, ECH: Improved efficiency
! 2008, BPB: Added aerosols to Delta Eddington code
! 2013, ECH: merged with NCAR version, cleaned up
module ice_shortwave
use ice_kinds_mod
use ice_constants_colpkg, only: c0, c1, c1p5, c2, c3, c4, c10, &
p01, p1, p15, p25, p5, p75, puny, &
albocn, Timelt, snowpatch, awtvdr, awtidr, awtvdf, awtidf, &
kappav, hs_min, rhofresh, rhos, nspint, nspint_5bd, snwlvlfac
use ice_colpkg_shared, only: hi_ssl, hs_ssl, modal_aero, max_aero
use ice_colpkg_shared, only: hi_ssl, hs_ssl, modal_aero, rsnw_fall, &
rsnw_tmax
use ice_warnings, only: add_warning
implicit none
private
public :: run_dEdd, shortwave_ccsm3, compute_shortwave_trcr
real (kind=dbl_kind), parameter :: &
hpmin = 0.005_dbl_kind, & ! minimum allowed melt pond depth (m)
hp0 = 0.200_dbl_kind ! pond depth below which transition to bare ice
real (kind=dbl_kind) :: &
exp_min ! minimum exponential value
!=======================================================================
contains
!=======================================================================
!
! Driver for basic solar radiation from CCSM3. Albedos and absorbed solar.
subroutine shortwave_ccsm3 (aicen, vicen, &
vsnon, Tsfcn, &
swvdr, swvdf, &
swidr, swidf, &
heat_capacity, &
albedo_type, &
albicev, albicei, &
albsnowv, albsnowi, &
ahmax, &
alvdrn, alidrn, &
alvdfn, alidfn, &
fswsfc, fswint, &
fswthru, fswpenl, &
Iswabs, SSwabs, &
albin, albsn, &
coszen, ncat)
integer (kind=int_kind), intent(in) :: &
ncat ! number of ice thickness categories
real (kind=dbl_kind), dimension (:), intent(in) :: &
aicen , & ! concentration of ice per category
vicen , & ! volume of ice per category
vsnon , & ! volume of ice per category
Tsfcn ! surface temperature
real (kind=dbl_kind), intent(in) :: &
swvdr , & ! sw down, visible, direct (W/m^2)
swvdf , & ! sw down, visible, diffuse (W/m^2)
swidr , & ! sw down, near IR, direct (W/m^2)
swidf ! sw down, near IR, diffuse (W/m^2)
! baseline albedos for ccsm3 shortwave, set in namelist
real (kind=dbl_kind), intent(in) :: &
albicev , & ! visible ice albedo for h > ahmax
albicei , & ! near-ir ice albedo for h > ahmax
albsnowv, & ! cold snow albedo, visible
albsnowi, & ! cold snow albedo, near IR
ahmax ! thickness above which ice albedo is constant (m)
logical(kind=log_kind), intent(in) :: &
heat_capacity! if true, ice has nonzero heat capacity
character (len=char_len), intent(in) :: &
albedo_type ! albedo parameterization, 'default' ('ccsm3') or 'constant'
real (kind=dbl_kind), dimension (:), intent(inout) :: &
alvdrn , & ! visible, direct, avg (fraction)
alidrn , & ! near-ir, direct, avg (fraction)
alvdfn , & ! visible, diffuse, avg (fraction)
alidfn , & ! near-ir, diffuse, avg (fraction)
fswsfc , & ! SW absorbed at ice/snow surface (W m-2)
fswint , & ! SW absorbed in ice interior, below surface (W m-2)
fswthru , & ! SW through ice to ocean (W m-2)
albin , & ! bare ice albedo
albsn ! snow albedo
real (kind=dbl_kind), intent(inout) :: &
coszen ! cosine(zenith angle)
real (kind=dbl_kind), dimension (:,:), intent(inout) :: &
fswpenl , & ! SW entering ice layers (W m-2)
Iswabs , & ! SW absorbed in particular layer (W m-2)
Sswabs ! SW absorbed in particular layer (W m-2)
! local variables
integer (kind=int_kind) :: &
n ! thickness category index
! ice and snow albedo for each category
real (kind=dbl_kind) :: &
alvdrni, & ! visible, direct, ice (fraction)
alidrni, & ! near-ir, direct, ice (fraction)
alvdfni, & ! visible, diffuse, ice (fraction)
alidfni, & ! near-ir, diffuse, ice (fraction)
alvdrns, & ! visible, direct, snow (fraction)
alidrns, & ! near-ir, direct, snow (fraction)
alvdfns, & ! visible, diffuse, snow (fraction)
alidfns ! near-ir, diffuse, snow (fraction)
!-----------------------------------------------------------------
! Solar radiation: albedo and absorbed shortwave
!-----------------------------------------------------------------
! For basic shortwave, set coszen to a constant between 0 and 1.
coszen = p5 ! sun above the horizon
do n = 1, ncat
Sswabs(:,n) = c0
alvdrni = albocn
alidrni = albocn
alvdfni = albocn
alidfni = albocn
alvdrns = albocn
alidrns = albocn
alvdfns = albocn
alidfns = albocn
alvdrn(n) = albocn
alidrn(n) = albocn
alvdfn(n) = albocn
alidfn(n) = albocn
albin(n) = c0
albsn(n) = c0
fswsfc(n) = c0
fswint(n) = c0
fswthru(n) = c0
fswpenl(:,n) = c0
Iswabs (:,n) = c0
if (aicen(n) > puny) then
!-----------------------------------------------------------------
! Compute albedos for ice and snow.
!-----------------------------------------------------------------
if (trim(albedo_type) == 'constant') then
call constant_albedos (aicen(n), &
vsnon(n), &
Tsfcn(n), &
alvdrni, alidrni, &
alvdfni, alidfni, &
alvdrns, alidrns, &
alvdfns, alidfns, &
alvdrn(n), &
alidrn(n), &
alvdfn(n), &
alidfn(n), &
albin(n), &
albsn(n))
else ! default
call compute_albedos (aicen(n), &
vicen(n), &
vsnon(n), &
Tsfcn(n), &
albicev, albicei, &
albsnowv, albsnowi, &
ahmax, &
alvdrni, alidrni, &
alvdfni, alidfni, &
alvdrns, alidrns, &
alvdfns, alidfns, &
alvdrn(n), &
alidrn(n), &
alvdfn(n), &
alidfn(n), &
albin(n), &
albsn(n))
endif
!-----------------------------------------------------------------
! Compute solar radiation absorbed in ice and penetrating to ocean.
!-----------------------------------------------------------------
call absorbed_solar (heat_capacity, &
ncat, &
aicen(n), &
vicen(n), &
vsnon(n), &
swvdr, swvdf, &
swidr, swidf, &
alvdrni, alvdfni, &
alidrni, alidfni, &
alvdrns, alvdfns, &
alidrns, alidfns, &
fswsfc(n), &
fswint(n), &
fswthru(n), &
fswpenl(:,n), &
Iswabs(:,n))
endif ! aicen > puny
enddo ! ncat
end subroutine shortwave_ccsm3
!=======================================================================
!
! Compute albedos for each thickness category
subroutine compute_albedos (aicen, vicen, &
vsnon, Tsfcn, &
albicev, albicei, &
albsnowv, albsnowi, &
ahmax, &
alvdrni, alidrni, &
alvdfni, alidfni, &
alvdrns, alidrns, &
alvdfns, alidfns, &
alvdrn, alidrn, &
alvdfn, alidfn, &
albin, albsn)
real (kind=dbl_kind), intent(in) :: &
aicen , & ! concentration of ice per category
vicen , & ! volume of ice per category
vsnon , & ! volume of ice per category
Tsfcn ! surface temperature
! baseline albedos for ccsm3 shortwave, set in namelist
real (kind=dbl_kind), intent(in) :: &
albicev , & ! visible ice albedo for h > ahmax
albicei , & ! near-ir ice albedo for h > ahmax
albsnowv, & ! cold snow albedo, visible
albsnowi, & ! cold snow albedo, near IR
ahmax ! thickness above which ice albedo is constant (m)
real (kind=dbl_kind), intent(out) :: &
alvdrni , & ! visible, direct, ice (fraction)
alidrni , & ! near-ir, direct, ice (fraction)
alvdfni , & ! visible, diffuse, ice (fraction)
alidfni , & ! near-ir, diffuse, ice (fraction)
alvdrns , & ! visible, direct, snow (fraction)
alidrns , & ! near-ir, direct, snow (fraction)
alvdfns , & ! visible, diffuse, snow (fraction)
alidfns , & ! near-ir, diffuse, snow (fraction)
alvdrn , & ! visible, direct, avg (fraction)
alidrn , & ! near-ir, direct, avg (fraction)
alvdfn , & ! visible, diffuse, avg (fraction)
alidfn , & ! near-ir, diffuse, avg (fraction)
albin , & ! bare ice
albsn ! snow
! local variables
real (kind=dbl_kind), parameter :: &
dT_melt = c1 , & ! change in temp to give dalb_mlt
! albedo change
dalb_mlt = -0.075_dbl_kind, & ! albedo change per dT_melt change
! in temp for ice
dalb_mltv = -p1 , & ! albedo vis change per dT_melt change
! in temp for snow
dalb_mlti = -p15 ! albedo nir change per dT_melt change
! in temp for snow
real (kind=dbl_kind) :: &
hi , & ! ice thickness (m)
hs , & ! snow thickness (m)
albo, & ! effective ocean albedo, function of ice thickness
fh , & ! piecewise linear function of thickness
fT , & ! piecewise linear function of surface temperature
dTs , & ! difference of Tsfc and Timelt
fhtan,& ! factor used in albedo dependence on ice thickness
asnow ! fractional area of snow cover
fhtan = atan(ahmax*c4)
!-----------------------------------------------------------------
! Compute albedo for each thickness category.
!-----------------------------------------------------------------
hi = vicen / aicen
hs = vsnon / aicen
! bare ice, thickness dependence
fh = min(atan(hi*c4)/fhtan,c1)
albo = albocn*(c1-fh)
alvdfni = albicev*fh + albo
alidfni = albicei*fh + albo
! bare ice, temperature dependence
dTs = Timelt - Tsfcn
fT = min(dTs/dT_melt-c1,c0)
alvdfni = alvdfni - dalb_mlt*fT
alidfni = alidfni - dalb_mlt*fT
! avoid negative albedos for thin, bare, melting ice
alvdfni = max (alvdfni, albocn)
alidfni = max (alidfni, albocn)
if (hs > puny) then
alvdfns = albsnowv
alidfns = albsnowi
! snow on ice, temperature dependence
alvdfns = alvdfns - dalb_mltv*fT
alidfns = alidfns - dalb_mlti*fT
endif ! hs > puny
! direct albedos (same as diffuse for now)
alvdrni = alvdfni
alidrni = alidfni
alvdrns = alvdfns
alidrns = alidfns
! fractional area of snow cover
if (hs > puny) then
asnow = hs / (hs + snowpatch)
else
asnow = c0
endif
! combine ice and snow albedos (for coupler)
alvdfn = alvdfni*(c1-asnow) + &
alvdfns*asnow
alidfn = alidfni*(c1-asnow) + &
alidfns*asnow
alvdrn = alvdrni*(c1-asnow) + &
alvdrns*asnow
alidrn = alidrni*(c1-asnow) + &
alidrns*asnow
! save ice and snow albedos (for history)
albin = awtvdr*alvdrni + awtidr*alidrni &
+ awtvdf*alvdfni + awtidf*alidfni
albsn = awtvdr*alvdrns + awtidr*alidrns &
+ awtvdf*alvdfns + awtidf*alidfns
end subroutine compute_albedos
!=======================================================================
!
! Compute albedos for each thickness category
subroutine constant_albedos (aicen, &
vsnon, Tsfcn, &
alvdrni, alidrni, &
alvdfni, alidfni, &
alvdrns, alidrns, &
alvdfns, alidfns, &
alvdrn, alidrn, &
alvdfn, alidfn, &
albin, albsn)
real (kind=dbl_kind), intent(in) :: &
aicen , & ! concentration of ice per category
vsnon , & ! volume of ice per category
Tsfcn ! surface temperature
real (kind=dbl_kind), intent(out) :: &
alvdrni , & ! visible, direct, ice (fraction)
alidrni , & ! near-ir, direct, ice (fraction)
alvdfni , & ! visible, diffuse, ice (fraction)
alidfni , & ! near-ir, diffuse, ice (fraction)
alvdrns , & ! visible, direct, snow (fraction)
alidrns , & ! near-ir, direct, snow (fraction)
alvdfns , & ! visible, diffuse, snow (fraction)
alidfns , & ! near-ir, diffuse, snow (fraction)
alvdrn , & ! visible, direct, avg (fraction)
alidrn , & ! near-ir, direct, avg (fraction)
alvdfn , & ! visible, diffuse, avg (fraction)
alidfn , & ! near-ir, diffuse, avg (fraction)
albin , & ! bare ice
albsn ! snow
! local variables
real (kind=dbl_kind), parameter :: &
warmice = 0.68_dbl_kind, &
coldice = 0.70_dbl_kind, &
warmsnow = 0.77_dbl_kind, &
coldsnow = 0.81_dbl_kind
real (kind=dbl_kind) :: &
hs ! snow thickness (m)
!-----------------------------------------------------------------
! Compute albedo for each thickness category.
!-----------------------------------------------------------------
hs = vsnon / aicen
if (hs > puny) then
! snow, temperature dependence
if (Tsfcn >= -c2*puny) then
alvdfn = warmsnow
alidfn = warmsnow
else
alvdfn = coldsnow
alidfn = coldsnow
endif
else ! hs < puny
! bare ice, temperature dependence
if (Tsfcn >= -c2*puny) then
alvdfn = warmice
alidfn = warmice
else
alvdfn = coldice
alidfn = coldice
endif
endif ! hs > puny
! direct albedos (same as diffuse for now)
alvdrn = alvdfn
alidrn = alidfn
alvdrni = alvdrn
alidrni = alidrn
alvdrns = alvdrn
alidrns = alidrn
alvdfni = alvdfn
alidfni = alidfn
alvdfns = alvdfn
alidfns = alidfn
! save ice and snow albedos (for history)
albin = awtvdr*alvdrni + awtidr*alidrni &
+ awtvdf*alvdfni + awtidf*alidfni
albsn = awtvdr*alvdrns + awtidr*alidrns &
+ awtvdf*alvdfns + awtidf*alidfns
end subroutine constant_albedos
!=======================================================================
!
! Compute solar radiation absorbed in ice and penetrating to ocean
!
! authors William H. Lipscomb, LANL
! C. M. Bitz, UW
subroutine absorbed_solar (heat_capacity, &
nilyr, aicen, &
vicen, vsnon, &
swvdr, swvdf, &
swidr, swidf, &
alvdrni, alvdfni, &
alidrni, alidfni, &
alvdrns, alvdfns, &
alidrns, alidfns, &
fswsfc, fswint, &
fswthru, fswpenl, &
Iswabs)
logical(kind=log_kind), intent(in) :: &
heat_capacity ! if true, ice has nonzero heat capacity
integer (kind=int_kind), intent(in) :: &
nilyr ! number of ice layers
real (kind=dbl_kind), intent(in) :: &
aicen , & ! fractional ice area
vicen , & ! ice volume
vsnon , & ! snow volume
swvdr , & ! sw down, visible, direct (W/m^2)
swvdf , & ! sw down, visible, diffuse (W/m^2)
swidr , & ! sw down, near IR, direct (W/m^2)
swidf , & ! sw down, near IR, diffuse (W/m^2)
alvdrni , & ! visible, direct albedo,ice
alidrni , & ! near-ir, direct albedo,ice
alvdfni , & ! visible, diffuse albedo,ice
alidfni , & ! near-ir, diffuse albedo,ice
alvdrns , & ! visible, direct albedo, snow
alidrns , & ! near-ir, direct albedo, snow
alvdfns , & ! visible, diffuse albedo, snow
alidfns ! near-ir, diffuse albedo, snow
real (kind=dbl_kind), intent(out):: &
fswsfc , & ! SW absorbed at ice/snow surface (W m-2)
fswint , & ! SW absorbed in ice interior, below surface (W m-2)
fswthru ! SW through ice to ocean (W m-2)
real (kind=dbl_kind), dimension (:), intent(out) :: &
Iswabs , & ! SW absorbed in particular layer (W m-2)
fswpenl ! visible SW entering ice layers (W m-2)
! local variables
real (kind=dbl_kind), parameter :: &
i0vis = 0.70_dbl_kind ! fraction of penetrating solar rad (visible)
integer (kind=int_kind) :: &
k ! ice layer index
real (kind=dbl_kind) :: &
fswpen , & ! SW penetrating beneath surface (W m-2)
trantop , & ! transmitted frac of penetrating SW at layer top
tranbot ! transmitted frac of penetrating SW at layer bot
real (kind=dbl_kind) :: &
swabs , & ! net SW down at surface (W m-2)
swabsv , & ! swabs in vis (wvlngth < 700nm) (W/m^2)
swabsi , & ! swabs in nir (wvlngth > 700nm) (W/m^2)
fswpenvdr , & ! penetrating SW, vis direct
fswpenvdf , & ! penetrating SW, vis diffuse
hi , & ! ice thickness (m)
hs , & ! snow thickness (m)
hilyr , & ! ice layer thickness
asnow ! fractional area of snow cover
!-----------------------------------------------------------------
! Initialize
!-----------------------------------------------------------------
trantop = c0
tranbot = c0
hs = vsnon / aicen
!-----------------------------------------------------------------
! Fractional snow cover
!-----------------------------------------------------------------
if (hs > puny) then
asnow = hs / (hs + snowpatch)
else
asnow = c0
endif
!-----------------------------------------------------------------
! Shortwave flux absorbed at surface, absorbed internally,
! and penetrating to mixed layer.
! This parameterization assumes that all IR is absorbed at the
! surface; only visible is absorbed in the ice interior or
! transmitted to the ocean.
!-----------------------------------------------------------------
swabsv = swvdr * ( (c1-alvdrni)*(c1-asnow) &
+ (c1-alvdrns)*asnow ) &
+ swvdf * ( (c1-alvdfni)*(c1-asnow) &
+ (c1-alvdfns)*asnow )
swabsi = swidr * ( (c1-alidrni)*(c1-asnow) &
+ (c1-alidrns)*asnow ) &
+ swidf * ( (c1-alidfni)*(c1-asnow) &
+ (c1-alidfns)*asnow )
swabs = swabsv + swabsi
fswpenvdr = swvdr * (c1-alvdrni) * (c1-asnow) * i0vis
fswpenvdf = swvdf * (c1-alvdfni) * (c1-asnow) * i0vis
! no penetrating radiation in near IR
! fswpenidr = swidr * (c1-alidrni) * (c1-asnow) * i0nir
! fswpenidf = swidf * (c1-alidfni) * (c1-asnow) * i0nir
fswpen = fswpenvdr + fswpenvdf
fswsfc = swabs - fswpen
trantop = c1 ! transmittance at top of ice
!-----------------------------------------------------------------
! penetrating SW absorbed in each ice layer
!-----------------------------------------------------------------
do k = 1, nilyr
hi = vicen / aicen
hilyr = hi / real(nilyr,kind=dbl_kind)
tranbot = exp (-kappav * hilyr * real(k,kind=dbl_kind))
Iswabs(k) = fswpen * (trantop-tranbot)
! bottom of layer k = top of layer k+1
trantop = tranbot
! bgc layer model
if (k == 1) then ! surface flux
fswpenl(k) = fswpen
fswpenl(k+1) = fswpen * tranbot
else
fswpenl(k+1) = fswpen * tranbot
endif
enddo ! nilyr
! SW penetrating thru ice into ocean
fswthru = fswpen * tranbot
! SW absorbed in ice interior
fswint = fswpen - fswthru
!----------------------------------------------------------------
! if zero-layer model (no heat capacity), no SW is absorbed in ice
! interior, so add to surface absorption
!----------------------------------------------------------------
if (.not. heat_capacity) then
! SW absorbed at snow/ice surface
fswsfc = fswsfc + fswint
! SW absorbed in ice interior (nilyr = 1)
fswint = c0
Iswabs(1) = c0
endif ! heat_capacity
end subroutine absorbed_solar
! End ccsm3 shortwave method
!=======================================================================
! Begin Delta-Eddington shortwave method
! Compute initial data for Delta-Eddington method, specifically,
! the approximate exponential look-up table.
!
! author: Bruce P. Briegleb, NCAR
! 2011 ECH modified for melt pond tracers
! 2013 ECH merged with NCAR version
subroutine run_dEdd(dt, tr_aero, &
tr_pond_cesm, &
tr_pond_lvl, &
tr_pond_topo, &
ncat, n_aero, &
n_zaero, dEdd_algae,&
nlt_chl_sw, &
nlt_zaero_sw, &
tr_bgc_N, tr_zaero, &
nilyr, nslyr, &
aicen, vicen, &
vsnon, Tsfcn, &
alvln, apndn, &
hpndn, ipndn, &
snwredist, &
rsnow, tr_rsnw, &
aeron, kalg, &
zbion, &
heat_capacity, &
tlat, tlon, &
calendar_type, &
days_per_year, &
nextsw_cday, yday, &
sec, R_ice, &
R_pnd, R_snw, &
dT_mlt, rsnw_mlt, &
hs0, hs1, hp1, &
pndaspect, &
kaer_tab, waer_tab, &
gaer_tab, &
kaer_bc_tab, &
waer_bc_tab, &
gaer_bc_tab, &
bcenh, &
modal_aero, &
swvdr, swvdf, &
swidr, swidf, &
coszen, fsnow, &
alvdrn, alvdfn, &
alidrn, alidfn, &
fswsfcn, fswintn, &
fswthrun, fswpenln, &
Sswabsn, Iswabsn, &
albicen, albsnon, &
albpndn, apeffn, &
snowfracn, &
dhsn, ffracn, &
rsnw_dEddn, &
l_print_point, &
initonly, &
use_snicar, &
asm_prm_ice_drc, &
asm_prm_ice_dfs, &
ss_alb_ice_drc, &
ss_alb_ice_dfs, &
ext_cff_mss_ice_drc, &
ext_cff_mss_ice_dfs, &
kaer_tab_5bd, &
waer_tab_5bd, &
gaer_tab_5bd, &
kaer_bc_tab_5bd, &
waer_bc_tab_5bd, &
gaer_bc_tab_5bd, &
bcenh_5bd)
use ice_orbital, only: compute_coszen
integer (kind=int_kind), intent(in) :: &
ncat , & ! number of ice thickness categories
nilyr , & ! number of ice layers
nslyr , & ! number of snow layers
n_aero , & ! number of aerosol tracers
n_zaero, & ! number of zaerosol tracers
nlt_chl_sw ! index for chla
integer (kind=int_kind), dimension(:), intent(in) :: &
nlt_zaero_sw ! index for zaerosols
logical(kind=log_kind), intent(in) :: &
heat_capacity,& ! if true, ice has nonzero heat capacity
tr_aero , & ! if .true., use aerosol tracers
tr_pond_cesm, & ! if .true., use explicit topography-based ponds
tr_pond_lvl , & ! if .true., use explicit topography-based ponds
tr_pond_topo, & ! if .true., use explicit topography-based ponds
tr_rsnw, & ! if .true., use snow grain radius tracer
dEdd_algae, & ! .true. use prognostic chla in dEdd
tr_bgc_N, & ! .true. active bgc (skl or z)
tr_zaero, & ! .true. use zaerosols
modal_aero ! .true. use modal aerosol treatment
! dEdd tuning parameters, set in namelist
real (kind=dbl_kind), intent(in) :: &
R_ice , & ! sea ice tuning parameter; +1 > 1sig increase in albedo
R_pnd , & ! ponded ice tuning parameter; +1 > 1sig increase in albedo
R_snw , & ! snow tuning parameter; +1 > ~.01 change in broadband albedo
dT_mlt, & ! change in temp for non-melt to melt snow grain radius change (C)
rsnw_mlt, & ! maximum melting snow grain radius (10^-6 m)
hs0 , & ! snow depth for transition to bare sea ice (m)
pndaspect, & ! ratio of pond depth to pond fraction
hs1 , & ! tapering parameter for snow on pond ice
hp1 , & ! critical parameter for pond ice thickness
kalg ! algae absorption coefficient
real (kind=dbl_kind), dimension(:,:), intent(in) :: &
kaer_tab, & ! aerosol mass extinction cross section (m2/kg)
waer_tab, & ! aerosol single scatter albedo (fraction)
gaer_tab ! aerosol asymmetry parameter (cos(theta))
real (kind=dbl_kind), dimension(:,:), intent(in) :: & ! Modal aerosol treatment
kaer_bc_tab, & ! aerosol mass extinction cross section (m2/kg)
waer_bc_tab, & ! aerosol single scatter albedo (fraction)
gaer_bc_tab ! aerosol asymmetry parameter (cos(theta))
real (kind=dbl_kind), dimension(:,:), intent(in) :: & ! Model SNICAR snow SSP
asm_prm_ice_drc, & ! snow asymmetry factor (cos(theta))
asm_prm_ice_dfs, & ! snow asymmetry factor (cos(theta))
ss_alb_ice_drc, & ! snow single scatter albedo (fraction)
ss_alb_ice_dfs, & ! snow single scatter albedo (fraction)
ext_cff_mss_ice_drc, & ! snow mass extinction cross section (m2/kg)
ext_cff_mss_ice_dfs ! snow mass extinction cross section (m2/kg)
real (kind=dbl_kind), dimension(:,:), intent(in) :: &
kaer_tab_5bd, & ! aerosol mass extinction cross section (m2/kg)
waer_tab_5bd, & ! aerosol single scatter albedo (fraction)
gaer_tab_5bd ! aerosol asymmetry parameter (cos(theta))
real (kind=dbl_kind), dimension(:,:), intent(in) :: & ! Modal aerosol treatment
kaer_bc_tab_5bd, & ! aerosol mass extinction cross section (m2/kg)
waer_bc_tab_5bd, & ! aerosol single scatter albedo (fraction)
gaer_bc_tab_5bd ! aerosol asymmetry parameter (cos(theta))
real (kind=dbl_kind), dimension(:,:,:), intent(in) :: & ! Modal aerosol treatment
bcenh_5bd ! BC absorption enhancement factor
real (kind=dbl_kind), dimension(:,:,:), intent(in) :: & ! Modal aerosol treatment
bcenh ! BC absorption enhancement factor
character (len=char_len), intent(in) :: &
calendar_type ! differentiates Gregorian from other calendars
integer (kind=int_kind), intent(in) :: &
days_per_year, & ! number of days in one year
sec ! elapsed seconds into date
real (kind=dbl_kind), intent(in) :: &
nextsw_cday , & ! julian day of next shortwave calculation
yday ! day of the year
real(kind=dbl_kind), intent(in) :: &
dt, & ! time step (s)
tlat, & ! latitude of temp pts (radians)
tlon, & ! longitude of temp pts (radians)
swvdr, & ! sw down, visible, direct (W/m^2)
swvdf, & ! sw down, visible, diffuse (W/m^2)
swidr, & ! sw down, near IR, direct (W/m^2)
swidf, & ! sw down, near IR, diffuse (W/m^2)
fsnow ! snowfall rate (kg/m^2 s)
real(kind=dbl_kind), dimension(:), intent(in) :: &
aicen, & ! concentration of ice
vicen, & ! volume per unit area of ice (m)
vsnon, & ! volume per unit area of snow (m)
ffracn,& ! fraction of fsurfn used to melt ipond
Tsfcn, & ! surface temperature (deg C)
alvln, & ! level-ice area fraction
apndn, & ! pond area fraction
hpndn, & ! pond depth (m)
ipndn ! pond refrozen lid thickness (m)
character(len=char_len), intent(in) :: &
snwredist ! type of snow redistribution
real(kind=dbl_kind), dimension(:,:), intent(in) :: &
rsnow, & ! snow grain radius tracer (10^-6 m)
aeron, & ! aerosols (kg/m^3)
zbion ! zaerosols (kg/m^3) + chlorophyll on shorthwave grid
real(kind=dbl_kind), dimension(:), intent(inout) :: &
rsnw_dEddn, & ! snow grain radius if .not. tr_rsnw (10^-6 m)
dhsn ! depth difference for snow on sea ice and pond ice
real(kind=dbl_kind), intent(inout) :: &
coszen ! cosine solar zenith angle, < 0 for sun below horizon
real(kind=dbl_kind), dimension(:), intent(inout) :: &
alvdrn, & ! visible direct albedo (fraction)
alvdfn, & ! near-ir direct albedo (fraction)
alidrn, & ! visible diffuse albedo (fraction)
alidfn, & ! near-ir diffuse albedo (fraction)
fswsfcn, & ! SW absorbed at ice/snow surface (W m-2)
fswintn, & ! SW absorbed in ice interior, below surface (W m-2)
fswthrun, & ! SW through ice to ocean (W/m^2)
albicen, & ! albedo bare ice
albsnon, & ! albedo snow
albpndn, & ! albedo pond
apeffn, & ! effective pond area used for radiation calculation
snowfracn ! snow fraction on each category used for radiation
real(kind=dbl_kind), dimension(:,:), intent(inout) :: &
Sswabsn , & ! SW radiation absorbed in snow layers (W m-2)
Iswabsn , & ! SW radiation absorbed in ice layers (W m-2)
fswpenln ! visible SW entering ice layers (W m-2)
logical (kind=log_kind), intent(in) :: &
use_snicar ! if true, use 5-band snicar IOPs for
! shortwave radiative calculation of
! snow-coverd sea ice
logical (kind=log_kind), intent(in) :: &
l_print_point
logical (kind=log_kind), optional :: &
initonly ! flag to indicate init only, default is false
! local temporary variables
! other local variables
! snow variables for Delta-Eddington shortwave
real (kind=dbl_kind) :: &
fsn , & ! snow horizontal fraction
hsn , & ! snow depth (m)
hsnlvl , & ! snow depth over level ice (m)
vsn , & ! snow volume
alvl ! area fraction of level ice
real (kind=dbl_kind), dimension (nslyr) :: &
rhosnwn , & ! snow density (kg/m3)
rsnwn ! snow grain radius (micrometers)
! pond variables for Delta-Eddington shortwave
real (kind=dbl_kind) :: &
fpn , & ! pond fraction of ice cover
hpn ! actual pond depth (m)
integer (kind=int_kind) :: &
n , & ! thickness category index
k , & ! snow layer index
na ! aerosol index
real (kind=dbl_kind) :: &
ipn , & ! refrozen pond ice thickness (m), mean over ice fraction
hp , & ! pond depth
hs , & ! snow depth
asnow , & ! fractional area of snow cover
rp , & ! volume fraction of retained melt water to total liquid content
hmx , & ! maximum available snow infiltration equivalent depth
dhs , & ! local difference in snow depth on sea ice and pond ice
spn , & ! snow depth on refrozen pond (m)
rnslyr , & ! 1/nslyr
tmp ! 0 or 1
logical (kind=log_kind) :: &
linitonly ! local initonly value
real (kind=dbl_kind), parameter :: &
argmax = c10 ! maximum argument of exponential
linitonly = .false.
if (present(initonly)) then
linitonly = initonly
endif
exp_min = exp(-argmax)
! cosine of the zenith angle
call compute_coszen (tlat, tlon, &
calendar_type, days_per_year, &
nextsw_cday, yday, sec, &
coszen, dt)
do n = 1, ncat
! note that rhoswn, rsnw, fp, hp and Sswabs ARE NOT dimensioned with ncat
! BPB 19 Dec 2006
! set snow properties
fsn = c0
hsn = c0
rhosnwn(:) = c0
rsnwn(:) = c0
apeffn(n) = c0 ! for history
snowfracn(n) = c0 ! for history
rsnw_dEddn(n) = c0 ! for history
if (aicen(n) > puny) then
call shortwave_dEdd_set_snow(nslyr, R_snw, &
dT_mlt, rsnw_mlt, &
aicen(n), vsnon(n), &
Tsfcn(n), fsn, &
hs0, hsn, &
rhosnwn, rsnwn, &
rsnow(:,n), tr_rsnw)
! set pond properties
if (tr_pond_cesm) then
! fraction of ice area
fpn = apndn(n)
! pond depth over fraction fpn
hpn = hpndn(n)
! snow infiltration
if (hsn >= hs_min .and. hs0 > puny) then
asnow = min(hsn/hs0, c1) ! delta-Eddington formulation
fpn = (c1 - asnow) * fpn
hpn = pndaspect * fpn
endif
! Zero out fraction of thin ponds for radiation only
if (hpn < hpmin) fpn = c0
fsn = min(fsn, c1-fpn)
apeffn(n) = fpn ! for history
elseif (tr_pond_lvl) then
hsnlvl = hsn ! initialize
if (trim(snwredist) == '30percentsw') then
hsnlvl = hsn / (c1 + snwlvlfac*(c1-alvln(n)))
! snow volume over level ice
alvl = aicen(n) * alvln(n)
if (alvl > puny) then
vsn = hsnlvl * alvl
else
vsn = vsnon(n)
alvl = aicen(n)
endif
! set snow properties over level ice
call shortwave_dEdd_set_snow(nslyr, R_snw, &
dT_mlt, rsnw_mlt, &
alvl, vsn, &