Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make dsnow and dsnown optional. #492

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions columnphysics/icepack_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ subroutine merge_fluxes (aicen, &
meltbn , & ! bottom ice melt (m)
meltsn , & ! snow melt (m)
meltsliqn,& ! mass of snow melt (kg/m^2)
dsnown , & ! change in snow depth (m)
congeln , & ! congelation ice growth (m)
snoicen ! snow-ice growth (m)

Expand All @@ -102,7 +101,8 @@ subroutine merge_fluxes (aicen, &
fswthrun_vdf, & ! vis dif sw radiation through ice bot (W/m**2)
fswthrun_idr, & ! nir dir sw radiation through ice bot (W/m**2)
fswthrun_idf, & ! nir dif sw radiation through ice bot (W/m**2)
Urefn ! air speed reference level (m/s)
dsnown , & ! change in snow depth (m)
Urefn ! air speed reference level (m/s)

! cumulative fluxes
real (kind=dbl_kind), intent(inout) :: &
Expand Down Expand Up @@ -220,9 +220,8 @@ subroutine merge_fluxes (aicen, &
if (snwgrain) then
meltsliq = meltsliq + meltsliqn * aicen
endif
if (present(dsnow)) then
if (present(dsnow)) &
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably should check present of dsnow and dsnown like others above. Also fswthru_* maybe needs the same. We might also want to improve robustness. If dsnow is passed but dsnown isn't (or vv), should this throw an error? Again, same question for all other optional diagnostics. Those checks could be at the start of the subroutine.

dsnow = dsnow + dsnown * aicen
endif
congel = congel + congeln * aicen
snoice = snoice + snoicen * aicen

Expand Down
12 changes: 6 additions & 6 deletions columnphysics/icepack_therm_vertical.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2248,6 +2248,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
meltt , & ! top ice melt (m/step-->cm/day)
melts , & ! snow melt (m/step-->cm/day)
meltb , & ! basal ice melt (m/step-->cm/day)
dsnow , & ! change in snow depth (m/step-->cm/day)
mlt_onset , & ! day of year that sfc melting begins
frz_onset ! day of year that freezing begins (congel or frazil)

Expand All @@ -2259,7 +2260,6 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
fswthru_vdf , & ! vis dif shortwave penetrating to ocean (W/m^2)
fswthru_idr , & ! nir dir shortwave penetrating to ocean (W/m^2)
fswthru_idf , & ! nir dif shortwave penetrating to ocean (W/m^2)
dsnow , & ! change in snow depth (m/step-->cm/day)
fsloss ! rate of snow loss to leads (kg/m^2/s)

real (kind=dbl_kind), intent(out), optional :: &
Expand Down Expand Up @@ -2320,17 +2320,17 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
melttn , & ! top ice melt (m)
meltbn , & ! bottom ice melt (m)
congeln , & ! congelation ice growth (m)
snoicen , & ! snow-ice growth (m)
dsnown ! change in snow thickness (m/step-->cm/day)
snoicen ! snow-ice growth (m)

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

real (kind=dbl_kind), dimension(:), intent(in), optional :: &
real (kind=dbl_kind), dimension(:), intent(inout), 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)
fswthrun_idf , & ! nir dif SW through ice to ocean (W/m^2)
dsnown ! change in snow thickness (m/step-->cm/day)

real (kind=dbl_kind), dimension(:,:), intent(inout) :: &
zqsn , & ! snow layer enthalpy (J m-3)
Expand Down
Loading