TNO Intern

Commit cb31b25b authored by Arjo Segers's avatar Arjo Segers
Browse files

Check on `pix_all` value to know if pixels are assigned to any of the sub-domains.

parent 8afcdee1
Loading
Loading
Loading
Loading
+250 −233
Original line number Diff line number Diff line
!#################################################################
!
! CSO Tutorial for observation operator code.
! Application on S5p data.
!
! CHANGES
!
!   2023-08, Arjo Segers
!     Check on `pix_all` value to know if pixels are assigned 
!     to any of the sub-domains.
!
!### macro's #####################################################
!
#define TRACEBACK write (logfu,'("in ",a," (",a,", line",i5,")")') rname, __FILE__, __LINE__
@@ -137,7 +148,7 @@ program Tutorial_Oper_S5p
  character(len=64), allocatable    ::  uvarunits(:)  ! (nuvar)

  ! pixel counter and index:
  integer                           ::  npix
  integer                           ::  npix, npix_all
  integer                           ::  ipix 
  ! pixel footprints:
  real, pointer                     ::  lons(:), lats(:)         ! (npix)
@@ -488,9 +499,13 @@ program Tutorial_Oper_S5p
      
      ! obtain info on track:
      !  - number of local pixels
      call sdata%Get( status, npix=npix )
      !  - total number of local pixels over all sub-domains
      call sdata%Get( status, npix=npix, npix_all=npix_all )
      IF_NOT_OK_RETURN(status=1)
      
      ! any pixels at all?
      if ( npix_all > 0 ) then
      
        ! initialize simulation state;
        ! optional arguments:
        !   description='long name'    : used for output attributes
@@ -529,7 +544,7 @@ program Tutorial_Oper_S5p
        call sstate%EndDef( status )
        IF_NOT_OK_RETURN(status=1)

      ! any pixels?
        ! any local pixels?
        if ( npix > 0 ) then

          ! pointers to (*,pixel) arrays:
@@ -739,6 +754,8 @@ program Tutorial_Oper_S5p
        call sstate%Done( sdata, status )
        IF_NOT_OK_RETURN(status=1)
        
      end if ! npix_all > 0
      
      ! done with data:
      call sdata%Done( status )
      IF_NOT_OK_RETURN(status=1)