-
Notifications
You must be signed in to change notification settings - Fork 12
/
ice_shortwave.F90
3965 lines (3463 loc) · 165 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 925 2015-03-04 00:34:27Z eclare $
!=======================================================================
!
! 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_domain_size, only: nilyr, nslyr, ncat, n_aero, max_blocks, max_aero
use ice_constants
!use ice_blocks, only: nx_block, ny_block, block, get_block
use ice_blocks, only: nx_block, ny_block
use ice_diagnostics, only: npnt, print_points, pmloc, piloc, pjloc
use ice_fileunits, only: nu_diag
use ice_communicate, only: my_task
#ifdef AusCOM
use cpl_parameters, only : cst_ocn_albedo, ocn_albedo
use ice_grid, only : TLAT
#endif
implicit none
private
public :: init_shortwave, run_dEdd, shortwave_ccsm3
character (len=char_len), public :: &
shortwave, & ! shortwave method, 'default' ('ccsm3') or 'dEdd'
albedo_type ! albedo parameterization, 'default' ('ccsm3') or 'constant'
! shortwave='dEdd' overrides this parameter
! baseline albedos for ccsm3 shortwave, set in namelist
real (kind=dbl_kind), public :: &
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
!ars599: 24032014
! not sure if that is right!!
!ars599: 26032014
! dT_mlt has been defined in new code
! mark out and use new code
! however are they the same varialbes?
!#if defined(AusCOM) || defined(ACCICE)
#ifdef AusCOM
snowpatch, & ! parameter for fractional snow area (m)
! dT_mlt , & ! change in temp to give dalb_mlt
! albedo change
dalb_mlt , & ! albedo change per dT_mlt change
! in temp for ice
#endif
ahmax ! thickness above which ice albedo is constant (m)
! category albedos
real (kind=dbl_kind), &
dimension (nx_block,ny_block,ncat,max_blocks), public, save :: &
alvdrn , & ! visible direct albedo (fraction)
alidrn , & ! near-ir direct albedo (fraction)
alvdfn , & ! visible diffuse albedo (fraction)
alidfn ! near-ir diffuse albedo (fraction)
! albedo components for history
real (kind=dbl_kind), &
dimension (nx_block,ny_block,ncat,max_blocks), public, save :: &
albicen, & ! bare ice
albsnon, & ! snow
albpndn, & ! pond
apeffn ! effective pond area used for radiation calculation
! shortwave components
real (kind=dbl_kind), &
dimension (nx_block,ny_block,nilyr,ncat,max_blocks), public, save :: &
Iswabsn ! SW radiation absorbed in ice layers (W m-2)
real (kind=dbl_kind), &
dimension (nx_block,ny_block,nslyr,ncat,max_blocks), public, save :: &
Sswabsn ! SW radiation absorbed in snow layers (W m-2)
real (kind=dbl_kind), dimension (nx_block,ny_block,ncat,max_blocks), &
public, save :: &
fswsfcn , & ! SW absorbed at ice/snow surface (W m-2)
fswthrun , & ! SW through ice to ocean (W/m^2)
fswintn ! SW absorbed in ice interior, below surface (W m-2)
real (kind=dbl_kind), dimension (nx_block,ny_block,nilyr+1,ncat,max_blocks), &
public, save :: &
fswpenln ! visible SW entering ice layers (W m-2)
real (kind=dbl_kind), dimension (nx_block,ny_block,ncat,max_blocks), &
public, save :: &
snowfracn ! Category snow fraction used in radiation
! dEdd tuning parameters, set in namelist
real (kind=dbl_kind), public :: &
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)
kalg ! algae absorption coefficient for 0.5 m thick layer
real (kind=dbl_kind), parameter, public :: &
hi_ssl = 0.050_dbl_kind, & ! ice surface scattering layer thickness (m)
hs_ssl = 0.040_dbl_kind ! snow surface scattering layer thickness (m)
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
netsw
#ifdef AusCOM
!ars599: 26032014: change to public
real (kind=dbl_kind), dimension (nx_block,ny_block,max_blocks), public :: &
ocn_albedo2D
#endif
!=======================================================================
contains
!=======================================================================
!
! Initialize shortwave
subroutine init_shortwave
use ice_calendar, only: nstreams
use ice_domain, only: nblocks, blocks_ice
use ice_flux, only: alvdf, alidf, alvdr, alidr, &
alvdr_ai, alidr_ai, alvdf_ai, alidf_ai, &
swvdr, swvdf, swidr, swidf, scale_factor, &
albice, albsno, albpnd, albcnt, coszen, fsnow, &
apeff_ai, snowfrac
use ice_orbital, only: init_orbit
use ice_state, only: aicen, vicen, vsnon, trcrn, nt_Tsfc
use ice_blocks, only: block, get_block
use ice_grid, only: tmask, tlat, tlon
use ice_meltpond_lvl, only: dhsn, ffracn
use ice_restart_shared, only: restart, runtype
integer (kind=int_kind) :: &
icells ! number of cells with aicen > puny
integer (kind=int_kind), dimension(nx_block*ny_block) :: &
indxi, indxj ! indirect indices for cells with aicen > puny
integer (kind=int_kind) :: &
i, j, ij , & ! horizontal indices
iblk , & ! block index
ilo,ihi,jlo,jhi, & ! beginning and end of physical domain
n ! thickness category index
real (kind=dbl_kind) :: cszn ! counter for history averaging
type (block) :: &
this_block ! block information for current block
!$OMP PARALLEL DO PRIVATE(iblk,i,j,n)
do iblk = 1, nblocks
do j = 1, ny_block
do i = 1, nx_block
alvdf(i,j,iblk) = c0
alidf(i,j,iblk) = c0
alvdr(i,j,iblk) = c0
alidr(i,j,iblk) = c0
alvdr_ai(i,j,iblk) = c0
alidr_ai(i,j,iblk) = c0
alvdf_ai(i,j,iblk) = c0
alidf_ai(i,j,iblk) = c0
enddo
enddo
! Initialize
do n = 1, ncat
do j = 1, ny_block
do i = 1, nx_block
alvdrn(i,j,n,iblk) = c0
alidrn(i,j,n,iblk) = c0
alvdfn(i,j,n,iblk) = c0
alidfn(i,j,n,iblk) = c0
fswsfcn(i,j,n,iblk) = c0
fswintn(i,j,n,iblk) = c0
fswthrun(i,j,n,iblk) = c0
enddo ! i
enddo ! j
enddo ! ncat
fswpenln(:,:,:,:,iblk) = c0
Iswabsn(:,:,:,:,iblk) = c0
Sswabsn(:,:,:,:,iblk) = c0
enddo ! iblk
!$OMP END PARALLEL DO
if (trim(shortwave) == 'dEdd') then ! delta Eddington
#ifndef CCSMCOUPLED
! These come from the driver in the coupled model.
call init_orbit ! initialize orbital parameters
#endif
!$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block)
do iblk = 1, nblocks
this_block = get_block(blocks_ice(iblk),iblk)
ilo = this_block%ilo
ihi = this_block%ihi
jlo = this_block%jlo
jhi = this_block%jhi
! initialize delta Eddington
call run_dEdd(ilo, ihi, jlo, jhi, &
aicen(:,:,:,iblk), vicen(:,:,:,iblk), &
vsnon(:,:,:,iblk), trcrn(:,:,:,:,iblk), &
tlat(:,:,iblk), tlon(:,:,iblk), &
tmask(:,:,iblk), &
swvdr(:,:,iblk), swvdf(:,:,iblk), &
swidr(:,:,iblk), swidf(:,:,iblk), &
coszen(:,:,iblk), fsnow(:,:,iblk), &
alvdrn(:,:,:,iblk), alvdfn(:,:,:,iblk), &
alidrn(:,:,:,iblk), alidfn(:,:,:,iblk), &
fswsfcn(:,:,:,iblk), fswintn(:,:,:,iblk), &
fswthrun(:,:,:,iblk), fswpenln(:,:,:,:,iblk), &
Sswabsn(:,:,:,:,iblk), Iswabsn(:,:,:,:,iblk), &
albicen(:,:,:,iblk), albsnon(:,:,:,iblk), &
albpndn(:,:,:,iblk), apeffn(:,:,:,iblk), &
snowfracn(:,:,:,iblk), &
dhsn(:,:,:,iblk), ffracn(:,:,:,iblk), &
initonly = .true. )
enddo
!$OMP END PARALLEL DO
else ! basic (ccsm3) shortwave
!$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block)
do iblk = 1, nblocks
this_block = get_block(blocks_ice(iblk),iblk)
ilo = this_block%ilo
ihi = this_block%ihi
jlo = this_block%jlo
jhi = this_block%jhi
#ifndef AusCOM
call shortwave_ccsm3(nx_block, ny_block, &
ilo, ihi, jlo, jhi, &
aicen(:,:,:,iblk), vicen(:,:,:,iblk), &
vsnon(:,:,:,iblk), &
trcrn(:,:,nt_Tsfc,:,iblk), &
swvdr(:,:, iblk), swvdf(:,:, iblk), &
swidr(:,:, iblk), swidf(:,:, iblk), &
alvdrn(:,:,:,iblk), alidrn(:,:,:,iblk), &
alvdfn(:,:,:,iblk), alidfn(:,:,:,iblk), &
fswsfcn(:,:,:,iblk), fswintn(:,:,:,iblk), &
fswthrun(:,:,:,iblk), &
fswpenln(:,:,:,:,iblk), &
Iswabsn(:,:,:,:,iblk), &
Sswabsn(:,:,:,:,iblk), &
albicen(:,:,:,iblk), albsnon(:,:,:,iblk), &
coszen(:,:,iblk))
#else
if (cst_ocn_albedo) then
ocn_albedo2D(:,:,iblk) = ocn_albedo
else
ocn_albedo2D(:,:,iblk) = 0.069 - 0.011 * cos(2.0*TLAT(:,:,iblk))
!latitude-dependent profile of Large & Yeager (2009)
endif
call shortwave_ccsm3(nx_block, ny_block, &
ilo, ihi, jlo, jhi, &
aicen(:,:,:,iblk), vicen(:,:,:,iblk), &
vsnon(:,:,:,iblk), &
trcrn(:,:,nt_Tsfc,:,iblk), &
swvdr(:,:, iblk), swvdf(:,:, iblk), &
swidr(:,:, iblk), swidf(:,:, iblk), &
alvdrn(:,:,:,iblk), alidrn(:,:,:,iblk), &
alvdfn(:,:,:,iblk), alidfn(:,:,:,iblk), &
fswsfcn(:,:,:,iblk), fswintn(:,:,:,iblk), &
fswthrun(:,:,:,iblk), &
fswpenln(:,:,:,:,iblk), &
Iswabsn(:,:,:,:,iblk), &
Sswabsn(:,:,:,:,iblk), &
albicen(:,:,:,iblk), albsnon(:,:,:,iblk), &
coszen(:,:,iblk), &
ocn_albedo2D(:,:,iblk) )
#endif
enddo ! nblocks
!$OMP END PARALLEL DO
endif
!-----------------------------------------------------------------
! Aggregate albedos
!-----------------------------------------------------------------
!$OMP PARALLEL DO PRIVATE(iblk,i,j,n,ilo,ihi,jlo,jhi,this_block, &
!$OMP ij,icells,cszn,indxi,indxj)
do iblk = 1, nblocks
this_block = get_block(blocks_ice(iblk),iblk)
ilo = this_block%ilo
ihi = this_block%ihi
jlo = this_block%jlo
jhi = this_block%jhi
do n = 1, ncat
icells = 0
do j = jlo, jhi
do i = ilo, ihi
if (aicen(i,j,n,iblk) > puny) then
icells = icells + 1
indxi(icells) = i
indxj(icells) = j
endif
enddo ! i
enddo ! j
do ij = 1, icells
i = indxi(ij)
j = indxj(ij)
alvdf(i,j,iblk) = alvdf(i,j,iblk) &
+ alvdfn(i,j,n,iblk)*aicen(i,j,n,iblk)
alidf(i,j,iblk) = alidf(i,j,iblk) &
+ alidfn(i,j,n,iblk)*aicen(i,j,n,iblk)
alvdr(i,j,iblk) = alvdr(i,j,iblk) &
+ alvdrn(i,j,n,iblk)*aicen(i,j,n,iblk)
alidr(i,j,iblk) = alidr(i,j,iblk) &
+ alidrn(i,j,n,iblk)*aicen(i,j,n,iblk)
netsw = swvdr(i,j,iblk)+swidr(i,j,iblk)+swvdf(i,j,iblk)+swidf(i,j,iblk)
if (netsw > puny) then ! sun above horizon
albice(i,j,iblk) = albice(i,j,iblk) &
+ albicen(i,j,n,iblk)*aicen(i,j,n,iblk)
albsno(i,j,iblk) = albsno(i,j,iblk) &
+ albsnon(i,j,n,iblk)*aicen(i,j,n,iblk)
albpnd(i,j,iblk) = albpnd(i,j,iblk) &
+ albpndn(i,j,n,iblk)*aicen(i,j,n,iblk)
endif
apeff_ai(i,j,iblk) = apeff_ai(i,j,iblk) &
+ apeffn(i,j,n,iblk)*aicen(i,j,n,iblk)
snowfrac(i,j,iblk) = snowfrac(i,j,iblk) &
+ snowfracn(i,j,n,iblk)*aicen(i,j,n,iblk)
enddo
enddo ! ncat
!----------------------------------------------------------------
! Store grid box mean albedos and fluxes before scaling by aice
!----------------------------------------------------------------
do j = 1, ny_block
do i = 1, nx_block
alvdf_ai (i,j,iblk) = alvdf (i,j,iblk)
alidf_ai (i,j,iblk) = alidf (i,j,iblk)
alvdr_ai (i,j,iblk) = alvdr (i,j,iblk)
alidr_ai (i,j,iblk) = alidr (i,j,iblk)
enddo
enddo
!----------------------------------------------------------------
! Save net shortwave for scaling factor in scale_factor
!----------------------------------------------------------------
if (runtype == 'initial' .and. .not. restart) then
do j = 1, ny_block
do i = 1, nx_block
scale_factor(i,j,iblk) = &
swvdr(i,j,iblk)*(c1 - alvdr_ai(i,j,iblk)) &
+ swvdf(i,j,iblk)*(c1 - alvdf_ai(i,j,iblk)) &
+ swidr(i,j,iblk)*(c1 - alidr_ai(i,j,iblk)) &
+ swidf(i,j,iblk)*(c1 - alidf_ai(i,j,iblk))
enddo
enddo
endif
enddo ! nblocks
!$OMP END PARALLEL DO
end subroutine init_shortwave
!=======================================================================
!
! Driver for basic solar radiation from CCSM3. Albedos and absorbed solar.
subroutine shortwave_ccsm3 (nx_block, ny_block, &
ilo, ihi, jlo, jhi, &
aicen, vicen, &
vsnon, Tsfcn, &
swvdr, swvdf, &
swidr, swidf, &
alvdrn, alidrn, &
alvdfn, alidfn, &
fswsfc, fswint, &
fswthru, fswpenl, &
Iswabs, SSwabs, &
albin, albsn, &
#ifndef AusCOM
coszen)
#else
coszen, &
ocn_albedo2Da)
#endif
integer (kind=int_kind), intent(in) :: &
nx_block, ny_block, & ! block dimensions
ilo,ihi,jlo,jhi ! beginning and end of physical domain
real (kind=dbl_kind), dimension (nx_block,ny_block,ncat), &
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), dimension (nx_block,ny_block), &
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)
real (kind=dbl_kind), dimension (nx_block,ny_block,ncat), &
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), dimension (nx_block,ny_block,nilyr+1,ncat), &
intent(inout) :: &
fswpenl ! SW entering ice layers (W m-2)
real (kind=dbl_kind), dimension (nx_block,ny_block), &
intent(out) :: &
coszen ! cosine(zenith angle)
real (kind=dbl_kind), dimension (nx_block,ny_block,nilyr,ncat), &
intent(inout) :: &
Iswabs ! SW absorbed in particular layer (W m-2)
real (kind=dbl_kind), dimension (nx_block,ny_block,nslyr,ncat), &
intent(inout) :: &
Sswabs ! SW absorbed in particular layer (W m-2)
! local variables
integer (kind=int_kind) :: &
i, j , & ! horizontal indices
icells , & ! number of ice-covered grid cells
n ! thickness category index
integer (kind=int_kind), dimension (nx_block*ny_block) :: &
indxi , & ! indices for ice-covered cells
indxj
! ice and snow albedo for each category
real (kind=dbl_kind), dimension (nx_block,ny_block):: &
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)
#ifdef AusCOM
real (kind=dbl_kind), dimension (nx_block,ny_block), intent(in) :: &
ocn_albedo2Da
#endif
!-----------------------------------------------------------------
! 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
icells = 0
do j = jlo, jhi
do i = ilo, ihi
if (aicen(i,j,n) > puny) then
icells = icells + 1
indxi(icells) = i
indxj(icells) = j
endif
enddo ! i
enddo ! j
Sswabs(:,:,:,n) = c0
!-----------------------------------------------------------------
! Compute albedos for ice and snow.
!-----------------------------------------------------------------
#ifndef AusCOM
if (trim(albedo_type) == 'constant') then
call constant_albedos (nx_block, ny_block, &
icells, &
indxi, indxj, &
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 (nx_block, ny_block, &
icells, &
indxi, indxj, &
aicen(:,:,n), &
vicen(:,:,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))
endif
#else
if (trim(albedo_type) == 'constant') then
call constant_albedos (nx_block, ny_block, &
icells, &
indxi, indxj, &
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), &
ocn_albedo2Da)
else ! default
call compute_albedos (nx_block, ny_block, &
icells, &
indxi, indxj, &
aicen(:,:,n), &
vicen(:,:,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), &
ocn_albedo2Da)
endif
#endif
!-----------------------------------------------------------------
! Compute solar radiation absorbed in ice and penetrating to ocean.
!-----------------------------------------------------------------
call absorbed_solar (nx_block, ny_block, &
icells, &
indxi, indxj, &
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))
enddo ! ncat
end subroutine shortwave_ccsm3
!=======================================================================
!
! Compute albedos for each thickness category
subroutine compute_albedos (nx_block, ny_block, &
icells, &
indxi, indxj, &
aicen, vicen, &
vsnon, Tsfcn, &
alvdrni, alidrni, &
alvdfni, alidfni, &
alvdrns, alidrns, &
alvdfns, alidfns, &
alvdrn, alidrn, &
alvdfn, alidfn, &
#ifndef AusCOM
albin, albsn)
#else
albin, albsn, &
ocn_albedo2Da)
#endif
integer (kind=int_kind), intent(in) :: &
nx_block, ny_block, & ! block dimensions
icells ! number of ice-covered grid cells
integer (kind=int_kind), dimension (nx_block*ny_block), &
intent(in) :: &
indxi , & ! compressed indices for ice-covered cells
indxj
real (kind=dbl_kind), dimension (nx_block,ny_block), &
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), dimension (nx_block,ny_block), &
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
#ifdef AusCOM
real (kind=dbl_kind), dimension (nx_block,ny_block), intent(in) :: &
ocn_albedo2Da
#endif
! 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
integer (kind=int_kind) :: &
i, j
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
integer (kind=int_kind) :: &
ij ! horizontal index, combines i and j loops
fhtan = atan(ahmax*c4)
do j = 1, ny_block
do i = 1, nx_block
!ars599: 21032014 (2D_code)
! according to dhb599 cice use ond-D ocean albedo
! AusCOm use 2D.
#ifndef AusCOM
alvdrni(i,j) = albocn
alidrni(i,j) = albocn
alvdfni(i,j) = albocn
alidfni(i,j) = albocn
alvdrns(i,j) = albocn
alidrns(i,j) = albocn
alvdfns(i,j) = albocn
alidfns(i,j) = albocn
alvdrn(i,j) = albocn
alidrn(i,j) = albocn
alvdfn(i,j) = albocn
alidfn(i,j) = albocn
#else
alvdrni(i,j) = ocn_albedo2Da(i,j)
alidrni(i,j) = ocn_albedo2Da(i,j)
alvdfni(i,j) = ocn_albedo2Da(i,j)
alidfni(i,j) = ocn_albedo2Da(i,j)
alvdrns(i,j) = ocn_albedo2Da(i,j)
alidrns(i,j) = ocn_albedo2Da(i,j)
alvdfns(i,j) = ocn_albedo2Da(i,j)
alidfns(i,j) = ocn_albedo2Da(i,j)
alvdrn(i,j) = ocn_albedo2Da(i,j)
alidrn(i,j) = ocn_albedo2Da(i,j)
alvdfn(i,j) = ocn_albedo2Da(i,j)
alidfn(i,j) = ocn_albedo2Da(i,j)
#endif
albin(i,j) = c0
albsn(i,j) = c0
enddo
enddo
!-----------------------------------------------------------------
! Compute albedo for each thickness category.
!-----------------------------------------------------------------
!DIR$ CONCURRENT !Cray
!cdir nodep !NEC
!ocl novrec !Fujitsu
do ij = 1, icells
i = indxi(ij)
j = indxj(ij)
hi = vicen(i,j) / aicen(i,j)
hs = vsnon(i,j) / aicen(i,j)
! bare ice, thickness dependence
fh = min(atan(hi*c4)/fhtan,c1)
#ifndef AusCOM
albo = albocn*(c1-fh)
#else
albo = ocn_albedo2Da(i,j)*(c1-fh)
#endif
alvdfni(i,j) = albicev*fh + albo
alidfni(i,j) = albicei*fh + albo
! bare ice, temperature dependence
dTs = Timelt - Tsfcn(i,j)
fT = min(dTs/dT_melt-c1,c0)
alvdfni(i,j) = alvdfni(i,j) - dalb_mlt*fT
alidfni(i,j) = alidfni(i,j) - dalb_mlt*fT
! avoid negative albedos for thin, bare, melting ice
#ifndef AusCOM
alvdfni(i,j) = max (alvdfni(i,j), albocn)
alidfni(i,j) = max (alidfni(i,j), albocn)
#else
alvdfni(i,j) = max (alvdfni(i,j), ocn_albedo2Da(i,j))
alidfni(i,j) = max (alidfni(i,j), ocn_albedo2Da(i,j))
#endif
if (hs > puny) then
alvdfns(i,j) = albsnowv
alidfns(i,j) = albsnowi
! snow on ice, temperature dependence
alvdfns(i,j) = alvdfns(i,j) - dalb_mltv*fT
alidfns(i,j) = alidfns(i,j) - dalb_mlti*fT
endif ! hs > puny
! direct albedos (same as diffuse for now)
alvdrni(i,j) = alvdfni(i,j)
alidrni(i,j) = alidfni(i,j)
alvdrns(i,j) = alvdfns(i,j)
alidrns(i,j) = alidfns(i,j)
! 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(i,j) = alvdfni(i,j)*(c1-asnow) + &
alvdfns(i,j)*asnow
alidfn(i,j) = alidfni(i,j)*(c1-asnow) + &
alidfns(i,j)*asnow
alvdrn(i,j) = alvdrni(i,j)*(c1-asnow) + &
alvdrns(i,j)*asnow
alidrn(i,j) = alidrni(i,j)*(c1-asnow) + &
alidrns(i,j)*asnow
! save ice and snow albedos (for history)
albin(i,j) = awtvdr*alvdrni(i,j) + awtidr*alidrni(i,j) &
+ awtvdf*alvdfni(i,j) + awtidf*alidfni(i,j)
albsn(i,j) = awtvdr*alvdrns(i,j) + awtidr*alidrns(i,j) &
+ awtvdf*alvdfns(i,j) + awtidf*alidfns(i,j)
enddo ! ij
end subroutine compute_albedos
!=======================================================================
!
! Compute albedos for each thickness category
subroutine constant_albedos (nx_block, ny_block, &
icells, &
indxi, indxj, &
aicen, &
vsnon, Tsfcn, &
alvdrni, alidrni, &
alvdfni, alidfni, &
alvdrns, alidrns, &
alvdfns, alidfns, &
alvdrn, alidrn, &
alvdfn, alidfn, &
#ifndef AusCOM
albin, albsn)
#else
albin, albsn, &
ocn_albedo2Da)
#endif
integer (kind=int_kind), intent(in) :: &
nx_block, ny_block, & ! block dimensions
icells ! number of ice-covered grid cells
integer (kind=int_kind), dimension (nx_block*ny_block), &
intent(in) :: &
indxi , & ! compressed indices for ice-covered cells
indxj
real (kind=dbl_kind), dimension (nx_block,ny_block), &
intent(in) :: &
aicen , & ! concentration of ice per category
vsnon , & ! volume of ice per category
Tsfcn ! surface temperature
real (kind=dbl_kind), dimension (nx_block,ny_block), &
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
#ifdef AusCOM
real (kind=dbl_kind), dimension (nx_block,ny_block), intent(in) :: &
ocn_albedo2Da
#endif
! 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
integer (kind=int_kind) :: &
i, j
real (kind=dbl_kind) :: &
hs ! snow thickness (m)
integer (kind=int_kind) :: &
ij ! horizontal index, combines i and j loops
do j = 1, ny_block
do i = 1, nx_block
!ars599: 21032014 (2D_code)
#ifndef AusCOM
alvdrn(i,j) = albocn
alidrn(i,j) = albocn
alvdfn(i,j) = albocn
alidfn(i,j) = albocn
#else
alvdrn(i,j) = ocn_albedo2Da(i,j)
alidrn(i,j) = ocn_albedo2Da(i,j)
alvdfn(i,j) = ocn_albedo2Da(i,j)
alidfn(i,j) = ocn_albedo2Da(i,j)
#endif
albin(i,j) = c0
albsn(i,j) = c0
enddo
enddo
!-----------------------------------------------------------------
! Compute albedo for each thickness category.
!-----------------------------------------------------------------
!DIR$ CONCURRENT !Cray
!cdir nodep !NEC
!ocl novrec !Fujitsu
do ij = 1, icells
i = indxi(ij)
j = indxj(ij)
hs = vsnon(i,j) / aicen(i,j)
if (hs > puny) then
! snow, temperature dependence
if (Tsfcn(i,j) >= -c2*puny) then
alvdfn(i,j) = warmsnow
alidfn(i,j) = warmsnow
else
alvdfn(i,j) = coldsnow
alidfn(i,j) = coldsnow
endif
else ! hs < puny
! bare ice, temperature dependence
if (Tsfcn(i,j) >= -c2*puny) then
alvdfn(i,j) = warmice
alidfn(i,j) = warmice
else
alvdfn(i,j) = coldice
alidfn(i,j) = coldice
endif
endif ! hs > puny
! direct albedos (same as diffuse for now)
alvdrn (i,j) = alvdfn(i,j)
alidrn (i,j) = alidfn(i,j)
alvdrni(i,j) = alvdrn(i,j)
alidrni(i,j) = alidrn(i,j)
alvdrns(i,j) = alvdrn(i,j)
alidrns(i,j) = alidrn(i,j)
alvdfni(i,j) = alvdfn(i,j)
alidfni(i,j) = alidfn(i,j)
alvdfns(i,j) = alvdfn(i,j)