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.
#2380 (issues in fld_bdy_interp) – NEMO

Opened 4 years ago

Closed 4 years ago

Last modified 2 years ago

#2380 closed Bug (fixed)

issues in fld_bdy_interp

Reported by: clem Owned by: systeam
Priority: normal Milestone:
Component: BDY Version: v4.0
Severity: minor Keywords: v4.0
Cc:

Description

Context

Running regional configuration when the number of vertical levels for bdy input data (say 50) is not the same as the number of vertical levels in the domain (say 75) should fail.

Analysis

It is caused by these lines:

            ELSEIF( zdepth(jk) > pdta_read_z(jb,1,ipkb) ) THEN                       ! below the last level of external data 
               pdta(jb,1,jk) =  pdta_read(jb,1,MAXLOC(pdta_read_z(jb,1,:),1))
            ELSE                                                             ! inbetween: vertical interpolation between jkb & jkb+1
               DO jkb = 1, ipkb-1                                            ! when  gdept_n(jkb) < zdepth(jk) < gdept_n(jkb+1)
                  IF( ( ( zdepth(jk) - pdta_read_z(jb,1,jkb) ) * ( zdepth(jk) - pdta_read_z(jb,1,jkb+1) ) <= 0._wp ) &
                     &    .AND. ( pdta_read_z(jb,1,jkb+1) /= zfv_alt) ) THEN   ! linear interpolation between 2 levels
                     zi = ( zdepth(jk) - pdta_read_z(jb,1,jkb) ) / ( pdta_read_z(jb,1,jkb+1) - pdta_read_z(jb,1,jkb) )
                     pdta(jb,1,jk) = pdta_read(jb,1,jkb) + ( pdta_read  (jb,1,jkb+1) - pdta_read  (jb,1,jkb) ) * zi
                  ENDIF
               END DO
            ENDIF
 

Fix

Replace by:

            ELSEIF( zdepth(jk) >  pdta_read_z(jb,1,ipkmax) ) THEN   ! below the last level of external data /= FillValue
               pdta(jb,1,jk) = pdta_read(jb,1,ipkmax)
            ELSE                                                    ! inbetween: vertical interpolation between jkb & jkb+1
               DO jkb = 1, ipkmax-1
                  IF( ( ( zdepth(jk) - pdta_read_z(jb,1,jkb) ) * ( zdepth(jk) - pdta_read_z(jb,1,jkb+1) ) ) <= 0._wp ) THEN ! linear interpolation between 2 levels
                     zi = ( zdepth(jk) - pdta_read_z(jb,1,jkb) ) / ( pdta_read_z(jb,1,jkb+1) - pdta_read_z(jb,1,jkb) )
                     pdta(jb,1,jk) = pdta_read(jb,1,jkb) + zi * ( pdta_read(jb,1,jkb+1) - pdta_read(jb,1,jkb) )
                  ENDIF
               END DO
            ENDIF

where ipkmax is the deepest level where input data is different from FillValue?

Commit History (2)

ChangesetAuthorTimeChangeLog
12372acc2020-02-12T13:37:21+01:00

Branch 2019/dev_r11943_MERGE_2019. A few changes to align the option 1 branch with the trunk@12371. These include a fix for #2317 (changes for LFRA freshwater correction) which was done at changeset 12279 on the trunk. These affect dynatf.F90, traatf.F90 and isfdynatf.F90 and pass SETTE but change results in all tests that use freshwater input (expected). All other changes on the trunk are present (where applicable) up to and including changeset 12367 (Solve #2380)

12367clem2020-02-11T19:37:34+01:00

solve ticket #2380

Change History (4)

comment:1 Changed 4 years ago by clem

In 12367:

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

comment:2 Changed 4 years ago by acc

In 12372:

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

comment:3 Changed 4 years ago by clem

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 Changed 2 years ago by nemo

  • Keywords v4.0 added
Note: See TracTickets for help on using tickets.