New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 12380 for branches/UKMO/dev_r5518_obs_oper_update_sit/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_surf.F90 – NEMO

Ignore:
Timestamp:
2020-02-13T15:10:57+01:00 (4 years ago)
Author:
dcarneir
Message:

Updating obs_oper with obs_oper version in the apps trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_obs_oper_update_sit/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_surf.F90

    r11932 r12380  
    3939 
    4040   SUBROUTINE obs_rea_surf( surfdata, knumfiles, cdfilenames, & 
    41       &                     kvars, kextr, kstp, ddobsini, ddobsend, & 
    42       &                     ldignmis, ldmod, ldnightav, ldclim, cdvars ) 
     41      &                     kvars, kextr, kstp, ddobsini, ddobsend, MeanPeriodHours, & 
     42      &                     ldignmis, ldmod, ldnightav, ldclim, ln_time_mean_sla_bkg, cdvars ) 
    4343      !!--------------------------------------------------------------------- 
    4444      !! 
     
    7272      LOGICAL, INTENT(IN) :: ldnightav  ! Observations represent a night-time average 
    7373      LOGICAL, INTENT(IN) :: ldclim     ! Will include climatology at obs points. 
     74      LOGICAL, INTENT(IN) :: ln_time_mean_sla_bkg     ! Will reset times to end of averaging period. 
    7475      REAL(dp), INTENT(IN) :: ddobsini   ! Obs. ini time in YYYYMMDD.HHMMSS 
    7576      REAL(dp), INTENT(IN) :: ddobsend   ! Obs. end time in YYYYMMDD.HHMMSS 
     77      REAL(wp), INTENT(IN) :: MeanPeriodHours ! Averaging period in hours 
    7678      CHARACTER(len=8), DIMENSION(kvars), INTENT(IN) :: cdvars 
    7779 
     
    280282               inpfiles(jj)%iobsj = -1 
    281283            ENDIF 
     284 
     285            !If SLA observations are representing a time mean then set the time 
     286            !of the obs to the end of that meaning period relative to the start of the run 
     287            IF ( ln_time_mean_sla_bkg .AND. ( TRIM( clvarsin(1) ) == 'SLA' ) ) THEN 
     288               DO ji = 1, inpfiles(jj)%nobs 
     289                  ! Only do this for obs within time window 
     290                  IF ( ( inpfiles(jj)%ptim(ji) > djulini(jj) ) .AND. & 
     291                     & ( inpfiles(jj)%ptim(ji) <= djulend(jj) ) ) THEN 
     292                     inpfiles(jj)%ptim(ji) = & 
     293                           & djulini(jj) + (MeanPeriodHours/24.) 
     294                  ENDIF       
     295               END DO 
     296            ENDIF    
     297 
    282298            inowin = 0 
    283299            DO ji = 1, inpfiles(jj)%nobs 
Note: See TracChangeset for help on using the changeset viewer.