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_prof.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_prof.F90

    r9306 r11259  
    4646      &                     kvars, kextr, kstp, ddobsini, ddobsend, & 
    4747      &                     ldvar, ldignmis, ldsatt, & 
    48       &                     ldmod, kdailyavtypes ) 
     48      &                     ldmod, cdvars, kdailyavtypes ) 
    4949      !!--------------------------------------------------------------------- 
    5050      !! 
     
    8080      REAL(dp), INTENT(IN) :: ddobsini  ! Obs. ini time in YYYYMMDD.HHMMSS 
    8181      REAL(dp), INTENT(IN) :: ddobsend  ! Obs. end time in YYYYMMDD.HHMMSS 
     82      CHARACTER(len=8), DIMENSION(kvars), INTENT(IN) :: cdvars 
    8283      INTEGER, DIMENSION(imaxavtypes), OPTIONAL :: & 
    8384         & kdailyavtypes                ! Types of daily average observations 
     
    8687      CHARACTER(LEN=15), PARAMETER :: cpname='obs_rea_prof' 
    8788      CHARACTER(len=8) :: clrefdate 
    88       CHARACTER(len=8), DIMENSION(:), ALLOCATABLE :: clvars 
     89      CHARACTER(len=8), DIMENSION(:), ALLOCATABLE :: clvarsin 
    8990      INTEGER :: jvar 
    9091      INTEGER :: ji 
     
    221222 
    222223            IF ( jj == 1 ) THEN 
    223                ALLOCATE( clvars( inpfiles(jj)%nvar ) ) 
     224               ALLOCATE( clvarsin( inpfiles(jj)%nvar ) ) 
    224225               DO ji = 1, inpfiles(jj)%nvar 
    225                  clvars(ji) = inpfiles(jj)%cname(ji) 
     226                 clvarsin(ji) = inpfiles(jj)%cname(ji) 
     227                 IF ( clvarsin(ji) /= cdvars(ji) ) THEN 
     228                    CALL ctl_stop( 'Feedback file variables do not match', & 
     229                        &           ' expected variable names for this type' ) 
     230                 ENDIF 
    226231               END DO 
    227232            ELSE 
    228233               DO ji = 1, inpfiles(jj)%nvar 
    229                   IF ( inpfiles(jj)%cname(ji) /= clvars(ji) ) THEN 
     234                  IF ( inpfiles(jj)%cname(ji) /= clvarsin(ji) ) THEN 
    230235                     CALL ctl_stop( 'Feedback file variables not consistent', & 
    231236                        &           ' with previous files for this type' ) 
     
    506511      profdata%nprof     = 0 
    507512      profdata%nvprot(:) = 0 
    508       profdata%cvars(:)  = clvars(:) 
     513      profdata%cvars(:)  = clvarsin(:) 
    509514      iprof = 0 
    510515 
     
    805810      ! Deallocate temporary data 
    806811      !----------------------------------------------------------------------- 
    807       DEALLOCATE( ifileidx, iprofidx, zdat, clvars ) 
     812      DEALLOCATE( ifileidx, iprofidx, zdat, clvarsin ) 
    808813 
    809814      !----------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.