*IF DEF,C72_1A,AND,DEF,ATMOS,AND,DEF,OCEAN                                 GLW1F404.45     
C ******************************COPYRIGHT******************************    GTS2F400.7363   
C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved.    GTS2F400.7364   
C                                                                          GTS2F400.7365   
C Use, duplication or disclosure of this code is subject to the            GTS2F400.7366   
C restrictions as set forth in the contract.                               GTS2F400.7367   
C                                                                          GTS2F400.7368   
C                Meteorological Office                                     GTS2F400.7369   
C                London Road                                               GTS2F400.7370   
C                BRACKNELL                                                 GTS2F400.7371   
C                Berkshire UK                                              GTS2F400.7372   
C                RG12 2SZ                                                  GTS2F400.7373   
C                                                                          GTS2F400.7374   
C If no contract has been raised with this copy of the code, the use,      GTS2F400.7375   
C duplication or disclosure of it is strictly prohibited.  Permission      GTS2F400.7376   
C to do so must first be obtained in writing from the Head of Numerical    GTS2F400.7377   
C Modelling at the above address.                                          GTS2F400.7378   
C ******************************COPYRIGHT******************************    GTS2F400.7379   
C                                                                          GTS2F400.7380   

      SUBROUTINE POST_H_INT(NCOASTAL,INDEXS,INDEXI,NS,FIELDS,SMINT          15POSTINT1.3      
     &,NI,FIELDI,TPOINT,RMDI,NT,FIELDT)                                    POSTINT1.4      
CLL                                                                        POSTINT1.5      
CLL   Subroutine POST_H_INT                                                POSTINT1.6      
CLL                                                                        POSTINT1.7      
CLL       Purpose                                                          POSTINT1.8      
CLL   POST_H_INT performs coastal adjustment and transfers the field       POSTINT1.9      
CLL   onto the target grid.                                                POSTINT1.10     
CLL                                                                        POSTINT1.11     
CLL   In the first step, values at points on the source grid (the          POSTINT1.12     
CLL   input to H_INT) are used to replace output values at coastal         POSTINT1.13     
CLL   points identified by COAST_AJ, provided the source grid point        POSTINT1.14     
CLL   selected by COAST_AJ is a sea point on that grid. Otherwise          POSTINT1.15     
CLL   missing data is substituted. In the second step, the final           POSTINT1.16     
CLL   set of values are written to the appropriate locations in the        POSTINT1.17     
CLL   target grid. (The interpolation routine H_INT does not use a         POSTINT1.18     
CLL   target grid explicitly, but a set of target points instead.)         POSTINT1.19     
CLL   Missing data values are not transferred.                             POSTINT1.20     
CLL                                                                        POSTINT1.21     
CLL   WRITTEN BY J M GREGORY (3.6.91)                                      POSTINT1.22     
CLL                                                                        POSTINT1.23     
CLL  Model            Modification history from model version 3.0:         POSTINT1.24     
CLL version  date                                                          POSTINT1.25     
CLL                                                                        POSTINT1.26     
CLL   FOLLOWS DOCUMENTATION PAPER 3, VERSION 1 FOR STANDARDS.              POSTINT1.27     
CLL                                                                        POSTINT1.28     
C*L                                                                        POSTINT1.29     
      IMPLICIT NONE                                                        POSTINT1.30     
C                                                                          POSTINT1.31     
      INTEGER                                                              POSTINT1.32     
     + NCOASTAL             !IN NUMBER OF COASTAL POINTS                   POSTINT1.33     
     +,INDEXS(*)            !IN coastal points on source grid              POSTINT1.34     
     +,INDEXI(*)            !IN coastal points in target sea set           POSTINT1.35     
     &,NS                   !IN number of points in source grid            POSTINT1.36     
     &,SMINT(NS)            !IN land-sea mask on source grid               POSTINT1.37     
     &,NI                   !IN number of target sea points                POSTINT1.38     
     &,TPOINT(NI)           !IN list of sea points in target grid          POSTINT1.39     
     &,NT                   !IN number of points in target grid            POSTINT1.40     
C                                                                          POSTINT1.41     
      REAL                                                                 POSTINT1.42     
     & FIELDS(NS)           !IN field on source grid                       POSTINT1.43     
     &,FIELDI(NI)           !INOUT values at target sea points             POSTINT1.44     
     &,RMDI                 !IN missing data indicator                     POSTINT1.45     
     &,FIELDT(NT)           !INOUT field on target grid                    POSTINT1.46     
C*                                                                         POSTINT1.47     
      INTEGER                                                              POSTINT1.48     
     + K                    ! Loop index                                   POSTINT1.49     
C                                                                          POSTINT1.50     
CDIR$ IVDEP                                                                POSTINT1.51     
      DO K=1,NCOASTAL                                                      POSTINT1.52     
        IF (SMINT(INDEXS(K)).EQ.0) THEN                                    POSTINT1.53     
          FIELDI(INDEXI(K))=FIELDS(INDEXS(K))                              POSTINT1.54     
                                                                           OOM3F403.54     
        ENDIF                                                              POSTINT1.57     
      ENDDO                                                                POSTINT1.58     
      DO K=1,NI                                                            POSTINT1.59     
        IF (FIELDI(K).NE.RMDI) FIELDT(TPOINT(K))=FIELDI(K)                 POSTINT1.60     
      ENDDO                                                                POSTINT1.61     
C                                                                          POSTINT1.62     
      RETURN                                                               POSTINT1.63     
      END                                                                  POSTINT1.64     
*ENDIF                                                                     POSTINT1.65