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

Ignore:
Timestamp:
2019-07-11T18:29:19+02:00 (5 years ago)
Author:
dford
Message:

Check variable names are as expected.

File:
1 edited

Legend:

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

    r11255 r11259  
    4040   SUBROUTINE obs_rea_surf( surfdata, knumfiles, cdfilenames, & 
    4141      &                     kvars, kextr, kstp, ddobsini, ddobsend, & 
    42       &                     ldignmis, ldmod, ldnightav ) 
     42      &                     ldignmis, ldmod, ldnightav, cdvars ) 
    4343      !!--------------------------------------------------------------------- 
    4444      !! 
     
    7373      REAL(dp), INTENT(IN) :: ddobsini   ! Obs. ini time in YYYYMMDD.HHMMSS 
    7474      REAL(dp), INTENT(IN) :: ddobsend   ! Obs. end time in YYYYMMDD.HHMMSS 
     75      CHARACTER(len=8), DIMENSION(kvars), INTENT(IN) :: cdvars 
    7576 
    7677      !! * Local declarations 
    7778      CHARACTER(LEN=11), PARAMETER :: cpname='obs_rea_surf' 
    7879      CHARACTER(len=8) :: clrefdate 
    79       CHARACTER(len=8), DIMENSION(:), ALLOCATABLE :: clvars 
     80      CHARACTER(len=8), DIMENSION(:), ALLOCATABLE :: clvarsin 
    8081      INTEGER :: ji 
    8182      INTEGER :: jj 
     
    192193 
    193194            IF ( jj == 1 ) THEN 
    194                ALLOCATE( clvars( inpfiles(jj)%nvar ) ) 
     195               ALLOCATE( clvarsin( inpfiles(jj)%nvar ) ) 
    195196               DO ji = 1, inpfiles(jj)%nvar 
    196                  clvars(ji) = inpfiles(jj)%cname(ji) 
     197                 clvarsin(ji) = inpfiles(jj)%cname(ji) 
     198                 IF ( clvarsin(ji) /= cdvars(ji) ) THEN 
     199                    CALL ctl_stop( 'Feedback file variables do not match', & 
     200                        &           ' expected variable names for this type' ) 
     201                 ENDIF 
    197202               END DO 
    198203            ELSE 
    199204               DO ji = 1, inpfiles(jj)%nvar 
    200                   IF ( inpfiles(jj)%cname(ji) /= clvars(ji) ) THEN 
     205                  IF ( inpfiles(jj)%cname(ji) /= clvarsin(ji) ) THEN 
    201206                     CALL ctl_stop( 'Feedback file variables not consistent', & 
    202207                        &           ' with previous files for this type' ) 
     
    369374 
    370375      iobs = 0 
    371       surfdata%cvars(:)  = clvars(:) 
     376      surfdata%cvars(:)  = clvarsin(:) 
    372377      IF ( ldmod .AND. ( TRIM( surfdata%cvars(1) ) == 'SLA' ) ) THEN 
    373378         surfdata%cext(1) = 'SSH' 
     
    511516      ! Deallocate temporary data 
    512517      !----------------------------------------------------------------------- 
    513       DEALLOCATE( ifileidx, isurfidx, zdat, clvars ) 
     518      DEALLOCATE( ifileidx, isurfidx, zdat, clvarsin ) 
    514519 
    515520      !----------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.