Index: src/calcpar.f90
===================================================================
--- src/calcpar.f90	(revision 027e844aa76ac151b33b946b4eb11e23321598af)
+++ src/calcpar.f90	(revision c0884a86ec69f31a8b28c5554286971ba48392be)
@@ -20,5 +20,5 @@
 !**********************************************************************
 
-subroutine calcpar(n,uuh,vvh,pvh,metdata_format)
+subroutine calcpar(n,uuh,vvh,pvh,id_centre)
   !                   i  i   i   o
   !*****************************************************************************
@@ -46,6 +46,7 @@
   !     - Merged calcpar and calcpar_gfs into one routine using if-then        *
   !       for meteo-type dependent code                                        *
-  !*****************************************************************************
-
+  !                                                                            *
+  !  Petra Seibert, 2018-06-26: simplified version met data format detection   *
+  !                                                                            *
   !*****************************************************************************
   !                                                                            *
@@ -55,5 +56,5 @@
   ! vvh                                                                        *
   ! pvh                                                                        *
-  ! metdata_format     format of metdata (ecmwf/gfs)                           * 
+  ! id_centre          format of metdata (ecmwf/gfs)                           *
   !                                                                            *
   ! Constants:                                                                 *
@@ -68,9 +69,9 @@
   use par_mod
   use com_mod
-  use class_gribfile
+  use check_gribfile_mod
 
   implicit none
 
-  integer :: metdata_format
+  integer :: id_centre
   integer :: n,ix,jy,i,kz,lz,kzmin,llev,loop_start
   real :: ttlev(nuvzmax),qvlev(nuvzmax),obukhov,scalev,ol,hmixplus
@@ -125,5 +126,5 @@
   !***********************************************
 
-      if (metdata_format.eq.GRIBFILE_CENTRE_NCEP) then
+      if (id_centre.eq.icg_id_ncep) then
         ! NCEP version: find first level above ground
         llev = 0
@@ -137,9 +138,11 @@
         ! calculate inverse Obukhov length scale with tth(llev)
         ol=obukhov(ps(ix,jy,1,n),tt2(ix,jy,1,n),td2(ix,jy,1,n), &
-             tth(ix,jy,llev,n),ustar(ix,jy,1,n),sshf(ix,jy,1,n),akm,bkm,akz(llev),metdata_format)
+             tth(ix,jy,llev,n),ustar(ix,jy,1,n),sshf(ix,jy,1,n), &
+             akm,bkm,akz(llev),id_centre)
       else
         llev=0
         ol=obukhov(ps(ix,jy,1,n),tt2(ix,jy,1,n),td2(ix,jy,1,n), &
-            tth(ix,jy,2,n),ustar(ix,jy,1,n),sshf(ix,jy,1,n),akm,bkm,akzdummy,metdata_format)
+            tth(ix,jy,2,n),ustar(ix,jy,1,n),sshf(ix,jy,1,n), &
+            akm,bkm,akzdummy,id_centre)
       end if
 
@@ -161,13 +164,13 @@
       end do
 
-      if (metdata_format.eq.GRIBFILE_CENTRE_NCEP) then
+      if (id_centre.eq.icg_id_ncep) then
         ! NCEP version hmix has been read in in readwind.f, is therefore not calculated here
       call richardson(ps(ix,jy,1,n),ustar(ix,jy,1,n),ttlev,qvlev, &
            ulev,vlev,nuvz,akz,bkz,sshf(ix,jy,1,n),tt2(ix,jy,1,n), &
-             td2(ix,jy,1,n),hmixdummy,wstar(ix,jy,1,n),hmixplus,metdata_format)
+             td2(ix,jy,1,n),hmixdummy,wstar(ix,jy,1,n),hmixplus,id_centre)
       else
         call richardson(ps(ix,jy,1,n),ustar(ix,jy,1,n),ttlev,qvlev, &
              ulev,vlev,nuvz,akz,bkz,sshf(ix,jy,1,n),tt2(ix,jy,1,n), &
-             td2(ix,jy,1,n),hmix(ix,jy,1,n),wstar(ix,jy,1,n),hmixplus,metdata_format)
+             td2(ix,jy,1,n),hmix(ix,jy,1,n),wstar(ix,jy,1,n),hmixplus,id_centre)
       end if
 
@@ -218,5 +221,5 @@
       pold=ps(ix,jy,1,n)
       zold=0.
-      if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then
+      if (id_centre.eq.icg_id_ecmwf) then
         loop_start=2
       else
@@ -242,5 +245,5 @@
   !************************************************************************
 
-      if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then
+      if (id_centre.eq.icg_id_ecmwf) then
         loop_start=1
       else
