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

Ignore:
Timestamp:
2018-10-29T11:08:56+01:00 (6 years ago)
Author:
kingr
Message:

Merged dev_r5518_obs_oper_update@10168

File:
1 edited

Legend:

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

    r10246 r10247  
    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 
     74      CHARACTER(len=8), POINTER, DIMENSION(:) :: & 
     75         & cext           !: Extra field names 
     76 
    6977      CHARACTER(LEN=8), POINTER, DIMENSION(:) :: & 
    7078         & cwmo           !: WMO indentifier 
     
    9098         & nsstpmpp       !: Global number of surface observations per time step 
    9199 
     100      ! Arrays with size equal to the number of observation records in the window 
     101      INTEGER, POINTER, DIMENSION(:) :: & 
     102         & mrecstp   ! Time step of the records 
     103 
    92104      ! Arrays used to store source indices when  
    93105      ! compressing obs_surf derived types 
     
    97109      INTEGER, POINTER, DIMENSION(:) :: & 
    98110         & nsind          !: Source indices of surface data in compressed data 
     111 
     112      ! Is this a gridded product? 
     113      
     114      LOGICAL :: lgrid 
    99115 
    100116   END TYPE obs_surf 
     
    130146      !!* Local variables 
    131147      INTEGER :: ji 
     148      INTEGER :: jvar 
    132149 
    133150      ! Set bookkeeping variables 
     
    140157      surf%npi      = kpi 
    141158      surf%npj      = kpj 
     159 
     160      ! Allocate arrays of size number of variables 
     161 
     162      ALLOCATE( & 
     163         & surf%cvars(kvar)    & 
     164         & ) 
     165 
     166      DO jvar = 1, kvar 
     167         surf%cvars(jvar) = "NotSet" 
     168      END DO 
    142169       
    143170      ! Allocate arrays of number of surface data size 
     
    146173         & surf%mi(ksurf),      & 
    147174         & surf%mj(ksurf),      & 
     175         & surf%mt(ksurf),      & 
    148176         & surf%nsidx(ksurf),   & 
    149177         & surf%nsfil(ksurf),   & 
     
    162190         & ) 
    163191 
     192      surf%mt(:) = -1 
     193 
    164194 
    165195      ! Allocate arrays of number of surface data size * number of variables 
     
    173203 
    174204      ALLOCATE( &  
    175          & surf%rext(ksurf,kextra) & 
    176          & ) 
     205         & surf%rext(ksurf,kextra), & 
     206         & surf%cext(kextra)        & 
     207         & ) 
     208 
     209      surf%rext(:,:) = 0.0_wp  
     210 
     211      DO ji = 1, kextra 
     212         surf%cext(ji) = "NotSet" 
     213      END DO 
    177214 
    178215      ! Allocate arrays of number of time step size 
     
    203240 
    204241      surf%nsurfup     = 0 
     242       
     243      ! Not gridded by default 
     244           
     245      surf%lgrid       = .FALSE. 
    205246               
    206247   END SUBROUTINE obs_surf_alloc 
     
    228269         & surf%mi,      & 
    229270         & surf%mj,      & 
     271         & surf%mt,      & 
    230272         & surf%nsidx,   & 
    231273         & surf%nsfil,   & 
     
    254296 
    255297      DEALLOCATE( &  
    256          & surf%rext & 
     298         & surf%rext, & 
     299         & surf%cext & 
    257300         & ) 
    258301 
     
    269312         & surf%nsstp,     & 
    270313         & surf%nsstpmpp   & 
     314         & ) 
     315 
     316      ! Dellocate arrays of size number of variables 
     317 
     318      DEALLOCATE( & 
     319         & surf%cvars     & 
    271320         & ) 
    272321 
     
    350399            newsurf%mi(insurf)    = surf%mi(ji) 
    351400            newsurf%mj(insurf)    = surf%mj(ji) 
     401            newsurf%mt(insurf)    = surf%mt(ji) 
    352402            newsurf%nsidx(insurf) = surf%nsidx(ji) 
    353403            newsurf%nsfil(insurf) = surf%nsfil(ji) 
     
    392442      ! Set book keeping variables which do not depend on number of obs. 
    393443 
    394       newsurf%nstp  = surf%nstp 
     444      newsurf%nstp     = surf%nstp 
     445      newsurf%cvars(:) = surf%cvars(:) 
     446      newsurf%cext(:)  = surf%cext(:) 
     447       
     448      ! Set gridded stuff 
     449       
     450      newsurf%mt(insurf)    = surf%mt(ji) 
    395451  
    396452      ! Deallocate temporary data 
     
    433489         oldsurf%mi(jj)    = surf%mi(ji) 
    434490         oldsurf%mj(jj)    = surf%mj(ji) 
     491         oldsurf%mt(jj)    = surf%mt(ji) 
    435492         oldsurf%nsidx(jj) = surf%nsidx(ji) 
    436493         oldsurf%nsfil(jj) = surf%nsfil(ji) 
Note: See TracChangeset for help on using the changeset viewer.