Skip to content

Commit 8c3f26a

Browse files
authored
Make dsnow and dsnown optional (#506)
This is the icepack part of making both dsnow and dsnown optional. Later I can add some diagnostics for these in CICE.
1 parent 286630f commit 8c3f26a

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

columnphysics/icepack_therm_vertical.F90

+22-6
Original file line numberDiff line numberDiff line change
@@ -2361,12 +2361,14 @@ subroutine icepack_step_therm1(dt, &
23612361
melttn , & ! top ice melt (m)
23622362
meltbn , & ! bottom ice melt (m)
23632363
congeln , & ! congelation ice growth (m)
2364-
snoicen , & ! snow-ice growth (m)
2365-
dsnown ! change in snow thickness (m/step-->cm/day)
2364+
snoicen ! snow-ice growth (m)
23662365

23672366
real (kind=dbl_kind), dimension(:), intent(in) :: &
23682367
fswthrun ! SW through ice to ocean (W/m^2)
23692368

2369+
real (kind=dbl_kind), dimension(:), intent(inout), optional :: &
2370+
dsnown ! change in snow thickness (m/step-->cm/day)
2371+
23702372
real (kind=dbl_kind), dimension(:), intent(in), optional :: &
23712373
fswthrun_vdr , & ! vis dir SW through ice to ocean (W/m^2)
23722374
fswthrun_vdf , & ! vis dif SW through ice to ocean (W/m^2)
@@ -2442,6 +2444,8 @@ subroutine icepack_step_therm1(dt, &
24422444
l_fswthrun_vdf, & ! vis dif SW local n ice to ocean (W/m^2)
24432445
l_fswthrun_idr, & ! nir dir SW local n ice to ocean (W/m^2)
24442446
l_fswthrun_idf, & ! nir dif SW local n ice to ocean (W/m^2)
2447+
l_dsnow, & ! local snow change
2448+
l_dsnown, & ! local snow change category
24452449
l_meltsliq ! mass of snow melt local (kg/m^2)
24462450

24472451
real (kind=dbl_kind) :: &
@@ -2485,6 +2489,12 @@ subroutine icepack_step_therm1(dt, &
24852489
call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
24862490
return
24872491
endif
2492+
if ((present(dsnow) .and. .not.present(dsnown)) .or. &
2493+
(present(dsnown) .and. .not.present(dsnow))) then
2494+
call icepack_warnings_add(subname//' error in dsnow arguments')
2495+
call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
2496+
return
2497+
endif
24882498
if (tr_fsd) then
24892499
if (.not.present(afsdn)) then
24902500
call icepack_warnings_add(subname//' error missing afsdn argument, tr_fsd=T')
@@ -2509,6 +2519,8 @@ subroutine icepack_step_therm1(dt, &
25092519

25102520
l_meltsliq = c0
25112521
l_meltsliqn = c0
2522+
l_dsnow = c0
2523+
if (present(dsnow)) l_dsnow = dsnow
25122524

25132525
! solid and liquid components of snow mass
25142526
massicen(:,:) = c0
@@ -2589,7 +2601,8 @@ subroutine icepack_step_therm1(dt, &
25892601
meltbn (n) = c0
25902602
congeln(n) = c0
25912603
snoicen(n) = c0
2592-
dsnown (n) = c0
2604+
l_dsnown = c0
2605+
if (present(dsnown)) dsnown(n) = c0
25932606

25942607
Trefn = c0
25952608
Qrefn = c0
@@ -2714,8 +2727,8 @@ subroutine icepack_step_therm1(dt, &
27142727
smice=smice, massice=massicen (:,n), &
27152728
smliq=smliq, massliq=massliqn (:,n), &
27162729
congel=congeln (n), snoice=snoicen (n), &
2717-
mlt_onset=mlt_onset, frz_onset=frz_onset, &
2718-
yday=yday, dsnow=dsnown (n), &
2730+
mlt_onset=mlt_onset, frz_onset=frz_onset , &
2731+
yday=yday, dsnow=l_dsnown , &
27192732
prescribed_ice=prescribed_ice)
27202733

27212734
if (icepack_warnings_aborted(subname)) then
@@ -2903,7 +2916,7 @@ subroutine icepack_step_therm1(dt, &
29032916
meltbn=meltbn (n), congeln=congeln(n),&
29042917
meltt=meltt, melts=melts, &
29052918
meltb=meltb, snoicen=snoicen(n),&
2906-
dsnow=dsnow, dsnown=dsnown(n), &
2919+
dsnow=l_dsnow, dsnown=l_dsnown, &
29072920
congel=congel, snoice=snoice, &
29082921
meltsliq=l_meltsliq, &
29092922
meltsliqn=l_meltsliqn(n), &
@@ -2919,6 +2932,8 @@ subroutine icepack_step_therm1(dt, &
29192932

29202933
endif
29212934

2935+
if (present(dsnown )) dsnown(n) = l_dsnown
2936+
29222937
enddo ! ncat
29232938

29242939
!-----------------------------------------------------------------
@@ -2944,6 +2959,7 @@ subroutine icepack_step_therm1(dt, &
29442959

29452960
if (present(meltsliqn )) meltsliqn = l_meltsliqn
29462961
if (present(meltsliq )) meltsliq = l_meltsliq
2962+
if (present(dsnow )) dsnow = l_dsnow
29472963

29482964
!-----------------------------------------------------------------
29492965
! Calculate ponds from the topographic scheme

0 commit comments

Comments
 (0)