[61e07ba] | 1 | !********************************************************************** |
---|
| 2 | ! Copyright 1998,1999,2000,2001,2002,2005,2007,2008,2009,2010 * |
---|
| 3 | ! Andreas Stohl, Petra Seibert, A. Frank, Gerhard Wotawa, * |
---|
| 4 | ! Caroline Forster, Sabine Eckhardt, John Burkhart, Harald Sodemann * |
---|
| 5 | ! * |
---|
| 6 | ! This file is part of FLEXPART. * |
---|
| 7 | ! * |
---|
| 8 | ! FLEXPART is free software: you can redistribute it and/or modify * |
---|
| 9 | ! it under the terms of the GNU General Public License as published by* |
---|
| 10 | ! the Free Software Foundation, either version 3 of the License, or * |
---|
| 11 | ! (at your option) any later version. * |
---|
| 12 | ! * |
---|
| 13 | ! FLEXPART is distributed in the hope that it will be useful, * |
---|
| 14 | ! but WITHOUT ANY WARRANTY; without even the implied warranty of * |
---|
| 15 | ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
---|
| 16 | ! GNU General Public License for more details. * |
---|
| 17 | ! * |
---|
| 18 | ! You should have received a copy of the GNU General Public License * |
---|
| 19 | ! along with FLEXPART. If not, see <http://www.gnu.org/licenses/>. * |
---|
| 20 | !********************************************************************** |
---|
| 21 | |
---|
| 22 | integer function detectformat() |
---|
| 23 | |
---|
| 24 | !***************************************************************************** |
---|
| 25 | ! * |
---|
| 26 | ! This routine reads the 1st file with windfields to determine * |
---|
| 27 | ! the format. * |
---|
| 28 | ! * |
---|
| 29 | ! Authors: M. Harustak * |
---|
| 30 | ! * |
---|
| 31 | ! 6 May 2015 * |
---|
| 32 | ! * |
---|
| 33 | ! Unified ECMWF and GFS builds * |
---|
| 34 | ! Marian Harustak, 12.5.2017 * |
---|
| 35 | ! - Added routine to FP10 Flexpart distribution * |
---|
| 36 | !***************************************************************************** |
---|
| 37 | ! * |
---|
| 38 | ! Variables: * |
---|
| 39 | ! fname file name of file to check * |
---|
| 40 | ! * |
---|
| 41 | !***************************************************************************** |
---|
| 42 | |
---|
| 43 | use par_mod |
---|
| 44 | use com_mod |
---|
| 45 | use class_gribfile |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | implicit none |
---|
| 49 | |
---|
| 50 | character(len=255) :: filename |
---|
| 51 | character(len=255) :: wfname1(maxwf) |
---|
| 52 | integer :: metdata_format |
---|
| 53 | |
---|
| 54 | ! If no file is available |
---|
| 55 | if ( maxwf.le.0 ) then |
---|
| 56 | print*,'No wind file available' |
---|
| 57 | detectformat = GRIBFILE_CENTRE_UNKNOWN |
---|
| 58 | return |
---|
| 59 | endif |
---|
| 60 | |
---|
| 61 | ! construct filename |
---|
| 62 | filename = path(3)(1:length(3)) // trim(wfname(1)) |
---|
| 63 | |
---|
| 64 | ! get format |
---|
| 65 | detectformat = gribfile_centre(TRIM(filename)) |
---|
| 66 | |
---|
| 67 | end |
---|