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 4990 for trunk/NEMOGCM/NEMO/OPA_SRC/OBS – NEMO

Ignore:
Timestamp:
2014-12-15T17:42:49+01:00 (9 years ago)
Author:
timgraham
Message:

Merged branches/2014/dev_MERGE_2014 back onto the trunk as follows:

In the working copy of branch ran:
svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk@HEAD
1 conflict in LIM_SRC_3/limdiahsb.F90
Resolved by keeping the version from dev_MERGE_2014 branch
and commited at r4989

In working copy run:
svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
to switch working copy

Run:
svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2014/dev_MERGE_2014
to merge the branch into the trunk - no conflicts at this stage.

Location:
trunk/NEMOGCM/NEMO/OPA_SRC/OBS
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/OBS/ddatetoymdhms.h90

    r2287 r4990  
    2121 
    2222      !! * Arguments 
    23       REAL(dp), INTENT(IN) :: ddate 
     23      real(wp), INTENT(IN) :: ddate 
    2424      INTEGER, INTENT(OUT) :: kyea 
    2525      INTEGER, INTENT(OUT) :: kmon 
  • trunk/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90

    r4741 r4990  
    208208      !----------------------------------------------------------------------- 
    209209 
    210       !Initalise all values in namelist arrays 
    211210      enactfiles(:) = '' 
    212211      coriofiles(:) = '' 
     
    233232      ln_velfb_av(:) = .FALSE. 
    234233      ln_ignmis = .FALSE. 
     234       
    235235      CALL ini_date( dobsini ) 
    236236      CALL fin_date( dobsend ) 
     
    483483      CALL obs_grid_setup( ) 
    484484      IF ( ( n1dint < 0 ).OR.( n1dint > 1 ) ) THEN 
    485          IF(lwp) WRITE(numout,cform_err) 
    486          IF(lwp) WRITE(numout,*) ' Choice of vertical (1D) interpolation method', & 
    487             &                    ' is not available' 
    488          nstop = nstop + 1 
     485         CALL ctl_stop(' Choice of vertical (1D) interpolation method', & 
     486            &                    ' is not available') 
    489487      ENDIF 
    490488      IF ( ( n2dint < 0 ).OR.( n2dint > 4 ) ) THEN 
    491          IF(lwp) WRITE(numout,cform_err) 
    492          IF(lwp) WRITE(numout,*) ' Choice of horizontal (2D) interpolation method', & 
    493             &                    ' is not available' 
    494          nstop = nstop + 1 
     489         CALL ctl_stop(' Choice of horizontal (2D) interpolation method', & 
     490            &                    ' is not available') 
    495491      ENDIF 
    496492 
  • trunk/NEMOGCM/NEMO/OPA_SRC/OBS/jul2greg.h90

    r2287 r4990  
    1616      !!      ! 06-05  (A. Vidard) Reformatted and refdate       
    1717      !!      ! 06-10  (A. Weaver) Cleanup 
     18      !!      ! 2014-09 (D. Lea) Change to use FLOOR to deal with negative prelday 
    1819      !!----------------------------------------------------------------------- 
    1920 
     
    8283 
    8384      zday = prelday 
    84       ksec = NINT( 86400. * MOD( zday, 1. ) ) 
     85      ksec = FLOOR( 86400. * MOD( zday, 1. ) ) 
    8586 
    8687      IF ( ksec < 0. ) ksec = 86400. + ksec 
  • trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_grid.F90

    r2715 r4990  
    412412         ENDIF 
    413413 
    414          IF (MAXVAL(ixpos(ipx1:ipx,ipy1:ipy)) == -1) CYCLE! cycle if no lookup points found 
     414         IF (.NOT. llfourflag) THEN 
     415            IF (MAXVAL(ixpos(ipx1:ipx,ipy1:ipy)) == -1) CYCLE! cycle if no lookup points found 
     416         ENDIF 
    415417          
    416418         jimin = 0 
     
    996998                        df = ABS( iypos(ji+1,jj) - iypos(ji,jj) ) 
    997999                        tmpy1 = df 
    998                         IF ( df < limxdiff ) numy1 = numy1 + 1 
     1000                        IF ( df < limydiff ) numy1 = numy1 + 1 
    9991001                        IF ( df < histsize ) histy1(df+1) = histy1(df+1) + 1 
    10001002                     ENDIF 
     
    10021004                        df = ABS( iypos(ji,jj+1) - iypos(ji,jj) ) 
    10031005                        tmpy2 = df 
    1004                         IF ( df < limxdiff ) numy2 = numy2+1 
     1006                        IF ( df < limydiff ) numy2 = numy2+1 
    10051007                        IF ( df < histsize ) histy2(df+1) = histy2(df+1)+1 
    10061008                     ENDIF 
  • trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_prof.F90

    r4292 r4990  
    128128         & zphi, & 
    129129         & zlam 
    130       REAL(dp), DIMENSION(:), ALLOCATABLE :: & 
     130      real(wp), DIMENSION(:), ALLOCATABLE :: & 
    131131         & zdat 
    132132      LOGICAL :: llvalprof 
    133133      TYPE(obfbdata), POINTER, DIMENSION(:) :: & 
    134134         & inpfiles 
    135       REAL(dp), DIMENSION(knumfiles) :: & 
     135      real(wp), DIMENSION(knumfiles) :: & 
    136136         & djulini, & 
    137137         & djulend 
     
    143143      INTEGER :: is3dt 
    144144      INTEGER :: ip3dt 
     145      INTEGER :: ios 
     146      INTEGER :: ioserrcount 
    145147      INTEGER, DIMENSION(kvars) :: & 
    146148         & iv3dt 
     
    280282               &           krefdate = irefdate(jj) ) 
    281283 
     284            ioserrcount=0 
    282285            IF ( ldavtimset ) THEN 
    283286               DO ji = 1, inpfiles(jj)%nobs 
     
    287290                  !  to be the  end of the day 
    288291                  ! 
    289                   READ( inpfiles(jj)%cdtyp(ji), '(I4)' ) itype 
     292                  READ( inpfiles(jj)%cdtyp(ji), '(I4)', IOSTAT = ios, ERR = 900 ) itype 
     293900               IF ( ios /= 0 ) THEN 
     294                     itype = 0         ! Set type to zero if there is a problem in the string conversion 
     295                  ENDIF 
    290296                  IF ( ANY (idailyavtypes == itype ) ) THEN 
    291297                     inpfiles(jj)%ptim(ji) = & 
     
    468474      itypsmpp(:) = 0 
    469475       
    470        
     476      ioserrcount = 0       
    471477      DO jk = 1, iproftot 
    472478          
     
    552558                
    553559               ! Instrument type 
    554                READ( inpfiles(jj)%cdtyp(ji), '(I4)' ) itype 
     560               READ( inpfiles(jj)%cdtyp(ji), '(I4)', IOSTAT = ios, ERR = 901 ) itype 
     561901            IF ( ios /= 0 ) THEN 
     562                  IF (ioserrcount == 0) CALL ctl_warn ( 'Problem converting an instrument type to integer. Setting type to zero' ) 
     563                  ioserrcount = ioserrcount + 1 
     564                  itype = 0 
     565               ENDIF 
     566                
    555567               profdata%ntyp(iprof) = itype 
    556568                
  • trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_seaice.F90

    r3651 r4990  
    110110         & zphi, & 
    111111         & zlam 
    112       REAL(dp), DIMENSION(:), ALLOCATABLE :: & 
     112      real(wp), DIMENSION(:), ALLOCATABLE :: & 
    113113         & zdat 
    114114      LOGICAL :: llvalprof 
    115115      TYPE(obfbdata), POINTER, DIMENSION(:) :: & 
    116116         & inpfiles 
    117       REAL(dp), DIMENSION(knumfiles) :: & 
     117      real(wp), DIMENSION(knumfiles) :: & 
    118118         & djulini, & 
    119119         & djulend 
    120120      INTEGER :: iobs 
    121121      INTEGER :: iobstot 
     122      INTEGER :: ios 
     123      INTEGER :: ioserrcount 
    122124      CHARACTER(len=8) :: cl_refdate 
    123125    
     
    335337      ityp   (:) = 0 
    336338      itypmpp(:) = 0 
    337        
     339 
     340      ioserrcount=0       
     341 
    338342      DO jk = 1, iobstot 
    339343          
     
    382386                
    383387               ! Instrument type 
    384                READ( inpfiles(jj)%cdtyp(ji), '(I4)' ) itype 
     388               READ( inpfiles(jj)%cdtyp(ji), '(I4)', IOSTAT = ios, ERR = 901 ) itype 
     389901            IF ( ios /= 0 ) THEN 
     390                  IF (ioserrcount == 0) CALL ctl_warn ( 'Problem converting an instrument type to integer. Setting type to zero' )  
     391                  ioserrcount = ioserrcount + 1 
     392                  itype = 0 
     393               ENDIF 
    385394               seaicedata%ntyp(iobs) = itype 
    386395               IF ( itype < iseaicemaxtype + 1 ) THEN 
  • trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_sla.F90

    r3651 r4990  
    111111         & zphi, & 
    112112         & zlam 
    113       REAL(dp), DIMENSION(:), ALLOCATABLE :: & 
     113      real(wp), DIMENSION(:), ALLOCATABLE :: & 
    114114         & zdat 
    115115      LOGICAL :: llvalprof 
     
    117117      TYPE(obfbdata), POINTER, DIMENSION(:) :: & 
    118118         & inpfiles 
    119       REAL(dp), DIMENSION(knumfiles) :: & 
     119      real(wp), DIMENSION(knumfiles) :: & 
    120120         & djulini, & 
    121121         & djulend 
     
    125125      INTEGER :: iobs 
    126126      INTEGER :: iobstot 
     127      INTEGER :: ios 
     128      INTEGER :: ioserrcount 
    127129      CHARACTER(len=8) :: cl_refdate 
    128130    
     
    391393         &               iindx   ) 
    392394       
    393       CALL obs_surf_alloc( sladata, iobs, kvars, kextr, & 
    394          &                 jpi, jpj, kstp ) 
     395      CALL obs_surf_alloc( sladata, iobs, kvars, kextr, kstp, jpi, jpj ) 
    395396       
    396397      ! * Read obs/positions, QC, all variable and assign to sladata 
     
    400401      ityp   (:) = 0 
    401402      itypmpp(:) = 0 
     403 
     404      ioserrcount = 0 
    402405       
    403406      DO jk = 1, iobstot 
     
    451454                
    452455               ! Instrument type 
    453                READ( inpfiles(jj)%cdtyp(ji), '(I4)' ) itype 
     456               READ( inpfiles(jj)%cdtyp(ji), '(I4)', IOSTAT = ios, ERR = 901 ) itype 
     457901            IF ( ios /= 0 ) THEN 
     458                  IF (ioserrcount == 0) CALL ctl_warn ( 'Problem converting an instrument type to integer. Setting type to zero' )  
     459                  ioserrcount = ioserrcount + 1 
     460                  itype = 0 
     461               ENDIF 
    454462               sladata%ntyp(iobs) = itype 
    455463               ityp(itype+1) = ityp(itype+1) + 1 
  • trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_sst.F90

    r3651 r4990  
    110110         & zphi, & 
    111111         & zlam 
    112       REAL(dp), DIMENSION(:), ALLOCATABLE :: & 
     112      real(wp), DIMENSION(:), ALLOCATABLE :: & 
    113113         & zdat 
    114114      LOGICAL :: llvalprof 
    115115      TYPE(obfbdata), POINTER, DIMENSION(:) :: & 
    116116         & inpfiles 
    117       REAL(dp), DIMENSION(knumfiles) :: & 
     117      real(wp), DIMENSION(knumfiles) :: & 
    118118         & djulini, & 
    119119         & djulend 
    120120      INTEGER :: iobs 
    121121      INTEGER :: iobstot 
     122      INTEGER :: ios 
     123      INTEGER :: ioserrcount 
    122124      CHARACTER(len=8) :: cl_refdate 
    123125    
     
    335337      itypmpp(:) = 0 
    336338       
     339      ioserrcount = 0 
     340       
    337341      DO jk = 1, iobstot 
    338342          
     
    381385                
    382386               ! Instrument type 
    383                READ( inpfiles(jj)%cdtyp(ji), '(I4)' ) itype 
     387               READ( inpfiles(jj)%cdtyp(ji), '(I4)', IOSTAT = ios, ERR = 901 ) itype 
     388901            IF ( ios /= 0 ) THEN 
     389                  IF (ioserrcount == 0) CALL ctl_warn ( 'Problem converting an instrument type to integer. Setting type to zero' )  
     390                  ioserrcount = ioserrcount + 1 
     391                  itype = 0 
     392               ENDIF 
    384393               sstdata%ntyp(iobs) = itype 
    385394               IF ( itype < isstmaxtype + 1 ) THEN 
  • trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_vel.F90

    r4292 r4990  
    118118         & zphi, & 
    119119         & zlam 
    120       REAL(dp), DIMENSION(:), ALLOCATABLE :: & 
     120      real(wp), DIMENSION(:), ALLOCATABLE :: & 
    121121         & zdat 
    122122      LOGICAL :: & 
     
    124124      TYPE(obfbdata), POINTER, DIMENSION(:) :: & 
    125125         & inpfiles 
    126       REAL(dp), DIMENSION(knumfiles) :: & 
     126      real(wp), DIMENSION(knumfiles) :: & 
    127127         & djulini, & 
    128128         & djulend 
     
    130130      INTEGER :: iproftot 
    131131      INTEGER :: iuv3dt 
     132      INTEGER :: ios 
     133      INTEGER :: ioserrcount 
    132134      INTEGER, DIMENSION(kvars) :: iv3dt 
    133135      CHARACTER(len=8) :: cl_refdate 
     
    459461                
    460462               ! Instrument type 
    461                READ( inpfiles(jj)%cdtyp(ji), '(I4)' ) itype 
     463               READ( inpfiles(jj)%cdtyp(ji), '(I4)', IOSTAT = ios, ERR = 901 ) itype 
     464901            IF ( ios /= 0 ) THEN 
     465                  IF (ioserrcount == 0) CALL ctl_warn ( 'Problem converting an instrument type to integer. Setting type to zero' )  
     466                  ioserrcount = ioserrcount + 1 
     467                  itype = 0 
     468               ENDIF 
    462469               profdata%ntyp(iprof) = itype 
    463470                
  • trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_write.F90

    r2287 r4990  
    66 
    77   !!---------------------------------------------------------------------- 
    8    !!   cdf_wri_p3d   : Write profile observation diagnostics in NetCDF format 
     8   !!   obs_wri_p3d   : Write profile observation diagnostics in NetCDF format 
    99   !!   obs_wri_sla   : Write SLA observation related diagnostics 
    1010   !!   obs_wri_sst   : Write SST observation related diagnostics 
    1111   !!   obs_wri_seaice: Write seaice observation related diagnostics 
    12    !!   cdf_wri_vel   : Write velocity observation diagnostics in NetCDF format 
     12   !!   obs_wri_vel   : Write velocity observation diagnostics in NetCDF format 
     13   !!   obs_wri_stats : Print basic statistics on the data being written out 
    1314   !!---------------------------------------------------------------------- 
    1415 
     
    3132   USE obs_sla_types 
    3233   USE obs_rot_vel          ! Rotation of velocities 
     34   USE obs_mpp              ! MPP support routines for observation diagnostics 
     35   USE lib_mpp        ! MPP routines 
    3336 
    3437   IMPLICIT NONE 
     
    256259      ! Write the obfbdata structure 
    257260      CALL write_obfbdata( cfname, fbdata ) 
    258        
     261 
     262      ! Output some basic statistics 
     263      CALL obs_wri_stats( fbdata ) 
     264 
    259265      CALL dealloc_obfbdata( fbdata ) 
    260266      
     
    414420      CALL write_obfbdata( cfname, fbdata ) 
    415421 
     422      ! Output some basic statistics 
     423      CALL obs_wri_stats( fbdata ) 
     424 
    416425      CALL dealloc_obfbdata( fbdata ) 
    417426 
     
    565574      CALL write_obfbdata( cfname, fbdata ) 
    566575 
     576      ! Output some basic statistics 
     577      CALL obs_wri_stats( fbdata ) 
     578 
    567579      CALL dealloc_obfbdata( fbdata ) 
    568580 
     
    715727      CALL write_obfbdata( cfname, fbdata ) 
    716728 
     729      ! Output some basic statistics 
     730      CALL obs_wri_stats( fbdata ) 
     731 
    717732      CALL dealloc_obfbdata( fbdata ) 
    718733 
     
    722737      !!----------------------------------------------------------------------- 
    723738      !! 
    724       !!                     *** ROUTINE obs_wri_p3d  *** 
     739      !!                     *** ROUTINE obs_wri_vel  *** 
    725740      !! 
    726741      !! ** Purpose : Write current (profile) observation  
     
    903918      CALL write_obfbdata( cfname, fbdata ) 
    904919       
     920      ! Output some basic statistics 
     921      CALL obs_wri_stats( fbdata ) 
     922 
    905923      CALL dealloc_obfbdata( fbdata ) 
    906924      
     
    912930   END SUBROUTINE obs_wri_vel 
    913931 
     932   SUBROUTINE obs_wri_stats( fbdata ) 
     933      !!----------------------------------------------------------------------- 
     934      !! 
     935      !!                     *** ROUTINE obs_wri_stats  *** 
     936      !! 
     937      !! ** Purpose : Output some basic statistics of the data being written out 
     938      !! 
     939      !! ** Method  : 
     940      !!  
     941      !! ** Action  : 
     942      !! 
     943      !!      ! 2014-08  (D. Lea) Initial version  
     944      !!----------------------------------------------------------------------- 
     945 
     946      !! * Arguments 
     947      TYPE(obfbdata) :: fbdata 
     948 
     949      !! * Local declarations 
     950      INTEGER :: jvar 
     951      INTEGER :: jo 
     952      INTEGER :: jk 
     953 
     954!      INTEGER :: nlev 
     955!      INTEGER :: nlevmpp 
     956!      INTEGER :: nobsmpp 
     957      INTEGER :: numgoodobs 
     958      INTEGER :: numgoodobsmpp 
     959      REAL(wp) :: zsumx 
     960      REAL(wp) :: zsumx2 
     961      REAL(wp) :: zomb 
     962 
     963      IF (lwp) THEN 
     964         WRITE(numout,*) '' 
     965         WRITE(numout,*) 'obs_wri_stats :' 
     966         WRITE(numout,*) '~~~~~~~~~~~~~~~'  
     967      ENDIF 
     968 
     969      DO jvar = 1, fbdata%nvar 
     970         zsumx=0.0_wp 
     971         zsumx2=0.0_wp 
     972         numgoodobs=0 
     973         DO jo = 1, fbdata%nobs 
     974            DO jk = 1, fbdata%nlev 
     975               IF ( ( fbdata%pob(jk,jo,jvar) < 9999.0 ) .AND. & 
     976                  & ( fbdata%pdep(jk,jo) < 9999.0 ) .AND. & 
     977                  & ( fbdata%padd(jk,jo,1,jvar) < 9999.0 ) ) THEN 
     978        
     979             zomb=fbdata%pob(jk, jo, jvar)-fbdata%padd(jk, jo, 1, jvar) 
     980                  zsumx=zsumx+zomb 
     981                  zsumx2=zsumx2+zomb**2 
     982                  numgoodobs=numgoodobs+1 
     983          ENDIF 
     984            ENDDO 
     985         ENDDO 
     986 
     987         CALL obs_mpp_sum_integer( numgoodobs, numgoodobsmpp ) 
     988         CALL mpp_sum(zsumx) 
     989         CALL mpp_sum(zsumx2) 
     990 
     991         IF (lwp) THEN 
     992       WRITE(numout,*) 'Type: ',fbdata%cname(jvar),'  Total number of good observations: ',numgoodobsmpp  
     993       WRITE(numout,*) 'Overall mean obs minus model of the good observations: ',zsumx/numgoodobsmpp 
     994            WRITE(numout,*) 'Overall RMS obs minus model of the good observations: ',sqrt( zsumx2/numgoodobsmpp ) 
     995       WRITE(numout,*) '' 
     996         ENDIF 
     997  
     998      ENDDO 
     999 
     1000   END SUBROUTINE obs_wri_stats 
     1001 
    9141002END MODULE obs_write 
Note: See TracChangeset for help on using the changeset viewer.