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 11230 for NEMO/branches/2019/dev_r11117_obsasm_bugfixes/src/OCE/OBS/obs_grid.F90 – NEMO

Ignore:
Timestamp:
2019-07-09T16:48:48+02:00 (5 years ago)
Author:
djlea
Message:

Change namelist_cfg so that the OBS and ASM tests work. Remove some old debugging output from OBS grid search.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11117_obsasm_bugfixes/src/OCE/OBS/obs_grid.F90

    r10068 r11230  
    1111   !!   obs_rlevel_search : Find density level from observed density 
    1212   !!---------------------------------------------------------------------- 
    13    !! * Modules used    
     13   !! * Modules used 
    1414   USE par_kind, ONLY : &          ! Precision variables 
    15       & wp  
     15      & wp 
    1616   USE par_oce, ONLY :  &          ! Ocean parameters 
    1717      & jpk,     & 
     
    3232   USE netcdf 
    3333   USE obs_const, ONLY :      & 
    34       & obfillflt                  ! Fillvalue    
     34      & obfillflt                  ! Fillvalue 
    3535   USE lib_mpp, ONLY :   & 
    3636      & ctl_warn, ctl_stop 
     
    6666   REAL(wp), PRIVATE :: dlon     ! Lon spacing 
    6767   REAL(wp), PRIVATE :: dlat     ! Lat spacing 
    68     
     68 
    6969   INTEGER, PRIVATE :: maxxdiff, maxydiff ! Max diffs between model points 
    7070   INTEGER, PRIVATE :: limxdiff, limydiff 
    71     
     71 
    7272   ! Data storage 
    7373   REAL(wp), PRIVATE, DIMENSION(:,:), ALLOCATABLE :: & 
     
    7777      & ixpos, & 
    7878      & iypos, & 
    79       & iprocn     
     79      & iprocn 
    8080 
    8181   ! Switches 
     
    8383   LOGICAL, PUBLIC :: ln_grid_global         ! Use global distribution of observations 
    8484   CHARACTER(LEN=44), PUBLIC :: & 
    85       & cn_gridsearchfile    ! file name head for grid search lookup  
     85      & cn_gridsearchfile    ! file name head for grid search lookup 
    8686 
    8787   !!---------------------------------------------------------------------- 
     
    102102      !!              obs_grd_bruteforce - the original brute force search 
    103103      !!                     or 
    104       !!              obs_grd_lookup - uses a lookup table to do a fast  
     104      !!              obs_grd_lookup - uses a lookup table to do a fast 
    105105      !!search 
    106106      !!History : 
    107       !!        !  2007-12  (D. Lea)  
     107      !!        !  2007-12  (D. Lea) 
    108108      !!------------------------------------------------------------------------ 
    109109 
     
    112112         & kobsin                     ! Size of the observation arrays 
    113113      REAL(KIND=wp), DIMENSION(kobsin), INTENT(IN) :: & 
    114          & plam, &                  ! Longitude of obsrvations  
     114         & plam, &                  ! Longitude of obsrvations 
    115115         & pphi                     ! Latitude of observations 
    116116      INTEGER, DIMENSION(kobsin), INTENT(OUT) :: & 
    117          & kobsi, &                 ! I-index of observations  
    118          & kobsj, &                 ! J-index of observations  
     117         & kobsi, &                 ! I-index of observations 
     118         & kobsj, &                 ! J-index of observations 
    119119         & kproc                    ! Processor number of observations 
    120120      CHARACTER(LEN=1) :: & 
     
    159159            ENDIF 
    160160         ENDIF 
    161           
     161 
    162162      ENDIF 
    163163 
     
    165165 
    166166#include "obs_grd_bruteforce.h90" 
    167     
     167 
    168168   SUBROUTINE obs_grd_lookup( kobs, plam, pphi, kobsi, kobsj, kproc ) 
    169169      !!---------------------------------------------------------------------- 
     
    177177      !! ** Action  : Return kproc holding the observation and kiobsi,kobsj 
    178178      !!              valid on kproc=nproc processor only. 
    179       !!    
     179      !! 
    180180      !! History : 
    181181      !!        !  2007-12 (D. Lea) new routine based on obs_grid_search 
     
    187187      INTEGER :: kobs                     ! Size of the observation arrays 
    188188      REAL(KIND=wp), DIMENSION(kobs), INTENT(IN) :: & 
    189          & plam, &                  ! Longitude of obsrvations  
     189         & plam, &                  ! Longitude of obsrvations 
    190190         & pphi                     ! Latitude of observations 
    191191      INTEGER, DIMENSION(kobs), INTENT(OUT) :: & 
    192          & kobsi, &                 ! I-index of observations  
    193          & kobsj, &                 ! J-index of observations  
     192         & kobsi, &                 ! I-index of observations 
     193         & kobsj, &                 ! J-index of observations 
    194194         & kproc                    ! Processor number of observations 
    195    
     195 
    196196      !! * Local declarations 
    197197      REAL(KIND=wp), DIMENSION(:), ALLOCATABLE :: & 
     
    301301      !----------------------------------------------------------------------- 
    302302      ! Copy longitudes 
    303       !-----------------------------------------------------------------------  
     303      !----------------------------------------------------------------------- 
    304304      ALLOCATE( & 
    305305         & zplam(kobs) & 
     
    341341         DO ji = 1, jlon-1 
    342342            zlammax = MAXVAL( zlamtm(:,ji,jj) ) 
    343             WHERE (zlammax - zlamtm(:, ji, jj) > 180 ) &  
     343            WHERE (zlammax - zlamtm(:, ji, jj) > 180 ) & 
    344344               & zlamtm(:,ji,jj) = zlamtm(:,ji,jj) + 360._wp 
    345345            zphitmax(ji,jj) = MAXVAL(zphitm(:,ji,jj)) 
     
    369369      ! - For land points kproc is set to number of the processor + 1000000 
    370370      !   and we continue the search. 
    371       ! - For ocean points kproc is set to the number of the processor  
     371      ! - For ocean points kproc is set to the number of the processor 
    372372      !   and we stop the search. 
    373373      !----------------------------------------------------------------------- 
     
    379379      ! Master loop for grid search 
    380380      !------------------------------------------------------------------------ 
    381           
     381 
    382382      gpkobs: DO jo = 1+joffset, kobs, jostride 
    383383         ! Normal case 
     
    390390 
    391391         ! bottom corner point 
    392          ipx1 = INT( ( zplam(jo)  - lonmin ) / dlon + 1.0 )  
    393          ipy1 = INT( ( pphi (jo)  - latmin ) / dlat + 1.0 )   
    394           
     392         ipx1 = INT( ( zplam(jo)  - lonmin ) / dlon + 1.0 ) 
     393         ipy1 = INT( ( pphi (jo)  - latmin ) / dlat + 1.0 ) 
     394 
    395395         ipx = ipx1 + 1 
    396396         ipy = ipy1 + 1 
     
    399399         ! default to false 
    400400         llfourflag = .FALSE. 
    401           
     401 
    402402         ! check for point fully outside of region 
    403403         IF ( (ipx1 > nlons) .OR. (ipy1 > nlats) .OR. & 
     
    415415            IF (MAXVAL(ixpos(ipx1:ipx,ipy1:ipy)) == -1) CYCLE! cycle if no lookup points found 
    416416         ENDIF 
    417           
     417 
    418418         jimin = 0 
    419419         jimax = 0 
    420420         jjmin = 0 
    421421         jjmax = 0 
    422           
    423          IF (.NOT. llfourflag) THEN  
     422 
     423         IF (.NOT. llfourflag) THEN 
    424424 
    425425            ! calculate points range 
     
    436436            jjmin = jojjmin - 1 
    437437            jjmax = jojjmax + 1 
    438              
    439             IF ( jojimin < 0 .OR. jojjmin < 0) THEN  
     438 
     439            IF ( jojimin < 0 .OR. jojjmin < 0) THEN 
    440440               llfourflag = .TRUE. 
    441441               ifourflagcountr(2) = ifourflagcountr(2) + 1 
     
    449449               ifourflagcountr(4) = ifourflagcountr(4) + 1 
    450450            ENDIF 
    451              
     451 
    452452         ENDIF 
    453453 
     
    455455         IF (llfourflag) ipmx = 1 
    456456 
    457          IF (llfourflag) THEN  
     457         IF (llfourflag) THEN 
    458458            ifourflagcountt = ifourflagcountt + 1 
    459459         ELSE 
     
    463463         gridpointsn : DO ip = 0, ipmx 
    464464            DO jp = 0, ipmx 
    465                 
     465 
    466466               IF ( kproc(jo) /= -1 ) EXIT gridpointsn 
    467          
     467 
    468468               ipx = ipx1 + ip 
    469469               ipy = ipy1 + jp 
    470                 
     470 
    471471               IF (llfourflag) THEN 
    472472 
     
    477477                  IF ( ipy < 1     ) ipy = nlats 
    478478 
    479                   ! get i,j  
     479                  ! get i,j 
    480480                  isx = ixpos(ipx,ipy) 
    481481                  isy = iypos(ipx,ipy) 
    482                    
     482 
    483483                  ! estimate appropriate search region (use max/min values) 
    484484                  jimin = isx - maxxdiff - 1 
     
    493493               IF ( jjmin < 1      ) jjmin = 1 
    494494               IF ( jjmax > jlat-1 ) jjmax = jlat-1 
    495                 
     495 
    496496               !--------------------------------------------------------------- 
    497                ! Ensure that all observation longtiudes are between 0 and 360  
     497               ! Ensure that all observation longtiudes are between 0 and 360 
    498498               !--------------------------------------------------------------- 
    499499 
    500500               IF ( zplam(jo) <   0.0_wp ) zplam(jo) = zplam(jo) + 360.0_wp 
    501501               IF ( zplam(jo) > 360.0_wp ) zplam(jo) = zplam(jo) - 360.0_wp 
    502        
     502 
    503503               !--------------------------------------------------------------- 
    504504               ! Find observations which are on within 1e-6 of a grid point 
     
    535535 
    536536               IF ( kproc(jo) == -1 ) THEN 
    537                    
    538                   ! Normal case  
     537 
     538                  ! Normal case 
    539539                  gridpoints : DO jj = jjmin, jjmax 
    540540                     DO ji = jimin, jimax 
     
    543543                        IF ( ( zplam(jo) > zlamtmax(ji,jj) ) .OR. & 
    544544                           & ( zplam(jo) < zlamtmin(ji,jj) ) ) CYCLE 
    545                          
     545 
    546546                        IF ( ABS( pphi(jo) ) < 85 ) THEN 
    547547                           IF ( ( pphi(jo) > zphitmax(ji,jj) ) .OR. & 
    548548                              & ( pphi(jo) < zphitmin(ji,jj) ) ) CYCLE 
    549549                        ENDIF 
    550                          
     550 
    551551                        IF ( linquad( zplam(jo), pphi(jo), & 
    552552                           &          zlamtm(:,ji,jj), zphitm(:,ji,jj) ) ) THEN 
     
    563563                           ENDIF 
    564564                        ENDIF 
    565                          
     565 
    566566                     END DO 
    567567                  END DO gridpoints 
     
    572572                  gridpoints_greenwich : DO jj = jjmin, jjmax 
    573573                     DO ji = jimin, jimax 
    574                          
     574 
    575575                        IF ( ( zplam(jo)+360.0_wp > zlamtmax(ji,jj) ) .OR. & 
    576576                           & ( zplam(jo)+360.0_wp < zlamtmin(ji,jj) ) ) CYCLE 
     
    595595                           ENDIF 
    596596                        ENDIF 
    597                          
     597 
    598598                     END DO 
    599599                  END DO gridpoints_greenwich 
    600                    
     600 
    601601               ENDIF   ! kproc 
    602                 
     602 
    603603            END DO 
    604604         END DO gridpointsn 
     
    633633         & zplam          & 
    634634         & ) 
    635        
     635 
    636636   END SUBROUTINE obs_grd_lookup 
    637637 
     
    643643      !! ** Purpose : Setup a lookup table to reduce the searching required 
    644644      !!              for converting lat lons to grid point location 
    645       !!              produces or reads in a preexisting file for use in  
     645      !!              produces or reads in a preexisting file for use in 
    646646      !!              obs_grid_search_lookup_local 
    647647      !! 
    648       !! ** Method : calls obs_grid_search_bruteforce_local with a array  
     648      !! ** Method : calls obs_grid_search_bruteforce_local with a array 
    649649      !!             of lats and lons 
    650650      !! 
     
    652652      !!        !  2007-12 (D. Lea) new routine 
    653653      !!---------------------------------------------------------------------- 
    654        
     654 
    655655      !! * Local declarations 
    656656      CHARACTER(LEN=15), PARAMETER :: & 
    657657         & cpname = 'obs_grid_setup' 
    658       CHARACTER(LEN=40) :: cfname       
     658      CHARACTER(LEN=40) :: cfname 
    659659      INTEGER :: ji 
    660660      INTEGER :: jj 
     
    674674         & lonsi,     & 
    675675         & latsi 
    676       INTEGER, DIMENSION(:,:), ALLOCATABLE :: &   
     676      INTEGER, DIMENSION(:,:), ALLOCATABLE :: & 
    677677         & ixposi,    & 
    678          & iyposi,    &  
    679          & iproci     
     678         & iyposi,    & 
     679         & iproci 
    680680      INTEGER, PARAMETER :: histsize=90 
    681681      INTEGER, DIMENSION(histsize) :: & 
     
    684684         & fhistx1, fhistx2, fhisty1, fhisty2 
    685685      REAL(wp) :: histtol 
    686        
     686 
    687687      IF (ln_grid_search_lookup) THEN 
    688           
     688 
    689689         WRITE(numout,*) 'Calling obs_grid_setup' 
    690           
     690 
    691691         IF(lwp) WRITE(numout,*) 
    692692         IF(lwp) WRITE(numout,*)'Grid search resolution : ', rn_gridsearchres 
    693           
    694          gsearch_nlons_def  = NINT( 360.0_wp / rn_gridsearchres )  
     693 
     694         gsearch_nlons_def  = NINT( 360.0_wp / rn_gridsearchres ) 
    695695         gsearch_nlats_def  = NINT( 180.0_wp / rn_gridsearchres ) 
    696696         gsearch_lonmin_def = -180.0_wp + 0.5_wp * rn_gridsearchres 
     
    698698         gsearch_dlon_def   = rn_gridsearchres 
    699699         gsearch_dlat_def   = rn_gridsearchres 
    700           
     700 
    701701         IF (lwp) THEN 
    702702            WRITE(numout,*)'Grid search gsearch_nlons_def  = ',gsearch_nlons_def 
     
    718718         fileexist=nf90_open( TRIM( cfname ), nf90_nowrite, & 
    719719            &                  idfile ) 
    720           
     720 
    721721         IF ( fileexist == nf90_noerr ) THEN 
    722              
     722 
    723723            ! read data 
    724724            ! initially assume size is as defined (to be fixed) 
    725              
     725 
    726726            WRITE(numout,*) 'Reading: ',cfname 
    727              
     727 
    728728            CALL chkerr( nf90_open( TRIM( cfname ), nf90_nowrite, idfile ), & 
    729729               &         cpname, __LINE__ ) 
    730730            CALL chkerr( nf90_get_att( idfile, nf90_global, 'maxxdiff', maxxdiff ), & 
    731                &         cpname, __LINE__ )         
     731               &         cpname, __LINE__ ) 
    732732            CALL chkerr( nf90_get_att( idfile, nf90_global, 'maxydiff', maxydiff ), & 
    733                &         cpname, __LINE__ )         
     733               &         cpname, __LINE__ ) 
    734734            CALL chkerr( nf90_get_att( idfile, nf90_global, 'dlon', dlon ), & 
    735             &         cpname, __LINE__ )         
     735            &         cpname, __LINE__ ) 
    736736            CALL chkerr( nf90_get_att( idfile, nf90_global, 'dlat', dlat ), & 
    737                &         cpname, __LINE__ )         
     737               &         cpname, __LINE__ ) 
    738738            CALL chkerr( nf90_get_att( idfile, nf90_global, 'lonmin', lonmin ), & 
    739                &         cpname, __LINE__ )         
     739               &         cpname, __LINE__ ) 
    740740            CALL chkerr( nf90_get_att( idfile, nf90_global, 'latmin', latmin ), & 
    741                &         cpname, __LINE__ )         
    742              
     741               &         cpname, __LINE__ ) 
     742 
    743743            CALL chkerr( nf90_inq_dimid(idfile, 'nx'  , idnx), & 
    744744               &         cpname, __LINE__ ) 
    745745            CALL chkerr( nf90_inquire_dimension( idfile, idnx, len = nlons ),     & 
    746                &         cpname, __LINE__ )  
     746               &         cpname, __LINE__ ) 
    747747            CALL chkerr( nf90_inq_dimid(idfile, 'ny'  , idny), & 
    748748               &         cpname, __LINE__ ) 
    749749            CALL chkerr( nf90_inquire_dimension( idfile, idny, len = nlats ),     & 
    750                &         cpname, __LINE__ )  
    751              
     750               &         cpname, __LINE__ ) 
     751 
    752752            ALLOCATE( & 
    753753               & lons(nlons,nlats),  & 
     
    757757               & iprocn(nlons,nlats)  & 
    758758               & ) 
    759              
    760             CALL chkerr( nf90_inq_varid( idfile, 'XPOS', idxpos ), &  
     759 
     760            CALL chkerr( nf90_inq_varid( idfile, 'XPOS', idxpos ), & 
    761761               &         cpname, __LINE__ ) 
    762762            CALL chkerr( nf90_get_var  ( idfile, idxpos, ixpos),   & 
    763763               &         cpname, __LINE__ ) 
    764             CALL chkerr( nf90_inq_varid( idfile, 'YPOS', idypos ), &  
     764            CALL chkerr( nf90_inq_varid( idfile, 'YPOS', idypos ), & 
    765765               &         cpname, __LINE__ ) 
    766766            CALL chkerr( nf90_get_var  ( idfile, idypos, iypos),   & 
    767767               &         cpname, __LINE__ ) 
    768              
     768 
    769769            CALL chkerr( nf90_close( idfile ), cpname, __LINE__ ) 
    770              
     770 
    771771            ! setup arrays 
    772              
     772 
    773773            DO ji = 1, nlons 
    774774               DO jj = 1, nlats 
     
    777777               END DO 
    778778            END DO 
    779              
     779 
    780780            ! if we are not reading the file we need to create it 
    781781            ! create new obs grid search lookup file 
    782              
    783          ELSE  
    784              
     782 
     783         ELSE 
     784 
    785785            ! call obs_grid_search 
    786              
     786 
    787787            IF (lwp) THEN 
    788788               WRITE(numout,*) 'creating: ',cfname 
     
    797797            dlon   = gsearch_dlon_def 
    798798            dlat   = gsearch_dlat_def 
    799              
     799 
    800800            ! setup arrays 
    801              
     801 
    802802            ALLOCATE( & 
    803803               & lonsi(nlons,nlats),   & 
     
    807807               & iproci(nlons,nlats)   & 
    808808               & ) 
    809           
     809 
    810810            DO ji = 1, nlons 
    811811               DO jj = 1, nlats 
     
    814814               END DO 
    815815            END DO 
    816              
     816 
    817817            CALL obs_grd_bruteforce( jpi, jpj, jpiglo, jpjglo,  & 
    818818               &                     1, nlci, 1, nlcj,          & 
     
    821821               &                     nlons*nlats, lonsi, latsi, & 
    822822               &                     ixposi, iyposi, iproci ) 
    823              
     823 
    824824            ! minimise file size by removing regions with no data from xypos file 
    825825            ! should be able to just use xpos (ypos will have the same areas of missing data) 
    826           
     826 
    827827            jimin=1 
    828828            jimax=nlons 
     
    852852 
    853853            maxlat_xpos: DO jj= nlats, 1, -1 
    854                IF (COUNT(ixposi(:,jj) >= 0) > 0) THEN  
     854               IF (COUNT(ixposi(:,jj) >= 0) > 0) THEN 
    855855                  jjmax=jj 
    856856                  EXIT maxlat_xpos 
     
    890890            tmpx2 = 0 
    891891            tmpy1 = 0 
    892             tmpy2 = 0  
     892            tmpy2 = 0 
    893893 
    894894            numx1 = 0 
     
    933933            END DO 
    934934 
    935             IF (lwp) THEN 
    936                WRITE(numout,*) 'histograms' 
    937                WRITE(numout,*) '0   1   2   3   4   5   6   7   8   9   10 ...' 
    938                WRITE(numout,*) 'histx1' 
    939                WRITE(numout,*) histx1 
    940                WRITE(numout,*) 'histx2' 
    941                WRITE(numout,*) histx2 
    942                WRITE(numout,*) 'histy1' 
    943                WRITE(numout,*) histy1 
    944                WRITE(numout,*) 'histy2' 
    945                WRITE(numout,*) histy2 
    946             ENDIF 
    947  
    948935            meanxdiff1 = tmpx1 / numx1 
    949936            meanydiff1 = tmpy1 / numy1 
     
    953940            meanxdiff = MAXVAL((/ meanxdiff1, meanxdiff2 /)) 
    954941            meanydiff = MAXVAL((/ meanydiff1, meanydiff2 /)) 
    955  
    956             IF (lwp) THEN 
    957                WRITE(numout,*) tmpx1, tmpx2, tmpy1, tmpy2 
    958                WRITE(numout,*) numx1, numx2, numy1, numy2 
    959                WRITE(numout,*) 'meanxdiff: ',meanxdiff, meanxdiff1, meanxdiff2 
    960                WRITE(numout,*) 'meanydiff: ',meanydiff, meanydiff1, meanydiff2 
    961             ENDIF 
    962942 
    963943            tmpx1 = 0 
     
    10351015            fhisty2(:) = histy2(:) * 1.0 / numy2 
    10361016 
    1037             ! output new histograms 
    1038  
    1039             IF (lwp) THEN 
    1040                WRITE(numout,*) 'cumulative histograms' 
    1041                WRITE(numout,*) '0   1   2   3   4   5   6   7   8   9   10 ...' 
    1042                WRITE(numout,*) 'fhistx1' 
    1043                WRITE(numout,*) fhistx1 
    1044                WRITE(numout,*) 'fhistx2' 
    1045                WRITE(numout,*) fhistx2 
    1046                WRITE(numout,*) 'fhisty1' 
    1047                WRITE(numout,*) fhisty1 
    1048                WRITE(numout,*) 'fhisty2' 
    1049                WRITE(numout,*) fhisty2 
    1050             ENDIF 
    1051  
    10521017            ! calculate maxxdiff and maxydiff based on cumulative histograms 
    10531018            ! where > 0.999 of points are 
    10541019 
    1055             ! maxval just converts 1x1 vector return from maxloc to a scalar  
     1020            ! maxval just converts 1x1 vector return from maxloc to a scalar 
    10561021 
    10571022            histtol = 0.999 
     
    10731038               CALL chkerr( nf90_put_att( idfile, nf90_global, 'title',       & 
    10741039                  &         'Mapping file from lon/lat to model grid point' ),& 
    1075                   &         cpname,__LINE__ )  
     1040                  &         cpname,__LINE__ ) 
    10761041               CALL chkerr( nf90_put_att( idfile, nf90_global, 'maxxdiff',    & 
    10771042                  &                       maxxdiff ),                         & 
    1078                   &         cpname,__LINE__ )  
     1043                  &         cpname,__LINE__ ) 
    10791044               CALL chkerr( nf90_put_att( idfile, nf90_global, 'maxydiff',    & 
    10801045                  &                       maxydiff ),                         & 
    1081                   &         cpname,__LINE__ )  
     1046                  &         cpname,__LINE__ ) 
    10821047               CALL chkerr( nf90_put_att( idfile, nf90_global, 'dlon', dlon ),& 
    1083                   &         cpname,__LINE__ )  
     1048                  &         cpname,__LINE__ ) 
    10841049               CALL chkerr( nf90_put_att( idfile, nf90_global, 'dlat', dlat ),& 
    1085                   &         cpname,__LINE__ )  
     1050                  &         cpname,__LINE__ ) 
    10861051               CALL chkerr( nf90_put_att( idfile, nf90_global, 'lonmin',      & 
    10871052                  &                       lonmin ),                           & 
    1088                   &         cpname,__LINE__ )  
     1053                  &         cpname,__LINE__ ) 
    10891054               CALL chkerr( nf90_put_att( idfile, nf90_global, 'latmin',      & 
    10901055                  &                       latmin ),                           & 
    1091                   &         cpname,__LINE__ )  
     1056                  &         cpname,__LINE__ ) 
    10921057 
    10931058               CALL chkerr( nf90_def_dim(idfile, 'nx'  , nlons, idnx),        & 
     
    10981063               incdim(1) = idnx 
    10991064               incdim(2) = idny 
    1100                 
     1065 
    11011066               CALL chkerr( nf90_def_var( idfile, 'LON', nf90_float, incdim,  & 
    11021067                  &                       idlon ),                            & 
     
    11051070                  &                       'longitude' ),                      & 
    11061071                  &         cpname, __LINE__ ) 
    1107                 
     1072 
    11081073               CALL chkerr( nf90_def_var( idfile, 'LAT', nf90_float, incdim,  & 
    11091074                  &                       idlat ),                            & 
     
    11321097 
    11331098               CALL chkerr( nf90_enddef( idfile ), cpname, __LINE__ ) 
    1134                 
     1099 
    11351100               CALL chkerr( nf90_put_var( idfile, idlon, lons),               & 
    11361101                  &         cpname, __LINE__ ) 
     
    11411106               CALL chkerr( nf90_put_var( idfile, idypos, iypos),             & 
    11421107                  &         cpname, __LINE__ ) 
    1143                 
     1108 
    11441109               CALL chkerr( nf90_close( idfile ), cpname, __LINE__ ) 
    1145                 
    1146                ! should also output max i, max j spacing for use in  
     1110 
     1111               ! should also output max i, max j spacing for use in 
    11471112               ! obs_grid_search_lookup 
    1148                 
     1113 
    11491114            ENDIF 
    11501115 
     
    11541119 
    11551120   END SUBROUTINE obs_grid_setup 
    1156     
     1121 
    11571122   SUBROUTINE obs_grid_deallocate( ) 
    11581123      !!---------------------------------------------------------------------- 
     
    11681133         DEALLOCATE( lons, lats, ixpos, iypos, iprocn ) 
    11691134      ENDIF 
    1170        
     1135 
    11711136   END SUBROUTINE obs_grid_deallocate 
    11721137 
     
    11801145 
    11811146END MODULE obs_grid 
    1182  
Note: See TracChangeset for help on using the changeset viewer.