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 4817 – NEMO

Changeset 4817


Ignore:
Timestamp:
2014-10-15T14:36:35+02:00 (9 years ago)
Author:
jwhile
Message:

Additional code for checking obs near land

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO14.4_OBS_GENERAL_VINTERP/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90

    r4292 r4817  
    4848   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    4949   !!---------------------------------------------------------------------- 
     50 
     51!! * Substitutions  
     52#  include "domzgr_substitute.h90"   
    5053 
    5154CONTAINS 
     
    17091712      !! * Modules used 
    17101713      USE dom_oce, ONLY : &       ! Geographical information 
    1711          & gdepw_1d                         
    1712  
     1714         & gdepw_1d,      & 
     1715         & gdepw_0,       &                         
     1716#if defined key_vvl  
     1717         & gdepw_n,       &  
     1718         & gdept_n,       &  
     1719#endif  
     1720         & ln_zco,        &  
     1721         & ln_zps                         
     1722  
    17131723      !! * Arguments 
    17141724      INTEGER, INTENT(IN) :: kprofno      ! Number of profiles 
     
    17541764         & igrdj 
    17551765      LOGICAL :: lgridobs           ! Is observation on a model grid point. 
     1766      LOGICAL :: ll_next_to_land    ! Is a profile next to land  
    17561767      INTEGER :: iig, ijg           ! i,j of observation on model grid point. 
    17571768      INTEGER :: jobs, jobsp, jk, ji, jj 
     
    18161827         END DO 
    18171828 
     1829         ! Check if next to land  
     1830         IF (  ANY( zgmsk(1:2,1:2,1,jobs) == 0.0_wp ) ) THEN  
     1831           ll_next_to_land=.TRUE.  
     1832         ELSE  
     1833           ll_next_to_land=.FALSE.  
     1834         ENDIF  
     1835          
    18181836         ! Reject observations 
    18191837 
     
    18321850            ENDIF 
    18331851 
    1834             ! Flag if the observation falls with a model land cell 
    1835             IF ( SUM( zgmsk(1:2,1:2,kobsk(jobsp)-1:kobsk(jobsp),jobs) ) & 
    1836                &  == 0.0_wp ) THEN 
    1837                kobsqc(jobsp) = kobsqc(jobsp) + 12 
    1838                klanobs = klanobs + 1 
    1839                CYCLE 
     1852            ! To check if an observations falls within land there are two cases:  
     1853            ! 1: z-coordibnates, where the check uses the mask  
     1854            ! 2: terrain following (eg s-coordinates),   
     1855            !    where we use the depth of the bottom cell to mask observations  
     1856              
     1857            IF( ln_zps .OR. ln_zco ) THEN !(CASE 1)  
     1858                 
     1859               ! Flag if the observation falls with a model land cell  
     1860               IF ( SUM( zgmsk(1:2,1:2,kobsk(jobsp)-1:kobsk(jobsp),jobs) ) &  
     1861                  &  == 0.0_wp ) THEN  
     1862                  kobsqc(jobsp) = kobsqc(jobsp) + 12  
     1863                  klanobs = klanobs + 1  
     1864                  CYCLE  
     1865               ENDIF  
     1866              
     1867               ! Flag if the observation is close to land  
     1868               IF ( MINVAL( zgmsk(1:2,1:2,kobsk(jobsp)-1:kobsk(jobsp),jobs) ) == &  
     1869                  &  0.0_wp) THEN  
     1870                  knlaobs = knlaobs + 1  
     1871                  IF (ld_nea) THEN    
     1872                     kobsqc(jobsp) = kobsqc(jobsp) + 14   
     1873                  ENDIF   
     1874               ENDIF  
     1875              
     1876            ELSE ! Case 2  
     1877  
     1878               ! Flag if the observation is deeper than the bathymetry  
     1879               ! Or if it is within the mask  
     1880               IF ( ALL( fsdepw(iig-1:iig+1,ijg-1:ijg+1,kpk) < pobsdep(jobsp) ) &  
     1881               &     .OR. &  
     1882               &  ( SUM( zgmsk(1:2,1:2,kobsk(jobsp)-1:kobsk(jobsp),jobs) ) &  
     1883               &  == 0.0_wp) ) THEN  
     1884                  kobsqc(jobsp) = kobsqc(jobsp) + 12  
     1885                  klanobs = klanobs + 1  
     1886                  CYCLE  
     1887               ENDIF  
     1888                 
     1889               ! Flag if the observation is close to land  
     1890               IF ( ll_next_to_land ) THEN  
     1891                  knlaobs = knlaobs + 1  
     1892                  IF (ld_nea) THEN    
     1893                     kobsqc(jobsp) = kobsqc(jobsp) + 14   
     1894                  ENDIF   
     1895               ENDIF  
     1896              
    18401897            ENDIF 
    18411898 
     
    18501907               ENDIF 
    18511908            ENDIF 
    1852              
    1853             ! Flag if the observation falls is close to land 
    1854             IF ( MINVAL( zgmsk(1:2,1:2,kobsk(jobsp)-1:kobsk(jobsp),jobs) ) == & 
    1855                &  0.0_wp) THEN 
    1856                IF (ld_nea) kobsqc(jobsp) = kobsqc(jobsp) + 14 
    1857                knlaobs = knlaobs + 1 
    1858             ENDIF 
     1909            
    18591910 
    18601911            ! Set observation depth equal to that of the first model depth 
Note: See TracChangeset for help on using the changeset viewer.