Changeset 8624a75 in flexpart.git
- Timestamp:
- Aug 24, 2017, 7:07:08 PM (7 years ago)
- Branches:
- FPv9.3.2, grib2nc4_repair
- Children:
- 857dfd0
- Parents:
- 4c0504c
- Location:
- flexpart_code
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
flexpart_code/fpmetbinary_mod.F90
rfd86dea r8624a75 238 238 ncret = nf90_def_dim(ncid, 'nxmax', nxmax, nxmax_dimid) 239 239 call handle_nf90_err(ncret) 240 ! attributes 241 ncret = nf90_put_att(ncid, ncvarid, "description","maximum dimension of wind fields in x") 242 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 243 240 244 ncret = nf90_def_dim(ncid, 'nymax', nymax, nymax_dimid) 241 245 call handle_nf90_err(ncret) 246 ! attributes 247 ncret = nf90_put_att(ncid, ncvarid, "description","maximum dimension of wind fields in y") 248 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 249 242 250 ncret = nf90_def_dim(ncid, 'nzmax', nzmax, nzmax_dimid) 243 251 call handle_nf90_err(ncret) 252 ! attributes 253 ncret = nf90_put_att(ncid, ncvarid, "description","maximum dimension of wind fields in z") 254 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 255 244 256 ncret = nf90_def_dim(ncid, 'nuvzmax', nuvzmax, nuvzmax_dimid) 245 257 call handle_nf90_err(ncret) 258 ! attributes 259 ncret = nf90_put_att(ncid, ncvarid, "description"," maximum dimension of (u,v) wind field in z") 260 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 261 246 262 ncret = nf90_def_dim(ncid, 'nwzmax', nwzmax, nwzmax_dimid) 247 263 call handle_nf90_err(ncret) 264 ! attributes 265 ncret = nf90_put_att(ncid, ncvarid, "description"," maximum dimension of w component of wind field in z") 266 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 267 248 268 ncret = nf90_def_dim(ncid, 'maxspec', maxspec, maxspec_dimid) 249 269 call handle_nf90_err(ncret) 270 ! attributes 271 ncret = nf90_put_att(ncid, ncvarid, "description"," maximum number of species") 272 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 273 250 274 ncret = nf90_def_dim(ncid, 'numclass', numclass, numclass_dimid) 251 275 call handle_nf90_err(ncret) 276 ! attributes 277 ncret = nf90_put_att(ncid, ncvarid, "description"," maximum number of ageclasses") 278 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 252 279 253 280 ! There are a handful of variables indexed from 0 to n, rather than 0 to n-1, … … 255 282 ncret = nf90_def_dim(ncid, 'zero_to_nzmax', nzmax+1, zero_to_nzmax_dimid) 256 283 call handle_nf90_err(ncret) 284 ! attributes 285 ncret = nf90_put_att(ncid, ncvarid, "description","variable to change indexing of variables with nzmax dimension") 286 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 287 257 288 ncret = nf90_def_dim(ncid, 'zero_to_maxnests', maxnests+1, zero_to_maxnests_dimid) 258 289 call handle_nf90_err(ncret) 290 ! attributes 291 ncret = nf90_put_att(ncid, ncvarid, "description","variable to change indexing of variables with maxnests dimension") 292 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 259 293 260 294 ! This is for a couple of small arrays that store polar stereographic stuff 261 295 ncret = nf90_def_dim(ncid, 'polemap_dim', 9, polemap_dimid) 262 296 call handle_nf90_err(ncret) 297 ! attributes 298 ncret = nf90_put_att(ncid, ncvarid, "description","variable to store polar stereographic indexing") 299 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 263 300 264 301 ! These two values come from conv_mod 265 302 ncret = nf90_def_dim(ncid, 'nconvlevmax_dim', nconvlevmax, nconvlevmax_dimid) 266 303 call handle_nf90_err(ncret) 304 ! attributes 305 ncret = nf90_put_att(ncid, ncvarid, "description","maximum number of levels for convection") 306 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 307 267 308 ncret = nf90_def_dim(ncid, 'na_dim', na, na_dimid) 268 309 call handle_nf90_err(ncret) 310 ! attributes 311 ncret = nf90_put_att(ncid, ncvarid, "description","maximum number of levels for convection +1") 312 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 313 269 314 270 315 ! Scalar values 271 272 316 273 317 dim1dids = (/preproc_fmt_str_dimid/) … … 288 332 ncret = nf90_put_var(ncid, ncvarid, nx) 289 333 call handle_nf90_err(ncret) 334 ! attributes 335 ncret = nf90_put_att(ncid, ncvarid, "description","actual dimensions of wind fields in x") 336 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 290 337 291 338 ncret = nf90_def_var(ncid, 'ny', NF90_INT, ncvarid) … … 293 340 ncret = nf90_put_var(ncid, ncvarid, ny) 294 341 call handle_nf90_err(ncret) 342 ! attributes 343 ncret = nf90_put_att(ncid, ncvarid, "description","actual dimensions of wind fields in y") 344 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 295 345 296 346 ncret = nf90_def_var(ncid, 'nxmin1', NF90_INT, ncvarid) … … 298 348 ncret = nf90_put_var(ncid, ncvarid, nxmin1) 299 349 call handle_nf90_err(ncret) 350 ! attributes 351 ncret = nf90_put_att(ncid, ncvarid, "description","actual dimensions of wind fields in x -1 (nx-1)") 352 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 300 353 301 354 ncret = nf90_def_var(ncid, 'nymin1', NF90_INT, ncvarid) … … 303 356 ncret = nf90_put_var(ncid, ncvarid, nymin1) 304 357 call handle_nf90_err(ncret) 358 ! attributes 359 ncret = nf90_put_att(ncid, ncvarid, "description","actual dimensions of wind fields in y -1 (ny-1)") 360 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 361 305 362 306 363 ncret = nf90_def_var(ncid, 'nxfield', NF90_INT, ncvarid) … … 308 365 ncret = nf90_put_var(ncid, ncvarid, nxfield) 309 366 call handle_nf90_err(ncret) 367 ! attributes 368 ncret = nf90_put_att(ncid, ncvarid, "description","actual dimensions of wind fields in x for limited area fields") 369 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 310 370 311 371 ncret = nf90_def_var(ncid, 'nuvz', NF90_INT, ncvarid) … … 313 373 ncret = nf90_put_var(ncid, ncvarid, nuvz) 314 374 call handle_nf90_err(ncret) 375 ! attributes 376 ncret = nf90_put_att(ncid, ncvarid, "description","actual dimensions of (u,v) wind fields in z direction") 377 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 315 378 316 379 ncret = nf90_def_var(ncid, 'nwz', NF90_INT, ncvarid) … … 318 381 ncret = nf90_put_var(ncid, ncvarid, nwz) 319 382 call handle_nf90_err(ncret) 383 ! attributes 384 ncret = nf90_put_att(ncid, ncvarid, "description","actual dimensions of w wind fields in z direction") 385 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 320 386 321 387 ncret = nf90_def_var(ncid, 'nz', NF90_INT, ncvarid) … … 323 389 ncret = nf90_put_var(ncid, ncvarid, nz) 324 390 call handle_nf90_err(ncret) 391 ! attributes 392 ncret = nf90_put_att(ncid, ncvarid, "description","number of vertical levels in the transformed coordinates") 393 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 325 394 326 395 ncret = nf90_def_var(ncid, 'nmixz', NF90_INT, ncvarid) … … 328 397 ncret = nf90_put_var(ncid, ncvarid, nmixz) 329 398 call handle_nf90_err(ncret) 399 ! attributes 400 ncret = nf90_put_att(ncid, ncvarid, "description","number of levels up to maximum PBL height (3500 m)") 401 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 330 402 331 403 ncret = nf90_def_var(ncid, 'nlev_ec', NF90_INT, ncvarid) … … 333 405 ncret = nf90_put_var(ncid, ncvarid, nlev_ec) 334 406 call handle_nf90_err(ncret) 407 ! attributes 408 ncret = nf90_put_att(ncid, ncvarid, "description","number of vertical levels ecmwf model") 409 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 335 410 336 411 ncret = nf90_def_var(ncid, 'dx', NF90_FLOAT, ncvarid) … … 338 413 ncret = nf90_put_var(ncid, ncvarid, dx) 339 414 call handle_nf90_err(ncret) 415 ! attributes 416 ncret = nf90_put_att(ncid, ncvarid, "description","grid distance in x direction") 417 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 340 418 341 419 ncret = nf90_def_var(ncid, 'dy', NF90_FLOAT, ncvarid) … … 343 421 ncret = nf90_put_var(ncid, ncvarid, dy) 344 422 call handle_nf90_err(ncret) 423 ! attributes 424 ncret = nf90_put_att(ncid, ncvarid, "description","grid distance in y direction") 425 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 345 426 346 427 ncret = nf90_def_var(ncid, 'xlon0', NF90_FLOAT, ncvarid) … … 348 429 ncret = nf90_put_var(ncid, ncvarid, xlon0) 349 430 call handle_nf90_err(ncret) 431 ! attributes 432 ncret = nf90_put_att(ncid, ncvarid, "description","geographical longitude of the lower left corner of the wind fields") 433 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 350 434 351 435 ncret = nf90_def_var(ncid, 'ylat0', NF90_FLOAT, ncvarid) … … 353 437 ncret = nf90_put_var(ncid, ncvarid, ylat0) 354 438 call handle_nf90_err(ncret) 439 ! attributes 440 ncret = nf90_put_att(ncid, ncvarid, "description","geographical latitude of the lower left corner of the wind fields") 441 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 355 442 356 443 ncret = nf90_def_var(ncid, 'dxconst', NF90_FLOAT, ncvarid) … … 358 445 ncret = nf90_put_var(ncid, ncvarid, dxconst) 359 446 call handle_nf90_err(ncret) 447 ! attributes 448 ncret = nf90_put_att(ncid, ncvarid, "description","auxiliary variable needed for utransform") 449 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 360 450 361 451 ncret = nf90_def_var(ncid, 'dyconst', NF90_FLOAT, ncvarid) … … 363 453 ncret = nf90_put_var(ncid, ncvarid, dyconst) 364 454 call handle_nf90_err(ncret) 365 366 455 ! attributes 456 ncret = nf90_put_att(ncid, ncvarid, "description","auxiliary variable needed for vtransform") 457 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 367 458 368 459 ! Fixed fields, static in time … … 380 471 & oro(0:nxmax-1, 0:nymax-1)) 381 472 call handle_nf90_err(ncret) 473 ! attributes 474 ncret = nf90_put_att(ncid, ncvarid, "description","orography of the ECMWF model") 475 ncret = nf90_put_att(ncid, ncvarid, "units","m") 476 382 477 383 478 ncret = nf90_def_var(ncid, 'excessoro', NF90_FLOAT, & … … 392 487 & excessoro(0:nxmax-1, 0:nymax-1)) 393 488 call handle_nf90_err(ncret) 489 ! attributes 490 ncret = nf90_put_att(ncid, ncvarid, "description","excess orography mother domain") 491 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 492 394 493 395 494 ncret = nf90_def_var(ncid, 'lsm', NF90_FLOAT, & … … 404 503 & lsm(0:nxmax-1, 0:nymax-1)) 405 504 call handle_nf90_err(ncret) 505 ! attributes 506 ncret = nf90_put_att(ncid, ncvarid, "description","land sea mask") 507 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 508 406 509 407 510 dim3dids = (/nxmax_dimid, nymax_dimid, numclass_dimid/) … … 418 521 & xlanduse(0:nxmax-1, 0:nymax-1, 1:numclass)) 419 522 call handle_nf90_err(ncret) 523 ! attributes 524 ncret = nf90_put_att(ncid, ncvarid, "description","area fraction in percent") 525 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 526 420 527 421 528 dim1dids = (/nzmax_dimid/) … … 431 538 & height(1:nzmax)) 432 539 call handle_nf90_err(ncret) 433 540 ! attributes 541 ncret = nf90_put_att(ncid, ncvarid, "description","heights of all model levels") 542 ncret = nf90_put_att(ncid, ncvarid, "units","m") 434 543 435 544 … … 449 558 & uu(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 450 559 call handle_nf90_err(ncret) 560 ! attributes 561 ncret = nf90_put_att(ncid, ncvarid, "description","U component of wind in the [horizontal] direction") 562 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 451 563 452 564 ncret = nf90_def_var(ncid, 'vv', NF90_FLOAT, & … … 461 573 & vv(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 462 574 call handle_nf90_err(ncret) 575 ! attributes 576 ncret = nf90_put_att(ncid, ncvarid, "description","V component of wind in the Y[horizontal] direction") 577 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 578 463 579 464 580 ncret = nf90_def_var(ncid, 'uupol', NF90_FLOAT, & … … 473 589 & uupol(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 474 590 call handle_nf90_err(ncret) 591 ! attributes 592 ncret = nf90_put_att(ncid, ncvarid, "description","horizontal component in polar stereographic projection of wind") 593 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 594 475 595 476 596 ncret = nf90_def_var(ncid, 'vvpol', NF90_FLOAT, & … … 485 605 & vvpol(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 486 606 call handle_nf90_err(ncret) 607 ! attributes 608 ncret = nf90_put_att(ncid, ncvarid, "description","horizontal component in polar stereographic projection of wind") 609 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 610 487 611 488 612 ncret = nf90_def_var(ncid, 'ww', NF90_FLOAT, & … … 497 621 & ww(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 498 622 call handle_nf90_err(ncret) 623 ! attributes 624 ncret = nf90_put_att(ncid, ncvarid, "description","wind component in the Z[vertical] direction") 625 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 626 499 627 500 628 ncret = nf90_def_var(ncid, 'tt', NF90_FLOAT, & … … 509 637 & tt(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 510 638 call handle_nf90_err(ncret) 639 ! attributes 640 ncret = nf90_put_att(ncid, ncvarid, "description","temperature") 641 ncret = nf90_put_att(ncid, ncvarid, "units","K") 642 511 643 512 644 ncret = nf90_def_var(ncid, 'qv', NF90_FLOAT, & … … 521 653 & qv(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 522 654 call handle_nf90_err(ncret) 655 ! attributes 656 ncret = nf90_put_att(ncid, ncvarid, "description","specific humidity data") 657 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 523 658 524 659 ncret = nf90_def_var(ncid, 'pv', NF90_FLOAT, & … … 533 668 & pv(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 534 669 call handle_nf90_err(ncret) 670 ! attributes 671 ncret = nf90_put_att(ncid, ncvarid, "description","potential vorticity") 672 ncret = nf90_put_att(ncid, ncvarid, "units","K*m**2 kg**-1 s**-1") 673 535 674 536 675 ncret = nf90_def_var(ncid, 'rho', NF90_FLOAT, & … … 545 684 & rho(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 546 685 call handle_nf90_err(ncret) 686 ! attributes 687 ncret = nf90_put_att(ncid, ncvarid, "description","air density") 688 ncret = nf90_put_att(ncid, ncvarid, "units","kg m**-3") 689 547 690 548 691 ncret = nf90_def_var(ncid, 'drhodz', NF90_FLOAT, & … … 557 700 & drhodz(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 558 701 call handle_nf90_err(ncret) 702 ! attributes 703 ncret = nf90_put_att(ncid, ncvarid, "description","vertical air density gradient") 704 ncret = nf90_put_att(ncid, ncvarid, "units","kg m**-2") 705 559 706 560 707 ncret = nf90_def_var(ncid, 'clouds', NF90_BYTE, & … … 569 716 & clouds(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 570 717 call handle_nf90_err(ncret) 571 718 ! attributes 719 ncret = nf90_put_att(ncid, ncvarid, "description","vcloud mask, & 720 no cloud no precip = 0, cloud no precip = 1, & 721 rainout conv/lsp dominated 2/3, & 722 washout conv/lsp dominated = 4/5 ") 723 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 572 724 573 725 … … 586 738 & tth(0:nxmax-1, 0:nymax-1, 1:nuvzmax, cm_index)) 587 739 call handle_nf90_err(ncret) 740 ! attributes 741 ncret = nf90_put_att(ncid, ncvarid, "description","temperature in the original input model level") 742 ncret = nf90_put_att(ncid, ncvarid, "units","K") 743 588 744 589 745 ncret = nf90_def_var(ncid, 'qvh', NF90_FLOAT, & … … 598 754 & qvh(0:nxmax-1, 0:nymax-1, 1:nuvzmax, cm_index)) 599 755 call handle_nf90_err(ncret) 756 ! attributes 757 ncret = nf90_put_att(ncid, ncvarid, "description","specific humidity in the original input model level") 758 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 759 600 760 601 761 ncret = nf90_def_var(ncid, 'pplev', NF90_FLOAT, & … … 610 770 & pplev(0:nxmax-1, 0:nymax-1, 1:nuvzmax, cm_index)) 611 771 call handle_nf90_err(ncret) 772 ! attributes 773 ncret = nf90_put_att(ncid, ncvarid, "description","pressure in pressure levels for GFS version") 774 ncret = nf90_put_att(ncid, ncvarid, "units","Pa") 612 775 613 776 … … 624 787 & cloudsh(0:nxmax-1, 0:nymax-1, cm_index)) 625 788 call handle_nf90_err(ncret) 789 ! attributes 790 ncret = nf90_put_att(ncid, ncvarid, "description","height of the cloud layer") 791 ncret = nf90_put_att(ncid, ncvarid, "units","m") 626 792 627 793 … … 649 815 & ps(0:nxmax-1, 0:nymax-1, 1, cm_index)) 650 816 call handle_nf90_err(ncret) 817 ! attributes 818 ncret = nf90_put_att(ncid, ncvarid, "description","surface pressure") 819 ncret = nf90_put_att(ncid, ncvarid, "units","Pa") 820 651 821 652 822 ncret = nf90_def_var(ncid, 'sd', NF90_FLOAT, & … … 661 831 & sd(0:nxmax-1, 0:nymax-1, 1, cm_index)) 662 832 call handle_nf90_err(ncret) 833 ! attributes 834 ncret = nf90_put_att(ncid, ncvarid, "description","snow depth") 835 ncret = nf90_put_att(ncid, ncvarid, "units","m") 836 663 837 664 838 ncret = nf90_def_var(ncid, 'msl', NF90_FLOAT, & … … 673 847 & msl(0:nxmax-1, 0:nymax-1, 1, cm_index)) 674 848 call handle_nf90_err(ncret) 849 ! attributes 850 ncret = nf90_put_att(ncid, ncvarid, "description","mean sea level pressure") 851 ncret = nf90_put_att(ncid, ncvarid, "units","Pa") 852 675 853 676 854 ncret = nf90_def_var(ncid, 'tcc', NF90_FLOAT, & … … 685 863 & tcc(0:nxmax-1, 0:nymax-1, 1, cm_index)) 686 864 call handle_nf90_err(ncret) 865 ! attributes 866 ncret = nf90_put_att(ncid, ncvarid, "description","total cloud cover") 867 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 868 687 869 688 870 ncret = nf90_def_var(ncid, 'u10', NF90_FLOAT, & … … 697 879 & u10(0:nxmax-1, 0:nymax-1, 1, cm_index)) 698 880 call handle_nf90_err(ncret) 881 ! attributes 882 ncret = nf90_put_att(ncid, ncvarid, "description","10 m u component of wind velocity") 883 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 699 884 700 885 ncret = nf90_def_var(ncid, 'v10', NF90_FLOAT, & … … 709 894 & v10(0:nxmax-1, 0:nymax-1, 1, cm_index)) 710 895 call handle_nf90_err(ncret) 896 ! attributes 897 ncret = nf90_put_att(ncid, ncvarid, "description","10 m v component of wind velocity") 898 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 899 711 900 712 901 ncret = nf90_def_var(ncid, 'tt2', NF90_FLOAT, & … … 721 910 & tt2(0:nxmax-1, 0:nymax-1, 1, cm_index)) 722 911 call handle_nf90_err(ncret) 912 ! attributes 913 ncret = nf90_put_att(ncid, ncvarid, "description","2 m temperature") 914 ncret = nf90_put_att(ncid, ncvarid, "units","K") 915 723 916 724 917 ncret = nf90_def_var(ncid, 'td2', NF90_FLOAT, & … … 733 926 & td2(0:nxmax-1, 0:nymax-1, 1, cm_index)) 734 927 call handle_nf90_err(ncret) 928 ! attributes 929 ncret = nf90_put_att(ncid, ncvarid, "description","2 m dew point temperature") 930 ncret = nf90_put_att(ncid, ncvarid, "units","K") 931 735 932 736 933 ncret = nf90_def_var(ncid, 'lsprec', NF90_FLOAT, & … … 745 942 & lsprec(0:nxmax-1, 0:nymax-1, 1, cm_index)) 746 943 call handle_nf90_err(ncret) 944 ! attributes 945 ncret = nf90_put_att(ncid, ncvarid, "description","large scale total precipitation") 946 ncret = nf90_put_att(ncid, ncvarid, "units","mm h**-1") 947 747 948 748 949 ncret = nf90_def_var(ncid, 'convprec', NF90_FLOAT, & … … 757 958 & convprec(0:nxmax-1, 0:nymax-1, 1, cm_index)) 758 959 call handle_nf90_err(ncret) 960 ! attributes 961 ncret = nf90_put_att(ncid, ncvarid, "description","convective precipitation") 962 ncret = nf90_put_att(ncid, ncvarid, "units","mm h**-1") 963 759 964 760 965 ncret = nf90_def_var(ncid, 'sshf', NF90_FLOAT, & … … 769 974 & sshf(0:nxmax-1, 0:nymax-1, 1, cm_index)) 770 975 call handle_nf90_err(ncret) 976 ! attributes 977 ncret = nf90_put_att(ncid, ncvarid, "description","surface sensible heat flux") 978 ncret = nf90_put_att(ncid, ncvarid, "units","J m**-2") 979 771 980 772 981 ncret = nf90_def_var(ncid, 'ssr', NF90_FLOAT, & … … 781 990 & ssr(0:nxmax-1, 0:nymax-1, 1, cm_index)) 782 991 call handle_nf90_err(ncret) 992 ! attributes 993 ncret = nf90_put_att(ncid, ncvarid, "description","surface solar radiation") 994 ncret = nf90_put_att(ncid, ncvarid, "units","J m**-2") 995 783 996 784 997 ncret = nf90_def_var(ncid, 'surfstr', NF90_FLOAT, & … … 793 1006 & surfstr(0:nxmax-1, 0:nymax-1, 1, cm_index)) 794 1007 call handle_nf90_err(ncret) 1008 ! attributes 1009 ncret = nf90_put_att(ncid, ncvarid, "description","surface stress") 1010 ncret = nf90_put_att(ncid, ncvarid, "units","N m**-2 s") 1011 795 1012 796 1013 ncret = nf90_def_var(ncid, 'ustar', NF90_FLOAT, & … … 805 1022 & ustar(0:nxmax-1, 0:nymax-1, 1, cm_index)) 806 1023 call handle_nf90_err(ncret) 1024 ! attributes 1025 ncret = nf90_put_att(ncid, ncvarid, "description","friction velocity") 1026 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 1027 807 1028 808 1029 ncret = nf90_def_var(ncid, 'wstar', NF90_FLOAT, & … … 817 1038 & wstar(0:nxmax-1, 0:nymax-1, 1, cm_index)) 818 1039 call handle_nf90_err(ncret) 1040 ! attributes 1041 ncret = nf90_put_att(ncid, ncvarid, "description","convective velocity scale") 1042 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 1043 819 1044 820 1045 ncret = nf90_def_var(ncid, 'hmix', NF90_FLOAT, & … … 829 1054 & hmix(0:nxmax-1, 0:nymax-1, 1, cm_index)) 830 1055 call handle_nf90_err(ncret) 1056 ! attributes 1057 ncret = nf90_put_att(ncid, ncvarid, "description","mixing height") 1058 ncret = nf90_put_att(ncid, ncvarid, "units","m") 1059 831 1060 832 1061 ncret = nf90_def_var(ncid, 'tropopause', NF90_FLOAT, & … … 841 1070 & tropopause(0:nxmax-1, 0:nymax-1, 1, cm_index)) 842 1071 call handle_nf90_err(ncret) 1072 ! attributes 1073 ncret = nf90_put_att(ncid, ncvarid, "description","altitude of thermal tropopause") 1074 ncret = nf90_put_att(ncid, ncvarid, "units","m") 1075 843 1076 844 1077 ncret = nf90_def_var(ncid, 'oli', NF90_FLOAT, & … … 853 1086 & oli(0:nxmax-1, 0:nymax-1, 1, cm_index)) 854 1087 call handle_nf90_err(ncret) 1088 ! attributes 1089 ncret = nf90_put_att(ncid, ncvarid, "description","inverse Obukhov length (1/L)") 1090 ncret = nf90_put_att(ncid, ncvarid, "units","m") 1091 855 1092 856 1093 ncret = nf90_def_var(ncid, 'diffk', NF90_FLOAT, & … … 865 1102 & diffk(0:nxmax-1, 0:nymax-1, 1, cm_index)) 866 1103 call handle_nf90_err(ncret) 867 1104 ! attributes 1105 ncret = nf90_put_att(ncid, ncvarid, "description","diffusion coefficient at reference height") 1106 ncret = nf90_put_att(ncid, ncvarid, "units","m**2 s**-1") 868 1107 869 1108 … … 888 1127 & vdep(0:nxmax-1, 0:nymax-1, 1:maxspec, cm_index)) 889 1128 call handle_nf90_err(ncret) 890 1129 ! attributes 1130 ncret = nf90_put_att(ncid, ncvarid, "description","deposition velocity") 1131 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-2") 891 1132 892 1133 … … 902 1143 ncret = nf90_put_var(ncid, ncvarid, & 903 1144 & z0(1:numclass)) 1145 ! attributes 1146 ncret = nf90_put_att(ncid, ncvarid, "description","surface roughness length") 1147 ncret = nf90_put_att(ncid, ncvarid, "units","m") 904 1148 905 1149 … … 917 1161 & akm(1:nwzmax)) 918 1162 call handle_nf90_err(ncret) 1163 ! attributes 1164 ncret = nf90_put_att(ncid, ncvarid, "description","ECMWF vertical discretization parameter") 1165 ncret = nf90_put_att(ncid, ncvarid, "units","Pa") 1166 919 1167 920 1168 ncret = nf90_def_var(ncid, 'bkm', NF90_FLOAT, & … … 929 1177 & bkm(1:nwzmax)) 930 1178 call handle_nf90_err(ncret) 1179 ! attributes 1180 ncret = nf90_put_att(ncid, ncvarid, "description","ECMWF vertical discretization parameter") 1181 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 931 1182 932 1183 … … 944 1195 & akz(1:nuvzmax)) 945 1196 call handle_nf90_err(ncret) 1197 ! attributes 1198 ncret = nf90_put_att(ncid, ncvarid, "description","ECMWF vertical discretization parameter at center of layer") 1199 ncret = nf90_put_att(ncid, ncvarid, "units","Pa") 1200 946 1201 947 1202 ncret = nf90_def_var(ncid, 'bkz', NF90_FLOAT, & … … 956 1211 & bkz(1:nuvzmax)) 957 1212 call handle_nf90_err(ncret) 1213 ! attributes 1214 ncret = nf90_put_att(ncid, ncvarid, "description","ECMWF vertical discretization parameter at center of layer") 1215 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 958 1216 959 1217 … … 971 1229 & aknew(1:nzmax)) 972 1230 call handle_nf90_err(ncret) 1231 ! attributes 1232 ncret = nf90_put_att(ncid, ncvarid, "description","model discretization coefficient at the interpolated levels") 1233 ncret = nf90_put_att(ncid, ncvarid, "units","Pa") 973 1234 974 1235 ncret = nf90_def_var(ncid, 'bknew', NF90_FLOAT, & … … 983 1244 & bknew(1:nzmax)) 984 1245 call handle_nf90_err(ncret) 1246 ! attributes 1247 ncret = nf90_put_att(ncid, ncvarid, "description","model discretization coefficient at the interpolated levels") 1248 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 985 1249 986 1250 … … 1017 1281 & nxn(1:maxnests)) 1018 1282 call handle_nf90_err(ncret) 1283 ! attributes 1284 ncret = nf90_put_att(ncid, ncvarid, "description","actual dimensions of wind fields in x for the nexted domain") 1285 1019 1286 1020 1287 ncret = nf90_def_var(ncid, 'nyn', NF90_INT, & … … 1029 1296 & nyn(1:maxnests)) 1030 1297 call handle_nf90_err(ncret) 1298 ! attributes 1299 ncret = nf90_put_att(ncid, ncvarid, "description","actual dimensions of wind fields in y for the nested domain") 1300 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1301 1031 1302 1032 1303 ncret = nf90_def_var(ncid, 'dxn', NF90_FLOAT, & … … 1041 1312 & dxn(1:maxnests)) 1042 1313 call handle_nf90_err(ncret) 1314 ! attributes 1315 ncret = nf90_put_att(ncid, ncvarid, "description","grid distance in x direction for the nested domain") 1316 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1317 1043 1318 1044 1319 ncret = nf90_def_var(ncid, 'dyn', NF90_FLOAT, & … … 1053 1328 & dyn(1:maxnests)) 1054 1329 call handle_nf90_err(ncret) 1330 ! attributes 1331 ncret = nf90_put_att(ncid, ncvarid, "description","grid distance in y direction for the nested domain") 1332 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1333 1055 1334 1056 1335 ncret = nf90_def_var(ncid, 'xlon0n', NF90_FLOAT, & … … 1065 1344 & xlon0n(1:maxnests)) 1066 1345 call handle_nf90_err(ncret) 1346 ! attributes 1347 ncret = nf90_put_att(ncid, ncvarid, "description","geographical longitude of the & 1348 lower left corner of the nested wind fields") 1349 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1350 1067 1351 1068 1352 ncret = nf90_def_var(ncid, 'ylat0n', NF90_FLOAT, & … … 1077 1361 & ylat0n(1:maxnests)) 1078 1362 call handle_nf90_err(ncret) 1079 1080 1363 ! attributes 1364 ncret = nf90_put_att(ncid, ncvarid, "description","geographical latitude of & 1365 the lower left corner of the nested wind fields") 1366 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1081 1367 1082 1368 … … 1095 1381 & oron(0:nxmaxn-1, 0:nymaxn-1, 1:maxnests)) 1096 1382 call handle_nf90_err(ncret) 1383 ! attributes 1384 ncret = nf90_put_att(ncid, ncvarid, "description","orography of the ECMWF model for the nested domain") 1385 ncret = nf90_put_att(ncid, ncvarid, "units","m") 1386 1097 1387 1098 1388 ncret = nf90_def_var(ncid, 'excessoron', NF90_FLOAT, & … … 1107 1397 & excessoron(0:nxmaxn-1, 0:nymaxn-1, 1:maxnests)) 1108 1398 call handle_nf90_err(ncret) 1399 ! attributes 1400 ncret = nf90_put_att(ncid, ncvarid, "description","excess orography nested domain") 1401 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1402 1109 1403 1110 1404 ncret = nf90_def_var(ncid, 'lsmn', NF90_FLOAT, & … … 1119 1413 & lsmn(0:nxmaxn-1, 0:nymaxn-1, 1:maxnests)) 1120 1414 call handle_nf90_err(ncret) 1415 ! attributes 1416 ncret = nf90_put_att(ncid, ncvarid, "description","land sea mask for the nested domian") 1417 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1418 1121 1419 1122 1420 dim4dids = (/nxmaxn_dimid, nymaxn_dimid, numclass_dimid, maxnests_dimid/) … … 1133 1431 & xlandusen(0:nxmaxn-1, 0:nymaxn-1, 1:numclass, 1:maxnests)) 1134 1432 call handle_nf90_err(ncret) 1433 ! attributes 1434 ncret = nf90_put_att(ncid, ncvarid, "description","area fraction in percent for the nested domain") 1435 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1436 1135 1437 1136 1438 ! PRINT *, 'SUM(oron): ', SUM(oron) … … 1152 1454 & uun(0:nxmaxn-1, 0:nymaxn-1, 1:nzmax, cm_index, 1:maxnests)) 1153 1455 call handle_nf90_err(ncret) 1456 ! attributes 1457 ncret = nf90_put_att(ncid, ncvarid, "description","U component of wind in the [horizontal] & 1458 direction for the nested domain") 1459 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 1460 1154 1461 1155 1462 ncret = nf90_def_var(ncid, 'vvn', NF90_FLOAT, & … … 1164 1471 & vvn(0:nxmaxn-1, 0:nymaxn-1, 1:nzmax, cm_index, 1:maxnests)) 1165 1472 call handle_nf90_err(ncret) 1473 ! attributes 1474 ncret = nf90_put_att(ncid, ncvarid, "description","V component of wind in the Y[horizontal] & 1475 direction for the nested domain") 1476 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 1166 1477 1167 1478 ncret = nf90_def_var(ncid, 'wwn', NF90_FLOAT, & … … 1176 1487 & wwn(0:nxmaxn-1, 0:nymaxn-1, 1:nzmax, cm_index, 1:maxnests)) 1177 1488 call handle_nf90_err(ncret) 1489 ! attributes 1490 ncret = nf90_put_att(ncid, ncvarid, "description","wind componend in the Z[vertical] & 1491 direction for the nested domain") 1492 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 1493 1178 1494 1179 1495 ncret = nf90_def_var(ncid, 'ttn', NF90_FLOAT, & … … 1188 1504 & ttn(0:nxmaxn-1, 0:nymaxn-1, 1:nzmax, cm_index, 1:maxnests)) 1189 1505 call handle_nf90_err(ncret) 1506 ! attributes 1507 ncret = nf90_put_att(ncid, ncvarid, "description","temperature for the nested domain") 1508 ncret = nf90_put_att(ncid, ncvarid, "units","K") 1509 1190 1510 1191 1511 ncret = nf90_def_var(ncid, 'qvn', NF90_FLOAT, & … … 1200 1520 & qvn(0:nxmaxn-1, 0:nymaxn-1, 1:nzmax, cm_index, 1:maxnests)) 1201 1521 call handle_nf90_err(ncret) 1522 ! attributes 1523 ncret = nf90_put_att(ncid, ncvarid, "description","specific humidity data for the nested domain") 1524 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1202 1525 1203 1526 ncret = nf90_def_var(ncid, 'pvn', NF90_FLOAT, & … … 1212 1535 & pvn(0:nxmaxn-1, 0:nymaxn-1, 1:nzmax, cm_index, 1:maxnests)) 1213 1536 call handle_nf90_err(ncret) 1537 ! attributes 1538 ncret = nf90_put_att(ncid, ncvarid, "description","potential vorticity for the nested domain") 1539 ncret = nf90_put_att(ncid, ncvarid, "units","K*m**2 kg**-1 s**-1") 1214 1540 1215 1541 ncret = nf90_def_var(ncid, 'rhon', NF90_FLOAT, & … … 1224 1550 & rhon(0:nxmaxn-1, 0:nymaxn-1, 1:nzmax, cm_index, 1:maxnests)) 1225 1551 call handle_nf90_err(ncret) 1552 ! attributes 1553 ncret = nf90_put_att(ncid, ncvarid, "description","air density for the nested domain") 1554 ncret = nf90_put_att(ncid, ncvarid, "units","kg m**-3") 1555 1226 1556 1227 1557 ncret = nf90_def_var(ncid, 'drhodzn', NF90_FLOAT, & … … 1236 1566 & drhodzn(0:nxmaxn-1, 0:nymaxn-1, 1:nzmax, cm_index, 1:maxnests)) 1237 1567 call handle_nf90_err(ncret) 1568 ! attributes 1569 ncret = nf90_put_att(ncid, ncvarid, "description","vertical air density gradient for the nested domain") 1570 ncret = nf90_put_att(ncid, ncvarid, "units","kg m**-2") 1238 1571 1239 1572 … … 1252 1585 & tthn(0:nxmaxn-1, 0:nymaxn-1, 1:nuvzmax, cm_index, 1:maxnests)) 1253 1586 call handle_nf90_err(ncret) 1587 ! attributes 1588 ncret = nf90_put_att(ncid, ncvarid, "description","temperature in the original & 1589 input model level for the nested domain") 1590 ncret = nf90_put_att(ncid, ncvarid, "units","K") 1591 1254 1592 1255 1593 ncret = nf90_def_var(ncid, 'qvhn', NF90_FLOAT, & … … 1264 1602 & qvhn(0:nxmaxn-1, 0:nymaxn-1, 1:nuvzmax, cm_index, 1:maxnests)) 1265 1603 call handle_nf90_err(ncret) 1604 ! attributes 1605 ncret = nf90_put_att(ncid, ncvarid, "description","specific humidity in the original & 1606 input model level for the nested domain") 1607 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1608 1266 1609 1267 1610 ! Note the new dimensions … … 1279 1622 & cloudsn(0:nxmaxn-1, 0:nymaxn-1, 0:nzmax, cm_index, 1:maxnests)) 1280 1623 call handle_nf90_err(ncret) 1624 ! attributes 1625 ncret = nf90_put_att(ncid, ncvarid, "description","vcloud mask, & 1626 no cloud no precip = 0, cloud no precip = 1, & 1627 rainout conv/lsp dominated 2/3, & 1628 washout conv/lsp dominated = 4/5 for the nested domain") 1629 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1630 1281 1631 1282 1632 ! Note the new dimensions … … 1294 1644 & cloudsnh(0:nxmaxn-1, 0:nymaxn-1, cm_index, 1:maxnests)) 1295 1645 call handle_nf90_err(ncret) 1646 ! attributes 1647 ncret = nf90_put_att(ncid, ncvarid, "description","cloud mask at the horizontal levels") 1648 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1649 1296 1650 1297 1651 … … 1316 1670 & psn(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1317 1671 call handle_nf90_err(ncret) 1672 ! attributes 1673 ncret = nf90_put_att(ncid, ncvarid, "description","surface pressure of the nested domian") 1674 ncret = nf90_put_att(ncid, ncvarid, "units","Pa") 1675 1318 1676 1319 1677 ncret = nf90_def_var(ncid, 'sdn', NF90_FLOAT, & … … 1328 1686 & sdn(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1329 1687 call handle_nf90_err(ncret) 1688 ! attributes 1689 ncret = nf90_put_att(ncid, ncvarid, "description","snow depth for the nested domain") 1690 ncret = nf90_put_att(ncid, ncvarid, "units","m") 1691 1330 1692 1331 1693 ncret = nf90_def_var(ncid, 'msln', NF90_FLOAT, & … … 1340 1702 & msln(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1341 1703 call handle_nf90_err(ncret) 1704 ! attributes 1705 ncret = nf90_put_att(ncid, ncvarid, "description","mean sea level pressure for the nested domain") 1706 ncret = nf90_put_att(ncid, ncvarid, "units","Pa") 1707 1342 1708 1343 1709 ncret = nf90_def_var(ncid, 'tccn', NF90_FLOAT, & … … 1352 1718 & tccn(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1353 1719 call handle_nf90_err(ncret) 1720 ! attributes 1721 ncret = nf90_put_att(ncid, ncvarid, "description","total cloud cover for the nested domain") 1722 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1723 1354 1724 1355 1725 ncret = nf90_def_var(ncid, 'u10n', NF90_FLOAT, & … … 1364 1734 & u10n(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1365 1735 call handle_nf90_err(ncret) 1736 ! attributes 1737 ncret = nf90_put_att(ncid, ncvarid, "description","10 m u component of wind velocity for the nested domain") 1738 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 1366 1739 1367 1740 ncret = nf90_def_var(ncid, 'v10n', NF90_FLOAT, & … … 1376 1749 & v10n(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1377 1750 call handle_nf90_err(ncret) 1751 ! attributes 1752 ncret = nf90_put_att(ncid, ncvarid, "description","10 m v component of wind velocity for the nested domain") 1753 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 1378 1754 1379 1755 ncret = nf90_def_var(ncid, 'tt2n', NF90_FLOAT, & … … 1388 1764 & tt2n(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1389 1765 call handle_nf90_err(ncret) 1766 ! attributes 1767 ncret = nf90_put_att(ncid, ncvarid, "description","2 m temperature for the nested domain") 1768 ncret = nf90_put_att(ncid, ncvarid, "units","K") 1769 1390 1770 1391 1771 ncret = nf90_def_var(ncid, 'td2n', NF90_FLOAT, & … … 1400 1780 & td2n(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1401 1781 call handle_nf90_err(ncret) 1782 ! attributes 1783 ncret = nf90_put_att(ncid, ncvarid, "description","2 m dew point temperature for the nested domain") 1784 ncret = nf90_put_att(ncid, ncvarid, "units","K") 1785 1402 1786 1403 1787 ncret = nf90_def_var(ncid, 'lsprecn', NF90_FLOAT, & … … 1412 1796 & lsprecn(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1413 1797 call handle_nf90_err(ncret) 1798 ! attributes 1799 ncret = nf90_put_att(ncid, ncvarid, "description","large scale total precipitation for the nested domain") 1800 ncret = nf90_put_att(ncid, ncvarid, "units","mm h**-1") 1414 1801 1415 1802 ncret = nf90_def_var(ncid, 'convprecn', NF90_FLOAT, & … … 1424 1811 & convprecn(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1425 1812 call handle_nf90_err(ncret) 1813 ! attributes 1814 ncret = nf90_put_att(ncid, ncvarid, "description","convective precipitation for the nested domain") 1815 ncret = nf90_put_att(ncid, ncvarid, "units","mm h**-1") 1426 1816 1427 1817 ncret = nf90_def_var(ncid, 'sshfn', NF90_FLOAT, & … … 1436 1826 & sshfn(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1437 1827 call handle_nf90_err(ncret) 1828 ! attributes 1829 ncret = nf90_put_att(ncid, ncvarid, "description","surface sensible heat flux for the nested domain") 1830 ncret = nf90_put_att(ncid, ncvarid, "units","J m**-2") 1438 1831 1439 1832 ncret = nf90_def_var(ncid, 'ssrn', NF90_FLOAT, & … … 1448 1841 & ssrn(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1449 1842 call handle_nf90_err(ncret) 1843 ! attributes 1844 ncret = nf90_put_att(ncid, ncvarid, "description","surface solar radiation for the nested domain") 1845 ncret = nf90_put_att(ncid, ncvarid, "units","J m**-2") 1450 1846 1451 1847 ncret = nf90_def_var(ncid, 'surfstrn', NF90_FLOAT, & … … 1460 1856 & surfstrn(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1461 1857 call handle_nf90_err(ncret) 1858 ! attributes 1859 ncret = nf90_put_att(ncid, ncvarid, "description","surface stress for the nested domain") 1860 ncret = nf90_put_att(ncid, ncvarid, "units","N m**-2 s") 1861 1462 1862 1463 1863 ncret = nf90_def_var(ncid, 'ustarn', NF90_FLOAT, & … … 1472 1872 & ustarn(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1473 1873 call handle_nf90_err(ncret) 1874 ! attributes 1875 ncret = nf90_put_att(ncid, ncvarid, "description","friction velocity for the nested domain") 1876 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 1474 1877 1475 1878 ncret = nf90_def_var(ncid, 'wstarn', NF90_FLOAT, & … … 1484 1887 & wstarn(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1485 1888 call handle_nf90_err(ncret) 1889 ! attributes 1890 ncret = nf90_put_att(ncid, ncvarid, "description","convective velocity scale for the nested domain") 1891 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-1") 1892 1486 1893 1487 1894 ncret = nf90_def_var(ncid, 'hmixn', NF90_FLOAT, & … … 1496 1903 & hmixn(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1497 1904 call handle_nf90_err(ncret) 1905 ! attributes 1906 ncret = nf90_put_att(ncid, ncvarid, "description","mixing height for the nested domain") 1907 ncret = nf90_put_att(ncid, ncvarid, "units","m") 1498 1908 1499 1909 ncret = nf90_def_var(ncid, 'tropopausen', NF90_FLOAT, & … … 1508 1918 & tropopausen(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1509 1919 call handle_nf90_err(ncret) 1920 ! attributes 1921 ncret = nf90_put_att(ncid, ncvarid, "description","altitude of thermal tropopause for the nested domain") 1922 ncret = nf90_put_att(ncid, ncvarid, "units","m") 1510 1923 1511 1924 ncret = nf90_def_var(ncid, 'olin', NF90_FLOAT, & … … 1520 1933 & olin(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1521 1934 call handle_nf90_err(ncret) 1935 ! attributes 1936 ncret = nf90_put_att(ncid, ncvarid, "description","inverse Obukhov length (1/L) for the nested domain") 1937 ncret = nf90_put_att(ncid, ncvarid, "units","m") 1522 1938 1523 1939 ncret = nf90_def_var(ncid, 'diffkn', NF90_FLOAT, & … … 1532 1948 & diffkn(0:nxmaxn-1, 0:nymaxn-1, 1, cm_index, 1:maxnests)) 1533 1949 call handle_nf90_err(ncret) 1950 ! attributes 1951 ncret = nf90_put_att(ncid, ncvarid, "description","diffusion coefficient at reference height & 1952 for the nested domain") 1953 ncret = nf90_put_att(ncid, ncvarid, "units","m**2 s**-1") 1954 1955 1534 1956 1535 1957 dim4dids = (/nxmaxn_dimid, nymaxn_dimid, maxspec_dimid, maxnests_dimid/) … … 1548 1970 & vdepn(0:nxmaxn-1, 0:nymaxn-1, 1:maxspec, cm_index, 1:maxnests)) 1549 1971 call handle_nf90_err(ncret) 1550 1972 ! attributes 1973 ncret = nf90_put_att(ncid, ncvarid, "description","deposition velocity for the nested domain") 1974 ncret = nf90_put_att(ncid, ncvarid, "units","m s**-2") 1551 1975 1552 1976 ! PRINT *, 'SUM(psn): ', SUM(psn(:,:,:,cm_index,:)) … … 1570 1994 & xresoln(0:maxnests)) 1571 1995 call handle_nf90_err(ncret) 1996 ! attributes 1997 ncret = nf90_put_att(ncid, ncvarid, "description","factor by which the resolutions in the nests & 1998 is enhanced compared to mother grid") 1999 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2000 1572 2001 1573 2002 ncret = nf90_def_var(ncid, 'yresoln', NF90_FLOAT, & … … 1582 2011 & yresoln(0:maxnests)) 1583 2012 call handle_nf90_err(ncret) 2013 ! attributes 2014 ncret = nf90_put_att(ncid, ncvarid, "description","factor by which the resolutions in the nests & 2015 is enhanced compared to mother grid") 2016 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2017 1584 2018 1585 2019 dim1dids = (/maxnests_dimid/) … … 1596 2030 & xln(1:maxnests)) 1597 2031 call handle_nf90_err(ncret) 2032 ! attributes 2033 ncret = nf90_put_att(ncid, ncvarid, "description","lower left corner x point of nested grids & 2034 in grid coordinates of mother grid") 2035 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2036 1598 2037 1599 2038 ncret = nf90_def_var(ncid, 'yln', NF90_FLOAT, & … … 1608 2047 & yln(1:maxnests)) 1609 2048 call handle_nf90_err(ncret) 2049 ! attributes 2050 ncret = nf90_put_att(ncid, ncvarid, "description","lower left corner y point of nested grids & 2051 in grid coordinates of mother grid") 2052 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2053 1610 2054 1611 2055 ncret = nf90_def_var(ncid, 'xrn', NF90_FLOAT, & … … 1620 2064 & xrn(1:maxnests)) 1621 2065 call handle_nf90_err(ncret) 2066 ! attributes 2067 ncret = nf90_put_att(ncid, ncvarid, "description","upper right corner x point of nested grids & 2068 in grid coordinates of mother grid") 2069 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2070 1622 2071 1623 2072 ncret = nf90_def_var(ncid, 'yrn', NF90_FLOAT, & … … 1632 2081 & yrn(1:maxnests)) 1633 2082 call handle_nf90_err(ncret) 2083 ! attributes 2084 ncret = nf90_put_att(ncid, ncvarid, "description","upper right corner y point of nested grids & 2085 in grid coordinates of mother grid") 2086 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1634 2087 1635 2088 ! PRINT *, 'SUM(yresoln): ', SUM(yresoln) … … 1649 2102 ncret = nf90_put_var(ncid, ncvarid, & 1650 2103 & southpolemap(:)) 2104 ! attributes 2105 ncret = nf90_put_att(ncid, ncvarid, "description","auxiliary variable to define stereographic projections") 2106 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2107 1651 2108 1652 2109 ncret = nf90_def_var(ncid, 'northpolemap', NF90_FLOAT, & … … 1658 2115 ncret = nf90_put_var(ncid, ncvarid, & 1659 2116 & northpolemap(:)) 1660 2117 ! attributes 2118 ncret = nf90_put_att(ncid, ncvarid, "description","auxiliary variable to define stereographic projections") 2119 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1661 2120 1662 2121 … … 1667 2126 ncret = nf90_put_var(ncid, ncvarid, logical2integer(xglobal)) 1668 2127 call handle_nf90_err(ncret) 2128 ! attributes 2129 ncret = nf90_put_att(ncid, ncvarid, "description","logical variable T for global fields, F for limited area fields") 2130 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2131 1669 2132 1670 2133 ncret = nf90_def_var(ncid, 'sglobal', NF90_INT, ncvarid) … … 1672 2135 ncret = nf90_put_var(ncid, ncvarid, logical2integer(sglobal)) 1673 2136 call handle_nf90_err(ncret) 2137 ! attributes 2138 ncret = nf90_put_att(ncid, ncvarid, "description","logical variable T if domain extends towards south pole") 2139 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2140 1674 2141 1675 2142 ncret = nf90_def_var(ncid, 'nglobal', NF90_INT, ncvarid) … … 1677 2144 ncret = nf90_put_var(ncid, ncvarid, logical2integer(nglobal)) 1678 2145 call handle_nf90_err(ncret) 2146 ! attributes 2147 ncret = nf90_put_att(ncid, ncvarid, "description","logical variable T if domain extends towards north pole") 2148 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2149 1679 2150 1680 2151 ncret = nf90_def_var(ncid, 'switchnorthg', NF90_FLOAT, ncvarid) … … 1682 2153 ncret = nf90_put_var(ncid, ncvarid, switchnorthg) 1683 2154 call handle_nf90_err(ncret) 2155 ! attributes 2156 ncret = nf90_put_att(ncid, ncvarid, "description","degrees for use polar stereographic grid north of switchnorth") 2157 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2158 1684 2159 1685 2160 ncret = nf90_def_var(ncid, 'switchsouthg', NF90_FLOAT, ncvarid) … … 1687 2162 ncret = nf90_put_var(ncid, ncvarid, switchsouthg) 1688 2163 call handle_nf90_err(ncret) 2164 ! attributes 2165 ncret = nf90_put_att(ncid, ncvarid, "description","degrees for use polar stereographic grid south of switchshouth") 2166 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1689 2167 1690 2168 … … 1707 2185 ncret = nf90_put_var(ncid, ncvarid, & 1708 2186 & pconv(:)) 2187 ! attributes 2188 ncret = nf90_put_att(ncid, ncvarid, "description","pressure at the input model levels for the convection calculation") 2189 ncret = nf90_put_att(ncid, ncvarid, "units","Pa") 2190 1709 2191 1710 2192 ncret = nf90_def_var(ncid, 'dpr', NF90_FLOAT, & … … 1716 2198 ncret = nf90_put_var(ncid, ncvarid, & 1717 2199 & dpr(:)) 2200 ! attributes 2201 ncret = nf90_put_att(ncid, ncvarid, "description","pressure difference around tconv(k)") 2202 ncret = nf90_put_att(ncid, ncvarid, "units","Pa") 2203 1718 2204 1719 2205 ncret = nf90_def_var(ncid, 'pconv_hpa', NF90_FLOAT, & … … 1725 2211 ncret = nf90_put_var(ncid, ncvarid, & 1726 2212 & pconv_hpa(:)) 2213 ! attributes 2214 ncret = nf90_put_att(ncid, ncvarid, "description","pressure at the input model levels & 2215 in hPa for the convection calculation") 2216 ncret = nf90_put_att(ncid, ncvarid, "units","hPa") 2217 1727 2218 1728 2219 ncret = nf90_def_var(ncid, 'ft', NF90_FLOAT, & … … 1734 2225 ncret = nf90_put_var(ncid, ncvarid, & 1735 2226 & ft(:)) 2227 ! attributes 2228 ncret = nf90_put_att(ncid, ncvarid, "description","auxiliary variable for the convection scheme") 2229 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2230 1736 2231 1737 2232 ncret = nf90_def_var(ncid, 'fq', NF90_FLOAT, & … … 1743 2238 ncret = nf90_put_var(ncid, ncvarid, & 1744 2239 & fq(:)) 2240 ! attributes 2241 ncret = nf90_put_att(ncid, ncvarid, "description","auxiliary variable for the convection scheme") 2242 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2243 1745 2244 1746 2245 ncret = nf90_def_var(ncid, 'sub', NF90_FLOAT, & … … 1753 2252 & sub(:)) 1754 2253 2254 ! attributes 2255 ncret = nf90_put_att(ncid, ncvarid, "description","auxiliary variable for the convection scheme") 2256 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 2257 2258 1755 2259 dim1dids = (/na_dimid/) 1756 2260 … … 1763 2267 ncret = nf90_put_var(ncid, ncvarid, & 1764 2268 & phconv(:)) 2269 ! attributes 2270 ncret = nf90_put_att(ncid, ncvarid, "description","pressure between levels k-1 and k") 2271 ncret = nf90_put_att(ncid, ncvarid, "units","Pa") 2272 1765 2273 1766 2274 ncret = nf90_def_var(ncid, 'phconv_hpa', NF90_FLOAT, & … … 1772 2280 ncret = nf90_put_var(ncid, ncvarid, & 1773 2281 & phconv_hpa(:)) 2282 ! attributes 2283 ncret = nf90_put_att(ncid, ncvarid, "description","pressure between levels k-1 and k in hPa") 2284 ncret = nf90_put_att(ncid, ncvarid, "units","hPa") 1774 2285 1775 2286 ncret = nf90_def_var(ncid, 'tconv', NF90_FLOAT, & … … 1781 2292 ncret = nf90_put_var(ncid, ncvarid, & 1782 2293 & tconv(:)) 2294 ! attributes 2295 ncret = nf90_put_att(ncid, ncvarid, "description","temperature at the input model levels & 2296 for the convection calculation") 2297 ncret = nf90_put_att(ncid, ncvarid, "units","K") 2298 1783 2299 1784 2300 ncret = nf90_def_var(ncid, 'qconv', NF90_FLOAT, & … … 1790 2306 ncret = nf90_put_var(ncid, ncvarid, & 1791 2307 & qconv(:)) 2308 ! attributes 2309 ncret = nf90_put_att(ncid, ncvarid, "description","specific humidity at the input model & 2310 levels for the convection calculation") 2311 ncret = nf90_put_att(ncid, ncvarid, "units","none") 2312 1792 2313 1793 2314 ncret = nf90_def_var(ncid, 'qsconv', NF90_FLOAT, & … … 1799 2320 ncret = nf90_put_var(ncid, ncvarid, & 1800 2321 & qsconv(:)) 2322 ! attributes 2323 ncret = nf90_put_att(ncid, ncvarid, "description","Saturation water vapor specific humidity & 2324 for the convection calculation") 2325 ncret = nf90_put_att(ncid, ncvarid, "units","kg/kg") 2326 1801 2327 1802 2328 ! New dimensions … … 1811 2337 ncret = nf90_put_var(ncid, ncvarid, & 1812 2338 & fmass(:,:)) 2339 ! attributes 2340 ncret = nf90_put_att(ncid, ncvarid, "description","mass in the grid column for the convection calculation") 2341 ncret = nf90_put_att(ncid, ncvarid, "units","kg") 2342 1813 2343 1814 2344 ncret = nf90_def_var(ncid, 'fmassfrac', NF90_FLOAT, & … … 1820 2350 ncret = nf90_put_var(ncid, ncvarid, & 1821 2351 & fmassfrac(:,:)) 2352 ! attributes 2353 ncret = nf90_put_att(ncid, ncvarid, "description","mass fraction due to the convection & 2354 displacement from level k to level k") 2355 ncret = nf90_put_att(ncid, ncvarid, "units","kg") 2356 1822 2357 1823 2358 … … 1833 2368 ncret = nf90_put_var(ncid, ncvarid, & 1834 2369 & cbaseflux(0:nxmax-1,0:nymax-1)) 2370 ! attributes 2371 ncret = nf90_put_att(ncid, ncvarid, "description","cloudbase massflux due to the convection") 2372 ncret = nf90_put_att(ncid, ncvarid, "units","(kg/m**2)/s") 1835 2373 1836 2374 ! New dimensions … … 1845 2383 ncret = nf90_put_var(ncid, ncvarid, & 1846 2384 & cbasefluxn(0:nxmaxn-1,0:nymaxn-1,1:maxnests)) 2385 ! attributes 2386 ncret = nf90_put_att(ncid, ncvarid, "description","cloudbase massflux due to the convection for the nested domain") 2387 ncret = nf90_put_att(ncid, ncvarid, "units","(kg/m**2)/s") 1847 2388 1848 2389 … … 1852 2393 ncret = nf90_put_var(ncid, ncvarid, psconv) 1853 2394 call handle_nf90_err(ncret) 2395 ! attributes 2396 ncret = nf90_put_att(ncid, ncvarid, "description","surface pressure for the convection calculation") 2397 ncret = nf90_put_att(ncid, ncvarid, "units","Pa") 2398 1854 2399 1855 2400 ncret = nf90_def_var(ncid, 'tt2conv', NF90_FLOAT, ncvarid) … … 1857 2402 ncret = nf90_put_var(ncid, ncvarid, tt2conv) 1858 2403 call handle_nf90_err(ncret) 2404 ! attributes 2405 ncret = nf90_put_att(ncid, ncvarid, "description","2 m temperature for the convection calculation") 2406 ncret = nf90_put_att(ncid, ncvarid, "units","K") 2407 1859 2408 1860 2409 ncret = nf90_def_var(ncid, 'td2conv', NF90_FLOAT, ncvarid) … … 1862 2411 ncret = nf90_put_var(ncid, ncvarid, td2conv) 1863 2412 call handle_nf90_err(ncret) 2413 ! attributes 2414 ncret = nf90_put_att(ncid, ncvarid, "description","2 m dew point temperature for the convection calculation") 2415 ncret = nf90_put_att(ncid, ncvarid, "units","K") 2416 1864 2417 1865 2418 ncret = nf90_def_var(ncid, 'nconvlev', NF90_INT, ncvarid) … … 1867 2420 ncret = nf90_put_var(ncid, ncvarid, nconvlev) 1868 2421 call handle_nf90_err(ncret) 2422 ! attributes 2423 ncret = nf90_put_att(ncid, ncvarid, "description","number of levels for convection") 2424 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1869 2425 1870 2426 ncret = nf90_def_var(ncid, 'nconvtop', NF90_INT, ncvarid) … … 1872 2428 ncret = nf90_put_var(ncid, ncvarid, nconvtop) 1873 2429 call handle_nf90_err(ncret) 2430 ! attributes 2431 ncret = nf90_put_att(ncid, ncvarid, "description","upper levels for convection") 2432 ncret = nf90_put_att(ncid, ncvarid, "units"," ") 1874 2433 1875 2434 ! PRINT *, 'SUM(pconv): ', SUM(pconv) -
flexpart_code/grib2nc4/Makefile
r87d9684 r8624a75 11 11 NETCDFF = /opt/netcdf-fortran-4.4.3 12 12 NETCDF = /opt/netcdf-c-4.4.0 13 13 #GRIBAPI = /usr/local/grib-api 14 #HDF5 = /usr/local/hdf5-1.8.16 15 #NETCDFF = /usr/local/netcdf-fortran-4.4.3 16 #NETCDF = /usr/local/netcdf-c-4.4.0 14 17 15 18 16 19 17 20 BINARY = grib2nc4 18 OBJS = processmetfields.o 19 FPMODOBJS = par_mod.o com_mod.o class_vtable_mod.o cmapf_mod.o conv_mod.o 20 FLXPRTOBJS = detectformat.o grib2check.o shift_field_0.o gridcheck.o \ 21 readwind.o readwind_nests.o calcpar.o calcpar_nests.o \ 22 shift_field.o pbl_profile.o scalev.o obukhov.o \ 23 richardson.o ew.o getvdep.o calcpv.o obukhov_gfs.o \ 24 richardson_gfs.o getvdep_nests.o calcpv_nests.o psim.o psih.o \ 25 qvsat.o caldate.o getrb.o raerod.o getrc.o partdep.o \ 26 verttransform.o verttransform_nests.o readwind_gfs.o \ 27 calcpar_gfs.o verttransform_gfs.o gridcheck_gfs.o 21 CMP_BINARY = nc4cmp 22 OBJS = processmetfields.o verttransform_grib2nc4_ecmwf.o verttransform_grib2nc4_gfs.o 23 FPMODOBJS = ${FLEXPART_SRC}/par_mod.o ${FLEXPART_SRC}/com_mod.o ${FLEXPART_SRC}/class_vtable_mod.o ${FLEXPART_SRC}/cmapf_mod.o ${FLEXPART_SRC}/conv_mod.o 24 FLXPRTOBJS = ${FLEXPART_SRC}/detectformat.o ${FLEXPART_SRC}/grib2check.o ${FLEXPART_SRC}/shift_field_0.o ${FLEXPART_SRC}/gridcheck.o \ 25 ${FLEXPART_SRC}/readwind.o ${FLEXPART_SRC}/readwind_nests.o ${FLEXPART_SRC}/calcpar.o ${FLEXPART_SRC}/calcpar_nests.o \ 26 ${FLEXPART_SRC}/shift_field.o ${FLEXPART_SRC}/pbl_profile.o ${FLEXPART_SRC}/scalev.o ${FLEXPART_SRC}/obukhov.o \ 27 ${FLEXPART_SRC}/richardson.o ${FLEXPART_SRC}/ew.o ${FLEXPART_SRC}/getvdep.o ${FLEXPART_SRC}/calcpv.o ${FLEXPART_SRC}/obukhov_gfs.o \ 28 ${FLEXPART_SRC}/richardson_gfs.o ${FLEXPART_SRC}/getvdep_nests.o ${FLEXPART_SRC}/calcpv_nests.o ${FLEXPART_SRC}/psim.o ${FLEXPART_SRC}/psih.o \ 29 ${FLEXPART_SRC}/qvsat.o ${FLEXPART_SRC}/caldate.o ${FLEXPART_SRC}/getrb.o ${FLEXPART_SRC}/raerod.o ${FLEXPART_SRC}/getrc.o ${FLEXPART_SRC}/partdep.o \ 30 ${FLEXPART_SRC}/verttransform.o ${FLEXPART_SRC}/verttransform_nests.o ${FLEXPART_SRC}/readwind_gfs.o \ 31 ${FLEXPART_SRC}/calcpar_gfs.o ${FLEXPART_SRC}/verttransform_gfs.o ${FLEXPART_SRC}/gridcheck_gfs.o 28 32 29 33 … … 32 36 33 37 INCLUDES_NETCDF = -I${NETCDFF}/include 34 INCLUDES = -I${GRIBAPI}/include ${INCLUDES_NETCDF} 38 INCLUDES = -I${GRIBAPI}/include ${INCLUDES_NETCDF} -I${FLEXPART_SRC} 35 39 36 40 37 41 ### NetCDF link flags - use the first one for dynamic libs, the second 38 42 ### one for static libs 39 #LDFLAGS_NETCDF = -L${NETCDFF}/lib -lnetcdff -L${NETCDF}/lib -lnetcdf40 LDFLAGS_NETCDF=-static -L${NETCDFF}/lib -lnetcdff -L${NETCDF}/lib -lnetcdf -lnetcdf -L${HDF5}/lib -lhdf5_fortran -lhdf5_hl -lhdf5hl_fortran -lhdf5 -ldl -lz43 LDFLAGS_NETCDF = -L${NETCDFF}/lib -lnetcdff -L${NETCDF}/lib -lnetcdf 44 #LDFLAGS_NETCDF=-static -L${NETCDFF}/lib -lnetcdff -L${NETCDF}/lib -lnetcdf -lnetcdf -L${HDF5}/lib -lhdf5_fortran -lhdf5_hl -lhdf5hl_fortran -lhdf5 -ldl -lz 41 45 42 46 43 LDFLAGS = -L${GRIBAPI}/lib -lgrib_api_f90 -lgrib_api ${LDFLAGS_NETCDF} -ljasper 47 LDFLAGS = -L${GRIBAPI}/lib -lgrib_api_f90 -lgrib_api ${LDFLAGS_NETCDF} -ljasper -L${FLEXPART_SRC} 44 48 45 49 … … 51 55 ${BINARY}.o : ${BINARY}.F90 fp2nc4io_mod.mod ${FPMODOBJS} Makefile 52 56 ${FC} -c ${BINARY}.F90 ${FFLAGS} ${INCLUDES} 57 58 #----------- NC4 compare ------------------------ 59 ${CMP_BINARY} : ${CMP_BINARY}.o 60 ${FC} -o ${CMP_BINARY} ${CMP_BINARY}.o ${LDFLAGS} 61 62 ${CMP_BINARY}.o : ${CMP_BINARY}.F90 Makefile 63 ${FC} -c ${CMP_BINARY}.F90 ${FFLAGS} ${INCLUDES} 53 64 54 65 fp2nc4io_mod.mod : ${FPMODOBJS} -
flexpart_code/grib2nc4/README
r496c607 r8624a75 7 7 M. Harustak 8 8 9 Last Update: 29 May 20169 Last Update: 05 July 2017 10 10 11 11 ====================================================================== … … 19 19 data for computations. It then takes the data which has been stored in 20 20 FLEXPART global arrays and selectively writes it to a NetCDF4 file. 21 22 Optional parameter allows user to request arrays calculated for specified 23 location instead of default algorithm selecting lowest left corner of meteorological 24 domain with a surface pressure above 100000Pa. 21 25 22 26 This distribution is integrated into the FLEXPART source code, in a grib2nc4 … … 42 46 is good, but only whether data was stored correctly in the NC4 files. 43 47 48 To be able to quickly compare variables in NetCDF files, simple utility 49 nc4cmp was introduced. It compares specified variable in two NetCDF files 50 (with dimension up to 3) and it prints average and maximal difference between 51 the values. It allows for specification of optional tolerance (in %). 52 Difference is calculated as abs((value1-value2)/value1)*100. 53 It is calculated for all values of variable multidimensional array. 54 55 44 56 ====================================================================== 45 57 2. Quick-Start … … 64 76 Simply type "make" (noting that you may see some warnings related to 65 77 variables for nests) to produce grib2nc4. 78 79 NetCDF compare utility nc4cmp can be built using command "make nc4cmp". 66 80 67 81 Before trying to run, you might want to try "make test" to make sure that … … 81 95 as the second argument. 82 96 97 Usage: 98 99 ./grib2nc4 <inpath> <outpath> [lat=value lon=value] [optional varnames] 100 101 83 102 Sample usage: 84 103 … … 92 111 93 112 ./grib2nc4 GD15051200 def9_nc1p0.nc4 q w 113 114 Calculation at user specified location can be requested by adding coord parameter 115 to the command line: 116 117 ./grib2nc4 GD15051200 def9_nc1p0.nc4 lon=20 lat=45 118 119 To compare two NetCDF files, nc4cmp can be used. 120 121 Usage: 122 123 ./nc4cmp <file1> <file2> <variable> [optional tolerance in %] 124 125 Sample usage: 126 127 ./nc4cmp def9_nc1p0.nc4 def9_nc1p0_reference.nc4 U 128 129 Sample usage with tolerance 1%: 130 131 ./nc4cmp def9_nc1p0.nc4 def9_nc1p0_reference.nc4 U 1.0 132 133 This will extract variable U from both NetCDF files, print and compare dimensions, 134 compare values and print average and maximal difference. 135 94 136 95 137 ====================================================================== -
flexpart_code/grib2nc4/fp2nc4io_mod.F90
r87d9684 r8624a75 157 157 ncfunc_retval = nf90_def_var(ncid, 'height', NF90_DOUBLE, & 158 158 & z_dimid, varid) 159 ! attributes 160 ncfunc_retval = nf90_put_att(ncid, varid, "description","height of the FLEXPART model levels") 161 ncfunc_retval = nf90_put_att(ncid, varid, "units","m a.g.l") 159 162 160 163 ncfunc_retval = nf90_def_var_deflate(ncid, varid, & … … 169 172 ncfunc_retval = nf90_def_var(ncid, 'dx', NF90_DOUBLE, varid) 170 173 ncfunc_retval = nf90_put_var(ncid, varid, dx) 174 ! attributes 175 ncfunc_retval = nf90_put_att(ncid, varid, "description","grid distance in x direction") 176 ncfunc_retval = nf90_put_att(ncid, varid, "units","degrees") 177 171 178 172 179 ncfunc_retval = nf90_def_var(ncid, 'dy', NF90_DOUBLE, varid) 173 180 ncfunc_retval = nf90_put_var(ncid, varid, dy) 181 ! attributes 182 ncfunc_retval = nf90_put_att(ncid, varid, "description","grid distance in y direction") 183 ncfunc_retval = nf90_put_att(ncid, varid, "units","degrees") 184 174 185 175 186 ncfunc_retval = nf90_def_var(ncid, 'xlon0', NF90_DOUBLE, varid) 176 187 ncfunc_retval = nf90_put_var(ncid, varid, xlon0) 188 ! attributes 189 ncfunc_retval = nf90_put_att(ncid, varid, "description","longitude of the lowest left corner") 190 ncfunc_retval = nf90_put_att(ncid, varid, "units","degrees") 191 177 192 178 193 ncfunc_retval = nf90_def_var(ncid, 'ylat0', NF90_DOUBLE, varid) 179 194 ncfunc_retval = nf90_put_var(ncid, varid, ylat0) 195 ! attributes 196 ncfunc_retval = nf90_put_att(ncid, varid, "description","latitude of the lowest left corner") 197 ncfunc_retval = nf90_put_att(ncid, varid, "units","degrees") 198 180 199 181 200 ! All done, close the NetCDF file … … 296 315 ncfunc_retval = nf90_put_var(ncid, varid, & 297 316 & uu(0:nx-1, 0:ny-1, 1:nz, 1)) 317 ! attributes 318 ncfunc_retval = nf90_put_att(ncid, varid, "description","U component of wind in the X[horizontal] direction") 319 ncfunc_retval = nf90_put_att(ncid, varid, "units","m s**-1") 320 321 298 322 ELSEIF (nc_varname == 'V') THEN 299 323 ncfunc_retval = nf90_put_var(ncid, varid, & 300 324 & vv(0:nx-1, 0:ny-1, 1:nz, 1)) 325 ! attributes 326 ncfunc_retval = nf90_put_att(ncid, varid, "description","V component of wind in the Y[horizontal] direction") 327 ncfunc_retval = nf90_put_att(ncid, varid, "units","m s**-1") 328 329 301 330 ELSEIF (nc_varname == 'T') THEN 302 331 ncfunc_retval = nf90_put_var(ncid, varid, & 303 332 & tt(0:nx-1, 0:ny-1, 1:nz, 1)) 333 ! attributes 334 ncfunc_retval = nf90_put_att(ncid, varid, "description","temperature") 335 ncfunc_retval = nf90_put_att(ncid, varid, "units","k") 336 304 337 ELSEIF (nc_varname == 'W') THEN 305 338 ncfunc_retval = nf90_put_var(ncid, varid, & 306 339 & ww(0:nx-1, 0:ny-1, 1:nz, 1)) 340 ! attributes 341 ncfunc_retval = nf90_put_att(ncid, varid, "description","wind component in the Z[vertical] direction") 342 ncfunc_retval = nf90_put_att(ncid, varid, "units","m s**-1") 343 344 307 345 ELSEIF (nc_varname == 'Q') THEN 308 346 ncfunc_retval = nf90_put_var(ncid, varid, & 309 347 & qv(0:nx-1, 0:ny-1, 1:nz, 1)) 348 ! attributes 349 ncfunc_retval = nf90_put_att(ncid, varid, "description","specific humidity") 350 ncfunc_retval = nf90_put_att(ncid, varid, "units"," ") 351 352 310 353 ELSE 311 354 PRINT *, -
flexpart_code/grib2nc4/grib2nc4.F90
r496c607 r8624a75 11 11 ! May 2016 * 12 12 !************************************************************************* 13 ! M. Harustak * 14 ! -) modification to generate the output in single precission * 15 ! -) possibility to add a lat lon selection to obtain the met variables* 16 ! in the vertical levels defined in that location * 17 !************************************************************************* 13 18 14 19 USE par_mod … … 21 26 IMPLICIT NONE 22 27 23 LOGICAL :: metfile_exists 28 LOGICAL :: metfile_exists, coordinates_provided, lat_provided, lon_provided 24 29 INTEGER :: i, j, k 25 30 INTEGER :: num_optional_vars, num_vars 26 31 INTEGER, PARAMETER :: DEFLATE_LEVEL = 2 ! Compression level (0-9) 27 CHARACTER(LEN=512) :: met_filepath, netcdf4_filepath 32 CHARACTER(LEN=512) :: met_filepath, netcdf4_filepath, param_str, coord_name_str, coord_val_str 28 33 CHARACTER, DIMENSION(:), ALLOCATABLE :: vars_list ! list of variables 29 34 INTEGER :: coordX, coordY, stat 35 REAL :: coord_lat, coord_lon 30 36 INTEGER :: metdata_format = UNKNOWN_METDATA ! From FP par_mod 31 37 … … 34 40 ! Read in mandatory arguments 35 41 IF (IARGC() < 2) THEN 36 PRINT *, 'Usage: grib2netcdf4 <inpath> <outpath> [ optional varnames]'42 PRINT *, 'Usage: grib2netcdf4 <inpath> <outpath> [lon=X lat=Y] [optional varnames]' 37 43 STOP 38 44 ELSE … … 48 54 ! First, get the number of optional args and allocate vars_list, 49 55 ! and fill the first three elements 50 IF (IARGC() > 2) THEN 51 num_optional_vars = IARGC() - 2 52 ELSE 53 num_optional_vars = 0 54 ENDIF 56 coordinates_provided = .FALSE. 57 lat_provided = .FALSE. 58 lon_provided = .FALSE. 59 ALLOCATE( vars_list(IARGC()+3),stat=stat ) 55 60 56 num_vars = num_optional_vars + 357 ALLOCATE( vars_list(num_vars) )58 61 vars_list(1) = 'u' 59 62 vars_list(2) = 'v' 60 63 vars_list(3) = 't' 61 64 62 ! Read in optional variable arguments, starting at element 4 of vars_list 63 IF (IARGC() > 2) THEN 64 DO i=1,num_optional_vars 65 CALL GETARG( i+2, vars_list(i+3) ) 66 ENDDO 65 num_vars = 3 66 DO i=3,IARGC() 67 CALL GETARG(i,param_str) 68 param_str = TRIM(param_str) 69 j = SCAN(param_str,"=") 70 if (j>1) then 71 coord_name_str=param_str(1:j-1) 72 coord_val_str=param_str(j+1:) 73 IF ( coord_name_str == "lat" .or. coord_name_str == "LAT" ) THEN 74 read(coord_val_str,*,iostat=stat) coord_lat 75 if ( stat == 0 ) then 76 lat_provided = .TRUE. 77 else 78 print *, "Incorrect coordinates: ", coord_val_str 79 stop 80 endif 81 ELSE IF ( coord_name_str == "lon" .or. coord_name_str == "LON" ) THEN 82 read(coord_val_str,*,iostat=stat) coord_lon 83 if ( stat == 0 ) then 84 lon_provided = .TRUE. 85 else 86 print *, "Incorrect coordinates: ", coord_val_str 87 stop 88 endif 89 ENDIF 90 else 91 num_vars = num_vars + 1 92 vars_list(num_vars) = param_str 93 endif 94 ENDDO 95 IF (lat_provided .AND. lon_provided) THEN 96 coordinates_provided = .TRUE. 67 97 ENDIF 68 98 … … 126 156 !CALL gridcheck_nests 127 157 158 ! If the coordinates are provided, then we need to obtain 159 ! the corresponding grid indexes since this is what verttransform needs 160 if ( coordinates_provided ) then 161 coordX = (coord_lon-xlon0)/dx 162 coordY = (coord_lat-ylat0)/dy 163 print *, "Coordinates: " 164 print *, "lon: ", coord_lon, ", lat: ",coord_lat 165 print *, "x: ", coordX, ", y: ", coordY 166 endif 167 128 168 PRINT *, 'Calling processmetfields()...' 129 call processmetfields( 1, metdata_format )169 call processmetfields( 1, metdata_format, coordinates_provided, coordX, coordY) 130 170 131 171 PRINT *, 'Calling fp2nc4io_dump()...' -
flexpart_code/grib2nc4/processmetfields.F90
r496c607 r8624a75 1 subroutine processmetfields(ind,metdata_format) 1 subroutine processmetfields(ind,metdata_format,coordinates_provided, coordX, coordY) 2 2 3 ! i o 3 4 !***************************************************************************** … … 37 38 integer :: dumpData 38 39 character(len=512):: fpfname, dumpPath, filename 40 integer :: coordX, coordY 41 logical :: coordinates_provided 39 42 40 43 … … 107 110 call calcpar_ecmwf(memind(1),uuh,vvh,pvh) 108 111 call calcpar_nests(memind(1),uuhn,vvhn,pvhn,metdata_format) 109 call verttransform_ecmwf(memind(1),uuh,vvh,wwh,pvh) 112 if ( coordinates_provided ) then 113 call verttransform_grib2nc4_ecmwf(memind(1),uuh,vvh,wwh,pvh,coordX,coordY) 114 else 115 call verttransform_grib2nc4_ecmwf(memind(1),uuh,vvh,wwh,pvh,-1,-1) 116 endif 110 117 call verttransform_nests(memind(1),uuhn,vvhn,wwhn,pvhn) 111 118 memtime(1)=wftime(ind) … … 116 123 call calcpar_gfs(memind(1),uuh,vvh,pvh) 117 124 call calcpar_nests(memind(1),uuhn,vvhn,pvhn,metdata_format) 118 call verttransform_gfs(memind(1),uuh,vvh,wwh,pvh) 125 if ( coordinates_provided ) then 126 call verttransform_grib2nc4_gfs(memind(1),uuh,vvh,wwh,pvh,coordX,coordY) 127 else 128 call verttransform_grib2nc4_gfs(memind(1),uuh,vvh,wwh,pvh,-1,-1) 129 endif 119 130 call verttransform_nests(memind(1),uuhn,vvhn,wwhn,pvhn) 120 131 memtime(1)=wftime(ind)
Note: See TracChangeset
for help on using the changeset viewer.