Changeset 467460a in flexpart.git
- Timestamp:
- Mar 13, 2021, 10:00:37 AM (3 years ago)
- Branches:
- GFS_025, dev
- Children:
- 9ca6e38
- Parents:
- 759df5f
- Location:
- src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/calcmatrix.f90
r92fab65 r467460a 71 71 k = kuvz-1 72 72 if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then 73 pconv(k) = (akz(kuvz) + bkz(kuvz)*psconv)74 phconv(kuvz) = (akm(kuvz) + bkm(kuvz)*psconv)73 pconv(k) = (akz(kuvz) + bkz(kuvz)*psconv) 74 phconv(kuvz) = (akm(kuvz) + bkm(kuvz)*psconv) 75 75 else 76 76 phconv(kuvz) = 0.5*(pconv(kuvz)+pconv(k)) -
src/ew.f90
r92fab65 r467460a 14 14 15 15 ew=0. 16 if(x.le.0.) stop 'sorry: t not in [k]' 16 if(x.le.0.) then 17 write(*,*) 'in ew.f90: x=', x 18 stop 'sorry: t not in [k]' 19 end if 20 17 21 y=373.16/x 18 22 a=-7.90298*(y-1.) -
src/gridcheck_gfs.f90
- Property mode changed from 100644 to 100755
ra803521 r467460a 75 75 real :: sizesouth,sizenorth,xauxa,pint 76 76 real :: akm_usort(nwzmax) 77 real,parameter :: eps= 0.000177 real,parameter :: eps=spacing(2.0_4*360.0_4) 78 78 79 79 ! NCEP GFS 80 80 real :: pres(nwzmax), help 81 81 82 integer :: i1 79,i180,i18182 integer :: i180 83 83 84 84 ! VARIABLES AND ARRAYS NEEDED FOR GRIB DECODING … … 224 224 nxfield=isec2(2) 225 225 ny=isec2(3) 226 if((abs(xaux1).lt.eps).and.(xaux2.ge.359 )) then ! NCEP DATA FROM 0 TO227 xaux1=-1 79.0 ! 359 DEG EAST ->228 xaux2=-1 79.0+360.-360./real(nxfield) ! TRANSFORMED TO -179226 if((abs(xaux1).lt.eps).and.(xaux2.ge.359.)) then ! NCEP DATA FROM 0 TO 227 xaux1=-180.0 ! 359 DEG EAST -> 228 xaux2=-180.0+360.-360./real(nxfield) ! TRANSFORMED TO -179 229 229 endif ! TO 180 DEG EAST 230 230 if (xaux1.gt.180) xaux1=xaux1-360.0 … … 305 305 306 306 307 i179=nint(179./dx) 308 if (dx.lt.0.7) then 309 i180=nint(180./dx)+1 ! 0.5 deg data 310 else 311 i180=nint(179./dx)+1 ! 1 deg data 312 endif 313 i181=i180+1 307 i180=nint(180./dx) ! 0.5 deg data 314 308 315 309 … … 321 315 do ix=0,nxfield-1 322 316 help=zsec4(nxfield*(ny-jy-1)+ix+1) 323 if(ix.l e.i180) then324 oro(i1 79+ix,jy)=help325 excessoro(i1 79+ix,jy)=0.0 ! ISOBARIC SURFACES: SUBGRID TERRAIN DISREGARDED317 if(ix.lt.i180) then 318 oro(i180+ix,jy)=help 319 excessoro(i180+ix,jy)=0.0 ! ISOBARIC SURFACES: SUBGRID TERRAIN DISREGARDED 326 320 else 327 oro(ix-i18 1,jy)=help328 excessoro(ix-i18 1,jy)=0.0 ! ISOBARIC SURFACES: SUBGRID TERRAIN DISREGARDED321 oro(ix-i180,jy)=help 322 excessoro(ix-i180,jy)=0.0 ! ISOBARIC SURFACES: SUBGRID TERRAIN DISREGARDED 329 323 endif 330 324 end do … … 339 333 do ix=0,nxfield-1 340 334 help=zsec4(nxfield*(ny-jy-1)+ix+1) 341 if(ix.l e.i180) then342 lsm(i1 79+ix,jy)=help335 if(ix.lt.i180) then 336 lsm(i180+ix,jy)=help 343 337 else 344 lsm(ix-i18 1,jy)=help338 lsm(ix-i180,jy)=help 345 339 endif 346 340 end do … … 413 407 write(*,*) 414 408 write(*,*) 415 write(*,'(a,2i7)') 'Vertical levels in NCEP data: ', &409 write(*,'(a,2i7)') '# of vertical levels in NCEP data: ', & 416 410 nuvz,nwz 417 411 write(*,*) -
src/par_mod.f90
r759df5f r467460a 146 146 147 147 ! GFS 148 integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138 148 ! integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138 149 ! GFS 0.25 150 integer,parameter :: nxmax=1441,nymax=721,nuvzmax=138,nwzmax=138,nzmax=138 149 151 integer :: nxshift=0 ! shift not fixed for the executable 150 152 … … 212 214 !************************************************** 213 215 214 integer,parameter :: maxpart=100000 216 integer,parameter :: maxpart=10000000 215 217 integer,parameter :: maxspec=6 216 218 … … 256 258 !********************************* 257 259 258 integer,parameter :: maxrand=1000000 260 integer,parameter :: maxrand=10000000 259 261 260 262 ! maxrand number of random numbers used -
src/readreleases.f90
- Property mode changed from 100644 to 100755
r92fab65 r467460a 546 546 if ((jul1.lt.bdate).or.(jul2.gt.edate)) then 547 547 write(*,*) 'FLEXPART MODEL ERROR' 548 write(*,*) 'Release starts before simulation begins or ends '548 write(*,*) 'Release starts before simulation begins or ends (1)' 549 549 write(*,*) 'after simulation stops.' 550 write(*,*) 'Make files COMMAND and RELEASES consistent .'550 write(*,*) 'Make files COMMAND and RELEASES consistent (1).' 551 551 stop 552 552 endif … … 561 561 if ((jul1.lt.edate).or.(jul2.gt.bdate)) then 562 562 write(*,*) 'FLEXPART MODEL ERROR' 563 write(*,*) 'Release starts before simulation begins or ends '563 write(*,*) 'Release starts before simulation begins or ends (2)' 564 564 write(*,*) 'after simulation stops.' 565 write(*,*) 'Make files COMMAND and RELEASES consistent .'565 write(*,*) 'Make files COMMAND and RELEASES consistent (2).' 566 566 stop 567 567 endif -
src/readwind_gfs.f90
- Property mode changed from 100644 to 100755
ra803521 r467460a 72 72 real :: qvh2(0:nxmax-1,0:nymax-1) 73 73 74 integer :: i1 79,i180,i18174 integer :: i180 75 75 76 76 ! VARIABLES AND ARRAYS NEEDED FOR GRIB DECODING … … 78 78 79 79 integer :: isec1(8),isec2(3) 80 real :: xsec18 80 81 real(kind=4) :: zsec4(jpunp) 81 82 real(kind=4) :: xaux,yaux,xaux0,yaux0 83 real,parameter :: eps=spacing(2.0_4*360.0_4) 82 84 real(kind=8) :: xauxin,yauxin 83 real,parameter :: eps=1.e-484 85 real(kind=4) :: ewss(0:nxmax-1,0:nymax-1),nsss(0:nxmax-1,0:nymax-1) 85 86 real :: plev1,hlev1,ff10m,fflev1 … … 137 138 !read the grib1 identifiers 138 139 call grib_get_int(igrib,'indicatorOfParameter',isec1(6),iret) 139 !call grib_check(iret,gribFunction,gribErrorMsg)140 call grib_check(iret,gribFunction,gribErrorMsg) 140 141 call grib_get_int(igrib,'indicatorOfTypeOfLevel',isec1(7),iret) 141 !call grib_check(iret,gribFunction,gribErrorMsg)142 call grib_check(iret,gribFunction,gribErrorMsg) 142 143 call grib_get_int(igrib,'level',isec1(8),iret) 143 ! call grib_check(iret,gribFunction,gribErrorMsg) 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)) 144 148 145 149 else ! GRIB Edition 2 … … 149 153 150 154 call grib_get_int(igrib,'discipline',discipl,iret) 151 !call grib_check(iret,gribFunction,gribErrorMsg)155 call grib_check(iret,gribFunction,gribErrorMsg) 152 156 call grib_get_int(igrib,'parameterCategory',parCat,iret) 153 !call grib_check(iret,gribFunction,gribErrorMsg)157 call grib_check(iret,gribFunction,gribErrorMsg) 154 158 call grib_get_int(igrib,'parameterNumber',parNum,iret) 155 !call grib_check(iret,gribFunction,gribErrorMsg)159 call grib_check(iret,gribFunction,gribErrorMsg) 156 160 call grib_get_int(igrib,'typeOfFirstFixedSurface',typSurf,iret) 157 !call grib_check(iret,gribFunction,gribErrorMsg)161 call grib_check(iret,gribFunction,gribErrorMsg) 158 162 call grib_get_int(igrib,'scaledValueOfFirstFixedSurface', & 159 163 valSurf,iret) 160 !call grib_check(iret,gribFunction,gribErrorMsg)164 call grib_check(iret,gribFunction,gribErrorMsg) 161 165 162 166 ! write(*,*) 'Field: ',ifield,parCat,parNum,typSurf,shortname 163 167 !convert to grib1 identifiers 164 isec1(6)=-1 165 isec1(7)=-1 166 isec1(8)=-1 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 167 172 if ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.100)) then ! T 168 173 isec1(6)=11 ! indicatorOfParameter 169 174 isec1(7)=100 ! indicatorOfTypeOfLevel 170 isec1(8)=valSurf/100 ! level, convert to hPa175 xsec18=valSurf/100.0 ! level, convert to hPa 171 176 elseif ((parCat.eq.2).and.(parNum.eq.2).and.(typSurf.eq.100)) then ! U 172 177 isec1(6)=33 ! indicatorOfParameter 173 178 isec1(7)=100 ! indicatorOfTypeOfLevel 174 isec1(8)=valSurf/100 ! level, convert to hPa179 xsec18=valSurf/100.0 ! level, convert to hPa 175 180 elseif ((parCat.eq.2).and.(parNum.eq.3).and.(typSurf.eq.100)) then ! V 176 181 isec1(6)=34 ! indicatorOfParameter 177 182 isec1(7)=100 ! indicatorOfTypeOfLevel 178 isec1(8)=valSurf/100 ! level, convert to hPa183 xsec18=valSurf/100.0 ! level, convert to hPa 179 184 elseif ((parCat.eq.2).and.(parNum.eq.8).and.(typSurf.eq.100)) then ! W 180 185 isec1(6)=39 ! indicatorOfParameter 181 186 isec1(7)=100 ! indicatorOfTypeOfLevel 182 isec1(8)=valSurf/100 ! level, convert to hPa187 xsec18=valSurf/100.0 ! level, convert to hPa 183 188 elseif ((parCat.eq.1).and.(parNum.eq.1).and.(typSurf.eq.100)) then ! RH 184 189 isec1(6)=52 ! indicatorOfParameter 185 190 isec1(7)=100 ! indicatorOfTypeOfLevel 186 isec1(8)=valSurf/100 ! level, convert to hPa191 xsec18=valSurf/100.0 ! level, convert to hPa 187 192 elseif ((parCat.eq.1).and.(parNum.eq.1).and.(typSurf.eq.103)) then ! RH2 188 193 isec1(6)=52 ! indicatorOfParameter 189 194 isec1(7)=105 ! indicatorOfTypeOfLevel 190 isec1(8)=2195 xsec18=real(2) 191 196 elseif ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.103)) then ! T2 192 197 isec1(6)=11 ! indicatorOfParameter 193 198 isec1(7)=105 ! indicatorOfTypeOfLevel 194 isec1(8)=2199 xsec18=real(2) 195 200 elseif ((parCat.eq.2).and.(parNum.eq.2).and.(typSurf.eq.103)) then ! U10 196 201 isec1(6)=33 ! indicatorOfParameter 197 202 isec1(7)=105 ! indicatorOfTypeOfLevel 198 isec1(8)=10203 xsec18=real(10) 199 204 elseif ((parCat.eq.2).and.(parNum.eq.3).and.(typSurf.eq.103)) then ! V10 200 205 isec1(6)=34 ! indicatorOfParameter 201 206 isec1(7)=105 ! indicatorOfTypeOfLevel 202 isec1(8)=10207 xsec18=real(10) 203 208 elseif ((parCat.eq.1).and.(parNum.eq.22).and.(typSurf.eq.100)) then ! CLWMR Cloud Mixing Ratio [kg/kg]: 204 209 isec1(6)=153 ! indicatorOfParameter 205 210 isec1(7)=100 ! indicatorOfTypeOfLevel 206 isec1(8)=valSurf/100 ! level, convert to hPa211 xsec18=valSurf/100.0 ! level, convert to hPa 207 212 elseif ((parCat.eq.3).and.(parNum.eq.1).and.(typSurf.eq.101)) then ! SLP 208 213 isec1(6)=2 ! indicatorOfParameter 209 214 isec1(7)=102 ! indicatorOfTypeOfLevel 210 isec1(8)=0215 xsec18=real(0) 211 216 elseif ((parCat.eq.3).and.(parNum.eq.0).and.(typSurf.eq.1)) then ! SP 212 217 isec1(6)=1 ! indicatorOfParameter 213 218 isec1(7)=1 ! indicatorOfTypeOfLevel 214 isec1(8)=0219 xsec18=real(0) 215 220 elseif ((parCat.eq.1).and.(parNum.eq.13).and.(typSurf.eq.1)) then ! SNOW 216 221 isec1(6)=66 ! indicatorOfParameter 217 222 isec1(7)=1 ! indicatorOfTypeOfLevel 218 isec1(8)=0223 xsec18=real(0) 219 224 elseif ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.104)) then ! T sigma 0 220 225 isec1(6)=11 ! indicatorOfParameter 221 226 isec1(7)=107 ! indicatorOfTypeOfLevel 222 isec1(8)=0.995! lowest sigma level227 xsec18=0.995 ! lowest sigma level 223 228 elseif ((parCat.eq.2).and.(parNum.eq.2).and.(typSurf.eq.104)) then ! U sigma 0 224 229 isec1(6)=33 ! indicatorOfParameter 225 230 isec1(7)=107 ! indicatorOfTypeOfLevel 226 isec1(8)=0.995! lowest sigma level231 xsec18=0.995 ! lowest sigma level 227 232 elseif ((parCat.eq.2).and.(parNum.eq.3).and.(typSurf.eq.104)) then ! V sigma 0 228 233 isec1(6)=34 ! indicatorOfParameter 229 234 isec1(7)=107 ! indicatorOfTypeOfLevel 230 isec1(8)=0.995! lowest sigma level235 xsec18=0.995 ! lowest sigma level 231 236 elseif ((parCat.eq.3).and.(parNum.eq.5).and.(typSurf.eq.1)) then ! TOPO 232 237 isec1(6)=7 ! indicatorOfParameter 233 238 isec1(7)=1 ! indicatorOfTypeOfLevel 234 isec1(8)=0239 xsec18=real(0) 235 240 elseif ((parCat.eq.0).and.(parNum.eq.0).and.(typSurf.eq.1) & 236 241 .and.(discipl.eq.2)) then ! LSM 237 242 isec1(6)=81 ! indicatorOfParameter 238 243 isec1(7)=1 ! indicatorOfTypeOfLevel 239 isec1(8)=0244 xsec18=real(0) 240 245 elseif ((parCat.eq.3).and.(parNum.eq.196).and.(typSurf.eq.1)) then ! BLH 241 246 isec1(6)=221 ! indicatorOfParameter 242 247 isec1(7)=1 ! indicatorOfTypeOfLevel 243 isec1(8)=0248 xsec18=real(0) 244 249 elseif ((parCat.eq.1).and.(parNum.eq.7).and.(typSurf.eq.1)) then ! LSP/TP 245 250 isec1(6)=62 ! indicatorOfParameter 246 251 isec1(7)=1 ! indicatorOfTypeOfLevel 247 isec1(8)=0252 xsec18=real(0) 248 253 elseif ((parCat.eq.1).and.(parNum.eq.196).and.(typSurf.eq.1)) then ! CP 249 254 isec1(6)=63 ! indicatorOfParameter 250 255 isec1(7)=1 ! indicatorOfTypeOfLevel 251 isec1(8)=0256 xsec18=real(0) 252 257 endif 253 258 … … 257 262 ! get the size and data of the values array 258 263 call grib_get_real4_array(igrib,'values',zsec4,iret) 259 !call grib_check(iret,gribFunction,gribErrorMsg)264 call grib_check(iret,gribFunction,gribErrorMsg) 260 265 endif 261 266 … … 266 271 call grib_get_int(igrib,'numberOfPointsAlongAParallel', & 267 272 isec2(2),iret) 268 !call grib_check(iret,gribFunction,gribErrorMsg)273 call grib_check(iret,gribFunction,gribErrorMsg) 269 274 call grib_get_int(igrib,'numberOfPointsAlongAMeridian', & 270 275 isec2(3),iret) 271 !call grib_check(iret,gribFunction,gribErrorMsg)276 call grib_check(iret,gribFunction,gribErrorMsg) 272 277 call grib_get_real8(igrib,'longitudeOfFirstGridPointInDegrees', & 273 278 xauxin,iret) 274 !call grib_check(iret,gribFunction,gribErrorMsg)279 call grib_check(iret,gribFunction,gribErrorMsg) 275 280 call grib_get_real8(igrib,'latitudeOfLastGridPointInDegrees', & 276 281 yauxin,iret) 277 !call grib_check(iret,gribFunction,gribErrorMsg)282 call grib_check(iret,gribFunction,gribErrorMsg) 278 283 xaux=xauxin+real(nxshift)*dx 279 284 yaux=yauxin … … 283 288 if(isec2(2).ne.nxfield) stop 'READWIND: NX NOT CONSISTENT' 284 289 if(isec2(3).ne.ny) stop 'READWIND: NY NOT CONSISTENT' 285 if(xaux.eq.0.) xaux=-1 79.0 ! NCEP DATA290 if(xaux.eq.0.) xaux=-180.0 ! NCEP DATA 286 291 xaux0=xlon0 287 292 yaux0=ylat0 … … 290 295 if(xaux0.lt.0.) xaux0=xaux0+360. 291 296 if(yaux0.lt.0.) yaux0=yaux0+360. 292 if(abs(xaux-xaux0).gt.eps) & 297 if(abs(xaux-xaux0).gt.eps) then 298 write (*, *) xaux, xaux0 293 299 stop 'READWIND: LOWER LEFT LONGITUDE NOT CONSISTENT' 294 if(abs(yaux-yaux0).gt.eps) & 300 endif 301 if(abs(yaux-yaux0).gt.eps) then 302 write (*, *) yaux, yaux0 295 303 stop 'READWIND: LOWER LEFT LATITUDE NOT CONSISTENT' 304 end if 296 305 endif 297 306 !HSO end of edits 298 307 299 i179=nint(179./dx) 300 if (dx.lt.0.7) then 301 i180=nint(180./dx)+1 ! 0.5 deg data 302 else 303 i180=nint(179./dx)+1 ! 1 deg data 304 endif 305 i181=i180+1 308 i180=nint(180./dx) 306 309 307 310 if (isec1(6).ne.-1) then 311 312 ! write (*, *) 'nxfield: ', nxfield, i180 308 313 309 314 do j=0,nymin1 310 315 do i=0,nxfield-1 311 316 if((isec1(6).eq.011).and.(isec1(7).eq.100)) then 312 ! TEMPERATURE 313 if((i.eq.0).and.(j.eq.0)) then 314 do ii=1,nuvz 315 if ((isec1(8)*100.0).eq.akz(ii)) numpt=ii 316 end do 317 endif 318 help=zsec4(nxfield*(ny-j-1)+i+1) 319 if(i.le.i180) then 320 tth(i179+i,j,numpt,n)=help 321 else 322 tth(i-i181,j,numpt,n)=help 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 328 endif 329 help=zsec4(nxfield*(ny-j-1)+i+1) 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 341 else 342 tth(i-i180,j,numpt,n)=help 323 343 endif 324 344 endif … … 327 347 if((i.eq.0).and.(j.eq.0)) then 328 348 do ii=1,nuvz 329 if ((isec1(8)*100.0).eq.akz(ii)) numpu=ii 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 330 353 end do 331 354 endif 332 355 help=zsec4(nxfield*(ny-j-1)+i+1) 333 if(i.l e.i180) then334 uuh(i1 79+i,j,numpu)=help335 else 336 uuh(i-i18 1,j,numpu)=help356 if(i.lt.i180) then 357 uuh(i180+i,j,numpu)=help 358 else 359 uuh(i-i180,j,numpu)=help 337 360 endif 338 361 endif … … 341 364 if((i.eq.0).and.(j.eq.0)) then 342 365 do ii=1,nuvz 343 if ((isec1(8)*100.0).eq.akz(ii)) numpv=ii 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 344 370 end do 345 371 endif 346 372 help=zsec4(nxfield*(ny-j-1)+i+1) 347 if(i.l e.i180) then348 vvh(i1 79+i,j,numpv)=help349 else 350 vvh(i-i18 1,j,numpv)=help373 if(i.lt.i180) then 374 vvh(i180+i,j,numpv)=help 375 else 376 vvh(i-i180,j,numpv)=help 351 377 endif 352 378 endif … … 355 381 if((i.eq.0).and.(j.eq.0)) then 356 382 do ii=1,nuvz 357 if ((isec1(8)*100.0).eq.akz(ii)) numprh=ii 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 358 387 end do 359 388 endif 360 389 help=zsec4(nxfield*(ny-j-1)+i+1) 361 if(i.l e.i180) then362 qvh(i1 79+i,j,numprh,n)=help363 else 364 qvh(i-i18 1,j,numprh,n)=help390 if(i.lt.i180) then 391 qvh(i180+i,j,numprh,n)=help 392 else 393 qvh(i-i180,j,numprh,n)=help 365 394 endif 366 395 endif … … 368 397 ! SURFACE PRESSURE 369 398 help=zsec4(nxfield*(ny-j-1)+i+1) 370 if(i.l e.i180) then371 ps(i1 79+i,j,1,n)=help372 else 373 ps(i-i18 1,j,1,n)=help399 if(i.lt.i180) then 400 ps(i180+i,j,1,n)=help 401 else 402 ps(i-i180,j,1,n)=help 374 403 endif 375 404 endif … … 378 407 if((i.eq.0).and.(j.eq.0)) then 379 408 do ii=1,nuvz 380 if (( isec1(8)*100.0).eq.akz(ii)) numpw=ii409 if ((xsec18*100.0).eq.akz(ii)) numpw=ii 381 410 end do 382 411 endif 383 412 help=zsec4(nxfield*(ny-j-1)+i+1) 384 if(i.l e.i180) then385 wwh(i1 79+i,j,numpw)=help386 else 387 wwh(i-i18 1,j,numpw)=help413 if(i.lt.i180) then 414 wwh(i180+i,j,numpw)=help 415 else 416 wwh(i-i180,j,numpw)=help 388 417 endif 389 418 endif … … 391 420 ! SNOW DEPTH 392 421 help=zsec4(nxfield*(ny-j-1)+i+1) 393 if(i.l e.i180) then394 sd(i1 79+i,j,1,n)=help395 else 396 sd(i-i18 1,j,1,n)=help422 if(i.lt.i180) then 423 sd(i180+i,j,1,n)=help 424 else 425 sd(i-i180,j,1,n)=help 397 426 endif 398 427 endif … … 400 429 ! MEAN SEA LEVEL PRESSURE 401 430 help=zsec4(nxfield*(ny-j-1)+i+1) 402 if(i.l e.i180) then403 msl(i1 79+i,j,1,n)=help404 else 405 msl(i-i18 1,j,1,n)=help431 if(i.lt.i180) then 432 msl(i180+i,j,1,n)=help 433 else 434 msl(i-i180,j,1,n)=help 406 435 endif 407 436 endif … … 409 438 ! TOTAL CLOUD COVER 410 439 help=zsec4(nxfield*(ny-j-1)+i+1) 411 if(i.l e.i180) then412 tcc(i1 79+i,j,1,n)=help413 else 414 tcc(i-i18 1,j,1,n)=help440 if(i.lt.i180) then 441 tcc(i180+i,j,1,n)=help 442 else 443 tcc(i-i180,j,1,n)=help 415 444 endif 416 445 endif 417 446 if((isec1(6).eq.033).and.(isec1(7).eq.105).and. & 418 (isec1(8).eq.10)) then447 (nint(xsec18).eq.10)) then 419 448 ! 10 M U VELOCITY 420 449 help=zsec4(nxfield*(ny-j-1)+i+1) 421 if(i.l e.i180) then422 u10(i1 79+i,j,1,n)=help423 else 424 u10(i-i18 1,j,1,n)=help450 if(i.lt.i180) then 451 u10(i180+i,j,1,n)=help 452 else 453 u10(i-i180,j,1,n)=help 425 454 endif 426 455 endif 427 456 if((isec1(6).eq.034).and.(isec1(7).eq.105).and. & 428 (isec1(8).eq.10)) then457 (nint(xsec18).eq.10)) then 429 458 ! 10 M V VELOCITY 430 459 help=zsec4(nxfield*(ny-j-1)+i+1) 431 if(i.l e.i180) then432 v10(i1 79+i,j,1,n)=help433 else 434 v10(i-i18 1,j,1,n)=help460 if(i.lt.i180) then 461 v10(i180+i,j,1,n)=help 462 else 463 v10(i-i180,j,1,n)=help 435 464 endif 436 465 endif 437 466 if((isec1(6).eq.011).and.(isec1(7).eq.105).and. & 438 (isec1(8).eq.02)) then467 (nint(xsec18).eq.2)) then 439 468 ! 2 M TEMPERATURE 440 469 help=zsec4(nxfield*(ny-j-1)+i+1) 441 if(i.l e.i180) then442 tt2(i1 79+i,j,1,n)=help443 else 444 tt2(i-i18 1,j,1,n)=help470 if(i.lt.i180) then 471 tt2(i180+i,j,1,n)=help 472 else 473 tt2(i-i180,j,1,n)=help 445 474 endif 446 475 endif 447 476 if((isec1(6).eq.017).and.(isec1(7).eq.105).and. & 448 (isec1(8).eq.02)) then477 (nint(xsec18).eq.2)) then 449 478 ! 2 M DEW POINT TEMPERATURE 450 479 help=zsec4(nxfield*(ny-j-1)+i+1) 451 if(i.l e.i180) then452 td2(i1 79+i,j,1,n)=help453 else 454 td2(i-i18 1,j,1,n)=help480 if(i.lt.i180) then 481 td2(i180+i,j,1,n)=help 482 else 483 td2(i-i180,j,1,n)=help 455 484 endif 456 485 endif … … 458 487 ! LARGE SCALE PREC. 459 488 help=zsec4(nxfield*(ny-j-1)+i+1) 460 if(i.l e.i180) then461 lsprec(i1 79+i,j,1,n)=help462 else 463 lsprec(i-i18 1,j,1,n)=help489 if(i.lt.i180) then 490 lsprec(i180+i,j,1,n)=help 491 else 492 lsprec(i-i180,j,1,n)=help 464 493 endif 465 494 endif … … 467 496 ! CONVECTIVE PREC. 468 497 help=zsec4(nxfield*(ny-j-1)+i+1) 469 if(i.l e.i180) then470 convprec(i1 79+i,j,1,n)=help471 else 472 convprec(i-i18 1,j,1,n)=help498 if(i.lt.i180) then 499 convprec(i180+i,j,1,n)=help 500 else 501 convprec(i-i180,j,1,n)=help 473 502 endif 474 503 endif … … 476 505 ! TOPOGRAPHY 477 506 help=zsec4(nxfield*(ny-j-1)+i+1) 478 if(i.l e.i180) then479 oro(i1 79+i,j)=help480 excessoro(i1 79+i,j)=0.0 ! ISOBARIC SURFACES: SUBGRID TERRAIN DISREGARDED481 else 482 oro(i-i18 1,j)=help483 excessoro(i-i18 1,j)=0.0 ! ISOBARIC SURFACES: SUBGRID TERRAIN DISREGARDED507 if(i.lt.i180) then 508 oro(i180+i,j)=help 509 excessoro(i180+i,j)=0.0 ! ISOBARIC SURFACES: SUBGRID TERRAIN DISREGARDED 510 else 511 oro(i-i180,j)=help 512 excessoro(i-i180,j)=0.0 ! ISOBARIC SURFACES: SUBGRID TERRAIN DISREGARDED 484 513 endif 485 514 endif … … 487 516 ! LAND SEA MASK 488 517 help=zsec4(nxfield*(ny-j-1)+i+1) 489 if(i.l e.i180) then490 lsm(i1 79+i,j)=help491 else 492 lsm(i-i18 1,j)=help518 if(i.lt.i180) then 519 lsm(i180+i,j)=help 520 else 521 lsm(i-i180,j)=help 493 522 endif 494 523 endif … … 496 525 ! MIXING HEIGHT 497 526 help=zsec4(nxfield*(ny-j-1)+i+1) 498 if(i.l e.i180) then499 hmix(i1 79+i,j,1,n)=help500 else 501 hmix(i-i18 1,j,1,n)=help527 if(i.lt.i180) then 528 hmix(i180+i,j,1,n)=help 529 else 530 hmix(i-i180,j,1,n)=help 502 531 endif 503 532 endif 504 533 if((isec1(6).eq.052).and.(isec1(7).eq.105).and. & 505 (isec1(8).eq.02)) then534 (nint(xsec18).eq.02)) then 506 535 ! 2 M RELATIVE HUMIDITY 507 536 help=zsec4(nxfield*(ny-j-1)+i+1) 508 if(i.l e.i180) then509 qvh2(i1 79+i,j)=help510 else 511 qvh2(i-i18 1,j)=help537 if(i.lt.i180) then 538 qvh2(i180+i,j)=help 539 else 540 qvh2(i-i180,j)=help 512 541 endif 513 542 endif … … 515 544 ! TEMPERATURE LOWEST SIGMA LEVEL 516 545 help=zsec4(nxfield*(ny-j-1)+i+1) 517 if(i.l e.i180) then518 tlev1(i1 79+i,j)=help519 else 520 tlev1(i-i18 1,j)=help546 if(i.lt.i180) then 547 tlev1(i180+i,j)=help 548 else 549 tlev1(i-i180,j)=help 521 550 endif 522 551 endif … … 524 553 ! U VELOCITY LOWEST SIGMA LEVEL 525 554 help=zsec4(nxfield*(ny-j-1)+i+1) 526 if(i.l e.i180) then527 ulev1(i1 79+i,j)=help528 else 529 ulev1(i-i18 1,j)=help555 if(i.lt.i180) then 556 ulev1(i180+i,j)=help 557 else 558 ulev1(i-i180,j)=help 530 559 endif 531 560 endif … … 533 562 ! V VELOCITY LOWEST SIGMA LEVEL 534 563 help=zsec4(nxfield*(ny-j-1)+i+1) 535 if(i.l e.i180) then536 vlev1(i1 79+i,j)=help537 else 538 vlev1(i-i18 1,j)=help564 if(i.lt.i180) then 565 vlev1(i180+i,j)=help 566 else 567 vlev1(i-i180,j)=help 539 568 endif 540 569 endif 541 570 ! SEC & IP 12/2018 read GFS clouds 542 if((isec1(6).eq.153).and.(isec1(7).eq.100)) then !! CLWCR Cloud liquid water content [kg/kg] 543 if((i.eq.0).and.(j.eq.0)) then 544 do ii=1,nuvz 545 if ((isec1(8)*100.0).eq.akz(ii)) numpclwch=ii 546 end do 547 endif 548 help=zsec4(nxfield*(ny-j-1)+i+1) 549 if(i.le.i180) then 550 clwch(i179+i,j,numpclwch,n)=help 551 else 552 clwch(i-i181,j,numpclwch,n)=help 553 endif 554 readclouds=.true. 555 sumclouds=.true. 556 ! readclouds=.false. 557 ! sumclouds=.false. 558 endif 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 559 587 560 588 … … 592 620 ! CONVERT TP TO LSP (GRIB2 only) 593 621 if (gribVer.eq.2) then 594 do j=0,nymin1 595 do i=0,nxfield-1 596 if(i.le.i180) then 597 if (convprec(i179+i,j,1,n).lt.lsprec(i179+i,j,1,n)) then ! neg precip would occur 598 lsprec(i179+i,j,1,n)= & 599 lsprec(i179+i,j,1,n)-convprec(i179+i,j,1,n) 600 else 601 lsprec(i179+i,j,1,n)=0 602 endif 603 else 604 if (convprec(i-i181,j,1,n).lt.lsprec(i-i181,j,1,n)) then 605 lsprec(i-i181,j,1,n)= & 606 lsprec(i-i181,j,1,n)-convprec(i-i181,j,1,n) 607 else 608 lsprec(i-i181,j,1,n)=0 609 endif 610 endif 611 enddo 612 enddo 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) ) 613 623 endif 614 624 !HSO end edits … … 622 632 help=qvh(i,j,k,n) 623 633 temp=tth(i,j,k,n) 634 if (temp .eq. 0.0) then 635 write (*, *) i, j, k, n 636 temp = 273.0 637 endif 624 638 plev1=akm(k)+bkm(k)*ps(i,j,1,n) 625 639 elev=ew(temp)*help/100.0 … … 637 651 help=qvh2(i,j) 638 652 temp=tt2(i,j,1,n) 653 if (temp .eq. 0.0) then 654 write (*, *) i, j, n 655 temp = 273.0 656 endif 639 657 elev=ew(temp)/100.*help/100. !vapour pressure in hPa 640 658 td2(i,j,1,n)=243.5/(17.67/log(elev/6.112)-1)+273. -
src/richardson.f90
- Property mode changed from 100644 to 100755
r92fab65 r467460a 141 141 zold=z 142 142 end do 143 k=k-1 ! ESO: make sure k <= nuvz (ticket #139)143 ! k=k-1 ! ESO: make sure k <= nuvz (ticket #139) 144 144 20 continue 145 145 146 146 ! Determine Richardson number between the critical levels 147 147 !******************************************************** 148 ! JMA: It may happen that k >= nuvz: 149 ! JMA: In that case: k is set to nuvz 150 151 if (k .gt. nuvz) k = nuvz ! JMA 148 152 149 153 zl1=zold
Note: See TracChangeset
for help on using the changeset viewer.