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 11863 for branches/UKMO/dev_r5518_obs_oper_update_SlaAssim/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_surf.F90 – NEMO

Ignore:
Timestamp:
2019-11-05T18:22:07+01:00 (4 years ago)
Author:
kingr
Message:

Merged recent changes to dev_r5518_obs_oper_update

File:
1 edited

Legend:

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

    r11468 r11863  
    4040   SUBROUTINE obs_rea_surf( surfdata, knumfiles, cdfilenames, & 
    4141      &                     kvars, kextr, kstp, ddobsini, ddobsend, & 
    42       &                     ldignmis, ldmod, ldnightav, ldclim ) 
     42      &                     ldignmis, ldmod, ldnightav, ldclim, cdvars ) 
    4343      !!--------------------------------------------------------------------- 
    4444      !! 
     
    7474      REAL(dp), INTENT(IN) :: ddobsini   ! Obs. ini time in YYYYMMDD.HHMMSS 
    7575      REAL(dp), INTENT(IN) :: ddobsend   ! Obs. end time in YYYYMMDD.HHMMSS 
     76      CHARACTER(len=8), DIMENSION(kvars), INTENT(IN) :: cdvars 
    7677 
    7778      !! * Local declarations 
    7879      CHARACTER(LEN=11), PARAMETER :: cpname='obs_rea_surf' 
    7980      CHARACTER(len=8) :: clrefdate 
    80       CHARACTER(len=8), DIMENSION(:), ALLOCATABLE :: clvars 
     81      CHARACTER(len=8), DIMENSION(:), ALLOCATABLE :: clvarsin 
    8182      INTEGER :: ji 
    8283      INTEGER :: jj 
     
    182183               &                ldgrid = .TRUE. ) 
    183184 
     185            IF ( inpfiles(jj)%nvar /= kvars ) THEN 
     186               CALL ctl_stop( 'Feedback format error: ', & 
     187                  &           ' unexpected number of vars in feedback file' ) 
     188            ENDIF 
     189 
    184190            IF ( ldmod .AND. ( inpfiles(jj)%nadd == 0 ) ) THEN 
    185191               CALL ctl_stop( 'Model not in input data' ) 
     
    188194 
    189195            IF ( jj == 1 ) THEN 
    190                ALLOCATE( clvars( inpfiles(jj)%nvar ) ) 
     196               ALLOCATE( clvarsin( inpfiles(jj)%nvar ) ) 
    191197               DO ji = 1, inpfiles(jj)%nvar 
    192                  clvars(ji) = inpfiles(jj)%cname(ji) 
     198                 clvarsin(ji) = inpfiles(jj)%cname(ji) 
     199                 IF ( clvarsin(ji) /= cdvars(ji) ) THEN 
     200                    CALL ctl_stop( 'Feedback file variables do not match', & 
     201                        &           ' expected variable names for this type' ) 
     202                 ENDIF 
    193203               END DO 
    194204            ELSE 
    195205               DO ji = 1, inpfiles(jj)%nvar 
    196                   IF ( inpfiles(jj)%cname(ji) /= clvars(ji) ) THEN 
     206                  IF ( inpfiles(jj)%cname(ji) /= clvarsin(ji) ) THEN 
    197207                     CALL ctl_stop( 'Feedback file variables not consistent', & 
    198208                        &           ' with previous files for this type' ) 
     
    365375 
    366376      iobs = 0 
    367       surfdata%cvars(:)  = clvars(:) 
     377      surfdata%cvars(:)  = clvarsin(:) 
    368378      IF ( ldmod .AND. ( TRIM( surfdata%cvars(1) ) == 'SLA' ) ) THEN 
    369379         surfdata%cext(1) = 'SSH' 
     
    510520      ! Deallocate temporary data 
    511521      !----------------------------------------------------------------------- 
    512       DEALLOCATE( ifileidx, isurfidx, zdat, clvars ) 
     522      DEALLOCATE( ifileidx, isurfidx, zdat, clvarsin ) 
    513523 
    514524      !----------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.