-
Notifications
You must be signed in to change notification settings - Fork 134
/
icepack_shortwave.F90
5504 lines (4808 loc) · 236 KB
/
icepack_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
!=======================================================================
!
! 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 icepack_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 icepack_shortwave
use icepack_kinds
use icepack_parameters, only: c0, c1, c1p5, c2, c3, c4, c10
use icepack_parameters, only: p01, p1, p15, p25, p5, p75, puny
use icepack_parameters, only: argcheck
use icepack_parameters, only: albocn, Timelt, snowpatch, awtvdr, awtidr, awtvdf, awtidf
use icepack_parameters, only: kappav, hs_min, rhofresh, rhos, rhoi
use icepack_parameters, only: rsnw_fall, snwredist, rsnw_tmax
use icepack_parameters, only: hi_ssl, hs_ssl, min_bgc, sk_l, snwlvlfac, snwgrain
use icepack_parameters, only: z_tracers, skl_bgc, calc_tsfc, shortwave, kalg
use icepack_parameters, only: R_ice, R_pnd, R_snw, dT_mlt, rsnw_mlt, hs0, hs1, hp1
use icepack_parameters, only: pndaspect, albedo_type, albicev, albicei, albsnowv, albsnowi, ahmax
use icepack_parameters, only: snw_ssp_table, modal_aero
use icepack_parameters, only: dEdd_algae
use icepack_tracers, only: ncat, nilyr, nslyr, nblyr
use icepack_tracers, only: ntrcr, nbtrcr_sw
use icepack_tracers, only: tr_pond_lvl, tr_pond_topo
use icepack_tracers, only: tr_bgc_N, tr_aero
use icepack_tracers, only: nt_bgc_N, nt_zaero
use icepack_tracers, only: tr_zaero, nlt_chl_sw, nlt_zaero_sw
use icepack_tracers, only: n_algae, n_aero, n_zaero
use icepack_tracers, only: nmodal1, nmodal2, max_aero
use icepack_shortwave_data, only: nspint_3bd, nspint_5bd, rsnw_datatype
use icepack_zbgc_shared,only: R_chl2N, F_abs_chl
use icepack_zbgc_shared,only: remap_zbgc, igrid, swgrid
use icepack_orbital, only: compute_coszen
use icepack_warnings, only: warnstr, icepack_warnings_add
use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted
! dEdd 3-band data
use icepack_shortwave_data, only: &
! inherent optical properties (iop)
! k = extinction coefficient (/m)
! w = single scattering albedo
! g = asymmetry parameter
ki_ssl_mn_3bd, wi_ssl_mn_3bd, gi_ssl_mn_3bd, & ! ice surface scattering layer (ssl) iops
ki_dl_mn_3bd, wi_dl_mn_3bd, gi_dl_mn_3bd , & ! ice drained layer (dl) iops
ki_int_mn_3bd, wi_int_mn_3bd, gi_int_mn_3bd, & ! ice interior layer (int) iops
ki_p_ssl_mn, wi_p_ssl_mn, gi_p_ssl_mn , & ! ponded ice surface scattering layer (ssl) iops
ki_p_int_mn, wi_p_int_mn, gi_p_int_mn , & ! ponded ice interior layer (int) iops
kw, ww, gw ! iops for pond water and underlying ocean
use icepack_shortwave_data, only: &
gaer_bc_3bd, kaer_bc_3bd, waer_bc_3bd, bcenh_3bd, &
gaer_3bd, kaer_3bd, waer_3bd
use icepack_shortwave_data, only: &
nmbrad_snw, & ! number of snow grain radii in tables
rsnw_tab, & ! snow grain radii (micro-meters) for table
Qs_tab, & ! snow extinction efficiency (unitless)
ws_tab, & ! snow single scattering albedo (unitless)
gs_tab ! snow asymmetry parameter (unitless)
! dEdd 5-band data
use icepack_shortwave_data, only: &
ki_ssl_mn_5bd, wi_ssl_mn_5bd, gi_ssl_mn_5bd, & ! ice surface scattering layer (ssl) iops
ki_dl_mn_5bd, wi_dl_mn_5bd, gi_dl_mn_5bd , & ! ice drained layer (dl) iops
ki_int_mn_5bd, wi_int_mn_5bd, gi_int_mn_5bd ! ice interior layer (int) iops
use icepack_shortwave_data, only: &
gaer_bc_5bd, kaer_bc_5bd, waer_bc_5bd, bcenh_5bd, &
gaer_5bd, kaer_5bd, waer_5bd
use icepack_shortwave_data, only: &
nmbrad_snicar , & ! number of snow grain radii in SNICAR SSP tables
rsnw_snicar_min, & ! minimum snow radius
rsnw_snicar_max, & ! maximum snow radius
ssp_snwextdr, ssp_snwalbdr, ssp_sasymmdr, &
ssp_snwextdf, ssp_snwalbdf, ssp_sasymmdf, &
rsnw_snicar_tab
implicit none
private
public :: icepack_prep_radiation, &
icepack_init_radiation, &
icepack_step_radiation
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), parameter :: &
exp_argmax = c10 ! maximum argument of exponential
! dEdd tuning parameters, set in namelist
! 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)
! pndaspect ! ratio of pond depth to pond fraction
! hs0 ! snow depth for transition to bare sea ice (m)
! hs1 ! tapering parameter for snow on pond ice
! hp1 ! critical parameter for pond ice thickness
! kalg ! algae absorption coefficient
!=======================================================================
contains
!=======================================================================
!autodocument_start icepack_init_radiation
! Initialize data needed for shortwave radiation calculations
! This should be called after values are set via icepack_init_parameters
subroutine icepack_init_radiation()
!autodocument_end
use icepack_shortwave_data, only: icepack_shortwave_init_dEdd3band
use icepack_shortwave_data, only: icepack_shortwave_init_dEdd5band
use icepack_shortwave_data, only: icepack_shortwave_init_snicar
use icepack_shortwave_data, only: icepack_shortwave_init_snicartest
! local variables
integer (kind=int_kind) :: n
character (len=*),parameter :: subname='(icepack_init_radiation)'
!-----------------------------------------------------------------
! Set dEdd parameter tables
!-----------------------------------------------------------------
if (shortwave(1:4) == 'dEdd') then
call icepack_shortwave_init_dEdd3band()
if (icepack_warnings_aborted(subname)) return
endif
if (trim(shortwave) == 'dEdd_snicar_ad') then
call icepack_shortwave_init_dEdd5band()
if (icepack_warnings_aborted(subname)) return
if (trim(snw_ssp_table) == 'test') then ! 5x5 test table
call icepack_shortwave_init_snicartest()
if (icepack_warnings_aborted(subname)) return
elseif (trim(snw_ssp_table) == 'snicar') then ! 5 x 1471 table
call icepack_shortwave_init_snicar()
if (icepack_warnings_aborted(subname)) return
else
call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
call icepack_warnings_add(subname//'ERROR: snw_ssp_table = '//trim(snw_ssp_table)//' not supported')
return
endif
!------------------------------
! Check SNICAR SSP data
!------------------------------
write(warnstr,'(2a,i8)') subname, ' nmbrad_snicar = ',nmbrad_snicar
call icepack_warnings_add(warnstr)
write(warnstr,'(2a,i8)') subname, ' nspint = ',nspint_5bd
call icepack_warnings_add(warnstr)
write(warnstr,'(2a,i8)') subname, ' nmodal1 = ',nmodal1
call icepack_warnings_add(warnstr)
write(warnstr,'(2a,i8)') subname, ' nmodal2 = ',nmodal2
call icepack_warnings_add(warnstr)
write(warnstr,'(2a,i8)') subname, ' max_aero = ',max_aero
call icepack_warnings_add(warnstr)
write(warnstr,'(2a,i5,a,i5,a,g22.15)') subname, ' ssp_snwextdr(',1, ',',1, ') = ',ssp_snwextdr(1,1)
call icepack_warnings_add(warnstr)
write(warnstr,'(2a,i5,a,i5,a,g22.15)') subname, ' ssp_snwextdr(',nspint_5bd,',',1, ') = ',ssp_snwextdr(nspint_5bd,1)
call icepack_warnings_add(warnstr)
write(warnstr,'(2a,i5,a,i5,a,g22.15)') subname, ' ssp_snwextdr(',1, ',',nmbrad_snicar,') = ',ssp_snwextdr(1,nmbrad_snicar)
call icepack_warnings_add(warnstr)
write(warnstr,'(2a,i5,a,i5,a,g22.15)') subname, ' ssp_snwextdr(',nspint_5bd,',',nmbrad_snicar,') = ',ssp_snwextdr(nspint_5bd,nmbrad_snicar)
call icepack_warnings_add(warnstr)
endif
end subroutine icepack_init_radiation
!=======================================================================
!
! Driver for basic solar radiation from CCSM3. Albedos and absorbed solar.
subroutine shortwave_ccsm3 (aicen, vicen, &
vsnon, Tsfcn, &
swvdr, swvdf, &
swidr, swidf, &
albedo_type, &
albicev, albicei, &
albsnowv, albsnowi, &
ahmax, &
alvdrn, alidrn, &
alvdfn, alidfn, &
fswsfc, fswint, &
fswthrun, &
fswthrun_vdr, &
fswthrun_vdf, &
fswthrun_idr, &
fswthrun_idf, &
fswpenl, &
Iswabs, SSwabs, &
albin, albsn, &
coszen)
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)
character (len=char_len), intent(in) :: &
albedo_type ! albedo parameterization, '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)
fswthrun , & ! SW through ice to ocean (W m-2)
albin , & ! bare ice albedo
albsn ! snow albedo
real (kind=dbl_kind), dimension (:), intent(out), optional :: &
fswthrun_vdr, & ! vis dir SW through ice to ocean (W m-2)
fswthrun_vdf, & ! vis dif SW through ice to ocean (W m-2)
fswthrun_idr, & ! nir dir SW through ice to ocean (W m-2)
fswthrun_idf ! nir dif SW through ice to ocean (W m-2)
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)
! needed for optional fswthrun arrays when passed as scalars
real (kind=dbl_kind) :: &
l_fswthru_vdr, & ! vis dir SW through ice to ocean (W m-2)
l_fswthru_vdf, & ! vis dif SW through ice to ocean (W m-2)
l_fswthru_idr, & ! nir dir SW through ice to ocean (W m-2)
l_fswthru_idf ! nir dif SW through ice to ocean (W m-2)
character(len=*),parameter :: subname='(shortwave_ccsm3)'
!-----------------------------------------------------------------
! 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
fswthrun(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))
if (icepack_warnings_aborted(subname)) return
elseif (trim(albedo_type) == 'ccsm3') then
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))
if (icepack_warnings_aborted(subname)) return
else
call icepack_warnings_add(subname//' ERROR: albedo_type '//trim(albedo_type)//' unknown')
call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
return
endif
!-----------------------------------------------------------------
! Compute solar radiation absorbed in ice and penetrating to ocean.
!-----------------------------------------------------------------
call absorbed_solar (aicen(n), &
vicen(n), &
vsnon(n), &
swvdr, swvdf, &
swidr, swidf, &
alvdrni, alvdfni, &
alidrni, alidfni, &
alvdrns, alvdfns, &
alidrns, alidfns, &
fswsfc=fswsfc(n), &
fswint=fswint(n), &
fswthru=fswthrun(n), &
fswthru_vdr=l_fswthru_vdr, &
fswthru_vdf=l_fswthru_vdf, &
fswthru_idr=l_fswthru_idr, &
fswthru_idf=l_fswthru_idf, &
fswpenl=fswpenl(:,n), &
Iswabs=Iswabs(:,n))
if (icepack_warnings_aborted(subname)) return
if (present(fswthrun_vdr)) fswthrun_vdr(n) = l_fswthru_vdr
if (present(fswthrun_vdf)) fswthrun_vdf(n) = l_fswthru_vdf
if (present(fswthrun_idr)) fswthrun_idr(n) = l_fswthru_idr
if (present(fswthrun_idf)) fswthrun_idf(n) = l_fswthru_idf
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
character(len=*),parameter :: subname='(compute_albedos)'
!-----------------------------------------------------------------
! Compute albedo for each thickness category.
!-----------------------------------------------------------------
hi = vicen / aicen
hs = vsnon / aicen
! bare ice, thickness dependence
fhtan = atan(ahmax*c4)
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)
character(len=*),parameter :: subname='(constant_albedos)'
!-----------------------------------------------------------------
! 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 (aicen, &
vicen, vsnon, &
swvdr, swvdf, &
swidr, swidf, &
alvdrni, alvdfni, &
alidrni, alidfni, &
alvdrns, alvdfns, &
alidrns, alidfns, &
fswsfc, fswint, &
fswthru, &
fswthru_vdr, &
fswthru_vdf, &
fswthru_idr, &
fswthru_idf, &
fswpenl, &
Iswabs)
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), intent(out) :: &
fswthru_vdr , & ! vis dir SW through ice to ocean (W m-2)
fswthru_vdf , & ! vis dif SW through ice to ocean (W m-2)
fswthru_idr , & ! nir dir SW through ice to ocean (W m-2)
fswthru_idf ! nir dif 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
character(len=*),parameter :: subname='(absorbed_solar)'
!-----------------------------------------------------------------
! 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
fswthru_vdr = fswpenvdr * tranbot
fswthru_vdf = fswpenvdf * tranbot
fswthru_idr = c0
fswthru_idf = c0
! SW absorbed in ice interior
fswint = fswpen - fswthru
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, &
aicen, vicen, &
vsnon, Tsfcn, &
alvln, apndn, &
hpndn, ipndn, &
aeron, &
trcrn_bgcsw, &
TLAT, TLON, &
calendar_type, &
days_per_year, &
nextsw_cday, yday, &
sec, &
swvdr, swvdf, &
swidr, swidf, &
coszen, fsnow, &
alvdrn, alvdfn, &
alidrn, alidfn, &
fswsfcn, fswintn, &
fswthrun, &
fswthrun_vdr, &
fswthrun_vdf, &
fswthrun_idr, &
fswthrun_idf, &
fswpenln, &
Sswabsn, Iswabsn, &
albicen, albsnon, &
albpndn, apeffn, &
snowfracn, &
dhsn, ffracn, &
rsnow, &
l_print_point, &
initonly)
integer (kind=int_kind), intent(in) :: &
sec ! elapsed seconds into date
real (kind=dbl_kind), intent(in), optional :: &
yday ! day of the year
character (len=char_len), intent(in), optional :: &
calendar_type ! differentiates Gregorian from other calendars
integer (kind=int_kind), intent(in), optional :: &
days_per_year ! number of days in one year
real (kind=dbl_kind), intent(in), optional :: &
nextsw_cday ! julian day of next shortwave calculation
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)
Tsfcn, & ! surface temperature (deg C)
alvln, & ! level-ice area fraction
apndn, & ! pond area fraction
hpndn, & ! pond depth (m)
ipndn ! pond refrozen lid thickness (m)
real(kind=dbl_kind), dimension(:,:), intent(in) :: &
aeron, & ! aerosols (kg/m^3)
trcrn_bgcsw ! zaerosols (kg/m^3) + chlorophyll on shorthwave grid
real(kind=dbl_kind), dimension(:), intent(inout) :: &
ffracn, & ! fraction of fsurfn used to melt ipond
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(out), optional :: &
fswthrun_vdr, & ! vis dir SW through ice to ocean (W/m^2)
fswthrun_vdf, & ! vis dif SW through ice to ocean (W/m^2)
fswthrun_idr, & ! nir dir SW through ice to ocean (W/m^2)
fswthrun_idf ! nir dif SW through ice to ocean (W/m^2)
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)
real(kind=dbl_kind), dimension(:,:), intent(inout), optional :: &
rsnow ! snow grain radius tracer (10^-6 m)
logical (kind=log_kind), intent(in) :: &
l_print_point ! print diagnostic information
logical (kind=log_kind), optional :: &
initonly ! flag to indicate init only, default is false
! 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
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)
tmp ! 0 or 1
! needed for optional fswthrun arrays when passed as scalars
real (kind=dbl_kind) :: &
l_fswthru_vdr , & ! vis dir SW through ice to ocean (W m-2)
l_fswthru_vdf , & ! vis dif SW through ice to ocean (W m-2)
l_fswthru_idr , & ! nir dir SW through ice to ocean (W m-2)
l_fswthru_idf ! nir dif SW through ice to ocean (W m-2)
logical (kind=log_kind) :: &
l_initonly ! local initonly value