Giter Site home page Giter Site logo

Comments (7)

DmitryDukhovskoy avatar DmitryDukhovskoy commented on July 17, 2024 1

Thank you Phil, I thought about puny as a very small volume to make the units work but was not sure if this was correct. Your explanation makes sense.

from icepack.

apcraig avatar apcraig commented on July 17, 2024

You could also try asking this question here, https://bb.cgd.ucar.edu/cesm/forums/cice-consortium.146/

from icepack.

phil-blain avatar phil-blain commented on July 17, 2024

I think the units are OK, as the comment above indicates that puny is used as a small volume, and so it has units of meters (m^3/m^2):

!-----------------------------------------------------------------
! Tmax based on the idea that dT ~ dq / (rhos*cp_ice)
! dq ~ q dv / v
! dv ~ puny = eps11
! where 'd' denotes an error due to roundoff.
!-----------------------------------------------------------------
if (hslyr > hs_min/rnslyr) then
! zqsn < 0
Tmax = -zqsn(k)*puny*rnslyr / &
(rhos*cp_ice*vsnon)
else

so this gets rid of your remaining meter and so Tmax has units of degrees.

I think that the rnslyr factor is also OK, it was added between CICE4 and CICE5, in CICE-Consortium/CICE-svn-trunk@147e57d#diff-0dea52c09d4accde92a7a7f9a321db395f5d2e0b506cd24fb9949b1a35acfb8eL969 and the commit messages indicates:

A bug fix in
ice_therm_vertical only affects simulations using more than one snow layer
(the default is one layer).
source/ice_therm_vertical.F90

  • BUG FIX: correct layer thickness for multiple snow layers

from icepack.

phil-blain avatar phil-blain commented on July 17, 2024

I see you are in fact referring to icepack_itd.F90:

! snow enthalpy and max temperature
if (hsn > hs_min) then
! zqsn < 0
zqsn = trcrn(nt_qsno+k-1,n)
Tmax = -zqsn*puny*rnslyr / (rhos*cp_ice*vsnon(n))
else
zqsn = -rhos * Lfresh
Tmax = puny
endif

That code seems to do the same thing as in icepack_therm_vertical.F90 which I point out above.

from icepack.

DmitryDukhovskoy avatar DmitryDukhovskoy commented on July 17, 2024

I'm still struggling with zqsn units in icepack_itd.F90. In the code, zqsn is defined as J/m2 (snow layer enthalpy) - units used in CICE4.
1515 zqsn , & ! snow layer enthalpy (J m-2)

For Tmax the formula seems to be ok, assuming puny = [m3] (a tiny volume of snow) and using rnslyr/vsnon to convert J/m2 --> J/m3 (internal energy of a snow layer).

Next, the code computes snow T using zqsn:
1552 ! snow temperature
1553 zTsn = (Lfresh + zqsn/rhos)/cp_ice

Here, units of zqsn should be J/m3 not J/m2 (Lfresh = [J/kg], rhos = [kg/m3], cp_ice = [J/(kg * degree)]). I thought that zqsn should be J/m3 - units for internal snow energy (that's what is saved in restart) and I could not find in the code, where initial energy is converted to J/m2 (enthalpy) before being passed to icepack_itd.
zqsn is taken from trcrn array:
1545 zqsn = trcrn(nt_qsno+k-1,n) (should be J/m3)
or computed as:
1548 zqsn = -rhos * Lfresh (J/m3)

In zap_snow subroutine, trcrn is converted to snow enthalpy (J/m2):
1447 xtmp = trcrn(nt_qsno+k-1) / dt &
1448 * vsnon/real(nslyr,kind=dbl_kind) ! < 0

What am I missing? Thank you!

from icepack.

eclare108213 avatar eclare108213 commented on July 17, 2024

Hi Dmitry,
This is confusing, I agree. Looking through the code, I believe that the qsno tracer (or zqsn) should be J/m3 everywhere. qsno is fundamentally Lfresh*rhos ~ J/kg * kg/m3 ~ J/m3. It is listed as J/m2 in the flood_ice routine in icepack_therm_mushy.F90, which is clearly wrong (they are passed in as J/m3). The only other place in Icepack that they are listed as J/m2 is in icepack_itd.F90, and I think the units comment is wrong here also. As @phil-blain notes above, the comments in icepack_therm_vertical.F90 regarding Tmax indicate that puny does have units for this approximation.
Does the code make sense if you assume the J/m2 units in the comments are wrong?

from icepack.

DmitryDukhovskoy avatar DmitryDukhovskoy commented on July 17, 2024

Hi Elizabeth, thank you for clarification and confirming the units of the qsno (zqsn) tracer. The code does make sense for J/m3 units.

from icepack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.