ECC-129 fixed

This commit is contained in:
Enrico Fucile 2015-05-28 09:56:33 +01:00
parent 75ffdc4581
commit b5709af577
4 changed files with 4060 additions and 11 deletions

View File

@ -24,8 +24,9 @@ integer :: ifile
integer :: iret integer :: iret
integer :: ibufr integer :: ibufr
integer :: i, count=0 integer :: i, count=0
integer(kind=4) :: numObs integer(kind=4) :: numObs,ii
real(kind=8), dimension(:), allocatable :: latVal,lonVal,bscatterVal real(kind=8), dimension(:), allocatable :: latVal,lonVal,bscatterVal
real(kind=8), dimension(:), allocatable :: year
call codes_open_file(ifile,'../../data/bufr/asca_139.bufr','r') call codes_open_file(ifile,'../../data/bufr/asca_139.bufr','r')
@ -59,6 +60,12 @@ real(kind=8), dimension(:), allocatable :: latVal,lonVal,bscatterVal
!Get longitude (for all the subsets) !Get longitude (for all the subsets)
call codes_get(ibufr,'latitude',lonVal); call codes_get(ibufr,'latitude',lonVal);
allocate(year(numObs))
call codes_get(ibufr,'year',year);
do ii= 1, size(year)
write(*,*) 'year(',ii,')=',year(ii)
enddo
!Get backScatter for beam two. We use an access by condition for this key. !Get backScatter for beam two. We use an access by condition for this key.
!(for all the subsets) !(for all the subsets)
call codes_get(ibufr,'/beamIdentifier=2/backscatter',bscatterVal); call codes_get(ibufr,'/beamIdentifier=2/backscatter',bscatterVal);

File diff suppressed because it is too large Load Diff

View File

@ -832,7 +832,7 @@ end subroutine codes_get_string
subroutine codes_get_int_array ( gribid, key, value, status ) subroutine codes_get_int_array ( gribid, key, value, status )
integer(kind=kindOfInt), intent(in) :: gribid integer(kind=kindOfInt), intent(in) :: gribid
character(len=*), intent(in) :: key character(len=*), intent(in) :: key
integer(kind=kindOfInt), dimension(:),allocatable,intent(out) :: value integer(kind=kindOfInt), dimension(:),allocatable,intent(inout) :: value
integer(kind=kindOfInt),optional, intent(out) :: status integer(kind=kindOfInt),optional, intent(out) :: status
integer(kind=kindOfInt) :: iret integer(kind=kindOfInt) :: iret
integer(kind=kindOfInt) :: nb_values integer(kind=kindOfInt) :: nb_values
@ -844,7 +844,7 @@ end subroutine codes_get_int_array
subroutine codes_get_long_array ( gribid, key, value, status ) subroutine codes_get_long_array ( gribid, key, value, status )
integer(kind=kindOfInt), intent(in) :: gribid integer(kind=kindOfInt), intent(in) :: gribid
character(len=*), intent(in) :: key character(len=*), intent(in) :: key
integer(kind=kindOfLong), dimension(:),allocatable,intent(out) :: value integer(kind=kindOfLong), dimension(:),allocatable,intent(inout) :: value
integer(kind=kindOfInt),optional, intent(out) :: status integer(kind=kindOfInt),optional, intent(out) :: status
integer(kind=kindOfInt) :: iret integer(kind=kindOfInt) :: iret
integer(kind=kindOfInt) :: nb_values integer(kind=kindOfInt) :: nb_values
@ -856,7 +856,7 @@ end subroutine codes_get_long_array
subroutine codes_get_byte_array ( gribid, key, value, length, status ) subroutine codes_get_byte_array ( gribid, key, value, length, status )
integer(kind=kindOfInt), intent(in) :: gribid integer(kind=kindOfInt), intent(in) :: gribid
character(len=*), intent(in) :: key character(len=*), intent(in) :: key
character(len=1), dimension(:), intent(out) :: value character(len=1), dimension(:), intent(inout) :: value
integer(kind=kindOfInt), optional, intent(out) :: length integer(kind=kindOfInt), optional, intent(out) :: length
integer(kind=kindOfInt), optional, intent(out) :: status integer(kind=kindOfInt), optional, intent(out) :: status
integer(kind=kindOfInt) :: iret integer(kind=kindOfInt) :: iret
@ -870,7 +870,7 @@ end subroutine codes_get_byte_array
subroutine codes_get_real4_array ( gribid, key, value, status) subroutine codes_get_real4_array ( gribid, key, value, status)
integer(kind=kindOfInt), intent(in) :: gribid integer(kind=kindOfInt), intent(in) :: gribid
character(len=*), intent(in) :: key character(len=*), intent(in) :: key
real(kind = kindOfFloat), dimension(:),allocatable, intent(out) :: value real(kind = kindOfFloat), dimension(:),allocatable, intent(inout) :: value
integer(kind=kindOfInt),optional, intent(out) :: status integer(kind=kindOfInt),optional, intent(out) :: status
integer(kind=kindOfInt) :: iret integer(kind=kindOfInt) :: iret
integer(kind=kindOfInt) :: nb_values integer(kind=kindOfInt) :: nb_values
@ -882,7 +882,7 @@ end subroutine codes_get_real4_array
subroutine codes_get_real8_array ( gribid, key, value, status ) subroutine codes_get_real8_array ( gribid, key, value, status )
integer(kind=kindOfInt), intent(in) :: gribid integer(kind=kindOfInt), intent(in) :: gribid
character(len=*), intent(in) :: key character(len=*), intent(in) :: key
real(kind = kindOfDouble), dimension(:),allocatable, intent(out) :: value real(kind = kindOfDouble), dimension(:),allocatable, intent(inout) :: value
integer(kind=kindOfInt),optional, intent(out) :: status integer(kind=kindOfInt),optional, intent(out) :: status
integer(kind=kindOfInt) :: iret integer(kind=kindOfInt) :: iret
integer(kind=kindOfInt) :: nb_values integer(kind=kindOfInt) :: nb_values

View File

@ -2232,7 +2232,7 @@
subroutine grib_get_real8_array ( gribid, key, value, status ) subroutine grib_get_real8_array ( gribid, key, value, status )
integer(kind=kindOfInt), intent(in) :: gribid integer(kind=kindOfInt), intent(in) :: gribid
character(len=*), intent(in) :: key character(len=*), intent(in) :: key
real(kind = kindOfDouble),dimension(:),allocatable,intent(out) :: value real(kind = kindOfDouble),dimension(:),allocatable,intent(inout) :: value
integer(kind=kindOfInt),optional, intent(out) :: status integer(kind=kindOfInt),optional, intent(out) :: status
integer(kind=kindOfInt) :: iret integer(kind=kindOfInt) :: iret
integer(kind=kindOfInt) :: nb_values integer(kind=kindOfInt) :: nb_values
@ -2249,7 +2249,9 @@
endif endif
return return
endif endif
if (.not.allocated(value)) allocate(value(nb_values)) if (allocated(value) .eqv. .false.) then
allocate(value(nb_values))
end if
size_value=size(value) size_value=size(value)
iret=grib_f_get_real8_array ( gribid, key, value, nb_values ) iret=grib_f_get_real8_array ( gribid, key, value, nb_values )
if (iret==0 .and. nb_values==1 .and. size_value/=1) then if (iret==0 .and. nb_values==1 .and. size_value/=1) then