Changeset 15240 for NEMO/branches/UKMO
- Timestamp:
- 2021-09-09T17:22:33+02:00 (3 years ago)
- Location:
- NEMO/branches/UKMO/NEMO_4.0.4_generic_obs
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/UKMO/NEMO_4.0.4_generic_obs/cfgs/SHARED/namelist_ref
r15180 r15240 1280 1280 rn_avgphiscl = 0. ! N/S diameter of observation footprint (metres/degrees) 1281 1281 ln_night = .false. ! Logical switch for calculating night-time average for obs 1282 ln_time_mean_bkg = .false. ! Logical switch for applying time mean of background (e.g. to remove tidal signal) 1283 rn_time_mean_period = 24.8333 ! Meaning period in hours if ln_time_mean_bkg (default is AMM tidal period) 1282 1284 ln_obsbias = .false. ! Logical switch for bias correction 1283 1285 cn_obsbiasfiles = '' ! Bias input file names … … 1292 1294 !!! NOT YET IMPLEMENTED: 1293 1295 !!! OUTPUT CLIMATOLOGY 1294 !!! TIME MEAN BACKGROUND1295 1296 / 1296 1297 !----------------------------------------------------------------------- -
NEMO/branches/UKMO/NEMO_4.0.4_generic_obs/src/OCE/OBS/diaobs.F90
r15228 r15240 249 249 ! Read in surface obs types 250 250 ! 251 CALL obs_rea_surf( sobsgroups(jgroup)%ssurfdata, & 252 & sobsgroups(jgroup)%nobsfiles, & 253 & sobsgroups(jgroup)%cobsfiles, & 254 & sobsgroups(jgroup)%nobstypes, & 255 & sobsgroups(jgroup)%naddvars, & 256 & sobsgroups(jgroup)%nextvars, & 257 & nitend-nit000+2, & 258 & rn_dobsini, & 259 & rn_dobsend, & 260 & sobsgroups(jgroup)%lignmis, & 261 & .FALSE., & 262 & sobsgroups(jgroup)%lnight, & 251 CALL obs_rea_surf( sobsgroups(jgroup)%ssurfdata, & 252 & sobsgroups(jgroup)%nobsfiles, & 253 & sobsgroups(jgroup)%cobsfiles, & 254 & sobsgroups(jgroup)%nobstypes, & 255 & sobsgroups(jgroup)%naddvars, & 256 & sobsgroups(jgroup)%nextvars, & 257 & nitend-nit000+2, & 258 & rn_dobsini, & 259 & rn_dobsend, & 260 & sobsgroups(jgroup)%rtime_mean_period, & 261 & sobsgroups(jgroup)%ltime_mean_bkg, & 262 & sobsgroups(jgroup)%lignmis, & 263 & .FALSE., & 264 & sobsgroups(jgroup)%lnight, & 263 265 & sobsgroups(jgroup)%cobstypes ) 264 266 ! … … 373 375 !! * Local declarations 374 376 INTEGER :: idaystp ! Number of timesteps per day 377 INTEGER :: imeanstp ! Number of timesteps for time averaging 375 378 INTEGER :: jtype ! Data loop variable 376 379 INTEGER :: jvar ! Variable number … … 504 507 ENDIF 505 508 ELSE 509 IF ( sobsgroups(jgroup)%ltime_mean_bkg ) THEN 510 ! Number of time-steps in meaning period 511 imeanstp = NINT( ( sobsgroups(jgroup)%rtime_mean_period * 60.0 * 60.0 ) / rdt ) 512 ENDIF 506 513 CALL obs_surf_opt( sobsgroups(jgroup)%ssurfdataqc, & 507 514 & kstp, jpi, jpj, & … … 514 521 & sobsgroups(jgroup)%ravgphiscl, & 515 522 & sobsgroups(jgroup)%lfp_indegs, & 523 & sobsgroups(jgroup)%ltime_mean_bkg, & 524 & imeanstp, & 516 525 & kssh=sobsgroups(jgroup)%nadd_ssh, & 517 526 & kmdt=sobsgroups(jgroup)%next_mdt, & -
NEMO/branches/UKMO/NEMO_4.0.4_generic_obs/src/OCE/OBS/obs_group_def.F90
r15228 r15240 82 82 LOGICAL :: lall_at_all !: Logical switch for computing all model variables at all obs points 83 83 LOGICAL :: lnight !: Logical switch for calculating night-time average 84 LOGICAL :: ltime_mean_bkg !: Logical switch for applying time mean of background (e.g. to remove tidal signal) 84 85 LOGICAL :: lfp_indegs !: Logical: T=> averaging footprint is in degrees, F=> in metres 85 86 ! … … 88 89 REAL(wp) :: rmdtcorr !: MDT correction 89 90 REAL(wp) :: rmdtcutoff !: MDT cutoff for computed correction 91 REAL(wp) :: rtime_mean_period !: Meaning period if ltime_mean_bkg 90 92 ! 91 93 REAL(wp), POINTER, DIMENSION(:,:,:) :: rglam !: Longitudes … … 193 195 LOGICAL :: ln_all_at_all 194 196 LOGICAL :: ln_night 197 LOGICAL :: ln_time_mean_bkg 195 198 LOGICAL :: ln_fp_indegs 196 199 REAL(wp) :: rn_avglamscl … … 198 201 REAL(wp) :: rn_mdtcorr 199 202 REAL(wp) :: rn_mdtcutoff 203 REAL(wp) :: rn_time_mean_period 200 204 !! 201 205 NAMELIST/namobs_dta/cn_groupname, ln_prof, ln_surf, ln_enabled, & … … 204 208 & ln_fp_indegs, rn_avglamscl, rn_avgphiscl, ln_obsbias, & 205 209 & cn_obsbiasfiles, cn_type_to_biascorrect, & 206 & cn_obsbiasfile_varname, ln_night, ln_ altbias,&207 & cn_altbiasfile, nn_msshc, rn_mdtcorr, rn_mdtcutoff,&208 & ln_all_at_all210 & cn_obsbiasfile_varname, ln_night, ln_time_mean_bkg, & 211 & rn_time_mean_period, ln_altbias, cn_altbiasfile, & 212 & nn_msshc, rn_mdtcorr, rn_mdtcutoff, ln_all_at_all 209 213 !!---------------------------------------------------------------------- 210 214 … … 350 354 sdobsgroup%lall_at_all = ln_all_at_all 351 355 sdobsgroup%lnight = ln_night 356 sdobsgroup%ltime_mean_bkg = ln_time_mean_bkg 352 357 sdobsgroup%lfp_indegs = ln_fp_indegs 353 358 sdobsgroup%ravglamscl = rn_avglamscl … … 355 360 sdobsgroup%rmdtcorr = rn_mdtcorr 356 361 sdobsgroup%rmdtcutoff = rn_mdtcutoff 362 sdobsgroup%rtime_mean_period = rn_time_mean_period 357 363 ENDIF 358 364 … … 411 417 WRITE(numout,*) ' N/S diameter of obs footprint rn_avgphiscl = ', sdobsgroup%ravgphiscl 412 418 WRITE(numout,*) ' Logical switch for night-time average ln_night = ', sdobsgroup%lnight 419 WRITE(numout,*) ' Logical switch for time-mean background ln_time_mean_bkg = ', sdobsgroup%ltime_mean_bkg 420 WRITE(numout,*) ' Meaning period (hours) for time-mean bkg rn_time_mean_period = ', sdobsgroup%rtime_mean_period 413 421 WRITE(numout,*) ' Logical switch for bias correction ln_obsbias = ', sdobsgroup%lobsbias 414 422 IF ( sdobsgroup%lobsbias ) THEN -
NEMO/branches/UKMO/NEMO_4.0.4_generic_obs/src/OCE/OBS/obs_oper.F90
r15228 r15240 455 455 & kit000, kdaystp, kvar, psurf, psurfmask, & 456 456 & k2dint, ldnightav, plamscl, pphiscl, & 457 & lindegrees, kssh, kmdt, kfbd, ksnow ) 457 & lindegrees, ldtime_mean, kmeanstp, & 458 & kssh, kmdt, kfbd, ksnow ) 458 459 459 460 !!----------------------------------------------------------------------- … … 512 513 LOGICAL, INTENT(IN) :: & 513 514 & lindegrees ! T=> plamscl and pphiscl are specified in degrees, F=> in metres 515 LOGICAL, INTENT(IN) :: & 516 & ldtime_mean ! Observations/background represent a time mean 517 INTEGER, INTENT(IN) :: kmeanstp ! Number of time steps for meaning if ldtime_mean 514 518 INTEGER, OPTIONAL, INTENT(IN) :: & 515 519 & kssh ! Index of additional variable representing SSH … … 531 535 INTEGER :: imodi, imodj 532 536 INTEGER :: idayend 537 INTEGER :: imeanend 533 538 INTEGER, DIMENSION(:,:,:), ALLOCATABLE :: & 534 539 & igrdi, & … … 543 548 REAL(wp), DIMENSION(1) :: zext, zobsmask 544 549 REAL(wp) :: zdaystp 550 REAL(wp) :: zmeanstp 545 551 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: & 546 552 & zweig, & … … 571 577 CALL obs_max_fpsize( k2dint, plamscl, pphiscl, lindegrees, psurfmask, imaxifp, imaxjfp ) 572 578 579 IF ( ldtime_mean .AND. ldnightav ) THEN 580 CALL ctl_stop( 'obs_surf_opt: Can have ldtime_mean or ldnightav but not both' ) 581 ENDIF 582 583 IF ( ldtime_mean ) THEN 584 ! Initialize time mean for first timestep 585 imeanend = MOD( kt - kit000 + 1, kmeanstp ) 586 IF (lwp) WRITE(numout,*) 'Obs time mean ', kt, kit000, kmeanstp, imeanend 587 588 ! Added kt == 0 test to catch restart case 589 IF ( ( imeanend == 1 ) .OR. ( kt == 0 ) ) THEN 590 IF (lwp) WRITE(numout,*) 'Reset surfdataqc%vdmean on time-step: ',kt 591 DO jj = 1, jpj 592 DO ji = 1, jpi 593 surfdataqc%vdmean(ji,jj,kvar) = 0.0 594 END DO 595 END DO 596 ENDIF 597 598 ! On each time-step, increment the field for computing time mean 599 IF (lwp) WRITE(numout,*)'Accumulating surfdataqc%vdmean on time-step: ',kt 600 DO jj = 1, jpj 601 DO ji = 1, jpi 602 surfdataqc%vdmean(ji,jj,kvar) = surfdataqc%vdmean(ji,jj,kvar) & 603 & + psurf(ji,jj) 604 END DO 605 END DO 606 607 ! Compute the time mean at the end of time period 608 IF ( imeanend == 0 ) THEN 609 zmeanstp = 1.0 / REAL( kmeanstp ) 610 IF (lwp) WRITE(numout,*)'Calculating surfdataqc%vdmean time mean on time-step: ',kt,' with weight: ',zmeanstp 611 DO jj = 1, jpj 612 DO ji = 1, jpi 613 surfdataqc%vdmean(ji,jj,kvar) = surfdataqc%vdmean(ji,jj,kvar) & 614 & * zmeanstp 615 END DO 616 END DO 617 ENDIF 618 ENDIF 573 619 574 620 IF ( ldnightav ) THEN … … 685 731 CALL obs_int_comm_2d( imaxifp, imaxjfp, isurf, kpi, kpj, & 686 732 & igrdi, igrdj, psurfmask, zmask ) 687 CALL obs_int_comm_2d( imaxifp, imaxjfp, isurf, kpi, kpj, & 688 & igrdi, igrdj, psurf, zsurf ) 733 734 ! At the end of the averaging period get interpolated means 735 IF ( ldtime_mean ) THEN 736 IF ( imeanend == 0 ) THEN 737 ALLOCATE( zsurfm(imaxifp,imaxjfp,isurf) ) 738 IF (lwp) WRITE(numout,*)' Interpolating the time mean values on time step: ',kt 739 CALL obs_int_comm_2d( imaxifp, imaxjfp, isurf, kpi, kpj, & 740 & igrdi, igrdj, surfdataqc%vdmean(:,:,kvar), zsurfm ) 741 ENDIF 742 ELSE 743 CALL obs_int_comm_2d( imaxifp, imaxjfp, isurf, kpi, kpj, & 744 & igrdi, igrdj, psurf, zsurf ) 745 ENDIF 746 747 ! IF ( k2dint > 4 ) THEN AROUND THIS? - SEEMS TO BE IN V3.6 689 748 CALL obs_int_comm_2d( imaxifp+1, imaxjfp+1, isurf, kpi, kpj, & 690 749 & igrdip1, igrdjp1, glamf, zglamf ) … … 730 789 zphi = surfdataqc%rphi(jobs) 731 790 732 IF ( ldnightav .AND. idayend == 0) THEN733 ! Night-time averaged data791 IF ( ( ldnightav .AND. idayend == 0 ) .OR. (ldtime_mean .AND. imeanend == 0) ) THEN 792 ! Night-time or N=kmeanstp timestep averaged data 734 793 zsurftmp(:,:,iobs) = zsurfm(:,:,iobs) 735 794 ELSE … … 737 796 ENDIF 738 797 739 IF ( k2dint <= 4 ) THEN 740 741 ! Get weights to interpolate the model value to the observation point 742 CALL obs_int_h2d_init( 1, 1, k2dint, zlam, zphi, & 743 & zglam(:,:,iobs), zgphi(:,:,iobs), & 744 & zmask(:,:,iobs), zweig, zobsmask ) 745 746 ! Interpolate the model value to the observation point 747 CALL obs_int_h2d( 1, 1, zweig, zsurftmp(:,:,iobs), zext ) 748 749 ELSE 750 751 ! Get weights to average the model field to the observation footprint 752 CALL obs_avg_h2d_init( 1, 1, imaxifp, imaxjfp, k2dint, zlam, zphi, & 753 & zglam(:,:,iobs), zgphi(:,:,iobs), & 754 & zglamf(:,:,iobs), zgphif(:,:,iobs), & 755 & zmask(:,:,iobs), plamscl, pphiscl, & 756 & lindegrees, zweig, zobsmask ) 757 758 ! Average the model field to the observation footprint 759 CALL obs_avg_h2d( 1, 1, imaxifp, imaxjfp, & 760 & zweig, zsurftmp(:,:,iobs), zext ) 761 762 ENDIF 763 764 IF ( TRIM(surfdataqc%cvars(kvar)) == cobsname_sla .AND. PRESENT(kssh) .AND. PRESENT(kmdt) ) THEN 765 ! ... Remove the MDT from the SSH at the observation point to get the SLA 766 surfdataqc%radd(jobs,kssh,kvar) = zext(1) 767 surfdataqc%rmod(jobs,kvar) = surfdataqc%radd(jobs,kssh,kvar) - surfdataqc%rext(jobs,kmdt) 798 IF ( ( .NOT. ldtime_mean ) .OR. ( ldtime_mean .AND. imeanend == 0) ) THEN 799 800 IF ( k2dint <= 4 ) THEN 801 802 ! Get weights to interpolate the model value to the observation point 803 CALL obs_int_h2d_init( 1, 1, k2dint, zlam, zphi, & 804 & zglam(:,:,iobs), zgphi(:,:,iobs), & 805 & zmask(:,:,iobs), zweig, zobsmask ) 806 807 ! Interpolate the model value to the observation point 808 CALL obs_int_h2d( 1, 1, zweig, zsurftmp(:,:,iobs), zext ) 809 810 ELSE 811 812 ! Get weights to average the model field to the observation footprint 813 CALL obs_avg_h2d_init( 1, 1, imaxifp, imaxjfp, k2dint, zlam, zphi, & 814 & zglam(:,:,iobs), zgphi(:,:,iobs), & 815 & zglamf(:,:,iobs), zgphif(:,:,iobs), & 816 & zmask(:,:,iobs), plamscl, pphiscl, & 817 & lindegrees, zweig, zobsmask ) 818 819 ! Average the model field to the observation footprint 820 CALL obs_avg_h2d( 1, 1, imaxifp, imaxjfp, & 821 & zweig, zsurftmp(:,:,iobs), zext ) 822 823 ENDIF 824 825 IF ( TRIM(surfdataqc%cvars(kvar)) == cobsname_sla .AND. PRESENT(kssh) .AND. PRESENT(kmdt) ) THEN 826 ! ... Remove the MDT from the SSH at the observation point to get the SLA 827 surfdataqc%radd(jobs,kssh,kvar) = zext(1) 828 surfdataqc%rmod(jobs,kvar) = surfdataqc%radd(jobs,kssh,kvar) - surfdataqc%rext(jobs,kmdt) 768 829 #if defined key_si3 || defined key_cice 769 ELSE IF ( TRIM(surfdataqc%cvars(kvar)) == cobsname_fbd .AND. PRESENT(kfbd) .AND. PRESENT(ksnow) ) THEN 770 ! Convert radar freeboard to true freeboard 771 ! (add 1/4 snow depth; 1/4 based on ratio of speed of light in vacuum 772 ! compared to snow (3.0e8 vs 2.4e8 m/s)) 773 surfdataqc%radd(jobs,kfbd,kvar) = surfdataqc%robs(jobs,kvar) 774 surfdataqc%robs(jobs,kvar) = surfdataqc%radd(jobs,kfbd,kvar) + 0.25*surfdataqc%rext(jobs,ksnow) 775 ! If the corrected freeboard observation is outside -0.3 to 3.0 m (CPOM) then set the QC flag to bad 776 IF ((surfdataqc%robs(jobs,kvar) < -0.3) .OR. (surfdataqc%robs(jobs,kvar) > 3.0)) THEN 830 ELSE IF ( TRIM(surfdataqc%cvars(kvar)) == cobsname_fbd .AND. PRESENT(kfbd) .AND. PRESENT(ksnow) ) THEN 831 ! Convert radar freeboard to true freeboard 832 ! (add 1/4 snow depth; 1/4 based on ratio of speed of light in vacuum 833 ! compared to snow (3.0e8 vs 2.4e8 m/s)) 834 surfdataqc%radd(jobs,kfbd,kvar) = surfdataqc%robs(jobs,kvar) 835 surfdataqc%robs(jobs,kvar) = surfdataqc%radd(jobs,kfbd,kvar) + 0.25*surfdataqc%rext(jobs,ksnow) 836 ! If the corrected freeboard observation is outside -0.3 to 3.0 m (CPOM) then set the QC flag to bad 837 IF ((surfdataqc%robs(jobs,kvar) < -0.3) .OR. (surfdataqc%robs(jobs,kvar) > 3.0)) THEN 838 surfdataqc%nqc(jobs) = 4 839 ENDIF 840 ! Convert corrected freeboard to ice thickness following Tilling et al. (2016) 841 surfdataqc%robs(jobs,kvar) = (surfdataqc%robs(jobs,kvar)*rhow + surfdataqc%rext(jobs,ksnow)*rhos)/ & 842 & (rhow - rhoi) 843 #endif 844 ELSE 845 surfdataqc%rmod(jobs,kvar) = zext(1) 846 ENDIF 847 848 IF ( zext(1) == obfillflt ) THEN 849 ! If the observation value is a fill value, set QC flag to bad 777 850 surfdataqc%nqc(jobs) = 4 778 ENDIF 779 ! Convert corrected freeboard to ice thickness following Tilling et al. (2016) 780 surfdataqc%robs(jobs,kvar) = (surfdataqc%robs(jobs,kvar)*rhow + surfdataqc%rext(jobs,ksnow)*rhos)/ & 781 & (rhow - rhoi) 782 #endif 783 ELSE 784 surfdataqc%rmod(jobs,kvar) = zext(1) 785 ENDIF 786 787 IF ( zext(1) == obfillflt ) THEN 788 ! If the observation value is a fill value, set QC flag to bad 789 surfdataqc%nqc(jobs) = 4 851 ENDIF 852 790 853 ENDIF 791 854 … … 808 871 & ) 809 872 810 ! At the end of the day also deallocate night-time mean array811 IF ( idayend == 0 .AND. ldnightav) THEN873 ! At the end of the day also deallocate time mean array 874 IF ( ( idayend == 0 .AND. ldnightav ) .OR. ( imeanend == 0 .AND. ldtime_mean ) ) THEN 812 875 DEALLOCATE( & 813 876 & zsurfm & -
NEMO/branches/UKMO/NEMO_4.0.4_generic_obs/src/OCE/OBS/obs_read_surf.F90
r15228 r15240 43 43 SUBROUTINE obs_rea_surf( surfdata, knumfiles, cdfilenames, & 44 44 & kvars, kadd, kextr, kstp, ddobsini, ddobsend, & 45 & ptime_mean_period, ld_time_mean_bkg, & 45 46 & ldignmis, ldmod, ldnightav, cdvars ) 46 47 !!--------------------------------------------------------------------- … … 64 65 !! * Arguments 65 66 TYPE(obs_surf), INTENT(INOUT) :: & 66 & surfdata ! Surface data to be read67 INTEGER, INTENT(IN) :: knumfiles! Number of corio format files to read67 & surfdata ! Surface data to be read 68 INTEGER, INTENT(IN) :: knumfiles ! Number of corio format files to read 68 69 CHARACTER(LEN=128), INTENT(IN) :: & 69 & cdfilenames(knumfiles) ! File names to read in 70 INTEGER, INTENT(IN) :: kvars ! Number of variables in surfdata 71 INTEGER, INTENT(IN) :: kadd ! Number of additional fields 72 ! in addition to those in the input file(s) 73 INTEGER, INTENT(IN) :: kextr ! Number of extra fields 74 ! in addition to those in the input file(s) 75 INTEGER, INTENT(IN) :: kstp ! Ocean time-step index 76 LOGICAL, INTENT(IN) :: ldignmis ! Ignore missing files 77 LOGICAL, INTENT(IN) :: ldmod ! Initialize model from input data 78 LOGICAL, INTENT(IN) :: ldnightav ! Observations represent a night-time average 79 REAL(dp), INTENT(IN) :: ddobsini ! Obs. ini time in YYYYMMDD.HHMMSS 80 REAL(dp), INTENT(IN) :: ddobsend ! Obs. end time in YYYYMMDD.HHMMSS 81 CHARACTER(len=8), DIMENSION(kvars), INTENT(IN) :: cdvars 70 & cdfilenames(knumfiles) ! File names to read in 71 INTEGER, INTENT(IN) :: kvars ! Number of variables in surfdata 72 INTEGER, INTENT(IN) :: kadd ! Number of additional fields 73 ! in addition to those in the input file(s) 74 INTEGER, INTENT(IN) :: kextr ! Number of extra fields 75 ! in addition to those in the input file(s) 76 INTEGER, INTENT(IN) :: kstp ! Ocean time-step index 77 REAL(dp), INTENT(IN) :: ddobsini ! Obs. ini time in YYYYMMDD.HHMMSS 78 REAL(dp), INTENT(IN) :: ddobsend ! Obs. end time in YYYYMMDD.HHMMSS 79 REAL(wp), INTENT(IN) :: ptime_mean_period ! Averaging period in hours 80 LOGICAL, INTENT(IN) :: ld_time_mean_bkg ! Will reset times to end of averaging period 81 LOGICAL, INTENT(IN) :: ldignmis ! Ignore missing files 82 LOGICAL, INTENT(IN) :: ldmod ! Initialize model from input data 83 LOGICAL, INTENT(IN) :: ldnightav ! Observations represent a night-time average 84 CHARACTER(len=8), DIMENSION(kvars), INTENT(IN) :: cdvars ! Expected variable names 82 85 83 86 !! * Local declarations … … 376 379 inpfiles(jj)%iobsj(:,:) = -1 377 380 ENDIF 381 382 ! If observations are representing a time mean then set the time 383 ! of the obs to the end of that meaning period relative to the start of the run 384 IF ( ld_time_mean_bkg ) THEN 385 DO ji = 1, inpfiles(jj)%nobs 386 ! Only do this for obs within time window 387 IF ( ( inpfiles(jj)%ptim(ji) > djulini(jj) ) .AND. & 388 & ( inpfiles(jj)%ptim(ji) <= djulend(jj) ) ) THEN 389 inpfiles(jj)%ptim(ji) = djulini(jj) + (ptime_mean_period/24.0) 390 ENDIF 391 END DO 392 ENDIF 393 378 394 inowin = 0 379 395 DO ji = 1, inpfiles(jj)%nobs
Note: See TracChangeset
for help on using the changeset viewer.