Skip to content

Commit

Permalink
Merge pull request #606 from NCAR/dart_to_clm-snlsno
Browse files Browse the repository at this point in the history
bug-fix: CCE compiler error and warnings for dart_to_clm variable snlsno
  • Loading branch information
mjs2369 committed Jan 17, 2024
2 parents 52e6e45 + 70bed4b commit 4dadee7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ individual files.

The changes are now listed with the most recent at the top.

**January 17 2024 :: CLM bug-fixes. Tag v11.0.1**

- CLM5-DART SourceMods path variable correction

- dart_to_clm:

- Resolved compiler error by changing the arrays for number of snow layers (snlsno and clm_SNLSNO) to integer types

- Forcing h2oliq_po to be slightly larger than zero to be consistent with h2oice_po and dzsno_po

- Adding checks to ensure that the values for h2oliq_po, h2oice_po, dzsno_po, and snowdp_po are never negative

**January 11 2024 :: QCEFF. Tag v11.0.0**

Nonlinear and Non-Gaussian Data Assimilation Capabilities in DART
Expand Down
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
author = 'Data Assimilation Research Section'

# The full version, including alpha/beta/rc tags
release = '11.0.0'
release = '11.0.1'
root_doc = 'index'

# -- General configuration ---------------------------------------------------
Expand Down
17 changes: 11 additions & 6 deletions models/clm/dart_to_clm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,15 @@ subroutine update_snow(dom_id, ncid_dart, ncid_clm, ncolumn, nlevel, nlevsno, re
real(r8) :: dart_H2OICE(nlevel,ncolumn)

real(r8) :: clm_H2OSNO(ncolumn) !(column,time) for vector history
real(r8) :: clm_SNLSNO(ncolumn)
integer :: clm_SNLSNO(ncolumn)
real(r8) :: clm_SNOWDP(ncolumn)
real(r8) :: clm_DZSNO(nlevsno,ncolumn)
real(r8) :: clm_ZSNO(nlevsno,ncolumn)
real(r8) :: clm_ZISNO(nlevsno,ncolumn)
real(r8) :: clm_H2OLIQ(nlevel,ncolumn)
real(r8) :: clm_H2OICE(nlevel,ncolumn)

real(r8) :: snlsno(ncolumn)
integer :: snlsno(ncolumn)
real(r8) :: h2osno_pr(ncolumn)
real(r8) :: h2osno_po(ncolumn)
real(r8) :: snowdp_pr(ncolumn)
Expand Down Expand Up @@ -611,7 +611,7 @@ subroutine update_snow(dom_id, ncid_dart, ncid_clm, ncolumn, nlevel, nlevsno, re
! Leave layer aggregation/initialization to CLM
do ilevel=1,-snlsno(icolumn)

h2oliq_po(ilevel,icolumn) = 0.0_r8
h2oliq_po(ilevel,icolumn) = 0.00000001_r8
h2oice_po(ilevel,icolumn) = 0.00000001_r8
dzsno_po(ilevel,icolumn) = 0.00000001_r8

Expand Down Expand Up @@ -686,7 +686,10 @@ subroutine update_snow(dom_id, ncid_dart, ncid_clm, ncolumn, nlevel, nlevsno, re
! Apply the increment for liquid, ice and depth for each layer.
h2oliq_po(ilevel,icolumn) = h2oliq_pr(ilevel,icolumn) + gain_h2oliq
h2oice_po(ilevel,icolumn) = h2oice_pr(ilevel,icolumn) + gain_h2oice


if (h2oliq_po(ilevel,icolumn) < 0.0_r8) h2oliq_po(ilevel,icolumn) = 0.00000001_r8
if (h2oice_po(ilevel,icolumn) < 0.0_r8) h2oice_po(ilevel,icolumn) = 0.00000001_r8

! Important to update snow layer dimensions because CLM code relies
! on snow layer thickness for compaction/aggregation snow algorithm
! to function properly
Expand All @@ -695,7 +698,8 @@ subroutine update_snow(dom_id, ncid_dart, ncid_clm, ncolumn, nlevel, nlevsno, re
if (abs(h2osno_po(icolumn) - h2osno_pr(icolumn)) > 0.0_r8) then

dzsno_po(ilevel,icolumn) = dzsno_pr(ilevel,icolumn) + gain_dzsno(ilevel,icolumn)

if (dzsno_po(ilevel,icolumn) < 0.0_r8) dzsno_po(ilevel,icolumn) = 0.00000001_r8

! For consistency with updated dzsno_po (thickness)
! also update zsno_po (middle depth) and zisno (top interface depth)

Expand Down Expand Up @@ -748,12 +752,13 @@ subroutine update_snow(dom_id, ncid_dart, ncid_clm, ncolumn, nlevel, nlevsno, re
! and recieved an H2OSNO adjustment. This eliminates operating
! on columns that do not require re-partitioning
if (abs(h2osno_po(icolumn) - h2osno_pr(icolumn)) &
> 0.0_r8 .and. snlsno(icolumn) < 0.0_r8) then
> 0.0_r8 .and. snlsno(icolumn) < 0) then
snowdp_po(icolumn) = snowdp_pr(icolumn) + sum(gain_dzsno(nlevsno+1+snlsno(icolumn):nlevsno,icolumn))
else
snowdp_po(icolumn) = snowdp_pr(icolumn)
endif

if (snowdp_po(icolumn) < 0.0_r8) snowdp_po(icolumn) = 0.00000001_r8

endif

Expand Down
2 changes: 1 addition & 1 deletion models/clm/shell_scripts/cesm2_2/DART_params.csh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ endif
#
setenv dartroot /glade/work/${USER}/DART
setenv use_SourceMods TRUE
setenv SourceModDir ${dartroot}/DART_SourceMods/cesm2_2_0/SourceMods
setenv SourceModDir ${dartroot}/models/clm/DART_SourceMods/cesm2_2_0/SourceMods

# ==============================================================================
# Directories:
Expand Down

0 comments on commit 4dadee7

Please sign in to comment.