Changeset 7480
- Timestamp:
- 2016-12-08T14:27:10+01:00 (7 years ago)
- Location:
- branches/UKMO/dev_r4650_general_vert_coord_obsoper_surf_bgc/NEMOGCM/NEMO/OPA_SRC/OBS
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r4650_general_vert_coord_obsoper_surf_bgc/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
r7479 r7480 196 196 & ln_sla, ln_sladt, ln_slafb, & 197 197 & ln_ssh, ln_sst, ln_sstfb, ln_sss, ln_nea, & 198 & ln_bound_reject, & 198 199 & enactfiles, coriofiles, profbfiles, & 199 200 & slafilesact, slafilespas, slafbfiles, & … … 302 303 ln_velfb_av(:) = .FALSE. 303 304 ln_ignmis = .FALSE. 305 ln_bound_reject = .TRUE. 304 306 305 307 ! Read Namelist namobs : control observation diagnostics … … 623 625 WRITE(numout,*) ' Type of horizontal interpolation method n2dint = ', n2dint 624 626 WRITE(numout,*) ' Rejection of observations near land swithch ln_nea = ', ln_nea 627 WRITE(numout,*) ' Rejection of obs near open bdys ln_bound_reject = ', ln_bound_reject 625 628 WRITE(numout,*) ' MSSH correction scheme nmsshc = ', nmsshc 626 629 WRITE(numout,*) ' MDT correction mdtcorr = ', mdtcorr -
branches/UKMO/dev_r4650_general_vert_coord_obsoper_surf_bgc/NEMOGCM/NEMO/OPA_SRC/OBS/obs_mpp.F90
r6406 r7480 98 98 ! 99 99 INTEGER :: ierr 100 INTEGER, DIMENSION(kno) :: ivals 101 ! 102 INCLUDE 'mpif.h' 103 !!---------------------------------------------------------------------- 100 INTEGER, DIMENSION(:), ALLOCATABLE :: ivals 101 ! 102 INCLUDE 'mpif.h' 103 !!---------------------------------------------------------------------- 104 105 ALLOCATE( ivals(kno) ) 104 106 105 107 ! Call the MPI library to find the maximum across processors … … 107 109 & mpi_max, mpi_comm_opa, ierr ) 108 110 kvals(:) = ivals(:) 111 112 DEALLOCATE( ivals ) 109 113 #else 110 114 ! no MPI: empty routine … … 138 142 ! 139 143 INTEGER :: ji, isum 140 INTEGER, DIMENSION(kno) :: iobsp 141 !! 142 !! 143 144 iobsp=kobsp 144 INTEGER, DIMENSION(:), ALLOCATABLE :: iobsp 145 !! 146 !! 147 148 ALLOCATE( iobsp(kno) ) 149 150 iobsp(:)=kobsp(:) 145 151 146 152 WHERE( iobsp(:) == -1 ) … … 148 154 END WHERE 149 155 150 iobsp =-1*iobsp156 iobsp(:)=-1*iobsp(:) 151 157 152 158 CALL obs_mpp_max_integer( iobsp, kno ) 153 159 154 kobsp =-1*iobsp160 kobsp(:)=-1*iobsp(:) 155 161 156 162 isum=0 … … 168 174 ENDIF 169 175 176 DEALLOCATE( iobsp ) 177 170 178 #else 171 179 ! no MPI: empty routine -
branches/UKMO/dev_r4650_general_vert_coord_obsoper_surf_bgc/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90
r6857 r7480 31 31 USE obs_inter_sup ! Interpolation support 32 32 USE obs_oper ! Observation operators 33 #if defined key_bdy 34 USE bdy_oce, ONLY : & ! Boundary information 35 idx_bdy, nb_bdy 36 #endif 33 37 USE lib_mpp, ONLY : & 34 38 & ctl_warn, ctl_stop … … 51 55 & calc_month_len ! Calculate the number of days in the months of a year 52 56 57 LOGICAL, PUBLIC :: ln_bound_reject !: Remove obs near open boundaries 58 53 59 !!---------------------------------------------------------------------- 54 60 !! NEMO/OPA 3.3 , NEMO Consortium (2010) … … 87 93 & gphit, & 88 94 & gdept_1d,& 89 & tmask 95 #if defined key_vvl 96 & gdepw_n, & 97 & gdept_n, & 98 #else 99 & gdepw_1d, & 100 & gdept_1d, & 101 #endif 102 & tmask, & 103 & ln_zco, & 104 & ln_zps, & 105 & nproc 90 106 !! * Arguments 91 107 TYPE(obs_prof), INTENT(INOUT) :: profdata ! Full set of profile data … … 109 125 INTEGER :: ilantobs ! - within a model land cell (temperature) 110 126 INTEGER :: ilansobs ! - within a model land cell (salinity) 127 INTEGER :: ibdytobs ! - boundary (temperature) 128 INTEGER :: ibdysobs ! - boundary (salinity) 111 129 INTEGER :: inlatobs ! - close to land (temperature) 112 130 INTEGER :: inlasobs ! - close to land (salinity) … … 118 136 INTEGER :: ilantobsmpp ! - within a model land cell (temperature) 119 137 INTEGER :: ilansobsmpp ! - within a model land cell (salinity) 138 INTEGER :: ibdytobsmpp ! - boundary (temperature) 139 INTEGER :: ibdysobsmpp ! - boundary (salinity) 120 140 INTEGER :: inlatobsmpp ! - close to land (temperature) 121 141 INTEGER :: inlasobsmpp ! - close to land (salinity) … … 150 170 inlatobs = 0 151 171 inlasobs = 0 172 ibdytobs = 0 173 ibdysobs = 0 152 174 153 175 ! ----------------------------------------------------------------------- … … 206 228 & profdata%nqc, profdata%var(1)%nvqc, & 207 229 & iosdtobs, ilantobs, & 208 & inlatobs, ld_nea ) 230 & inlatobs, ld_nea, & 231 & ibdytobs, ln_bound_reject ) 232 209 233 210 234 CALL obs_mpp_sum_integer( iosdtobs, iosdtobsmpp ) 211 235 CALL obs_mpp_sum_integer( ilantobs, ilantobsmpp ) 212 236 CALL obs_mpp_sum_integer( inlatobs, inlatobsmpp ) 237 CALL obs_mpp_sum_integer( ibdytobs, ibdytobsmpp ) 213 238 214 239 ! Salinity … … 226 251 & profdata%nqc, profdata%var(2)%nvqc, & 227 252 & iosdsobs, ilansobs, & 228 & inlasobs, ld_nea ) 253 & inlasobs, ld_nea, & 254 & ibdysobs, ln_bound_reject ) 229 255 230 256 CALL obs_mpp_sum_integer( iosdsobs, iosdsobsmpp ) 231 257 CALL obs_mpp_sum_integer( ilansobs, ilansobsmpp ) 232 258 CALL obs_mpp_sum_integer( inlasobs, inlasobsmpp ) 259 CALL obs_mpp_sum_integer( ibdysobs, ibdysobsmpp ) 233 260 234 261 ! ----------------------------------------------------------------------- … … 288 315 & inlatobsmpp 289 316 ENDIF 317 WRITE(numout,*) ' Remaining T data near open boundary (removed) = ',& 318 & ibdytobsmpp 290 319 WRITE(numout,*) ' T data accepted = ', & 291 320 & prodatqc%nvprotmpp(1) … … 301 330 & inlasobsmpp 302 331 ENDIF 332 WRITE(numout,*) ' Remaining S data near open boundary (removed) = ',& 333 & ibdysobsmpp 303 334 WRITE(numout,*) ' S data accepted = ', & 304 335 & prodatqc%nvprotmpp(2) … … 388 419 INTEGER :: inlasobs ! - close to land 389 420 INTEGER :: igrdobs ! - fail the grid search 421 INTEGER :: ibdysobs ! - close to open boundary 390 422 ! Global counters for observations that 391 423 INTEGER :: iotdobsmpp ! - outside time domain … … 394 426 INTEGER :: inlasobsmpp ! - close to land 395 427 INTEGER :: igrdobsmpp ! - fail the grid search 428 INTEGER :: ibdysobsmpp ! - close to open boundary 396 429 LOGICAL, DIMENSION(:), ALLOCATABLE :: & 397 430 & llvalid ! SLA data selection … … 399 432 INTEGER :: jstp ! Time loop variable 400 433 INTEGER :: inrc ! Time index variable 434 INTEGER :: irec ! Record index 401 435 402 436 IF(lwp) WRITE(numout,*)'obs_pre_sla : Preparing the SLA observations...' … … 418 452 ilansobs = 0 419 453 inlasobs = 0 454 ibdysobs = 0 420 455 421 456 ! ----------------------------------------------------------------------- … … 451 486 & tmask(:,:,1), sladata%nqc, & 452 487 & iosdsobs, ilansobs, & 453 & inlasobs, ld_nea ) 488 & inlasobs, ld_nea, & 489 & ibdysobs, ln_bound_reject ) 454 490 455 491 CALL obs_mpp_sum_integer( iosdsobs, iosdsobsmpp ) 456 492 CALL obs_mpp_sum_integer( ilansobs, ilansobsmpp ) 457 493 CALL obs_mpp_sum_integer( inlasobs, inlasobsmpp ) 494 CALL obs_mpp_sum_integer( ibdysobs, ibdysobsmpp ) 458 495 459 496 ! ----------------------------------------------------------------------- … … 504 541 & inlasobsmpp 505 542 ENDIF 543 WRITE(numout,*) ' Remaining SLA data near open boundary (removed) = ', & 544 & ibdysobsmpp 506 545 WRITE(numout,*) ' SLA data accepted = ', & 507 546 & sladatqc%nsurfmpp … … 529 568 ENDIF 530 569 570 !--------------------------------------------------------- 571 ! Record handling 572 !--------------------------------------------------------- 573 ! First count the number of records 574 sladatqc%nrec = 0 575 DO jstp = nit000 - 1, nitend 576 inrc = jstp - nit000 + 2 577 IF ( sladatqc%nsstpmpp(inrc) > 0 ) THEN 578 sladatqc%nrec = sladatqc%nrec + 1 579 ENDIF 580 END DO 581 ! Allocate record data 582 ALLOCATE( & 583 & sladatqc%mrecstp(sladatqc%nrec) & 584 & ) 585 ! Finally save the time step corresponding to record rank 586 irec = 0 587 DO jstp = nit000 - 1, nitend 588 inrc = jstp - nit000 + 2 589 IF ( sladatqc%nsstpmpp(inrc) > 0 ) THEN 590 irec = irec + 1 591 sladatqc%mrecstp(irec) = inrc 592 ENDIF 593 IF ( lwp ) THEN 594 WRITE(numout,1999) inrc, sladatqc%nsstpmpp(inrc) 595 ENDIF 596 END DO 597 598 ! Print record information 599 IF( lwp ) THEN 600 WRITE(numout,*) 601 WRITE(numout,2000) 602 WRITE(numout,2001) 603 DO irec = 1, sladatqc%nrec 604 WRITE(numout,1999) irec, sladatqc%mrecstp(irec) 605 END DO 606 ENDIF 607 608 531 609 1997 FORMAT(10X,'Time step',5X,'Sea level anomaly') 532 610 1998 FORMAT(10X,'---------',5X,'-----------------') 533 611 1999 FORMAT(10X,I9,5X,I17) 612 2000 FORMAT(15X,'Record',10X,'Time step') 613 2001 FORMAT(15X,'------',10X,'---------') 534 614 535 615 END SUBROUTINE obs_pre_sla … … 575 655 INTEGER :: inlasobs ! - close to land 576 656 INTEGER :: igrdobs ! - fail the grid search 657 INTEGER :: ibdysobs ! - close to open boundary 577 658 ! Global counters for observations that 578 659 INTEGER :: iotdobsmpp ! - outside time domain … … 581 662 INTEGER :: inlasobsmpp ! - close to land 582 663 INTEGER :: igrdobsmpp ! - fail the grid search 664 INTEGER :: ibdysobsmpp ! - close to open boundary 583 665 LOGICAL, DIMENSION(:), ALLOCATABLE :: & 584 666 & llvalid ! SST data selection … … 586 668 INTEGER :: jstp ! Time loop variable 587 669 INTEGER :: inrc ! Time index variable 670 INTEGER :: irec ! Record index 588 671 589 672 IF(lwp) WRITE(numout,*)'obs_pre_sst : Preparing the SST observations...' … … 605 688 ilansobs = 0 606 689 inlasobs = 0 690 ibdysobs = 0 607 691 608 692 ! ----------------------------------------------------------------------- … … 635 719 & tmask(:,:,1), sstdata%nqc, & 636 720 & iosdsobs, ilansobs, & 637 & inlasobs, ld_nea ) 721 & inlasobs, ld_nea, & 722 & ibdysobs, ln_bound_reject ) 638 723 639 724 CALL obs_mpp_sum_integer( iosdsobs, iosdsobsmpp ) 640 725 CALL obs_mpp_sum_integer( ilansobs, ilansobsmpp ) 641 726 CALL obs_mpp_sum_integer( inlasobs, inlasobsmpp ) 727 CALL obs_mpp_sum_integer( ibdysobs, ibdysobsmpp ) 642 728 643 729 ! ----------------------------------------------------------------------- … … 688 774 & inlasobsmpp 689 775 ENDIF 776 WRITE(numout,*) ' Remaining SST data near open boundary (removed) = ', & 777 & ibdysobsmpp 690 778 WRITE(numout,*) ' SST data accepted = ', & 691 779 & sstdatqc%nsurfmpp … … 713 801 ENDIF 714 802 803 !--------------------------------------------------------- 804 ! Record handling 805 !--------------------------------------------------------- 806 ! First count the number of records 807 sstdatqc%nrec = 0 808 DO jstp = nit000 - 1, nitend 809 inrc = jstp - nit000 + 2 810 IF ( sstdatqc%nsstpmpp(inrc) > 0 ) THEN 811 sstdatqc%nrec = sstdatqc%nrec + 1 812 ENDIF 813 END DO 814 ! Allocate record data 815 ALLOCATE( & 816 & sstdatqc%mrecstp(sstdatqc%nrec) & 817 & ) 818 ! Finally save the time step corresponding to record rank 819 irec = 0 820 DO jstp = nit000 - 1, nitend 821 inrc = jstp - nit000 + 2 822 IF ( sstdatqc%nsstpmpp(inrc) > 0 ) THEN 823 irec = irec + 1 824 sstdatqc%mrecstp(irec) = inrc 825 ENDIF 826 IF ( lwp ) THEN 827 WRITE(numout,1999) jstp, sstdatqc%nsstpmpp(inrc) 828 ENDIF 829 END DO 830 831 ! Print record information 832 IF( lwp ) THEN 833 WRITE(numout,*) 834 WRITE(numout,2000) 835 WRITE(numout,2001) 836 DO irec = 1, sstdatqc%nrec 837 WRITE(numout,1999) irec, sstdatqc%mrecstp(irec) - 1 838 END DO 839 ENDIF 840 715 841 1997 FORMAT(10X,'Time step',5X,'Sea surface temperature') 716 842 1998 FORMAT(10X,'---------',5X,'-----------------') 717 843 1999 FORMAT(10X,I9,5X,I17) 844 2000 FORMAT(15X,'Record',10X,'Time step') 845 2001 FORMAT(15X,'------',10X,'---------') 718 846 719 847 END SUBROUTINE obs_pre_sst … … 759 887 INTEGER :: inlasobs ! - close to land 760 888 INTEGER :: igrdobs ! - fail the grid search 889 INTEGER :: ibdysobs ! - close to open boundary 761 890 ! Global counters for observations that 762 891 INTEGER :: iotdobsmpp ! - outside time domain … … 765 894 INTEGER :: inlasobsmpp ! - close to land 766 895 INTEGER :: igrdobsmpp ! - fail the grid search 896 INTEGER :: ibdysobsmpp ! - close to open boundary 767 897 LOGICAL, DIMENSION(:), ALLOCATABLE :: & 768 898 & llvalid ! data selection … … 770 900 INTEGER :: jstp ! Time loop variable 771 901 INTEGER :: inrc ! Time index variable 902 INTEGER :: irec ! Record index 772 903 773 904 IF (lwp) WRITE(numout,*)'obs_pre_seaice : Preparing the sea ice observations...' … … 789 920 ilansobs = 0 790 921 inlasobs = 0 922 ibdysobs = 0 791 923 792 924 ! ----------------------------------------------------------------------- … … 819 951 & tmask(:,:,1), seaicedata%nqc, & 820 952 & iosdsobs, ilansobs, & 821 & inlasobs, ld_nea ) 953 & inlasobs, ld_nea, & 954 & ibdysobs, ln_bound_reject ) 822 955 823 956 CALL obs_mpp_sum_integer( iosdsobs, iosdsobsmpp ) 824 957 CALL obs_mpp_sum_integer( ilansobs, ilansobsmpp ) 825 958 CALL obs_mpp_sum_integer( inlasobs, inlasobsmpp ) 959 CALL obs_mpp_sum_integer( ibdysobs, ibdysobsmpp ) 826 960 827 961 ! ----------------------------------------------------------------------- … … 872 1006 & inlasobsmpp 873 1007 ENDIF 1008 WRITE(numout,*) ' Remaining sea ice data near open boundary (removed) = ', & 1009 & ibdysobsmpp 874 1010 WRITE(numout,*) ' Sea ice data accepted = ', & 875 1011 & seaicedatqc%nsurfmpp … … 897 1033 ENDIF 898 1034 1035 !--------------------------------------------------------- 1036 ! Record handling 1037 !--------------------------------------------------------- 1038 ! First count the number of records 1039 seaicedatqc%nrec = 0 1040 DO jstp = nit000 - 1, nitend 1041 inrc = jstp - nit000 + 2 1042 IF ( seaicedatqc%nsstpmpp(inrc) > 0 ) THEN 1043 seaicedatqc%nrec = seaicedatqc%nrec + 1 1044 ENDIF 1045 END DO 1046 ! Allocate record data 1047 ALLOCATE( & 1048 & seaicedatqc%mrecstp(seaicedatqc%nrec) & 1049 & ) 1050 ! Finally save the time step corresponding to record rank 1051 irec = 0 1052 DO jstp = nit000 - 1, nitend 1053 inrc = jstp - nit000 + 2 1054 IF ( seaicedatqc%nsstpmpp(inrc) > 0 ) THEN 1055 irec = irec + 1 1056 seaicedatqc%mrecstp(irec) = inrc 1057 ENDIF 1058 IF ( lwp ) THEN 1059 WRITE(numout,1999) inrc, seaicedatqc%nsstpmpp(inrc) 1060 ENDIF 1061 END DO 1062 1063 ! Print record information 1064 IF( lwp ) THEN 1065 WRITE(numout,*) 1066 WRITE(numout,2000) 1067 WRITE(numout,2001) 1068 DO irec = 1, seaicedatqc%nrec 1069 WRITE(numout,1999) irec, seaicedatqc%mrecstp(irec) 1070 END DO 1071 ENDIF 1072 899 1073 1997 FORMAT(10X,'Time step',5X,'Sea ice data ') 900 1074 1998 FORMAT(10X,'---------',5X,'-----------------') 901 1075 1999 FORMAT(10X,I9,5X,I17) 1076 2000 FORMAT(15X,'Record',10X,'Time step') 1077 2001 FORMAT(15X,'------',10X,'---------') 902 1078 903 1079 END SUBROUTINE obs_pre_seaice … … 947 1123 INTEGER :: inlavobs ! - close to land (meridional velocity component) 948 1124 INTEGER :: igrdobs ! - fail the grid search 1125 INTEGER :: ibdyuobs ! - close to open boundary 1126 INTEGER :: ibdyvobs ! - close to open boundary 949 1127 INTEGER :: iuvchku ! - reject u if v rejected and vice versa 950 1128 INTEGER :: iuvchkv ! … … 958 1136 INTEGER :: inlavobsmpp ! - close to land (meridional velocity component) 959 1137 INTEGER :: igrdobsmpp ! - fail the grid search 1138 INTEGER :: ibdyuobsmpp ! - close to open boundary 1139 INTEGER :: ibdyvobsmpp ! - close to open boundary 960 1140 INTEGER :: iuvchkumpp ! - reject u if v rejected and vice versa 961 1141 INTEGER :: iuvchkvmpp ! … … 989 1169 inlauobs = 0 990 1170 inlavobs = 0 1171 ibdyuobs = 0 1172 ibdyvobs = 0 991 1173 iuvchku = 0 992 1174 iuvchkv = 0 … … 1041 1223 & profdata%nqc, profdata%var(1)%nvqc, & 1042 1224 & iosduobs, ilanuobs, & 1043 & inlauobs, ld_nea ) 1225 & inlauobs, ld_nea, & 1226 & ibdyuobs, ln_bound_reject ) 1044 1227 1045 1228 CALL obs_mpp_sum_integer( iosduobs, iosduobsmpp ) 1046 1229 CALL obs_mpp_sum_integer( ilanuobs, ilanuobsmpp ) 1047 1230 CALL obs_mpp_sum_integer( inlauobs, inlauobsmpp ) 1231 CALL obs_mpp_sum_integer( ibdyuobs, ibdyuobsmpp ) 1048 1232 1049 1233 ! Meridional Velocity Component … … 1061 1245 & profdata%nqc, profdata%var(2)%nvqc, & 1062 1246 & iosdvobs, ilanvobs, & 1063 & inlavobs, ld_nea ) 1247 & inlavobs, ld_nea, & 1248 & ibdyvobs, ln_bound_reject ) 1064 1249 1065 1250 CALL obs_mpp_sum_integer( iosdvobs, iosdvobsmpp ) 1066 1251 CALL obs_mpp_sum_integer( ilanvobs, ilanvobsmpp ) 1067 1252 CALL obs_mpp_sum_integer( inlavobs, inlavobsmpp ) 1253 CALL obs_mpp_sum_integer( ibdyvobs, ibdyvobsmpp ) 1068 1254 1069 1255 ! ----------------------------------------------------------------------- … … 1131 1317 & inlauobsmpp 1132 1318 ENDIF 1319 WRITE(numout,*) ' Remaining U data near open boundary (removed) = ', & 1320 & ibdyuobsmpp 1133 1321 WRITE(numout,*) ' U observation rejected since V rejected = ', & 1134 1322 & iuvchku … … 1146 1334 & inlavobsmpp 1147 1335 ENDIF 1336 WRITE(numout,*) ' Remaining V data near open boundary (removed) = ', & 1337 & ibdyvobsmpp 1148 1338 WRITE(numout,*) ' V observation rejected since U rejected = ', & 1149 1339 & iuvchkv … … 2270 2460 & plam, pphi, pmask, & 2271 2461 & kobsqc, kosdobs, klanobs, & 2272 & knlaobs,ld_nea ) 2462 & knlaobs,ld_nea, & 2463 & kbdyobs,ld_bound_reject ) 2273 2464 !!---------------------------------------------------------------------- 2274 2465 !! *** ROUTINE obs_coo_spc_2d *** … … 2306 2497 INTEGER, INTENT(INOUT) :: klanobs ! Observations within a model land cell 2307 2498 INTEGER, INTENT(INOUT) :: knlaobs ! Observations near land 2499 INTEGER, INTENT(INOUT) :: kbdyobs ! Observations near boundary 2308 2500 LOGICAL, INTENT(IN) :: ld_nea ! Flag observations near land 2501 LOGICAL, INTENT(IN) :: ld_bound_reject ! Flag observations near open boundary 2309 2502 !! * Local declarations 2310 2503 REAL(KIND=wp), DIMENSION(2,2,kobsno) :: & 2311 2504 & zgmsk ! Grid mask 2505 #if defined key_bdy 2506 REAL(KIND=wp), DIMENSION(2,2,kobsno) :: & 2507 & zbmsk ! Boundary mask 2508 REAL(KIND=wp), DIMENSION(jpi,jpj) :: zbdymask 2509 #endif 2312 2510 REAL(KIND=wp), DIMENSION(2,2,kobsno) :: & 2313 2511 & zglam, & ! Model longitude at grid points … … 2351 2549 2352 2550 END DO 2551 2552 #if defined key_bdy 2553 ! Create a mask grid points in boundary rim 2554 IF (ld_bound_reject) THEN 2555 zbdymask(:,:) = 1.0_wp 2556 DO ji = 1, nb_bdy 2557 DO jj = 1, idx_bdy(ji)%nblen(1) 2558 zbdymask(idx_bdy(ji)%nbi(jj,1),idx_bdy(ji)%nbj(jj,1)) = 0.0_wp 2559 ENDDO 2560 ENDDO 2561 2562 CALL obs_int_comm_2d( 2, 2, kobsno, igrdi, igrdj, zbdymask, zbmsk ) 2563 ENDIF 2564 #endif 2353 2565 2354 2566 CALL obs_int_comm_2d( 2, 2, kobsno, igrdi, igrdj, pmask, zgmsk ) … … 2396 2608 END DO 2397 2609 2398 ! For observations on the grid reject them if their are at 2399 ! a masked point 2400 2401 IF (lgridobs) THEN 2402 IF (zgmsk(iig,ijg,jobs) == 0.0_wp ) THEN 2403 kobsqc(jobs) = kobsqc(jobs) + 12 2404 klanobs = klanobs + 1 2610 ! Flag if the observation falls is close to land 2611 IF ( MINVAL( zgmsk(1:2,1:2,jobs) ) == 0.0_wp) THEN 2612 knlaobs = knlaobs + 1 2613 IF (ld_nea) THEN 2614 kobsqc(jobs) = kobsqc(jobs) + 14 2405 2615 CYCLE 2406 2616 ENDIF 2407 2617 ENDIF 2408 2409 ! Flag if the observation falls is close to land 2410 IF ( MINVAL( zgmsk(1:2,1:2,jobs) ) == 0.0_wp) THEN 2411 IF (ld_nea) kobsqc(jobs) = kobsqc(jobs) + 14 2412 knlaobs = knlaobs + 1 2413 CYCLE 2414 ENDIF 2618 2619 #if defined key_bdy 2620 ! Flag if the observation falls close to the boundary rim 2621 IF (ld_bound_reject) THEN 2622 IF ( MINVAL( zbmsk(1:2,1:2,jobs) ) == 0.0_wp ) THEN 2623 kobsqc(jobs) = kobsqc(jobs) + 15 2624 kbdyobs = kbdyobs + 1 2625 CYCLE 2626 ENDIF 2627 ! for observations on the grid... 2628 IF (lgridobs) THEN 2629 IF (zbmsk(iig,ijg,jobs) == 0.0_wp ) THEN 2630 kobsqc(jobs) = kobsqc(jobs) + 15 2631 kbdyobs = kbdyobs + 1 2632 CYCLE 2633 ENDIF 2634 ENDIF 2635 ENDIF 2636 #endif 2415 2637 2416 2638 END DO … … 2424 2646 & plam, pphi, pdep, pmask, & 2425 2647 & kpobsqc, kobsqc, kosdobs, & 2426 & klanobs, knlaobs, ld_nea ) 2648 & klanobs, knlaobs, ld_nea, & 2649 & kbdyobs, ld_bound_reject ) 2427 2650 !!---------------------------------------------------------------------- 2428 2651 !! *** ROUTINE obs_coo_spc_3d *** … … 2489 2712 INTEGER, INTENT(INOUT) :: klanobs ! Observations within a model land cell 2490 2713 INTEGER, INTENT(INOUT) :: knlaobs ! Observations near land 2714 INTEGER, INTENT(INOUT) :: kbdyobs ! Observations near boundary 2491 2715 LOGICAL, INTENT(IN) :: ld_nea ! Flag observations near land 2716 LOGICAL, INTENT(IN) :: ld_bound_reject ! Flag observations near open boundary 2492 2717 !! * Local declarations 2493 2718 REAL(KIND=wp), DIMENSION(2,2,kpk,kprofno) :: & 2494 2719 & zgmsk ! Grid mask 2720 #if defined key_bdy 2721 REAL(KIND=wp), DIMENSION(2,2,kprofno) :: & 2722 & zbmsk ! Boundary mask 2723 REAL(KIND=wp), DIMENSION(jpi,jpj) :: zbdymask 2724 #endif 2495 2725 REAL(KIND=wp), DIMENSION(2,2,kpk,kprofno) :: & 2496 2726 & zgdepw … … 2537 2767 2538 2768 END DO 2769 2770 #if defined key_bdy 2771 ! Create a mask grid points in boundary rim 2772 IF (ld_bound_reject) THEN 2773 zbdymask(:,:) = 1.0_wp 2774 DO ji = 1, nb_bdy 2775 DO jj = 1, idx_bdy(ji)%nblen(1) 2776 zbdymask(idx_bdy(ji)%nbi(jj,1),idx_bdy(ji)%nbj(jj,1)) = 0.0_wp 2777 ENDDO 2778 ENDDO 2779 ENDIF 2780 2781 CALL obs_int_comm_2d( 2, 2, kprofno, igrdi, igrdj, zbdymask, zbmsk ) 2782 #endif 2539 2783 2540 2784 CALL obs_int_comm_3d( 2, 2, kprofno, kpk, igrdi, igrdj, pmask, zgmsk ) … … 2616 2860 2617 2861 ELSE ! Case 2 2618 2619 2862 ! Flag if the observation is deeper than the bathymetry 2620 2863 ! Or if it is within the mask … … 2648 2891 ENDIF 2649 2892 ENDIF 2650 2651 ! Flag if the observation falls is close to land 2652 IF ( MINVAL( zgmsk(1:2,1:2,kobsk(jobsp)-1:kobsk(jobsp),jobs) ) == & 2653 & 0.0_wp) THEN 2654 IF (ld_nea) kobsqc(jobsp) = kobsqc(jobsp) + 14 2655 knlaobs = knlaobs + 1 2656 ENDIF 2657 2893 2658 2894 ! Set observation depth equal to that of the first model depth 2659 2895 IF ( pobsdep(jobsp) <= pdep(1) ) THEN 2660 2896 pobsdep(jobsp) = pdep(1) 2661 2897 ENDIF 2898 2899 #if defined key_bdy 2900 ! Flag if the observation falls close to the boundary rim 2901 IF (ld_bound_reject) THEN 2902 IF ( MINVAL( zbmsk(1:2,1:2,jobs) ) == 0.0_wp ) THEN 2903 kobsqc(jobsp) = kobsqc(jobsp) + 15 2904 kbdyobs = kbdyobs + 1 2905 CYCLE 2906 ENDIF 2907 ! for observations on the grid... 2908 IF (lgridobs) THEN 2909 IF (zbmsk(iig,ijg,jobs) == 0.0_wp ) THEN 2910 kobsqc(jobsp) = kobsqc(jobsp) + 15 2911 kbdyobs = kbdyobs + 1 2912 CYCLE 2913 ENDIF 2914 ENDIF 2915 ENDIF 2916 #endif 2662 2917 2663 2918 END DO -
branches/UKMO/dev_r4650_general_vert_coord_obsoper_surf_bgc/NEMOGCM/NEMO/OPA_SRC/OBS/obs_surf_def.F90
r5838 r7480 50 50 INTEGER :: npj 51 51 INTEGER :: nsurfup !: Observation counter used in obs_oper 52 INTEGER :: nrec !: Number of surface observation records in window 52 53 53 54 ! Arrays with size equal to the number of surface observations … … 56 57 & mi, & !: i-th grid coord. for interpolating to surface observation 57 58 & mj, & !: j-th grid coord. for interpolating to surface observation 59 & mt, & !: time record number for gridded data 58 60 & nsidx,& !: Surface observation number 59 61 & nsfil,& !: Surface observation number in file … … 90 92 & nsstpmpp !: Global number of surface observations per time step 91 93 94 ! Arrays with size equal to the number of observation records in the window 95 INTEGER, POINTER, DIMENSION(:) :: & 96 & mrecstp ! Time step of the records 97 92 98 ! Arrays used to store source indices when 93 99 ! compressing obs_surf derived types … … 97 103 INTEGER, POINTER, DIMENSION(:) :: & 98 104 & nsind !: Source indices of surface data in compressed data 105 106 ! Is this a gridded product? 107 108 LOGICAL :: lgrid 99 109 100 110 END TYPE obs_surf … … 146 156 & surf%mi(ksurf), & 147 157 & surf%mj(ksurf), & 158 & surf%mt(ksurf), & 148 159 & surf%nsidx(ksurf), & 149 160 & surf%nsfil(ksurf), & … … 162 173 & ) 163 174 175 surf%mt(:) = -1 176 164 177 165 178 ! Allocate arrays of number of surface data size * number of variables … … 176 189 & ) 177 190 191 surf%rext(:,:) = 0.0_wp 192 178 193 ! Allocate arrays of number of time step size 179 194 … … 203 218 204 219 surf%nsurfup = 0 220 221 ! Not gridded by default 222 223 surf%lgrid = .FALSE. 205 224 206 225 END SUBROUTINE obs_surf_alloc … … 228 247 & surf%mi, & 229 248 & surf%mj, & 249 & surf%mt, & 230 250 & surf%nsidx, & 231 251 & surf%nsfil, & … … 350 370 newsurf%mi(insurf) = surf%mi(ji) 351 371 newsurf%mj(insurf) = surf%mj(ji) 372 newsurf%mt(insurf) = surf%mt(ji) 352 373 newsurf%nsidx(insurf) = surf%nsidx(ji) 353 374 newsurf%nsfil(insurf) = surf%nsfil(ji) … … 393 414 394 415 newsurf%nstp = surf%nstp 416 417 ! Set gridded stuff 418 419 newsurf%mt(insurf) = surf%mt(ji) 395 420 396 421 ! Deallocate temporary data … … 433 458 oldsurf%mi(jj) = surf%mi(ji) 434 459 oldsurf%mj(jj) = surf%mj(ji) 460 oldsurf%mt(jj) = surf%mt(ji) 435 461 oldsurf%nsidx(jj) = surf%nsidx(ji) 436 462 oldsurf%nsfil(jj) = surf%nsfil(ji)
Note: See TracChangeset
for help on using the changeset viewer.