[92fab65] | 1 | ! SPDX-FileCopyrightText: FLEXPART 1998-2019, see flexpart_license.txt |
---|
| 2 | ! SPDX-License-Identifier: GPL-3.0-or-later |
---|
[e200b7a] | 3 | |
---|
[6ecb30a] | 4 | subroutine readwind_gfs(indj,n,uuh,vvh,wwh) |
---|
[e200b7a] | 5 | |
---|
| 6 | !*********************************************************************** |
---|
| 7 | !* * |
---|
| 8 | !* TRAJECTORY MODEL SUBROUTINE READWIND * |
---|
| 9 | !* * |
---|
| 10 | !*********************************************************************** |
---|
| 11 | !* * |
---|
| 12 | !* AUTHOR: G. WOTAWA * |
---|
| 13 | !* DATE: 1997-08-05 * |
---|
| 14 | !* LAST UPDATE: 2000-10-17, Andreas Stohl * |
---|
| 15 | !* CHANGE: 01/02/2001, Bernd C. Krueger, Variables tth and * |
---|
| 16 | !* qvh (on eta coordinates) in common block * |
---|
| 17 | !* CHANGE: 16/11/2005, Caroline Forster, GFS data * |
---|
| 18 | !* CHANGE: 11/01/2008, Harald Sodemann, Input of GRIB1/2 * |
---|
| 19 | !* data with the ECMWF grib_api library * |
---|
| 20 | !* CHANGE: 03/12/2008, Harald Sodemann, update to f90 with * |
---|
| 21 | !* ECMWF grib_api * |
---|
[6ecb30a] | 22 | ! * |
---|
| 23 | ! Unified ECMWF and GFS builds * |
---|
| 24 | ! Marian Harustak, 12.5.2017 * |
---|
| 25 | ! - Renamed routine from readwind to readwind_gfs * |
---|
[e200b7a] | 26 | !* * |
---|
| 27 | !*********************************************************************** |
---|
| 28 | !* * |
---|
| 29 | !* DESCRIPTION: * |
---|
| 30 | !* * |
---|
| 31 | !* READING OF ECMWF METEOROLOGICAL FIELDS FROM INPUT DATA FILES. THE * |
---|
| 32 | !* INPUT DATA FILES ARE EXPECTED TO BE AVAILABLE IN GRIB CODE * |
---|
| 33 | !* * |
---|
| 34 | !* INPUT: * |
---|
| 35 | !* indj indicates number of the wind field to be read in * |
---|
| 36 | !* n temporal index for meteorological fields (1 to 3)* |
---|
| 37 | !* * |
---|
| 38 | !* IMPORTANT VARIABLES FROM COMMON BLOCK: * |
---|
| 39 | !* * |
---|
| 40 | !* wfname File name of data to be read in * |
---|
| 41 | !* nx,ny,nuvz,nwz expected field dimensions * |
---|
| 42 | !* nlev_ec number of vertical levels ecmwf model * |
---|
| 43 | !* uu,vv,ww wind fields * |
---|
| 44 | !* tt,qv temperature and specific humidity * |
---|
| 45 | !* ps surface pressure * |
---|
| 46 | !* * |
---|
| 47 | !*********************************************************************** |
---|
| 48 | |
---|
[a756649] | 49 | use eccodes |
---|
[e200b7a] | 50 | use par_mod |
---|
| 51 | use com_mod |
---|
| 52 | |
---|
| 53 | implicit none |
---|
| 54 | |
---|
| 55 | !HSO new parameters for grib_api |
---|
| 56 | integer :: ifile |
---|
| 57 | integer :: iret |
---|
| 58 | integer :: igrib |
---|
| 59 | integer :: gribVer,parCat,parNum,typSurf,valSurf,discipl |
---|
| 60 | !HSO end edits |
---|
| 61 | real :: uuh(0:nxmax-1,0:nymax-1,nuvzmax) |
---|
| 62 | real :: vvh(0:nxmax-1,0:nymax-1,nuvzmax) |
---|
| 63 | real :: wwh(0:nxmax-1,0:nymax-1,nwzmax) |
---|
| 64 | integer :: ii,indj,i,j,k,n,levdiff2,ifield,iumax,iwmax |
---|
| 65 | |
---|
| 66 | ! NCEP |
---|
[5d74ed9] | 67 | integer :: numpt,numpu,numpv,numpw,numprh,numpclwch |
---|
[e200b7a] | 68 | real :: help, temp, ew |
---|
| 69 | real :: elev |
---|
| 70 | real :: ulev1(0:nxmax-1,0:nymax-1),vlev1(0:nxmax-1,0:nymax-1) |
---|
| 71 | real :: tlev1(0:nxmax-1,0:nymax-1) |
---|
| 72 | real :: qvh2(0:nxmax-1,0:nymax-1) |
---|
| 73 | |
---|
[467460a] | 74 | integer :: i180 |
---|
[e200b7a] | 75 | |
---|
| 76 | ! VARIABLES AND ARRAYS NEEDED FOR GRIB DECODING |
---|
| 77 | !HSO kept isec1, isec2 and zsec4 for consistency with gribex GRIB input |
---|
| 78 | |
---|
| 79 | integer :: isec1(8),isec2(3) |
---|
[467460a] | 80 | real :: xsec18 |
---|
[e200b7a] | 81 | real(kind=4) :: zsec4(jpunp) |
---|
| 82 | real(kind=4) :: xaux,yaux,xaux0,yaux0 |
---|
[467460a] | 83 | real,parameter :: eps=spacing(2.0_4*360.0_4) |
---|
[e200b7a] | 84 | real(kind=8) :: xauxin,yauxin |
---|
| 85 | real(kind=4) :: ewss(0:nxmax-1,0:nymax-1),nsss(0:nxmax-1,0:nymax-1) |
---|
| 86 | real :: plev1,hlev1,ff10m,fflev1 |
---|
| 87 | |
---|
| 88 | logical :: hflswitch,strswitch |
---|
| 89 | |
---|
| 90 | !HSO for grib api error messages |
---|
| 91 | character(len=24) :: gribErrorMsg = 'Error reading grib file' |
---|
| 92 | character(len=20) :: gribFunction = 'readwind_gfs' |
---|
[db91eb7] | 93 | character(len=20) :: shortname |
---|
[e200b7a] | 94 | |
---|
| 95 | |
---|
| 96 | hflswitch=.false. |
---|
| 97 | strswitch=.false. |
---|
| 98 | levdiff2=nlev_ec-nwz+1 |
---|
| 99 | iumax=0 |
---|
| 100 | iwmax=0 |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | ! OPENING OF DATA FILE (GRIB CODE) |
---|
| 104 | |
---|
| 105 | !HSO |
---|
[db91eb7] | 106 | call grib_open_file(ifile,path(3)(1:length(3)) & |
---|
[e200b7a] | 107 | //trim(wfname(indj)),'r',iret) |
---|
| 108 | if (iret.ne.GRIB_SUCCESS) then |
---|
| 109 | goto 888 ! ERROR DETECTED |
---|
| 110 | endif |
---|
| 111 | !turn on support for multi fields messages |
---|
| 112 | call grib_multi_support_on |
---|
| 113 | |
---|
| 114 | numpt=0 |
---|
| 115 | numpu=0 |
---|
| 116 | numpv=0 |
---|
| 117 | numpw=0 |
---|
| 118 | numprh=0 |
---|
[7873bf7] | 119 | numpclwch=0 |
---|
[e200b7a] | 120 | ifield=0 |
---|
| 121 | 10 ifield=ifield+1 |
---|
| 122 | ! |
---|
| 123 | ! GET NEXT FIELDS |
---|
| 124 | ! |
---|
| 125 | call grib_new_from_file(ifile,igrib,iret) |
---|
| 126 | if (iret.eq.GRIB_END_OF_FILE) then |
---|
| 127 | goto 50 ! EOF DETECTED |
---|
| 128 | elseif (iret.ne.GRIB_SUCCESS) then |
---|
| 129 | goto 888 ! ERROR DETECTED |
---|
| 130 | endif |
---|
| 131 | |
---|
| 132 | !first see if we read GRIB1 or GRIB2 |
---|
| 133 | call grib_get_int(igrib,'editionNumber',gribVer,iret) |
---|
[8a65cb0] | 134 | ! call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[e200b7a] | 135 | |
---|
| 136 | if (gribVer.eq.1) then ! GRIB Edition 1 |
---|
| 137 | |
---|
| 138 | !read the grib1 identifiers |
---|
| 139 | call grib_get_int(igrib,'indicatorOfParameter',isec1(6),iret) |
---|
[467460a] | 140 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[e200b7a] | 141 | call grib_get_int(igrib,'indicatorOfTypeOfLevel',isec1(7),iret) |
---|
[467460a] | 142 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[e200b7a] | 143 | call grib_get_int(igrib,'level',isec1(8),iret) |
---|
[467460a] | 144 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
| 145 | !JMA / SH: isec1(8) not evaluated any more below |
---|
| 146 | !b/c with GRIB 2 this may be a real variable |
---|
| 147 | xsec18 = real(isec1(8)) |
---|
[e200b7a] | 148 | |
---|
| 149 | else ! GRIB Edition 2 |
---|
| 150 | |
---|
| 151 | !read the grib2 identifiers |
---|
[db91eb7] | 152 | call grib_get_string(igrib,'shortName',shortname,iret) |
---|
| 153 | |
---|
[e200b7a] | 154 | call grib_get_int(igrib,'discipline',discipl,iret) |
---|
[467460a] | 155 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[e200b7a] | 156 | call grib_get_int(igrib,'parameterCategory',parCat,iret) |
---|
[467460a] | 157 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[e200b7a] | 158 | call grib_get_int(igrib,'parameterNumber',parNum,iret) |
---|
[467460a] | 159 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[e200b7a] | 160 | call grib_get_int(igrib,'typeOfFirstFixedSurface',typSurf,iret) |
---|
[467460a] | 161 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[e200b7a] | 162 | call grib_get_int(igrib,'scaledValueOfFirstFixedSurface', & |
---|
| 163 | valSurf,iret) |
---|
[467460a] | 164 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[db91eb7] | 165 | |
---|
| 166 | ! write(*,*) 'Field: ',ifield,parCat,parNum,typSurf,shortname |
---|
[e200b7a] | 167 | !convert to grib1 identifiers |
---|
[467460a] | 168 | isec1(6:8)=-1 |
---|
| 169 | xsec18 =-1.0 |
---|
| 170 | !JMA / SH: isec1(8) not evaluated any more below |
---|
| 171 | !b/c with GRIB 2 this may be a real variable |
---|
[e200b7a] | 172 | if ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.100)) then ! T |
---|
| 173 | isec1(6)=11 ! indicatorOfParameter |
---|
| 174 | isec1(7)=100 ! indicatorOfTypeOfLevel |
---|
[467460a] | 175 | xsec18=valSurf/100.0 ! level, convert to hPa |
---|
[e200b7a] | 176 | elseif ((parCat.eq.2).and.(parNum.eq.2).and.(typSurf.eq.100)) then ! U |
---|
| 177 | isec1(6)=33 ! indicatorOfParameter |
---|
| 178 | isec1(7)=100 ! indicatorOfTypeOfLevel |
---|
[467460a] | 179 | xsec18=valSurf/100.0 ! level, convert to hPa |
---|
[e200b7a] | 180 | elseif ((parCat.eq.2).and.(parNum.eq.3).and.(typSurf.eq.100)) then ! V |
---|
| 181 | isec1(6)=34 ! indicatorOfParameter |
---|
| 182 | isec1(7)=100 ! indicatorOfTypeOfLevel |
---|
[467460a] | 183 | xsec18=valSurf/100.0 ! level, convert to hPa |
---|
[e200b7a] | 184 | elseif ((parCat.eq.2).and.(parNum.eq.8).and.(typSurf.eq.100)) then ! W |
---|
| 185 | isec1(6)=39 ! indicatorOfParameter |
---|
| 186 | isec1(7)=100 ! indicatorOfTypeOfLevel |
---|
[467460a] | 187 | xsec18=valSurf/100.0 ! level, convert to hPa |
---|
[e200b7a] | 188 | elseif ((parCat.eq.1).and.(parNum.eq.1).and.(typSurf.eq.100)) then ! RH |
---|
| 189 | isec1(6)=52 ! indicatorOfParameter |
---|
| 190 | isec1(7)=100 ! indicatorOfTypeOfLevel |
---|
[467460a] | 191 | xsec18=valSurf/100.0 ! level, convert to hPa |
---|
[e200b7a] | 192 | elseif ((parCat.eq.1).and.(parNum.eq.1).and.(typSurf.eq.103)) then ! RH2 |
---|
| 193 | isec1(6)=52 ! indicatorOfParameter |
---|
| 194 | isec1(7)=105 ! indicatorOfTypeOfLevel |
---|
[467460a] | 195 | xsec18=real(2) |
---|
[e200b7a] | 196 | elseif ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.103)) then ! T2 |
---|
| 197 | isec1(6)=11 ! indicatorOfParameter |
---|
| 198 | isec1(7)=105 ! indicatorOfTypeOfLevel |
---|
[467460a] | 199 | xsec18=real(2) |
---|
[e200b7a] | 200 | elseif ((parCat.eq.2).and.(parNum.eq.2).and.(typSurf.eq.103)) then ! U10 |
---|
| 201 | isec1(6)=33 ! indicatorOfParameter |
---|
| 202 | isec1(7)=105 ! indicatorOfTypeOfLevel |
---|
[467460a] | 203 | xsec18=real(10) |
---|
[e200b7a] | 204 | elseif ((parCat.eq.2).and.(parNum.eq.3).and.(typSurf.eq.103)) then ! V10 |
---|
| 205 | isec1(6)=34 ! indicatorOfParameter |
---|
| 206 | isec1(7)=105 ! indicatorOfTypeOfLevel |
---|
[467460a] | 207 | xsec18=real(10) |
---|
[db91eb7] | 208 | elseif ((parCat.eq.1).and.(parNum.eq.22).and.(typSurf.eq.100)) then ! CLWMR Cloud Mixing Ratio [kg/kg]: |
---|
| 209 | isec1(6)=153 ! indicatorOfParameter |
---|
| 210 | isec1(7)=100 ! indicatorOfTypeOfLevel |
---|
[467460a] | 211 | xsec18=valSurf/100.0 ! level, convert to hPa |
---|
[e200b7a] | 212 | elseif ((parCat.eq.3).and.(parNum.eq.1).and.(typSurf.eq.101)) then ! SLP |
---|
| 213 | isec1(6)=2 ! indicatorOfParameter |
---|
| 214 | isec1(7)=102 ! indicatorOfTypeOfLevel |
---|
[467460a] | 215 | xsec18=real(0) |
---|
[e200b7a] | 216 | elseif ((parCat.eq.3).and.(parNum.eq.0).and.(typSurf.eq.1)) then ! SP |
---|
| 217 | isec1(6)=1 ! indicatorOfParameter |
---|
| 218 | isec1(7)=1 ! indicatorOfTypeOfLevel |
---|
[467460a] | 219 | xsec18=real(0) |
---|
[e200b7a] | 220 | elseif ((parCat.eq.1).and.(parNum.eq.13).and.(typSurf.eq.1)) then ! SNOW |
---|
| 221 | isec1(6)=66 ! indicatorOfParameter |
---|
| 222 | isec1(7)=1 ! indicatorOfTypeOfLevel |
---|
[467460a] | 223 | xsec18=real(0) |
---|
[e200b7a] | 224 | elseif ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.104)) then ! T sigma 0 |
---|
| 225 | isec1(6)=11 ! indicatorOfParameter |
---|
| 226 | isec1(7)=107 ! indicatorOfTypeOfLevel |
---|
[467460a] | 227 | xsec18=0.995 ! lowest sigma level |
---|
[e200b7a] | 228 | elseif ((parCat.eq.2).and.(parNum.eq.2).and.(typSurf.eq.104)) then ! U sigma 0 |
---|
| 229 | isec1(6)=33 ! indicatorOfParameter |
---|
| 230 | isec1(7)=107 ! indicatorOfTypeOfLevel |
---|
[467460a] | 231 | xsec18=0.995 ! lowest sigma level |
---|
[e200b7a] | 232 | elseif ((parCat.eq.2).and.(parNum.eq.3).and.(typSurf.eq.104)) then ! V sigma 0 |
---|
| 233 | isec1(6)=34 ! indicatorOfParameter |
---|
| 234 | isec1(7)=107 ! indicatorOfTypeOfLevel |
---|
[467460a] | 235 | xsec18=0.995 ! lowest sigma level |
---|
[e200b7a] | 236 | elseif ((parCat.eq.3).and.(parNum.eq.5).and.(typSurf.eq.1)) then ! TOPO |
---|
| 237 | isec1(6)=7 ! indicatorOfParameter |
---|
| 238 | isec1(7)=1 ! indicatorOfTypeOfLevel |
---|
[467460a] | 239 | xsec18=real(0) |
---|
[e200b7a] | 240 | elseif ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.1) & |
---|
| 241 | .and.(discipl.eq.2)) then ! LSM |
---|
| 242 | isec1(6)=81 ! indicatorOfParameter |
---|
| 243 | isec1(7)=1 ! indicatorOfTypeOfLevel |
---|
[467460a] | 244 | xsec18=real(0) |
---|
[e200b7a] | 245 | elseif ((parCat.eq.3).and.(parNum.eq.196).and.(typSurf.eq.1)) then ! BLH |
---|
| 246 | isec1(6)=221 ! indicatorOfParameter |
---|
| 247 | isec1(7)=1 ! indicatorOfTypeOfLevel |
---|
[467460a] | 248 | xsec18=real(0) |
---|
[e200b7a] | 249 | elseif ((parCat.eq.1).and.(parNum.eq.7).and.(typSurf.eq.1)) then ! LSP/TP |
---|
| 250 | isec1(6)=62 ! indicatorOfParameter |
---|
| 251 | isec1(7)=1 ! indicatorOfTypeOfLevel |
---|
[467460a] | 252 | xsec18=real(0) |
---|
[e200b7a] | 253 | elseif ((parCat.eq.1).and.(parNum.eq.196).and.(typSurf.eq.1)) then ! CP |
---|
| 254 | isec1(6)=63 ! indicatorOfParameter |
---|
| 255 | isec1(7)=1 ! indicatorOfTypeOfLevel |
---|
[467460a] | 256 | xsec18=real(0) |
---|
[e200b7a] | 257 | endif |
---|
| 258 | |
---|
| 259 | endif ! gribVer |
---|
| 260 | |
---|
| 261 | if (isec1(6).ne.-1) then |
---|
| 262 | ! get the size and data of the values array |
---|
| 263 | call grib_get_real4_array(igrib,'values',zsec4,iret) |
---|
[467460a] | 264 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[e200b7a] | 265 | endif |
---|
| 266 | |
---|
| 267 | if(ifield.eq.1) then |
---|
| 268 | |
---|
| 269 | !get the required fields from section 2 |
---|
| 270 | !store compatible to gribex input |
---|
| 271 | call grib_get_int(igrib,'numberOfPointsAlongAParallel', & |
---|
| 272 | isec2(2),iret) |
---|
[467460a] | 273 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[e200b7a] | 274 | call grib_get_int(igrib,'numberOfPointsAlongAMeridian', & |
---|
| 275 | isec2(3),iret) |
---|
[467460a] | 276 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[e200b7a] | 277 | call grib_get_real8(igrib,'longitudeOfFirstGridPointInDegrees', & |
---|
| 278 | xauxin,iret) |
---|
[467460a] | 279 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[e200b7a] | 280 | call grib_get_real8(igrib,'latitudeOfLastGridPointInDegrees', & |
---|
| 281 | yauxin,iret) |
---|
[467460a] | 282 | call grib_check(iret,gribFunction,gribErrorMsg) |
---|
[e200b7a] | 283 | xaux=xauxin+real(nxshift)*dx |
---|
| 284 | yaux=yauxin |
---|
| 285 | |
---|
| 286 | ! CHECK GRID SPECIFICATIONS |
---|
| 287 | |
---|
| 288 | if(isec2(2).ne.nxfield) stop 'READWIND: NX NOT CONSISTENT' |
---|
| 289 | if(isec2(3).ne.ny) stop 'READWIND: NY NOT CONSISTENT' |
---|
[467460a] | 290 | if(xaux.eq.0.) xaux=-180.0 ! NCEP DATA |
---|
[e200b7a] | 291 | xaux0=xlon0 |
---|
| 292 | yaux0=ylat0 |
---|
| 293 | if(xaux.lt.0.) xaux=xaux+360. |
---|
| 294 | if(yaux.lt.0.) yaux=yaux+360. |
---|
| 295 | if(xaux0.lt.0.) xaux0=xaux0+360. |
---|
| 296 | if(yaux0.lt.0.) yaux0=yaux0+360. |
---|
[467460a] | 297 | if(abs(xaux-xaux0).gt.eps) then |
---|
| 298 | write (*, *) xaux, xaux0 |
---|
[e200b7a] | 299 | stop 'READWIND: LOWER LEFT LONGITUDE NOT CONSISTENT' |
---|
[467460a] | 300 | endif |
---|
| 301 | if(abs(yaux-yaux0).gt.eps) then |
---|
| 302 | write (*, *) yaux, yaux0 |
---|
[e200b7a] | 303 | stop 'READWIND: LOWER LEFT LATITUDE NOT CONSISTENT' |
---|
[467460a] | 304 | end if |
---|
[e200b7a] | 305 | endif |
---|
| 306 | !HSO end of edits |
---|
| 307 | |
---|
[467460a] | 308 | i180=nint(180./dx) |
---|
[e200b7a] | 309 | |
---|
| 310 | if (isec1(6).ne.-1) then |
---|
| 311 | |
---|
[467460a] | 312 | ! write (*, *) 'nxfield: ', nxfield, i180 |
---|
| 313 | |
---|
[e200b7a] | 314 | do j=0,nymin1 |
---|
| 315 | do i=0,nxfield-1 |
---|
| 316 | if((isec1(6).eq.011).and.(isec1(7).eq.100)) then |
---|
[467460a] | 317 | ! TEMPERATURE |
---|
| 318 | if((i.eq.0).and.(j.eq.0)) then |
---|
| 319 | do ii=1,nuvz+1 |
---|
| 320 | write(*,*) 'xsec18, akz(ii), xsec18*100.0-akz(ii), spacing(akz(ii), spacing(xsec18*100.0)',& |
---|
| 321 | & xsec18, akz(ii), xsec18*100.0-akz(ii), spacing(akz(ii)), spacing(xsec18*100.0) |
---|
| 322 | |
---|
| 323 | if (abs(xsec18*100.0-akz(ii)) < & |
---|
| 324 | 10.0*max(spacing(akz(ii)),spacing(xsec18*100.0))) then |
---|
| 325 | numpt=ii |
---|
| 326 | end if |
---|
| 327 | end do |
---|
[e200b7a] | 328 | endif |
---|
| 329 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 330 | if (help.eq.0) then |
---|
| 331 | write (*, *) 'i, j: ', i, j |
---|
| 332 | stop 'help == 0.0' |
---|
| 333 | endif |
---|
| 334 | if(i.lt.i180) then |
---|
| 335 | ! ESO: dbg out-of-bounds issue |
---|
| 336 | if (numpt < 1) then |
---|
| 337 | write(*,*) 'nuvzmax, nuvz', nuvzmax, nuvz |
---|
| 338 | write(*,*) 'i180+i,j,numpt,n', i180+i,j,numpt,n |
---|
| 339 | end if |
---|
| 340 | tth(i180+i,j,numpt,n)=help |
---|
[e200b7a] | 341 | else |
---|
[467460a] | 342 | tth(i-i180,j,numpt,n)=help |
---|
[e200b7a] | 343 | endif |
---|
| 344 | endif |
---|
| 345 | if((isec1(6).eq.033).and.(isec1(7).eq.100)) then |
---|
| 346 | ! U VELOCITY |
---|
| 347 | if((i.eq.0).and.(j.eq.0)) then |
---|
| 348 | do ii=1,nuvz |
---|
[467460a] | 349 | if (abs(xsec18*100.0-akz(ii)) < & |
---|
| 350 | 10.0*max(spacing(akz(ii)),spacing(xsec18*100.0))) then |
---|
| 351 | numpu=ii |
---|
| 352 | end if |
---|
[e200b7a] | 353 | end do |
---|
| 354 | endif |
---|
| 355 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 356 | if(i.lt.i180) then |
---|
| 357 | uuh(i180+i,j,numpu)=help |
---|
[e200b7a] | 358 | else |
---|
[467460a] | 359 | uuh(i-i180,j,numpu)=help |
---|
[e200b7a] | 360 | endif |
---|
| 361 | endif |
---|
| 362 | if((isec1(6).eq.034).and.(isec1(7).eq.100)) then |
---|
| 363 | ! V VELOCITY |
---|
| 364 | if((i.eq.0).and.(j.eq.0)) then |
---|
| 365 | do ii=1,nuvz |
---|
[467460a] | 366 | if (abs(xsec18*100.0-akz(ii)) < & |
---|
| 367 | 10.0*max(spacing(akz(ii)),spacing(xsec18*100.0))) then |
---|
| 368 | numpv=ii |
---|
| 369 | end if |
---|
[e200b7a] | 370 | end do |
---|
| 371 | endif |
---|
| 372 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 373 | if(i.lt.i180) then |
---|
| 374 | vvh(i180+i,j,numpv)=help |
---|
[e200b7a] | 375 | else |
---|
[467460a] | 376 | vvh(i-i180,j,numpv)=help |
---|
[e200b7a] | 377 | endif |
---|
| 378 | endif |
---|
| 379 | if((isec1(6).eq.052).and.(isec1(7).eq.100)) then |
---|
| 380 | ! RELATIVE HUMIDITY -> CONVERT TO SPECIFIC HUMIDITY LATER |
---|
| 381 | if((i.eq.0).and.(j.eq.0)) then |
---|
| 382 | do ii=1,nuvz |
---|
[467460a] | 383 | if (abs(xsec18*100.0-akz(ii)) < & |
---|
| 384 | 10.0*max(spacing(akz(ii)),spacing(xsec18*100.0))) then |
---|
| 385 | numprh=ii |
---|
| 386 | end if |
---|
[e200b7a] | 387 | end do |
---|
| 388 | endif |
---|
| 389 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 390 | if(i.lt.i180) then |
---|
| 391 | qvh(i180+i,j,numprh,n)=help |
---|
[e200b7a] | 392 | else |
---|
[467460a] | 393 | qvh(i-i180,j,numprh,n)=help |
---|
[e200b7a] | 394 | endif |
---|
| 395 | endif |
---|
| 396 | if((isec1(6).eq.001).and.(isec1(7).eq.001)) then |
---|
| 397 | ! SURFACE PRESSURE |
---|
| 398 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 399 | if(i.lt.i180) then |
---|
| 400 | ps(i180+i,j,1,n)=help |
---|
[e200b7a] | 401 | else |
---|
[467460a] | 402 | ps(i-i180,j,1,n)=help |
---|
[e200b7a] | 403 | endif |
---|
| 404 | endif |
---|
| 405 | if((isec1(6).eq.039).and.(isec1(7).eq.100)) then |
---|
| 406 | ! W VELOCITY |
---|
| 407 | if((i.eq.0).and.(j.eq.0)) then |
---|
| 408 | do ii=1,nuvz |
---|
[467460a] | 409 | if ((xsec18*100.0).eq.akz(ii)) numpw=ii |
---|
[e200b7a] | 410 | end do |
---|
| 411 | endif |
---|
| 412 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 413 | if(i.lt.i180) then |
---|
| 414 | wwh(i180+i,j,numpw)=help |
---|
[e200b7a] | 415 | else |
---|
[467460a] | 416 | wwh(i-i180,j,numpw)=help |
---|
[e200b7a] | 417 | endif |
---|
| 418 | endif |
---|
| 419 | if((isec1(6).eq.066).and.(isec1(7).eq.001)) then |
---|
| 420 | ! SNOW DEPTH |
---|
| 421 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 422 | if(i.lt.i180) then |
---|
| 423 | sd(i180+i,j,1,n)=help |
---|
[e200b7a] | 424 | else |
---|
[467460a] | 425 | sd(i-i180,j,1,n)=help |
---|
[e200b7a] | 426 | endif |
---|
| 427 | endif |
---|
| 428 | if((isec1(6).eq.002).and.(isec1(7).eq.102)) then |
---|
| 429 | ! MEAN SEA LEVEL PRESSURE |
---|
| 430 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 431 | if(i.lt.i180) then |
---|
| 432 | msl(i180+i,j,1,n)=help |
---|
[e200b7a] | 433 | else |
---|
[467460a] | 434 | msl(i-i180,j,1,n)=help |
---|
[e200b7a] | 435 | endif |
---|
| 436 | endif |
---|
| 437 | if((isec1(6).eq.071).and.(isec1(7).eq.244)) then |
---|
| 438 | ! TOTAL CLOUD COVER |
---|
| 439 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 440 | if(i.lt.i180) then |
---|
| 441 | tcc(i180+i,j,1,n)=help |
---|
[e200b7a] | 442 | else |
---|
[467460a] | 443 | tcc(i-i180,j,1,n)=help |
---|
[e200b7a] | 444 | endif |
---|
| 445 | endif |
---|
| 446 | if((isec1(6).eq.033).and.(isec1(7).eq.105).and. & |
---|
[467460a] | 447 | (nint(xsec18).eq.10)) then |
---|
[e200b7a] | 448 | ! 10 M U VELOCITY |
---|
| 449 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 450 | if(i.lt.i180) then |
---|
| 451 | u10(i180+i,j,1,n)=help |
---|
[e200b7a] | 452 | else |
---|
[467460a] | 453 | u10(i-i180,j,1,n)=help |
---|
[e200b7a] | 454 | endif |
---|
| 455 | endif |
---|
| 456 | if((isec1(6).eq.034).and.(isec1(7).eq.105).and. & |
---|
[467460a] | 457 | (nint(xsec18).eq.10)) then |
---|
[e200b7a] | 458 | ! 10 M V VELOCITY |
---|
| 459 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 460 | if(i.lt.i180) then |
---|
| 461 | v10(i180+i,j,1,n)=help |
---|
[e200b7a] | 462 | else |
---|
[467460a] | 463 | v10(i-i180,j,1,n)=help |
---|
[e200b7a] | 464 | endif |
---|
| 465 | endif |
---|
| 466 | if((isec1(6).eq.011).and.(isec1(7).eq.105).and. & |
---|
[467460a] | 467 | (nint(xsec18).eq.2)) then |
---|
[e200b7a] | 468 | ! 2 M TEMPERATURE |
---|
| 469 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 470 | if(i.lt.i180) then |
---|
| 471 | tt2(i180+i,j,1,n)=help |
---|
[e200b7a] | 472 | else |
---|
[467460a] | 473 | tt2(i-i180,j,1,n)=help |
---|
[e200b7a] | 474 | endif |
---|
| 475 | endif |
---|
| 476 | if((isec1(6).eq.017).and.(isec1(7).eq.105).and. & |
---|
[467460a] | 477 | (nint(xsec18).eq.2)) then |
---|
[e200b7a] | 478 | ! 2 M DEW POINT TEMPERATURE |
---|
| 479 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 480 | if(i.lt.i180) then |
---|
| 481 | td2(i180+i,j,1,n)=help |
---|
[e200b7a] | 482 | else |
---|
[467460a] | 483 | td2(i-i180,j,1,n)=help |
---|
[e200b7a] | 484 | endif |
---|
| 485 | endif |
---|
| 486 | if((isec1(6).eq.062).and.(isec1(7).eq.001)) then |
---|
| 487 | ! LARGE SCALE PREC. |
---|
| 488 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 489 | if(i.lt.i180) then |
---|
| 490 | lsprec(i180+i,j,1,n)=help |
---|
[e200b7a] | 491 | else |
---|
[467460a] | 492 | lsprec(i-i180,j,1,n)=help |
---|
[e200b7a] | 493 | endif |
---|
| 494 | endif |
---|
| 495 | if((isec1(6).eq.063).and.(isec1(7).eq.001)) then |
---|
| 496 | ! CONVECTIVE PREC. |
---|
| 497 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 498 | if(i.lt.i180) then |
---|
| 499 | convprec(i180+i,j,1,n)=help |
---|
[e200b7a] | 500 | else |
---|
[467460a] | 501 | convprec(i-i180,j,1,n)=help |
---|
[e200b7a] | 502 | endif |
---|
| 503 | endif |
---|
| 504 | if((isec1(6).eq.007).and.(isec1(7).eq.001)) then |
---|
| 505 | ! TOPOGRAPHY |
---|
| 506 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 507 | if(i.lt.i180) then |
---|
| 508 | oro(i180+i,j)=help |
---|
| 509 | excessoro(i180+i,j)=0.0 ! ISOBARIC SURFACES: SUBGRID TERRAIN DISREGARDED |
---|
[e200b7a] | 510 | else |
---|
[467460a] | 511 | oro(i-i180,j)=help |
---|
| 512 | excessoro(i-i180,j)=0.0 ! ISOBARIC SURFACES: SUBGRID TERRAIN DISREGARDED |
---|
[e200b7a] | 513 | endif |
---|
| 514 | endif |
---|
| 515 | if((isec1(6).eq.081).and.(isec1(7).eq.001)) then |
---|
| 516 | ! LAND SEA MASK |
---|
| 517 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 518 | if(i.lt.i180) then |
---|
| 519 | lsm(i180+i,j)=help |
---|
[e200b7a] | 520 | else |
---|
[467460a] | 521 | lsm(i-i180,j)=help |
---|
[e200b7a] | 522 | endif |
---|
| 523 | endif |
---|
| 524 | if((isec1(6).eq.221).and.(isec1(7).eq.001)) then |
---|
| 525 | ! MIXING HEIGHT |
---|
| 526 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 527 | if(i.lt.i180) then |
---|
| 528 | hmix(i180+i,j,1,n)=help |
---|
[e200b7a] | 529 | else |
---|
[467460a] | 530 | hmix(i-i180,j,1,n)=help |
---|
[e200b7a] | 531 | endif |
---|
| 532 | endif |
---|
| 533 | if((isec1(6).eq.052).and.(isec1(7).eq.105).and. & |
---|
[467460a] | 534 | (nint(xsec18).eq.02)) then |
---|
[e200b7a] | 535 | ! 2 M RELATIVE HUMIDITY |
---|
| 536 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 537 | if(i.lt.i180) then |
---|
| 538 | qvh2(i180+i,j)=help |
---|
[e200b7a] | 539 | else |
---|
[467460a] | 540 | qvh2(i-i180,j)=help |
---|
[e200b7a] | 541 | endif |
---|
| 542 | endif |
---|
| 543 | if((isec1(6).eq.011).and.(isec1(7).eq.107)) then |
---|
| 544 | ! TEMPERATURE LOWEST SIGMA LEVEL |
---|
| 545 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 546 | if(i.lt.i180) then |
---|
| 547 | tlev1(i180+i,j)=help |
---|
[e200b7a] | 548 | else |
---|
[467460a] | 549 | tlev1(i-i180,j)=help |
---|
[e200b7a] | 550 | endif |
---|
| 551 | endif |
---|
| 552 | if((isec1(6).eq.033).and.(isec1(7).eq.107)) then |
---|
| 553 | ! U VELOCITY LOWEST SIGMA LEVEL |
---|
| 554 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 555 | if(i.lt.i180) then |
---|
| 556 | ulev1(i180+i,j)=help |
---|
[e200b7a] | 557 | else |
---|
[467460a] | 558 | ulev1(i-i180,j)=help |
---|
[e200b7a] | 559 | endif |
---|
| 560 | endif |
---|
| 561 | if((isec1(6).eq.034).and.(isec1(7).eq.107)) then |
---|
| 562 | ! V VELOCITY LOWEST SIGMA LEVEL |
---|
| 563 | help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
[467460a] | 564 | if(i.lt.i180) then |
---|
| 565 | vlev1(i180+i,j)=help |
---|
[e200b7a] | 566 | else |
---|
[467460a] | 567 | vlev1(i-i180,j)=help |
---|
[e200b7a] | 568 | endif |
---|
| 569 | endif |
---|
[db91eb7] | 570 | ! SEC & IP 12/2018 read GFS clouds |
---|
[467460a] | 571 | ! ESO TODO: do as for hachinger version |
---|
| 572 | ! if((isec1(6).eq.153).and.(isec1(7).eq.100)) then !! CLWCR Cloud liquid water content [kg/kg] |
---|
| 573 | ! if((i.eq.0).and.(j.eq.0)) then |
---|
| 574 | ! do ii=1,nuvz |
---|
| 575 | ! if ((isec1(8)*100.0).eq.akz(ii)) numpclwch=ii |
---|
| 576 | ! end do |
---|
| 577 | ! endif |
---|
| 578 | ! help=zsec4(nxfield*(ny-j-1)+i+1) |
---|
| 579 | ! if(i.le.i180) then |
---|
| 580 | ! clwch(i179+i,j,numpclwch,n)=help |
---|
| 581 | ! else |
---|
| 582 | ! clwch(i-i181,j,numpclwch,n)=help |
---|
| 583 | ! endif |
---|
| 584 | ! readclouds=.true. |
---|
| 585 | ! sumclouds=.true. |
---|
| 586 | ! endif |
---|
[db91eb7] | 587 | |
---|
[e200b7a] | 588 | |
---|
| 589 | end do |
---|
| 590 | end do |
---|
| 591 | |
---|
| 592 | endif |
---|
| 593 | |
---|
| 594 | if((isec1(6).eq.33).and.(isec1(7).eq.100)) then |
---|
| 595 | ! NCEP ISOBARIC LEVELS |
---|
| 596 | iumax=iumax+1 |
---|
| 597 | endif |
---|
| 598 | |
---|
| 599 | call grib_release(igrib) |
---|
| 600 | goto 10 !! READ NEXT LEVEL OR PARAMETER |
---|
| 601 | ! |
---|
| 602 | ! CLOSING OF INPUT DATA FILE |
---|
| 603 | ! |
---|
| 604 | |
---|
| 605 | !HSO close grib file |
---|
| 606 | 50 continue |
---|
| 607 | call grib_close_file(ifile) |
---|
| 608 | |
---|
| 609 | ! SENS. HEAT FLUX |
---|
| 610 | sshf(:,:,1,n)=0.0 ! not available from gfs.tccz.pgrbfxx files |
---|
| 611 | hflswitch=.false. ! Heat flux not available |
---|
| 612 | ! SOLAR RADIATIVE FLUXES |
---|
| 613 | ssr(:,:,1,n)=0.0 ! not available from gfs.tccz.pgrbfxx files |
---|
| 614 | ! EW SURFACE STRESS |
---|
| 615 | ewss=0.0 ! not available from gfs.tccz.pgrbfxx files |
---|
| 616 | ! NS SURFACE STRESS |
---|
| 617 | nsss=0.0 ! not available from gfs.tccz.pgrbfxx files |
---|
| 618 | strswitch=.false. ! stress not available |
---|
| 619 | |
---|
| 620 | ! CONVERT TP TO LSP (GRIB2 only) |
---|
| 621 | if (gribVer.eq.2) then |
---|
[467460a] | 622 | lsprec(0:nxfield-1, 0:nymin1, 1, n) = max( 0.0 , lsprec(0:nxfield-1,0:nymin1,1,n)-convprec(0:nxfield-1,0:nymin1,1,n) ) |
---|
[e200b7a] | 623 | endif |
---|
| 624 | !HSO end edits |
---|
| 625 | |
---|
| 626 | |
---|
| 627 | ! TRANSFORM RH TO SPECIFIC HUMIDITY |
---|
| 628 | |
---|
| 629 | do j=0,ny-1 |
---|
| 630 | do i=0,nxfield-1 |
---|
| 631 | do k=1,nuvz |
---|
| 632 | help=qvh(i,j,k,n) |
---|
| 633 | temp=tth(i,j,k,n) |
---|
[467460a] | 634 | if (temp .eq. 0.0) then |
---|
| 635 | write (*, *) i, j, k, n |
---|
| 636 | temp = 273.0 |
---|
| 637 | endif |
---|
[e200b7a] | 638 | plev1=akm(k)+bkm(k)*ps(i,j,1,n) |
---|
| 639 | elev=ew(temp)*help/100.0 |
---|
| 640 | qvh(i,j,k,n)=xmwml*(elev/(plev1-((1.0-xmwml)*elev))) |
---|
| 641 | end do |
---|
| 642 | end do |
---|
| 643 | end do |
---|
| 644 | |
---|
| 645 | ! CALCULATE 2 M DEW POINT FROM 2 M RELATIVE HUMIDITY |
---|
| 646 | ! USING BOLTON'S (1980) FORMULA |
---|
| 647 | ! BECAUSE td2 IS NOT AVAILABLE FROM NCEP GFS DATA |
---|
| 648 | |
---|
| 649 | do j=0,ny-1 |
---|
| 650 | do i=0,nxfield-1 |
---|
| 651 | help=qvh2(i,j) |
---|
| 652 | temp=tt2(i,j,1,n) |
---|
[467460a] | 653 | if (temp .eq. 0.0) then |
---|
| 654 | write (*, *) i, j, n |
---|
| 655 | temp = 273.0 |
---|
| 656 | endif |
---|
[e200b7a] | 657 | elev=ew(temp)/100.*help/100. !vapour pressure in hPa |
---|
| 658 | td2(i,j,1,n)=243.5/(17.67/log(elev/6.112)-1)+273. |
---|
| 659 | if (help.le.0.) td2(i,j,1,n)=tt2(i,j,1,n) |
---|
| 660 | end do |
---|
| 661 | end do |
---|
| 662 | |
---|
| 663 | if(levdiff2.eq.0) then |
---|
| 664 | iwmax=nlev_ec+1 |
---|
| 665 | do i=0,nxmin1 |
---|
| 666 | do j=0,nymin1 |
---|
| 667 | wwh(i,j,nlev_ec+1)=0. |
---|
| 668 | end do |
---|
| 669 | end do |
---|
| 670 | endif |
---|
| 671 | |
---|
| 672 | |
---|
| 673 | ! For global fields, assign the leftmost data column also to the rightmost |
---|
| 674 | ! data column; if required, shift whole grid by nxshift grid points |
---|
| 675 | !************************************************************************* |
---|
| 676 | |
---|
| 677 | if (xglobal) then |
---|
| 678 | call shift_field_0(ewss,nxfield,ny) |
---|
| 679 | call shift_field_0(nsss,nxfield,ny) |
---|
| 680 | call shift_field_0(oro,nxfield,ny) |
---|
| 681 | call shift_field_0(excessoro,nxfield,ny) |
---|
| 682 | call shift_field_0(lsm,nxfield,ny) |
---|
| 683 | call shift_field_0(ulev1,nxfield,ny) |
---|
| 684 | call shift_field_0(vlev1,nxfield,ny) |
---|
| 685 | call shift_field_0(tlev1,nxfield,ny) |
---|
| 686 | call shift_field_0(qvh2,nxfield,ny) |
---|
| 687 | call shift_field(ps,nxfield,ny,1,1,2,n) |
---|
| 688 | call shift_field(sd,nxfield,ny,1,1,2,n) |
---|
| 689 | call shift_field(msl,nxfield,ny,1,1,2,n) |
---|
| 690 | call shift_field(tcc,nxfield,ny,1,1,2,n) |
---|
| 691 | call shift_field(u10,nxfield,ny,1,1,2,n) |
---|
| 692 | call shift_field(v10,nxfield,ny,1,1,2,n) |
---|
| 693 | call shift_field(tt2,nxfield,ny,1,1,2,n) |
---|
| 694 | call shift_field(td2,nxfield,ny,1,1,2,n) |
---|
| 695 | call shift_field(lsprec,nxfield,ny,1,1,2,n) |
---|
| 696 | call shift_field(convprec,nxfield,ny,1,1,2,n) |
---|
| 697 | call shift_field(sshf,nxfield,ny,1,1,2,n) |
---|
| 698 | call shift_field(ssr,nxfield,ny,1,1,2,n) |
---|
| 699 | call shift_field(hmix,nxfield,ny,1,1,2,n) |
---|
| 700 | call shift_field(tth,nxfield,ny,nuvzmax,nuvz,2,n) |
---|
| 701 | call shift_field(qvh,nxfield,ny,nuvzmax,nuvz,2,n) |
---|
| 702 | call shift_field(uuh,nxfield,ny,nuvzmax,nuvz,1,1) |
---|
| 703 | call shift_field(vvh,nxfield,ny,nuvzmax,nuvz,1,1) |
---|
| 704 | call shift_field(wwh,nxfield,ny,nwzmax,nwz,1,1) |
---|
[db91eb7] | 705 | ! IP & SEC adding GFS Clouds 20181205 |
---|
| 706 | call shift_field(clwch,nxfield,ny,nuvzmax,nuvz,2,n) |
---|
[e200b7a] | 707 | endif |
---|
| 708 | |
---|
| 709 | do i=0,nxmin1 |
---|
| 710 | do j=0,nymin1 |
---|
| 711 | ! Convert precip. from mm/s -> mm/hour |
---|
| 712 | convprec(i,j,1,n)=convprec(i,j,1,n)*3600. |
---|
| 713 | lsprec(i,j,1,n)=lsprec(i,j,1,n)*3600. |
---|
| 714 | surfstr(i,j,1,n)=sqrt(ewss(i,j)**2+nsss(i,j)**2) |
---|
| 715 | end do |
---|
| 716 | end do |
---|
| 717 | |
---|
| 718 | if ((.not.hflswitch).or.(.not.strswitch)) then |
---|
| 719 | ! write(*,*) 'WARNING: No flux data contained in GRIB file ', |
---|
| 720 | ! + wfname(indj) |
---|
| 721 | |
---|
| 722 | ! CALCULATE USTAR AND SSHF USING THE PROFILE METHOD |
---|
| 723 | !*************************************************************************** |
---|
| 724 | |
---|
| 725 | do i=0,nxmin1 |
---|
| 726 | do j=0,nymin1 |
---|
| 727 | hlev1=30.0 ! HEIGHT OF FIRST MODEL SIGMA LAYER |
---|
| 728 | ff10m= sqrt(u10(i,j,1,n)**2+v10(i,j,1,n)**2) |
---|
| 729 | fflev1=sqrt(ulev1(i,j)**2+vlev1(i,j)**2) |
---|
| 730 | call pbl_profile(ps(i,j,1,n),td2(i,j,1,n),hlev1, & |
---|
| 731 | tt2(i,j,1,n),tlev1(i,j),ff10m,fflev1, & |
---|
| 732 | surfstr(i,j,1,n),sshf(i,j,1,n)) |
---|
| 733 | if(sshf(i,j,1,n).gt.200.) sshf(i,j,1,n)=200. |
---|
| 734 | if(sshf(i,j,1,n).lt.-400.) sshf(i,j,1,n)=-400. |
---|
| 735 | end do |
---|
| 736 | end do |
---|
| 737 | endif |
---|
| 738 | |
---|
| 739 | if(iumax.ne.nuvz) stop 'READWIND: NUVZ NOT CONSISTENT' |
---|
| 740 | if(iumax.ne.nwz) stop 'READWIND: NWZ NOT CONSISTENT' |
---|
| 741 | |
---|
| 742 | return |
---|
| 743 | 888 write(*,*) ' #### FLEXPART MODEL ERROR! WINDFIELD #### ' |
---|
| 744 | write(*,*) ' #### ',wfname(indj),' #### ' |
---|
| 745 | write(*,*) ' #### IS NOT GRIB FORMAT !!! #### ' |
---|
| 746 | stop 'Execution terminated' |
---|
| 747 | 999 write(*,*) ' #### FLEXPART MODEL ERROR! WINDFIELD #### ' |
---|
| 748 | write(*,*) ' #### ',wfname(indj),' #### ' |
---|
| 749 | write(*,*) ' #### CANNOT BE OPENED !!! #### ' |
---|
| 750 | stop 'Execution terminated' |
---|
| 751 | |
---|
[6ecb30a] | 752 | end subroutine readwind_gfs |
---|