*IF DEF,CONTROL GLW1F404.34 !+ Masks ocean data in stash workspace w.r.t. a logical mask MASKODL1.2 C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved. GTS2F400.15133 C GTS2F400.15134 C Use, duplication or disclosure of this code is subject to the GTS2F400.15135 C restrictions as set forth in the contract. GTS2F400.15136 C GTS2F400.15137 C Meteorological Office GTS2F400.15138 C London Road GTS2F400.15139 C BRACKNELL GTS2F400.15140 C Berkshire UK GTS2F400.15141 C RG12 2SZ GTS2F400.15142 C GTS2F400.15143 C If no contract has been raised with this copy of the code, the use, GTS2F400.15144 C duplication or disclosure of it is strictly prohibited. Permission GTS2F400.15145 C to do so must first be obtained in writing from the Head of Numerical GTS2F400.15146 C Modelling at the above address. GTS2F400.15147 C ******************************COPYRIGHT****************************** GTS2F400.15148 C GTS2F400.15149 ! MASKODL1.3 ! Subroutine Interface: MASKODL1.4SUBROUTINE MASKODIAGL(NX,NY,KM,STDVMD,VMD,OCEAN,STASHWORK) 1MASKODL1.5 MASKODL1.6 IMPLICIT NONE MASKODL1.7 ! MASKODL1.8 ! Description: MASKODL1.9 ! MASKODL1.10 ! MASKODIAGL replaces with missing data elements of STASHWORK which MASKODL1.11 ! are not active ocean points according to the supplied 3D logical MASKODL1.12 ! mask OCEAN. The 1D STASHWORK array is assumed to contain 2D or 3D MASKODL1.13 ! data in the usual order of a Fortran array. In the case of a cylic MASKODL1.14 ! ocean, STASHWORK contains data for row of length NX-2, NX being the MASKODL1.15 ! row length of OCEAN. If STDVMD is .TRUE., missing data is indicated MASKODL1.16 ! by the standard missing data value. If STDVMD is .FALSE., the value MASKODL1.17 ! of VMD is inserted at missing-data points. MASKODL1.18 ! MASKODL1.19 ! To mask data of one level, call with KM=1. MASKODL1.20 ! MASKODL1.21 ! The ...L suffix of the subroutine name indicates that the data is MASKODL1.22 ! being masked with a logical array. The corresponding routine which MASKODL1.23 ! masks with a number-of-levels array is called MASKODIAGN. MASKODL1.24 ! MASKODL1.25 ! Current Code Owner: J.M.Gregory MASKODL1.26 ! MASKODL1.27 ! History: MASKODL1.28 ! Version Date Comment MASKODL1.29 ! ------- ---- ------- MASKODL1.30 ! 4.0 23.3.95 Original code. J.M.Gregory MASKODL1.31 ! MASKODL1.32 ! Code Description: MASKODL1.33 ! Language: FORTRAN 77 + common extensions. MASKODL1.34 ! This code is written to UMDP3 v6 programming standards. MASKODL1.35 ! MASKODL1.36 ! System component covered: <appropriate code> MASKODL1.37 ! System Task: <appropriate code> MASKODL1.38 ! MASKODL1.39 ! Global variables MASKODL1.40 *CALL C_MDI
MASKODL1.41 *CALL CNTLOCN
MASKODL1.42 MASKODL1.43 ! Input arguments MASKODL1.44 INTEGER MASKODL1.45 & NX ! 1st dimension of FKM MASKODL1.46 &,NY ! 2nd dimension of FKM MASKODL1.47 &,KM ! No. of levels of data to be masked in STASHWORK MASKODL1.48 MASKODL1.49 LOGICAL MASKODL1.50 & STDVMD ! Use standard value to indicate missing data MASKODL1.51 &,OCEAN(NX,NY,KM) ! Ocean mask, .TRUE. where data is wanted MASKODL1.52 MASKODL1.53 REAL MASKODL1.54 & VMD ! Missing data value; ignored if .NOT.STDVMD MASKODL1.55 MASKODL1.56 ! Input/output arguments MASKODL1.57 REAL MASKODL1.58 & STASHWORK(*) ! Stashwork array MASKODL1.59 MASKODL1.60 ! Local variables MASKODL1.61 INTEGER MASKODL1.62 & ICOL ! Number of columns of data, excluding wrap-round MASKODL1.63 &,I,J,K ! Indices into DATA and OCEAN MASKODL1.64 &,IPOINT ! Index into STASHWORK MASKODL1.65 MASKODL1.66 REAL MASKODL1.67 & TVMD ! Missing data value to be used MASKODL1.68 MASKODL1.69 !- End of header MASKODL1.70 MASKODL1.71 C Work out how many columns of data there are to be copied MASKODL1.72 IF (.NOT.L_OCYCLIC) THEN MASKODL1.73 ICOL=NX MASKODL1.74 ELSE MASKODL1.75 ICOL=NX-2 MASKODL1.76 ENDIF MASKODL1.77 MASKODL1.78 C Decide on the value of missing data. MASKODL1.79 IF (STDVMD) THEN MASKODL1.80 TVMD=RMDI MASKODL1.81 ELSE MASKODL1.82 TVMD=VMD MASKODL1.83 ENDIF MASKODL1.84 MASKODL1.85 C Loop over data to be masked. Substitute TVMD for unwanted MASKODL1.86 C elements. MASKODL1.87 IPOINT=1 MASKODL1.88 DO K=1,KM MASKODL1.89 DO J=1,NY MASKODL1.90 DO I=1,ICOL MASKODL1.91 IF (.NOT.OCEAN(I,J,K)) STASHWORK(IPOINT)=TVMD MASKODL1.92 IPOINT=IPOINT+1 MASKODL1.93 ENDDO MASKODL1.94 ENDDO MASKODL1.95 ENDDO MASKODL1.96 C MASKODL1.97 RETURN MASKODL1.98 END MASKODL1.99 *ENDIF GLW1F404.35