Commit 9ca6e380 authored by Espen Sollum's avatar Espen Sollum
Browse files

minor edits

parent 467460af
......@@ -66,24 +66,28 @@ subroutine calcmatrix(lconv,delt,cbmf,metdata_format)
phconv(1) = psconv
! Emanuel subroutine needs pressure in hPa, therefore convert all pressures
do kuvz = 2,nuvz
k = kuvz-1
if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then
! Emanuel subroutine needs pressure in hPa, therefore convert all pressures
if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then
do kuvz = 2,nuvz
k = kuvz-1
pconv(k) = (akz(kuvz) + bkz(kuvz)*psconv)
phconv(kuvz) = (akm(kuvz) + bkm(kuvz)*psconv)
else
phconv(kuvz) = 0.5*(pconv(kuvz)+pconv(k))
endif
dpr(k) = phconv(k) - phconv(kuvz)
qsconv(k) = f_qvsat( pconv(k), tconv(k) )
! initialize mass fractions
do kk=1,nconvlev
fmassfrac(k,kk)=0.
dpr(k) = phconv(k) - phconv(kuvz)
qsconv(k) = f_qvsat( pconv(k), tconv(k) )
end do
end do
else
! JMA / SH Bugfix phconv was set in loop with access to undefined pconv(nuvz)
phconv(2:nuvz-1) = 0.5*(pconv(2:nuvz-1)+pconv(1:nuvz-2))
phconv(nuvz) = pconv(nuvz-1)
dpr(1:nuvz-1) = phconv(1:nuvz-1)-phconv(2:nuvz)
do k = 1,nuvz-1
qsconv(k) = f_qvsat( pconv(k), tconv(k) )
end do
end if
! initialize mass fractions
fmassfrac(1:nuvz-1,1:nconvlev)=0.0
!note that Emanuel says it is important
!a. to set this =0. every grid point
......@@ -92,48 +96,48 @@ subroutine calcmatrix(lconv,delt,cbmf,metdata_format)
! CALL CONVECTION
!******************
cbmfold = cbmf
! Convert pressures to hPa, as required by Emanuel scheme
!********************************************************
cbmfold = cbmf
! Convert pressures to hPa, as required by Emanuel scheme
!********************************************************
!!$ do k=1,nconvlev !old
do k=1,nconvlev+1 !bugfix
pconv_hpa(k)=pconv(k)/100.
phconv_hpa(k)=phconv(k)/100.
end do
phconv_hpa(nconvlev+1)=phconv(nconvlev+1)/100.
call convect(nconvlevmax, nconvlev, delt, iflag, &
precip, wd, tprime, qprime, cbmf)
! do not update fmassfrac and cloudbase massflux
! if no convection takes place or
! if a CFL criterion is violated in convect43c.f
if (iflag .ne. 1 .and. iflag .ne. 4) then
cbmf=cbmfold
goto 200
endif
! do not update fmassfrac and cloudbase massflux
! if the old and the new cloud base mass
! fluxes are zero
if (cbmf.le.0..and.cbmfold.le.0.) then
cbmf=cbmfold
goto 200
endif
! Update fmassfrac
! account for mass displaced from level k to level k
lconv = .true.
do k=1,nconvtop
rlevmass = dpr(k)/ga
summe = 0.
do kk=1,nconvtop
fmassfrac(k,kk) = delt*fmass(k,kk)
summe = summe + fmassfrac(k,kk)
end do
fmassfrac(k,k)=fmassfrac(k,k) + rlevmass - summe
do k=1,nconvlev+1 !bugfix
pconv_hpa(k)=pconv(k)/100.
phconv_hpa(k)=phconv(k)/100.
end do
phconv_hpa(nconvlev+1)=phconv(nconvlev+1)/100.
call convect(nconvlevmax, nconvlev, delt, iflag, &
precip, wd, tprime, qprime, cbmf)
! do not update fmassfrac and cloudbase massflux
! if no convection takes place or
! if a CFL criterion is violated in convect43c.f
if (iflag .ne. 1 .and. iflag .ne. 4) then
cbmf=cbmfold
goto 200
endif
! do not update fmassfrac and cloudbase massflux
! if the old and the new cloud base mass
! fluxes are zero
if (cbmf.le.0..and.cbmfold.le.0.) then
cbmf=cbmfold
goto 200
endif
! Update fmassfrac
! account for mass displaced from level k to level k
lconv = .true.
do k=1,nconvtop
rlevmass = dpr(k)/ga
summe = 0.
do kk=1,nconvtop
fmassfrac(k,kk) = delt*fmass(k,kk)
summe = summe + fmassfrac(k,kk)
end do
fmassfrac(k,k)=fmassfrac(k,k) + rlevmass - summe
end do
200 continue
200 continue
end subroutine calcmatrix
......@@ -3,48 +3,48 @@
subroutine readwind_gfs(indj,n,uuh,vvh,wwh)
!***********************************************************************
!* *
!* TRAJECTORY MODEL SUBROUTINE READWIND *
!* *
!***********************************************************************
!* *
!* AUTHOR: G. WOTAWA *
!* DATE: 1997-08-05 *
!* LAST UPDATE: 2000-10-17, Andreas Stohl *
!* CHANGE: 01/02/2001, Bernd C. Krueger, Variables tth and *
!* qvh (on eta coordinates) in common block *
!* CHANGE: 16/11/2005, Caroline Forster, GFS data *
!* CHANGE: 11/01/2008, Harald Sodemann, Input of GRIB1/2 *
!* data with the ECMWF grib_api library *
!* CHANGE: 03/12/2008, Harald Sodemann, update to f90 with *
!* ECMWF grib_api *
! *
! Unified ECMWF and GFS builds *
! Marian Harustak, 12.5.2017 *
! - Renamed routine from readwind to readwind_gfs *
!* *
!***********************************************************************
!* *
!* DESCRIPTION: *
!* *
!* READING OF ECMWF METEOROLOGICAL FIELDS FROM INPUT DATA FILES. THE *
!* INPUT DATA FILES ARE EXPECTED TO BE AVAILABLE IN GRIB CODE *
!* *
!* INPUT: *
!* indj indicates number of the wind field to be read in *
!* n temporal index for meteorological fields (1 to 3)*
!* *
!* IMPORTANT VARIABLES FROM COMMON BLOCK: *
!* *
!* wfname File name of data to be read in *
!* nx,ny,nuvz,nwz expected field dimensions *
!* nlev_ec number of vertical levels ecmwf model *
!* uu,vv,ww wind fields *
!* tt,qv temperature and specific humidity *
!* ps surface pressure *
!* *
!***********************************************************************
!***********************************************************************
!* *
!* TRAJECTORY MODEL SUBROUTINE READWIND *
!* *
!***********************************************************************
!* *
!* AUTHOR: G. WOTAWA *
!* DATE: 1997-08-05 *
!* LAST UPDATE: 2000-10-17, Andreas Stohl *
!* CHANGE: 01/02/2001, Bernd C. Krueger, Variables tth and *
!* qvh (on eta coordinates) in common block *
!* CHANGE: 16/11/2005, Caroline Forster, GFS data *
!* CHANGE: 11/01/2008, Harald Sodemann, Input of GRIB1/2 *
!* data with the ECMWF grib_api library *
!* CHANGE: 03/12/2008, Harald Sodemann, update to f90 with *
!* ECMWF grib_api *
! *
! Unified ECMWF and GFS builds *
! Marian Harustak, 12.5.2017 *
! - Renamed routine from readwind to readwind_gfs *
!* *
!***********************************************************************
!* *
!* DESCRIPTION: *
!* *
!* READING OF ECMWF METEOROLOGICAL FIELDS FROM INPUT DATA FILES. THE *
!* INPUT DATA FILES ARE EXPECTED TO BE AVAILABLE IN GRIB CODE *
!* *
!* INPUT: *
!* indj indicates number of the wind field to be read in *
!* n temporal index for meteorological fields (1 to 3)*
!* *
!* IMPORTANT VARIABLES FROM COMMON BLOCK: *
!* *
!* wfname File name of data to be read in *
!* nx,ny,nuvz,nwz expected field dimensions *
!* nlev_ec number of vertical levels ecmwf model *
!* uu,vv,ww wind fields *
!* tt,qv temperature and specific humidity *
!* ps surface pressure *
!* *
!***********************************************************************
use eccodes
use par_mod
......@@ -52,18 +52,18 @@ subroutine readwind_gfs(indj,n,uuh,vvh,wwh)
implicit none
!HSO new parameters for grib_api
!HSO new parameters for grib_api
integer :: ifile
integer :: iret
integer :: igrib
integer :: gribVer,parCat,parNum,typSurf,valSurf,discipl
!HSO end edits
integer :: gribVer,parCat,parNum,typSurf,discipl,valSurf
!HSO end edits
real :: uuh(0:nxmax-1,0:nymax-1,nuvzmax)
real :: vvh(0:nxmax-1,0:nymax-1,nuvzmax)
real :: wwh(0:nxmax-1,0:nymax-1,nwzmax)
integer :: ii,indj,i,j,k,n,levdiff2,ifield,iumax,iwmax
! NCEP
! NCEP
integer :: numpt,numpu,numpv,numpw,numprh,numpclwch
real :: help, temp, ew
real :: elev
......@@ -73,8 +73,8 @@ subroutine readwind_gfs(indj,n,uuh,vvh,wwh)
integer :: i180
! VARIABLES AND ARRAYS NEEDED FOR GRIB DECODING
!HSO kept isec1, isec2 and zsec4 for consistency with gribex GRIB input
! VARIABLES AND ARRAYS NEEDED FOR GRIB DECODING
!HSO kept isec1, isec2 and zsec4 for consistency with gribex GRIB input
integer :: isec1(8),isec2(3)
real :: xsec18
......@@ -87,7 +87,7 @@ subroutine readwind_gfs(indj,n,uuh,vvh,wwh)
logical :: hflswitch,strswitch
!HSO for grib api error messages
!HSO for grib api error messages
character(len=24) :: gribErrorMsg = 'Error reading grib file'
character(len=20) :: gribFunction = 'readwind_gfs'
character(len=20) :: shortname
......@@ -100,15 +100,15 @@ subroutine readwind_gfs(indj,n,uuh,vvh,wwh)
iwmax=0
! OPENING OF DATA FILE (GRIB CODE)
! OPENING OF DATA FILE (GRIB CODE)
!HSO
!HSO
call grib_open_file(ifile,path(3)(1:length(3)) &
//trim(wfname(indj)),'r',iret)
//trim(wfname(indj)),'r',iret)
if (iret.ne.GRIB_SUCCESS) then
goto 888 ! ERROR DETECTED
endif
!turn on support for multi fields messages
!turn on support for multi fields messages
call grib_multi_support_on
numpt=0
......@@ -118,10 +118,10 @@ subroutine readwind_gfs(indj,n,uuh,vvh,wwh)
numprh=0
numpclwch=0
ifield=0
10 ifield=ifield+1
!
! GET NEXT FIELDS
!
10 ifield=ifield+1
!
! GET NEXT FIELDS
!
call grib_new_from_file(ifile,igrib,iret)
if (iret.eq.GRIB_END_OF_FILE) then
goto 50 ! EOF DETECTED
......@@ -129,161 +129,164 @@ subroutine readwind_gfs(indj,n,uuh,vvh,wwh)
goto 888 ! ERROR DETECTED
endif
!first see if we read GRIB1 or GRIB2
!first see if we read GRIB1 or GRIB2
call grib_get_int(igrib,'editionNumber',gribVer,iret)
! call grib_check(iret,gribFunction,gribErrorMsg)
if (gribVer.eq.1) then ! GRIB Edition 1
!read the grib1 identifiers
call grib_get_int(igrib,'indicatorOfParameter',isec1(6),iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'indicatorOfTypeOfLevel',isec1(7),iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'level',isec1(8),iret)
call grib_check(iret,gribFunction,gribErrorMsg)
!JMA / SH: isec1(8) not evaluated any more below
!b/c with GRIB 2 this may be a real variable
xsec18 = real(isec1(8))
!read the grib1 identifiers
call grib_get_int(igrib,'indicatorOfParameter',isec1(6),iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'indicatorOfTypeOfLevel',isec1(7),iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'level',isec1(8),iret)
call grib_check(iret,gribFunction,gribErrorMsg)
!JMA / SH: isec1(8) not evaluated any more below
!b/c with GRIB 2 this may be a real variable
xsec18 = real(isec1(8))
else ! GRIB Edition 2
!read the grib2 identifiers
call grib_get_string(igrib,'shortName',shortname,iret)
call grib_get_int(igrib,'discipline',discipl,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'parameterCategory',parCat,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'parameterNumber',parNum,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'typeOfFirstFixedSurface',typSurf,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'scaledValueOfFirstFixedSurface', &
valSurf,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
! write(*,*) 'Field: ',ifield,parCat,parNum,typSurf,shortname
!convert to grib1 identifiers
isec1(6:8)=-1
xsec18 =-1.0
!JMA / SH: isec1(8) not evaluated any more below
!b/c with GRIB 2 this may be a real variable
if ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.100)) then ! T
isec1(6)=11 ! indicatorOfParameter
isec1(7)=100 ! indicatorOfTypeOfLevel
xsec18=valSurf/100.0 ! level, convert to hPa
elseif ((parCat.eq.2).and.(parNum.eq.2).and.(typSurf.eq.100)) then ! U
isec1(6)=33 ! indicatorOfParameter
isec1(7)=100 ! indicatorOfTypeOfLevel
xsec18=valSurf/100.0 ! level, convert to hPa
elseif ((parCat.eq.2).and.(parNum.eq.3).and.(typSurf.eq.100)) then ! V
isec1(6)=34 ! indicatorOfParameter
isec1(7)=100 ! indicatorOfTypeOfLevel
xsec18=valSurf/100.0 ! level, convert to hPa
elseif ((parCat.eq.2).and.(parNum.eq.8).and.(typSurf.eq.100)) then ! W
isec1(6)=39 ! indicatorOfParameter
isec1(7)=100 ! indicatorOfTypeOfLevel
xsec18=valSurf/100.0 ! level, convert to hPa
elseif ((parCat.eq.1).and.(parNum.eq.1).and.(typSurf.eq.100)) then ! RH
isec1(6)=52 ! indicatorOfParameter
isec1(7)=100 ! indicatorOfTypeOfLevel
xsec18=valSurf/100.0 ! level, convert to hPa
elseif ((parCat.eq.1).and.(parNum.eq.1).and.(typSurf.eq.103)) then ! RH2
isec1(6)=52 ! indicatorOfParameter
isec1(7)=105 ! indicatorOfTypeOfLevel
xsec18=real(2)
elseif ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.103)) then ! T2
isec1(6)=11 ! indicatorOfParameter
isec1(7)=105 ! indicatorOfTypeOfLevel
xsec18=real(2)
elseif ((parCat.eq.2).and.(parNum.eq.2).and.(typSurf.eq.103)) then ! U10
isec1(6)=33 ! indicatorOfParameter
isec1(7)=105 ! indicatorOfTypeOfLevel
xsec18=real(10)
elseif ((parCat.eq.2).and.(parNum.eq.3).and.(typSurf.eq.103)) then ! V10
isec1(6)=34 ! indicatorOfParameter
isec1(7)=105 ! indicatorOfTypeOfLevel
xsec18=real(10)
elseif ((parCat.eq.1).and.(parNum.eq.22).and.(typSurf.eq.100)) then ! CLWMR Cloud Mixing Ratio [kg/kg]:
isec1(6)=153 ! indicatorOfParameter
isec1(7)=100 ! indicatorOfTypeOfLevel
xsec18=valSurf/100.0 ! level, convert to hPa
elseif ((parCat.eq.3).and.(parNum.eq.1).and.(typSurf.eq.101)) then ! SLP
isec1(6)=2 ! indicatorOfParameter
isec1(7)=102 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.3).and.(parNum.eq.0).and.(typSurf.eq.1)) then ! SP
isec1(6)=1 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.1).and.(parNum.eq.13).and.(typSurf.eq.1)) then ! SNOW
isec1(6)=66 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.104)) then ! T sigma 0
isec1(6)=11 ! indicatorOfParameter
isec1(7)=107 ! indicatorOfTypeOfLevel
xsec18=0.995 ! lowest sigma level
elseif ((parCat.eq.2).and.(parNum.eq.2).and.(typSurf.eq.104)) then ! U sigma 0
isec1(6)=33 ! indicatorOfParameter
isec1(7)=107 ! indicatorOfTypeOfLevel
xsec18=0.995 ! lowest sigma level
elseif ((parCat.eq.2).and.(parNum.eq.3).and.(typSurf.eq.104)) then ! V sigma 0
isec1(6)=34 ! indicatorOfParameter
isec1(7)=107 ! indicatorOfTypeOfLevel
xsec18=0.995 ! lowest sigma level
elseif ((parCat.eq.3).and.(parNum.eq.5).and.(typSurf.eq.1)) then ! TOPO
isec1(6)=7 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.1) &
.and.(discipl.eq.2)) then ! LSM
isec1(6)=81 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.3).and.(parNum.eq.196).and.(typSurf.eq.1)) then ! BLH
isec1(6)=221 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.1).and.(parNum.eq.7).and.(typSurf.eq.1)) then ! LSP/TP
isec1(6)=62 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.1).and.(parNum.eq.196).and.(typSurf.eq.1)) then ! CP
isec1(6)=63 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
endif
!read the grib2 identifiers
call grib_get_string(igrib,'shortName',shortname,iret)
call grib_get_int(igrib,'discipline',discipl,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'parameterCategory',parCat,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'parameterNumber',parNum,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'typeOfFirstFixedSurface',typSurf,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
!
call grib_get_int(igrib,'scaledValueOfFirstFixedSurface', &
valSurf,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
! write(*,*) 'Field: ',ifield,parCat,parNum,typSurf,shortname
!convert to grib1 identifiers
isec1(6:8)=-1
xsec18 =-1.0
!JMA / SH: isec1(8) not evaluated any more below
!b/c with GRIB 2 this may be a real variable
if ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.100)) then ! T
isec1(6)=11 ! indicatorOfParameter
isec1(7)=100 ! indicatorOfTypeOfLevel
xsec18=valSurf/100.0 ! level, convert to hPa
elseif ((parCat.eq.2).and.(parNum.eq.2).and.(typSurf.eq.100)) then ! U
isec1(6)=33 ! indicatorOfParameter
isec1(7)=100 ! indicatorOfTypeOfLevel
xsec18=valSurf/100.0 ! level, convert to hPa
elseif ((parCat.eq.2).and.(parNum.eq.3).and.(typSurf.eq.100)) then ! V
isec1(6)=34 ! indicatorOfParameter
isec1(7)=100 ! indicatorOfTypeOfLevel
xsec18=valSurf/100.0 ! level, convert to hPa
elseif ((parCat.eq.2).and.(parNum.eq.8).and.(typSurf.eq.100)) then ! W
isec1(6)=39 ! indicatorOfParameter
isec1(7)=100 ! indicatorOfTypeOfLevel
xsec18=valSurf/100.0 ! level, convert to hPa
elseif ((parCat.eq.1).and.(parNum.eq.1).and.(typSurf.eq.100)) then ! RH
isec1(6)=52 ! indicatorOfParameter
isec1(7)=100 ! indicatorOfTypeOfLevel
xsec18=valSurf/100.0 ! level, convert to hPa
elseif ((parCat.eq.1).and.(parNum.eq.1).and.(typSurf.eq.103)) then ! RH2
isec1(6)=52 ! indicatorOfParameter
isec1(7)=105 ! indicatorOfTypeOfLevel
xsec18=real(2)
elseif ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.103)) then ! T2
isec1(6)=11 ! indicatorOfParameter
isec1(7)=105 ! indicatorOfTypeOfLevel
xsec18=real(2)
elseif ((parCat.eq.2).and.(parNum.eq.2).and.(typSurf.eq.103)) then ! U10
isec1(6)=33 ! indicatorOfParameter
isec1(7)=105 ! indicatorOfTypeOfLevel
xsec18=real(10)
elseif ((parCat.eq.2).and.(parNum.eq.3).and.(typSurf.eq.103)) then ! V10
isec1(6)=34 ! indicatorOfParameter
isec1(7)=105 ! indicatorOfTypeOfLevel
xsec18=real(10)
elseif ((parCat.eq.1).and.(parNum.eq.22).and.(typSurf.eq.100)) then ! CLWMR Cloud Mixing Ratio [kg/kg]:
isec1(6)=153 ! indicatorOfParameter
isec1(7)=100 ! indicatorOfTypeOfLevel
xsec18=valSurf/100.0 ! level, convert to hPa
elseif ((parCat.eq.3).and.(parNum.eq.1).and.(typSurf.eq.101)) then ! SLP
isec1(6)=2 ! indicatorOfParameter
isec1(7)=102 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.3).and.(parNum.eq.0).and.(typSurf.eq.1)) then ! SP
isec1(6)=1 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.1).and.(parNum.eq.13).and.(typSurf.eq.1)) then ! SNOW
isec1(6)=66 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.104)) then ! T sigma 0
isec1(6)=11 ! indicatorOfParameter
isec1(7)=107 ! indicatorOfTypeOfLevel
xsec18=0.995 ! lowest sigma level
elseif ((parCat.eq.2).and.(parNum.eq.2).and.(typSurf.eq.104)) then ! U sigma 0
isec1(6)=33 ! indicatorOfParameter
isec1(7)=107 ! indicatorOfTypeOfLevel
xsec18=0.995 ! lowest sigma level
elseif ((parCat.eq.2).and.(parNum.eq.3).and.(typSurf.eq.104)) then ! V sigma 0
isec1(6)=34 ! indicatorOfParameter
isec1(7)=107 ! indicatorOfTypeOfLevel
xsec18=0.995 ! lowest sigma level
elseif ((parCat.eq.3).and.(parNum.eq.5).and.(typSurf.eq.1)) then ! TOPO
isec1(6)=7 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.1) &
.and.(discipl.eq.2)) then ! LSM
isec1(6)=81 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.3).and.(parNum.eq.196).and.(typSurf.eq.1)) then ! BLH
isec1(6)=221 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.1).and.(parNum.eq.7).and.(typSurf.eq.1)) then ! LSP/TP
isec1(6)=62 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
elseif ((parCat.eq.1).and.(parNum.eq.196).and.(typSurf.eq.1)) then ! CP
isec1(6)=63 ! indicatorOfParameter
isec1(7)=1 ! indicatorOfTypeOfLevel
xsec18=real(0)
endif
endif ! gribVer
if (isec1(6).ne.-1) then
! get the size and data of the values array
! get the size and data of the values array
call grib_get_real4_array(igrib,'values',zsec4,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
endif
if(ifield.eq.1) then
!get the required fields from section 2
!store compatible to gribex input
call grib_get_int(igrib,'numberOfPointsAlongAParallel', &
isec2(2),iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'numberOfPointsAlongAMeridian', &
isec2(3),iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_real8(igrib,'longitudeOfFirstGridPointInDegrees', &
xauxin,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_real8(igrib,'latitudeOfLastGridPointInDegrees', &
yauxin,iret)
call grib_check(iret,gribFunction,gribErrorMsg)
xaux=xauxin+real(nxshift)*dx
yaux=yauxin
! CHECK GRID SPECIFICATIONS
!get the required fields from section 2
!store compatible to gribex input
call grib_get_int(igrib,'numberOfPointsAlongAParallel', &
isec2(2),iret)
call grib_check(iret,gribFunction,gribErrorMsg)
call grib_get_int(igrib,'numberOfPointsAlongAMeridian', &
isec2(3),iret)