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 15396 for branches/UKMO/dev_r5518_obs_oper_update_DepthBug/NEMOGCM/NEMO/OPA_SRC/OBS/obsinter_z1d.h90 – NEMO

Ignore:
Timestamp:
2021-10-19T09:35:50+02:00 (12 months ago)
Author:
kingr
Message:

Corrected logic to avoid masked levels in obs_inter_z1d

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_obs_oper_update_DepthBug/NEMOGCM/NEMO/OPA_SRC/OBS/obsinter_z1d.h90

    r15365 r15396  
    6262         z1dm = ( pdep(kkco(jdep)) - pobsdep(jdep)      ) 
    6363         z1dp = ( pobsdep(jdep)    - pdep(kkco(jdep)-1) ) 
     64 
    6465          
    6566         ! Where both levels are masked, return a fill value 
    66          IF ( pobsmask(kkco(jdep)-1) == 0.0_wp ) .and. (pobsmask(kkco(jdep)) == 0.0_wp) THEN 
     67         IF ( ( pobsmask(kkco(jdep)-1) == 0.0_wp ) .AND. (pobsmask(kkco(jdep)) == 0.0_wp) ) THEN 
    6768            pobs(jdep)  = 99999. 
    6869         ELSE 
    6970          
    7071            ! Where upper level is masked (e.g., under ice cavity), only use deeper level 
    71             IF ( pobsmask(kkco(jdep)-1) == 0.0_wp ) z1dm = 0.0_wp 
     72            ! otherwise where ob is at or above upper level model T-point,  
     73            ! use upper model level rather than extrapolate 
     74            IF ( pobsmask(kkco(jdep)-1) == 0.0_wp ) THEN 
     75               z1dm = 0.0_wp 
     76            ELSE IF ( pobsdep(jdep) <= pdep(kkco(jdep)-1) ) THEN 
     77               z1dp = 0.0_wp    
     78            END IF    
    7279 
    7380            ! Where deeper level is masked (e.g., near sea bed), only use upper level 
    74             IF ( pobsmask(kkco(jdep)) == 0.0_wp ) z1dp = 0.0_wp 
    75  
    76             ! Where ob is at or above upper level model T-point, use upper model level  
    77             ! rather than extrapolate, except where that level is masked  
    78             IF ( pobsdep(jdep) <= pdep(kkco(jdep)-1) ) .and. & 
    79             &  ( pobsmask(kkco(jdep)-1) == 0.0_wp ) ) z1dp = 0.0_wp 
    80  
    81             ! Where ob is at or below deeper level model T-point, use deeper model level 
    82             ! rather than extrapolate, except where that level is masked  
    83             IF ( pobsdep(jdep) >= pdep(kkco(jdep)) ) .and. & 
    84             &  ( pobsmask(kkco(jdep)) == 0.0_wp ) ) z1dm = 0.0_wp 
    85  
     81            ! otherwise where ob is at or below deeper level model T-point,  
     82            ! use deeper model level rather than extrapolate 
     83            IF ( pobsmask(kkco(jdep)) == 0.0_wp ) THEN 
     84               z1dp = 0.0_wp 
     85            ELSE IF ( pobsdep(jdep) >= pdep(kkco(jdep)) ) THEN 
     86               z1dm = 0.0_wp    
     87            END IF    
    8688 
    8789            zsum = z1dm + z1dp 
     
    109111 
    110112            ENDIF 
     113         ENDIF    
    111114      END DO 
    112115 
Note: See TracChangeset for help on using the changeset viewer.