New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
#2679 (small errors in heat content diag computation) – NEMO

#2679 closed Bug (fixed)

small errors in heat content diag computation

Reported by: gsamson Owned by: gsamson
Priority: low Milestone:
Component: DIA Version: trunk
Severity: minor Keywords: dia, htc
Cc: greffray

Description

Context

heat content diag computation in "dia_hth_htc" routine

Analysis

2 possible small errors in htc computation:

  • vertical htc integration index should start at "1" instead of "2"
  • missing piece of vertical integration between the last considered full cell and htc depth (when htc depth is located between two vertical levels)

Fix

in dia_hth_htc, replace:

      ilevel(:,:) = 1
      DO_3D( 1, 1, 1, 1, 2, jpkm1 )
         IF( ( gdept(ji,jj,jk,Kmm) < pdep ) .AND. ( tmask(ji,jj,jk) == 1 ) ) THEN
             ilevel(ji,jj) = jk
             zthick(ji,jj) = zthick(ji,jj) + e3t(ji,jj,jk,Kmm)
             phtc  (ji,jj) = phtc  (ji,jj) + e3t(ji,jj,jk,Kmm) * pt(ji,jj,jk)
         ENDIF
      END_3D
      !
      DO_2D( 1, 1, 1, 1 )
         ik = ilevel(ji,jj)
         zthick(ji,jj) = pdep - zthick(ji,jj)   !   remaining thickness to reach depht pdep
         phtc(ji,jj)   = phtc(ji,jj)    &
            &           + pt (ji,jj,ik+1) * MIN( e3t(ji,jj,ik+1,Kmm), zthick(ji,jj) ) &
                                                       * tmask(ji,jj,ik+1)
      END_2D

by

      ilevel(:,:) = 1
      DO_3D( 1, 1, 1, 1, 1, jpkm1 )
         IF( ( gdepw(ji,jj,jk+1,Kmm) < pdep ) .AND. ( tmask(ji,jj,jk) == 1 ) ) THEN
             ilevel(ji,jj) = jk+1
             zthick(ji,jj) = zthick(ji,jj) + e3t(ji,jj,jk,Kmm)
             phtc  (ji,jj) = phtc  (ji,jj) + e3t(ji,jj,jk,Kmm) * pt(ji,jj,jk)
         ENDIF
      END_3D
      !
      DO_2D( 1, 1, 1, 1 )
         ik = ilevel(ji,jj)
         IF( tmask(ji,jj,ik) == 1 ) THEN
            zthick(ji,jj) = MIN ( gdepw(ji,jj,ik+1,Kmm), pdep ) - zthick(ji,jj)   ! remaining thickness to reach depht pdep
            phtc(ji,jj)   = phtc(ji,jj) + ptn(ji,jj,ik) * zthick(ji,jj)
         ENDIF
      END_2D

Commit History (2)

ChangesetAuthorTimeChangeLog
15234clem2021-09-08T16:07:02+02:00

trunk: solve ticket #2679

15231clem2021-09-08T09:58:57+02:00

4.0-HEAD: small bug fixes following tickets #2644 #2679 #2688

Change History (4)

comment:1 Changed 13 months ago by clem

I concur. I'll change it for 4.0-HEAD and let Guillaume change it for the trunk

comment:2 Changed 13 months ago by clem

In 15231:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:3 Changed 13 months ago by clem

In 15234:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:4 Changed 13 months ago by clem

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.