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.
Changeset 5700 for branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP – NEMO

Ignore:
Timestamp:
2015-08-18T13:10:40+02:00 (9 years ago)
Author:
jamesharle
Message:

Bug fixes for structured boundary conditions using BDY on-the-fly
interpolation. Structured boundary conditions example now matches
the unstructured equivalent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90

    r5639 r5700  
    761761      CASE(1)        ;    
    762762      CALL iom_get ( num, jpdom_unknown, clvar, dta_read(1:ilendta,1:ipj,1    ), nrec ) 
    763          IF (ipj==1) THEN ! we assume that this is an un-structured open boundary file 
     763         IF ( map%ll_unstruc) THEN ! unstructured open boundary data file 
    764764            DO ib = 1, ipi 
    765765              DO ik = 1, ipk 
     
    803803 
    804804#if defined key_bdy 
    805          CALL fld_bdy_interp(dta_read, dta_read_z, dta_read_dz, map, jpk_bdy, igrd, ibdy, fv, dta, fvl) 
     805         CALL fld_bdy_interp(dta_read, dta_read_z, dta_read_dz, map, jpk_bdy, igrd, ibdy, fv, dta, fvl, ilendta) 
    806806#endif 
    807807      ELSE ! boundary data assumed to be on model grid 
    808808          
    809809         CALL iom_get ( num, jpdom_unknown, clvar, dta_read(1:ilendta,1:ipj,1:ipk), nrec )                     
    810          IF (ipj==1) THEN ! we assume that this is an un-structured open boundary file 
     810         IF ( map%ll_unstruc) THEN ! unstructured open boundary data file 
    811811            DO ib = 1, ipi 
    812812              DO ik = 1, ipk 
     
    829829    
    830830#if defined key_bdy 
    831    SUBROUTINE fld_bdy_interp(dta_read, dta_read_z, dta_read_dz, map, jpk_bdy, igrd, ibdy, fv, dta, fvl) 
     831   SUBROUTINE fld_bdy_interp(dta_read, dta_read_z, dta_read_dz, map, jpk_bdy, igrd, ibdy, fv, dta, fvl, ilendta) 
    832832 
    833833      !!--------------------------------------------------------------------- 
     
    852852      INTEGER                                 ::   ipj        ! length of dummy dimension ( = 1 ) 
    853853      INTEGER                                 ::   ipk ! number of vertical levels of dta ( 2D: ipk=1 ; 3D: ipk=jpk ) 
    854       INTEGER                                 ::   ilendta    ! length of data in file 
     854      INTEGER, INTENT(in)                                 ::   ilendta    ! length of data in file 
    855855      INTEGER                                 ::   ib, ik, ikk! loop counters 
    856856      INTEGER                                 ::   ji, jj ! loop counters 
     
    859859      !!--------------------------------------------------------------------- 
    860860      
    861       WRITE(*,*) 'in bdy interp'  
    862861 
    863862      ipi       = SIZE( dta, 1 ) 
    864863      ipj       = SIZE( dta_read, 2 ) 
    865864      ipk       = SIZE( dta, 3 ) 
    866       ilendta   = SIZE( dta_read, 1 ) 
    867865      jpkm1_bdy = jpk_bdy-1 
    868   
     866       
    869867      fv_alt = -ABS(fv)  ! set _FillValue < 0 as we make use of MAXVAL and MAXLOC later 
    870868       
     
    966964         ENDDO  
    967965        
     966 
    968967         DO ib = 1, ipi 
    969968            jj=1+floor(REAL(map%ptr(ib)-1)/REAL(ilendta)) 
     
    973972               IF( zl < dta_read_z(ji,jj,1) ) THEN                                         ! above the first level of external data 
    974973                  dta(ib,1,ik) =  dta_read(ji,jj,1) 
    975                ELSEIF( zl > MAXVAL(dta_read_z(ji,ji,:),1) ) THEN                           ! below the last level of external data  
     974               ELSEIF( zl > MAXVAL(dta_read_z(ji,jj,:),1) ) THEN                           ! below the last level of external data  
    976975                  dta(ib,1,ik) =  dta_read(ji,jj,MAXLOC(dta_read_z(ji,jj,:),1)) 
    977976               ELSE                                                                          ! inbetween : vertical interpolation between ikk & ikk+1 
Note: See TracChangeset for help on using the changeset viewer.