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

Ignore:
Timestamp:
2017-05-02T13:21:57+02:00 (7 years ago)
Author:
jwhile
Message:

This version of the code seems to work correctly after some bug fixes

File:
1 edited

Legend:

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

    r7960 r7992  
    5050      INTEGER :: npj 
    5151      INTEGER :: nsurfup    !: Observation counter used in obs_oper 
     52      INTEGER :: nrec       !: Number of surface observation records in window 
    5253 
    5354      ! Arrays with size equal to the number of surface observations 
     
    5657         & mi,   &        !: i-th grid coord. for interpolating to surface observation 
    5758         & mj,   &        !: j-th grid coord. for interpolating to surface observation 
     59         & mt,   &        !: time record number for gridded data 
    5860         & nsidx,&        !: Surface observation number 
    5961         & nsfil,&        !: Surface observation number in file 
     
    6769         & ntyp           !: Type of surface observation product 
    6870 
     71      CHARACTER(len=8), POINTER, DIMENSION(:) :: & 
     72         & cvars          !: Variable names 
     73 
    6974      CHARACTER(LEN=8), POINTER, DIMENSION(:) :: & 
    7075         & cwmo           !: WMO indentifier 
     
    9095         & nsstpmpp       !: Global number of surface observations per time step 
    9196 
     97      ! Arrays with size equal to the number of observation records in the window 
     98      INTEGER, POINTER, DIMENSION(:) :: & 
     99         & mrecstp   ! Time step of the records 
     100 
    92101      ! Arrays used to store source indices when  
    93102      ! compressing obs_surf derived types 
     
    97106      INTEGER, POINTER, DIMENSION(:) :: & 
    98107         & nsind          !: Source indices of surface data in compressed data 
     108 
     109      ! Is this a gridded product? 
     110      
     111      LOGICAL :: lgrid 
    99112 
    100113   END TYPE obs_surf 
     
    130143      !!* Local variables 
    131144      INTEGER :: ji 
     145      INTEGER :: jvar 
    132146 
    133147      ! Set bookkeeping variables 
     
    140154      surf%npi      = kpi 
    141155      surf%npj      = kpj 
     156 
     157      ! Allocate arrays of size number of variables 
     158 
     159      ALLOCATE( & 
     160         & surf%cvars(kvar)    & 
     161         & ) 
     162 
     163      DO jvar = 1, kvar 
     164         surf%cvars(jvar) = "NotSet" 
     165      END DO 
    142166       
    143167      ! Allocate arrays of number of surface data size 
     
    146170         & surf%mi(ksurf),      & 
    147171         & surf%mj(ksurf),      & 
     172         & surf%mt(ksurf),      & 
    148173         & surf%nsidx(ksurf),   & 
    149174         & surf%nsfil(ksurf),   & 
     
    162187         & ) 
    163188 
     189      surf%mt(:) = -1 
     190 
    164191 
    165192      ! Allocate arrays of number of surface data size * number of variables 
     
    176203         & ) 
    177204 
     205      surf%rext(:,:) = 0.0_wp  
     206 
    178207      ! Allocate arrays of number of time step size 
    179208 
     
    203232 
    204233      surf%nsurfup     = 0 
     234       
     235      ! Not gridded by default 
     236           
     237      surf%lgrid       = .FALSE. 
    205238               
    206239   END SUBROUTINE obs_surf_alloc 
     
    228261         & surf%mi,      & 
    229262         & surf%mj,      & 
     263         & surf%mt,      & 
    230264         & surf%nsidx,   & 
    231265         & surf%nsfil,   & 
     
    269303         & surf%nsstp,     & 
    270304         & surf%nsstpmpp   & 
     305         & ) 
     306 
     307      ! Dellocate arrays of size number of variables 
     308 
     309      DEALLOCATE( & 
     310         & surf%cvars     & 
    271311         & ) 
    272312 
     
    350390            newsurf%mi(insurf)    = surf%mi(ji) 
    351391            newsurf%mj(insurf)    = surf%mj(ji) 
     392            newsurf%mt(insurf)    = surf%mt(ji) 
    352393            newsurf%nsidx(insurf) = surf%nsidx(ji) 
    353394            newsurf%nsfil(insurf) = surf%nsfil(ji) 
     
    392433      ! Set book keeping variables which do not depend on number of obs. 
    393434 
    394       newsurf%nstp  = surf%nstp 
     435      newsurf%nstp     = surf%nstp 
     436      newsurf%cvars(:) = surf%cvars(:) 
     437       
     438      ! Set gridded stuff 
     439       
     440      newsurf%mt(insurf)    = surf%mt(ji) 
    395441  
    396442      ! Deallocate temporary data 
     
    433479         oldsurf%mi(jj)    = surf%mi(ji) 
    434480         oldsurf%mj(jj)    = surf%mj(ji) 
     481         oldsurf%mt(jj)    = surf%mt(ji) 
    435482         oldsurf%nsidx(jj) = surf%nsidx(ji) 
    436483         oldsurf%nsfil(jj) = surf%nsfil(ji) 
Note: See TracChangeset for help on using the changeset viewer.