Opened 6 months ago

Closed 6 months ago

#2380 closed Bug (fixed)

issues in fld_bdy_interp

Reported by: clem Owned by: systeam
Priority: normal Milestone:
Component: BDY Version: release-4.0
Severity: minor Keywords:
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 Fill Value?

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 (3)

comment:1 Changed 6 months ago by clem

In 12367:

solve ticket #2380

comment:2 Changed 6 months ago by acc

In 12372:

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)

comment:3 Changed 6 months ago by clem

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