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 11468 for branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/OBS/obs_surf_def.F90 – NEMO

Ignore:
Timestamp:
2019-08-23T10:37:22+02:00 (5 years ago)
Author:
mattmartin
Message:

Merged changes to allow writing of climatological information to feedback files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_obs_oper_update/NEMOGCM/NEMO/OPA_SRC/OBS/obs_surf_def.F90

    r9308 r11468  
    5252      INTEGER :: nrec       !: Number of surface observation records in window 
    5353 
     54      LOGICAL :: lclim      !: Climatology will be calculated for this structure 
     55       
    5456      ! Arrays with size equal to the number of surface observations 
    5557 
     
    8486      REAL(KIND=wp), POINTER, DIMENSION(:,:) :: & 
    8587         & robs, &        !: Surface observation  
    86          & rmod           !: Model counterpart of the surface observation vector 
    87  
     88         & rmod, &        !: Model counterpart of the surface observation vector 
     89         & rclm           !: Climatological counterpart of the surface observation vector 
     90          
    8891      REAL(KIND=wp), POINTER, DIMENSION(:,:) :: & 
    8992         & rext           !: Extra fields interpolated to observation points 
     
    124127CONTAINS 
    125128    
    126    SUBROUTINE obs_surf_alloc( surf, ksurf, kvar, kextra, kstp, kpi, kpj ) 
     129   SUBROUTINE obs_surf_alloc( surf, ksurf, kvar, kextra, kstp, kpi, kpj, ldclim ) 
    127130      !!---------------------------------------------------------------------- 
    128131      !!                     ***  ROUTINE obs_surf_alloc  *** 
     
    143146      INTEGER, INTENT(IN) :: kpi     ! Number of 3D grid points 
    144147      INTEGER, INTENT(IN) :: kpj 
     148      LOGICAL, INTENT(IN) :: ldclim   
    145149 
    146150      !!* Local variables 
     
    157161      surf%npi      = kpi 
    158162      surf%npj      = kpj 
     163      surf%lclim    = ldclim 
    159164 
    160165      ! Allocate arrays of size number of variables 
     
    197202      ALLOCATE( &  
    198203         & surf%robs(ksurf,kvar), & 
    199          & surf%rmod(ksurf,kvar)  & 
     204         & surf%rmod(ksurf,kvar) & 
    200205         & )    
    201206 
     207      IF (surf%lclim) ALLOCATE( surf%rclm(ksurf,kvar) ) 
     208       
    202209      ! Allocate arrays of number of extra fields at observation points 
    203210 
     
    293300         & ) 
    294301 
     302      IF (surf%lclim) DEALLOCATE( surf%rclm ) 
    295303      ! Deallocate arrays of number of extra fields at observation points 
    296304 
     
    371379      IF ( lallocate ) THEN 
    372380         CALL obs_surf_alloc( newsurf,  insurf, surf%nvar, & 
    373             & surf%nextra, surf%nstp, surf%npi, surf%npj ) 
     381            & surf%nextra, surf%nstp, surf%npi, surf%npj, surf%lclim ) 
    374382      ENDIF 
    375383 
     
    418426               newsurf%robs(insurf,jk)  = surf%robs(ji,jk) 
    419427               newsurf%rmod(insurf,jk)  = surf%rmod(ji,jk) 
     428               IF (newsurf%lclim) newsurf%rclm(insurf,jk) = surf%rclm(ji,jk)  
    420429                
    421430            END DO 
     
    514523            oldsurf%robs(jj,jk)  = surf%robs(ji,jk) 
    515524            oldsurf%rmod(jj,jk)  = surf%rmod(ji,jk) 
     525            IF (surf%lclim) oldsurf%rclm(jj,jk)  = surf%rclm(ji,jk)             
    516526 
    517527         END DO 
Note: See TracChangeset for help on using the changeset viewer.