@@ -55,13 +55,19 @@ module icepack_fsd
55
55
public :: icepack_init_fsd_bounds, icepack_init_fsd, icepack_cleanup_fsd, &
56
56
fsd_lateral_growth, fsd_add_new_ice, fsd_weld_thermo, get_subdt_fsd
57
57
58
- real (kind= dbl_kind), dimension (:), allocatable :: &
58
+ real (kind= dbl_kind), dimension (:), allocatable , public :: &
59
59
floe_rad_h, & ! fsd size higher bound in m (radius)
60
+ floe_rad_c, & ! fsd size center in m (radius)
61
+ floe_rad_l, & ! fsd size lower bound in m (radius)
62
+ floe_binwidth, & ! fsd size binwidth in m (radius)
60
63
floe_area_l, & ! fsd area at lower bound (m^2)
61
64
floe_area_h, & ! fsd area at higher bound (m^2)
62
65
floe_area_c, & ! fsd area at bin centre (m^2)
63
66
floe_area_binwidth ! floe area bin width (m^2)
64
67
68
+ character (len= 35 ), dimension (:), allocatable , public :: &
69
+ c_fsd_range ! string for history output
70
+
65
71
integer (kind= int_kind), dimension (:,:), allocatable , public :: &
66
72
iweld ! floe size categories that can combine
67
73
! during welding (dimensionless)
@@ -85,22 +91,22 @@ module icepack_fsd
85
91
! authors: Lettie Roach, NIWA/VUW and C. M. Bitz, UW
86
92
87
93
subroutine icepack_init_fsd_bounds ( &
88
- floe_rad_l , & ! fsd size lower bound in m (radius )
89
- floe_rad_c , & ! fsd size bin centre in m (radius)
90
- floe_binwidth , & ! fsd size bin width in m (radius)
91
- c_fsd_range , & ! string for history output
92
- write_diags ) ! flag for writing diagnostics
94
+ floe_rad_l_out , & ! fsd size lower bound in m (radius )
95
+ floe_rad_c_out , & ! fsd size bin centre in m (radius)
96
+ floe_binwidth_out , & ! fsd size bin width in m (radius)
97
+ c_fsd_range_out , & ! string for history output
98
+ write_diags) ! flag for writing diagnostics
93
99
94
- real (kind= dbl_kind), dimension (:), intent (inout ) :: &
95
- floe_rad_l , & ! fsd size lower bound in m (radius)
96
- floe_rad_c , & ! fsd size bin centre in m (radius)
97
- floe_binwidth ! fsd size bin width in m (radius)
100
+ real (kind= dbl_kind), dimension (:), intent (out ), optional :: &
101
+ floe_rad_l_out , & ! fsd size lower bound in m (radius)
102
+ floe_rad_c_out , & ! fsd size bin centre in m (radius)
103
+ floe_binwidth_out ! fsd size bin width in m (radius)
98
104
99
- character (len= 35 ), intent (out ) :: &
100
- c_fsd_range(nfsd) ! string for history output
105
+ character (len= 35 ), dimension (:), intent (out ), optional :: &
106
+ c_fsd_range_out ! string for history output
101
107
102
108
logical (kind= log_kind), intent (in ), optional :: &
103
- write_diags ! write diags flag
109
+ write_diags ! write diags flag
104
110
105
111
! autodocument_end
106
112
@@ -111,11 +117,8 @@ subroutine icepack_init_fsd_bounds( &
111
117
112
118
real (kind= dbl_kind) :: test
113
119
114
- real (kind= dbl_kind), dimension (0 :nfsd) :: &
115
- floe_rad
116
-
117
120
real (kind= dbl_kind), dimension (:), allocatable :: &
118
- lims
121
+ lims, floe_rad
119
122
120
123
character (len= 8 ) :: c_fsd1,c_fsd2
121
124
character (len= 2 ) :: c_nf
@@ -169,10 +172,15 @@ subroutine icepack_init_fsd_bounds( &
169
172
170
173
allocate ( &
171
174
floe_rad_h (nfsd), & ! fsd size higher bound in m (radius)
175
+ floe_rad_l (nfsd), & ! fsd size lower bound in m (radius)
176
+ floe_rad_c (nfsd), & ! fsd size center in m (radius)
177
+ floe_rad (0 :nfsd), & ! fsd bounds in m (radius)
172
178
floe_area_l (nfsd), & ! fsd area at lower bound (m^2)
173
179
floe_area_h (nfsd), & ! fsd area at higher bound (m^2)
174
180
floe_area_c (nfsd), & ! fsd area at bin centre (m^2)
175
181
floe_area_binwidth (nfsd), & ! floe area bin width (m^2)
182
+ floe_binwidth (nfsd), & ! floe bin width (m)
183
+ c_fsd_range (nfsd), & !
176
184
iweld (nfsd, nfsd), & ! fsd categories that can weld
177
185
stat= ierr)
178
186
if (ierr/= 0 ) then
@@ -186,8 +194,11 @@ subroutine icepack_init_fsd_bounds( &
186
194
floe_rad_c = (floe_rad_h+ floe_rad_l)/ c2
187
195
188
196
floe_area_l = c4* floeshape* floe_rad_l** 2
189
- floe_area_c = c4* floeshape* floe_rad_c** 2
190
197
floe_area_h = c4* floeshape* floe_rad_h** 2
198
+ ! floe_area_c = c4*floeshape*floe_rad_c**2
199
+ ! This is exactly in the middle of floe_area_h and floe_area_l
200
+ ! Whereas the above calculation is closer to floe_area_l.
201
+ floe_area_c = (floe_area_h+ floe_area_l)/ c2
191
202
192
203
floe_binwidth = floe_rad_h - floe_rad_l
193
204
@@ -220,20 +231,56 @@ subroutine icepack_init_fsd_bounds( &
220
231
enddo
221
232
222
233
if (present (write_diags)) then
223
- if (write_diags) then
224
- write (warnstr,* ) ' '
225
- call icepack_warnings_add(warnstr)
226
- write (warnstr,* ) subname
227
- call icepack_warnings_add(warnstr)
228
- write (warnstr,* ) ' floe_rad(n-1) < fsd Cat n < floe_rad(n)'
229
- call icepack_warnings_add(warnstr)
230
- do n = 1 , nfsd
231
- write (warnstr,* ) floe_rad(n-1 ),' < fsd Cat ' ,n, ' < ' ,floe_rad(n)
234
+ if (write_diags) then
235
+ write (warnstr,* ) ' '
232
236
call icepack_warnings_add(warnstr)
233
- enddo
234
- write (warnstr,* ) ' '
235
- call icepack_warnings_add(warnstr)
237
+ write (warnstr,* ) subname
238
+ call icepack_warnings_add(warnstr)
239
+ write (warnstr,* ) ' floe_rad(n-1) < fsd Cat n < floe_rad(n)'
240
+ call icepack_warnings_add(warnstr)
241
+ do n = 1 , nfsd
242
+ write (warnstr,* ) floe_rad(n-1 ),' < fsd Cat ' ,n, ' < ' ,floe_rad(n)
243
+ call icepack_warnings_add(warnstr)
244
+ enddo
245
+ write (warnstr,* ) ' '
246
+ call icepack_warnings_add(warnstr)
247
+ endif
248
+ endif
249
+
250
+ if (present (floe_rad_l_out)) then
251
+ if (size (floe_rad_l_out) /= size (floe_rad_l)) then
252
+ call icepack_warnings_add(subname// ' floe_rad_l_out incorrect size' )
253
+ call icepack_warnings_setabort(.true. ,__FILE__,__LINE__)
254
+ return
255
+ endif
256
+ floe_rad_l_out(:) = floe_rad_l(:)
257
+ endif
258
+
259
+ if (present (floe_rad_c_out)) then
260
+ if (size (floe_rad_c_out) /= size (floe_rad_c)) then
261
+ call icepack_warnings_add(subname// ' floe_rad_c_out incorrect size' )
262
+ call icepack_warnings_setabort(.true. ,__FILE__,__LINE__)
263
+ return
264
+ endif
265
+ floe_rad_c_out(:) = floe_rad_c(:)
236
266
endif
267
+
268
+ if (present (floe_binwidth_out)) then
269
+ if (size (floe_binwidth_out) /= size (floe_binwidth)) then
270
+ call icepack_warnings_add(subname// ' floe_binwidth_out incorrect size' )
271
+ call icepack_warnings_setabort(.true. ,__FILE__,__LINE__)
272
+ return
273
+ endif
274
+ floe_binwidth_out(:) = floe_binwidth(:)
275
+ endif
276
+
277
+ if (present (c_fsd_range_out)) then
278
+ if (size (c_fsd_range_out) /= size (c_fsd_range)) then
279
+ call icepack_warnings_add(subname// ' c_fsd_range_out incorrect size' )
280
+ call icepack_warnings_setabort(.true. ,__FILE__,__LINE__)
281
+ return
282
+ endif
283
+ c_fsd_range_out(:) = c_fsd_range(:)
237
284
endif
238
285
239
286
end subroutine icepack_init_fsd_bounds
@@ -256,18 +303,11 @@ end subroutine icepack_init_fsd_bounds
256
303
!
257
304
! authors: Lettie Roach, NIWA/VUW
258
305
259
- subroutine icepack_init_fsd (ice_ic , &
260
- floe_rad_c , & ! fsd size bin centre in m (radius )
261
- floe_binwidth, & ! fsd size bin width in m (radius)
262
- afsd) ! floe size distribution tracer
306
+ subroutine icepack_init_fsd (ice_ic , afsd ) ! floe size distribution tracer
263
307
264
308
character (len= char_len_long), intent (in ) :: &
265
309
ice_ic ! method of ice cover initialization
266
310
267
- real (kind= dbl_kind), dimension (:), intent (inout ) :: &
268
- floe_rad_c, & ! fsd size bin centre in m (radius)
269
- floe_binwidth ! fsd size bin width in m (radius)
270
-
271
311
real (kind= dbl_kind), dimension (:), intent (inout ) :: &
272
312
afsd ! floe size tracer: fraction distribution of floes
273
313
@@ -323,7 +363,6 @@ subroutine icepack_cleanup_fsd (afsdn)
323
363
324
364
character (len=* ), parameter :: subname= ' (icepack_cleanup_fsd)'
325
365
326
-
327
366
if (tr_fsd) then
328
367
329
368
do n = 1 , ncat
@@ -378,14 +417,11 @@ end subroutine icepack_cleanup_fsdn
378
417
!
379
418
! authors: Lettie Roach, NIWA/VUW
380
419
381
- subroutine partition_area (floe_rad_c , aice , &
420
+ subroutine partition_area (aice , &
382
421
aicen , vicen , &
383
422
afsdn , lead_area , &
384
423
latsurf_area )
385
424
386
- real (kind= dbl_kind), dimension (:), intent (in ) :: &
387
- floe_rad_c ! fsd size bin centre in m (radius)
388
-
389
425
real (kind= dbl_kind), intent (in ) :: &
390
426
aice ! ice concentration
391
427
@@ -476,7 +512,7 @@ end subroutine partition_area
476
512
subroutine fsd_lateral_growth (dt , aice , &
477
513
aicen , vicen , &
478
514
vi0new , &
479
- frazil , floe_rad_c , &
515
+ frazil , &
480
516
afsdn , &
481
517
lead_area , latsurf_area , &
482
518
G_radial , d_an_latg , &
@@ -497,10 +533,6 @@ subroutine fsd_lateral_growth (dt, aice, &
497
533
vi0new , & ! volume of new ice added to cat 1 (m)
498
534
frazil ! frazil ice growth (m/step-->cm/day)
499
535
500
- ! floe size distribution
501
- real (kind= dbl_kind), dimension (:), intent (in ) :: &
502
- floe_rad_c ! fsd size bin centre in m (radius)
503
-
504
536
real (kind= dbl_kind), dimension (ncat), intent (out ) :: &
505
537
d_an_latg ! change in aicen occuring due to lateral growth
506
538
@@ -529,7 +561,7 @@ subroutine fsd_lateral_growth (dt, aice, &
529
561
d_an_latg = c0
530
562
531
563
! partition volume into lateral growth and frazil
532
- call partition_area (floe_rad_c, aice, &
564
+ call partition_area (aice, &
533
565
aicen, vicen, &
534
566
afsdn, lead_area, &
535
567
latsurf_area)
@@ -540,9 +572,6 @@ subroutine fsd_lateral_growth (dt, aice, &
540
572
vi0new_lat = vi0new * lead_area / (c1 + aice/ latsurf_area)
541
573
end if
542
574
543
- ! for history/diagnostics
544
- frazil = vi0new - vi0new_lat
545
-
546
575
! lateral growth increment
547
576
if (vi0new_lat > puny) then
548
577
G_radial = vi0new_lat/ dt
@@ -563,8 +592,6 @@ subroutine fsd_lateral_growth (dt, aice, &
563
592
endif ! vi0new_lat > 0
564
593
565
594
! Use remaining ice volume as in standard model,
566
- ! but ice cannot grow into the area that has grown laterally
567
- vi0new = vi0new - vi0new_lat
568
595
tot_latg = SUM (d_an_latg(:))
569
596
570
597
end subroutine fsd_lateral_growth
@@ -589,7 +616,6 @@ end subroutine fsd_lateral_growth
589
616
subroutine fsd_add_new_ice (n , &
590
617
dt , ai0new , &
591
618
d_an_latg , d_an_newi , &
592
- floe_rad_c , floe_binwidth , &
593
619
G_radial , area2 , &
594
620
wave_sig_ht , &
595
621
wave_spectrum , &
@@ -623,9 +649,7 @@ subroutine fsd_add_new_ice (n, &
623
649
624
650
real (kind= dbl_kind), dimension (:), intent (in ) :: &
625
651
aicen_init , & ! fractional area of ice
626
- aicen , & ! after update
627
- floe_rad_c , & ! fsd size bin centre in m (radius)
628
- floe_binwidth ! fsd size bin width in m (radius)
652
+ aicen ! after update
629
653
630
654
real (kind= dbl_kind), dimension (:,:), intent (in ) :: &
631
655
afsdn ! floe size distribution tracer
0 commit comments