Changeset 70ecaa0 in flexpart.git
- Timestamp:
- Dec 16, 2016, 1:46:33 AM (7 years ago)
- Branches:
- fp9.3.1-20161214-nc4
- Children:
- a9c0209
- Parents:
- 4f17d14
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
flexpart_code/fpmetbinary_mod.F90
r4f17d14 r70ecaa0 44 44 USE com_mod 45 45 USE conv_mod 46 USE par_mod, ONLY : nxmax, nymax, nzmax, nuvzmax, nwzmax 46 USE par_mod, ONLY : nxmax, nymax, nzmax, nuvzmax, nwzmax, numclass 47 47 48 48 USE netcdf … … 306 306 INTEGER :: nxmax_dimid, nymax_dimid, nzmax_dimid, nuvzmax_dimid, nwzmax_dimid 307 307 308 INTEGER, DIMENSION(1) :: dim1dids ! Dimension IDs for 1D arrays 309 INTEGER, DIMENSION(2) :: dim2dids ! Dimension IDs for 2D arrays 308 310 INTEGER, DIMENSION(3) :: dim3dids ! Dimension IDs for 3D arrays 309 311 … … 399 401 ! Fixed fields, static in time 400 402 WRITE(iounit) oro, excessoro, lsm, xlanduse, height 403 404 dim2dids = (/nxmax_dimid, nymax_dimid/) 405 406 ncret = nf90_def_var(ncid, 'oro', NF90_FLOAT, & 407 & dim2dids, ncvarid) 408 ncret = nf90_def_var_deflate(ncid, ncvarid, & 409 & shuffle=0, & 410 & deflate=1, & 411 & deflate_level=DEF_LEVEL) 412 ncret = nf90_put_var(ncid, ncvarid, & 413 & oro(0:nxmax-1, 0:nymax-1)) 414 415 ncret = nf90_def_var(ncid, 'excessoro', NF90_FLOAT, & 416 & dim2dids, ncvarid) 417 ncret = nf90_def_var_deflate(ncid, ncvarid, & 418 & shuffle=0, & 419 & deflate=1, & 420 & deflate_level=DEF_LEVEL) 421 ncret = nf90_put_var(ncid, ncvarid, & 422 & excessoro(0:nxmax-1, 0:nymax-1)) 423 424 ncret = nf90_def_var(ncid, 'lsm', NF90_FLOAT, & 425 & dim2dids, ncvarid) 426 ncret = nf90_def_var_deflate(ncid, ncvarid, & 427 & shuffle=0, & 428 & deflate=1, & 429 & deflate_level=DEF_LEVEL) 430 ncret = nf90_put_var(ncid, ncvarid, & 431 & lsm(0:nxmax-1, 0:nymax-1)) 432 433 dim3dids = (/nxmax_dimid, nymax_dimid, numclass/) 434 ! numclass comes from par_mod - number of land use classes 435 ncret = nf90_def_var(ncid, 'xlanduse', NF90_FLOAT, & 436 & dim3dids, ncvarid) 437 ncret = nf90_def_var_deflate(ncid, ncvarid, & 438 & shuffle=0, & 439 & deflate=1, & 440 & deflate_level=DEF_LEVEL) 441 ncret = nf90_put_var(ncid, ncvarid, & 442 & xlanduse(0:nxmax-1, 0:nymax-1, 1:numclass)) 443 444 dim1dids = (/nzmax_dimid/) 445 ncret = nf90_def_var(ncid, 'height', NF90_FLOAT, & 446 & dim1dids, ncvarid) 447 ncret = nf90_def_var_deflate(ncid, ncvarid, & 448 & shuffle=0, & 449 & deflate=1, & 450 & deflate_level=DEF_LEVEL) 451 ncret = nf90_put_var(ncid, ncvarid, & 452 & height(1:nzmax)) 453 454 455 401 456 402 457 ! 3d fields … … 509 564 & drhodz(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 510 565 511 566 ncret = nf90_def_var(ncid, 'clouds', NF90_BYTE, & 567 & dim3dids, ncvarid) 568 ncret = nf90_def_var_deflate(ncid, ncvarid, & 569 & shuffle=0, & 570 & deflate=1, & 571 & deflate_level=DEF_LEVEL) 572 ncret = nf90_put_var(ncid, ncvarid, & 573 & clouds(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)) 574 575 576 577 ! Note the change in z dimension for the following 512 578 dim3dids = (/nxmax_dimid, nymax_dimid, nuvzmax_dimid/) 513 579 … … 538 604 ncret = nf90_put_var(ncid, ncvarid, & 539 605 & pplev(0:nxmax-1, 0:nymax-1, 1:nuvzmax, cm_index)) 606 607 608 dim2dids = (/nxmax_dimid, nymax_dimid/) 609 ncret = nf90_def_var(ncid, 'cloudsh', NF90_INT, & 610 & dim2dids, ncvarid) 611 ncret = nf90_def_var_deflate(ncid, ncvarid, & 612 & shuffle=0, & 613 & deflate=1, & 614 & deflate_level=DEF_LEVEL) 615 ncret = nf90_put_var(ncid, ncvarid, & 616 & cloudsh(0:nxmax-1, 0:nymax-1, cm_index)) 617 618 540 619 541 620 PRINT *, 'SUM(tt(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)): ', & 542 621 & SUM(tt(0:nxmax-1,0:nymax-1,1:nzmax, cm_index)) 622 623 PRINT *, 'SUM(clouds(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)): ', & 624 & SUM(clouds(0:nxmax-1,0:nymax-1,1:nzmax, cm_index)) 625 543 626 544 627 … … 792 875 READ(iounit) oro, excessoro, lsm, xlanduse, height 793 876 877 ncret = nf90_inq_varid(ncid, 'oro', ncvarid) 878 ncret = nf90_get_var(ncid, ncvarid, oro(0:nxmax-1,0:nymax-1)) 879 880 ncret = nf90_inq_varid(ncid, 'excessoro', ncvarid) 881 ncret = nf90_get_var(ncid, ncvarid, excessoro(0:nxmax-1,0:nymax-1)) 882 883 ncret = nf90_inq_varid(ncid, 'lsm', ncvarid) 884 ncret = nf90_get_var(ncid, ncvarid, lsm(0:nxmax-1,0:nymax-1)) 885 886 ncret = nf90_inq_varid(ncid, 'xlanduse', ncvarid) 887 ncret = nf90_get_var(ncid, ncvarid, xlanduse(0:nxmax-1,0:nymax-1, 1:numclass)) 888 889 ncret = nf90_inq_varid(ncid, 'height', ncvarid) 890 ncret = nf90_get_var(ncid, ncvarid, height(1:nzmax)) 891 892 893 894 794 895 ! 3d fields 795 896 READ(iounit) uu(:,:,:,cm_index) … … 814 915 ! Get the varid and read the variable into the array 815 916 ncret = nf90_inq_varid(ncid, 'uu', ncvarid) 816 ncret = nf90_get_var(ncid, ncvarid, uu )917 ncret = nf90_get_var(ncid, ncvarid, uu(0:nxmax-1,0:nymax-1,1:nzmax,cm_index)) 817 918 818 919 ncret = nf90_inq_varid(ncid, 'vv', ncvarid) 819 ncret = nf90_get_var(ncid, ncvarid, vv )920 ncret = nf90_get_var(ncid, ncvarid, vv(0:nxmax-1,0:nymax-1,1:nzmax,cm_index)) 820 921 821 922 ncret = nf90_inq_varid(ncid, 'uupol', ncvarid) 822 ncret = nf90_get_var(ncid, ncvarid, uupol )923 ncret = nf90_get_var(ncid, ncvarid, uupol(0:nxmax-1,0:nymax-1,1:nzmax,cm_index)) 823 924 824 925 ncret = nf90_inq_varid(ncid, 'vvpol', ncvarid) 825 ncret = nf90_get_var(ncid, ncvarid, vvpol )926 ncret = nf90_get_var(ncid, ncvarid, vvpol(0:nxmax-1,0:nymax-1,1:nzmax,cm_index)) 826 927 827 928 ncret = nf90_inq_varid(ncid, 'ww', ncvarid) 828 ncret = nf90_get_var(ncid, ncvarid, ww )929 ncret = nf90_get_var(ncid, ncvarid, ww(0:nxmax-1,0:nymax-1,1:nzmax,cm_index)) 829 930 830 931 ncret = nf90_inq_varid(ncid, 'tt', ncvarid) 831 ncret = nf90_get_var(ncid, ncvarid, tt(0:nxmax-1,0:n zmax-1,1:nzmax,cm_index))932 ncret = nf90_get_var(ncid, ncvarid, tt(0:nxmax-1,0:nymax-1,1:nzmax,cm_index)) 832 933 833 934 ncret = nf90_inq_varid(ncid, 'qv', ncvarid) 834 ncret = nf90_get_var(ncid, ncvarid, qv )935 ncret = nf90_get_var(ncid, ncvarid, qv(0:nxmax-1,0:nymax-1,1:nzmax,cm_index)) 835 936 836 937 ncret = nf90_inq_varid(ncid, 'pv', ncvarid) 837 ncret = nf90_get_var(ncid, ncvarid, pv )938 ncret = nf90_get_var(ncid, ncvarid, pv(0:nxmax-1,0:nymax-1,1:nzmax,cm_index)) 838 939 839 940 ncret = nf90_inq_varid(ncid, 'rho', ncvarid) 840 ncret = nf90_get_var(ncid, ncvarid, rho )941 ncret = nf90_get_var(ncid, ncvarid, rho(0:nxmax-1,0:nymax-1,1:nzmax,cm_index)) 841 942 842 943 ncret = nf90_inq_varid(ncid, 'drhodz', ncvarid) 843 ncret = nf90_get_var(ncid, ncvarid, drhodz) 944 ncret = nf90_get_var(ncid, ncvarid, drhodz(0:nxmax-1,0:nymax-1,1:nzmax,cm_index)) 945 946 ncret = nf90_inq_varid(ncid, 'clouds', ncvarid) 947 ncret = nf90_get_var(ncid, ncvarid, clouds(0:nxmax-1,0:nzmax-1,1:nzmax,cm_index)) 844 948 845 949 ncret = nf90_inq_varid(ncid, 'tth', ncvarid) 846 ncret = nf90_get_var(ncid, ncvarid, tth )950 ncret = nf90_get_var(ncid, ncvarid, tth(0:nxmax-1,0:nymax-1,1:nuvzmax,cm_index)) 847 951 848 952 ncret = nf90_inq_varid(ncid, 'qvh', ncvarid) 849 ncret = nf90_get_var(ncid, ncvarid, qvh )953 ncret = nf90_get_var(ncid, ncvarid, qvh(0:nxmax-1,0:nymax-1,1:nuvzmax,cm_index)) 850 954 851 955 ncret = nf90_inq_varid(ncid, 'pplev', ncvarid) 852 ncret = nf90_get_var(ncid, ncvarid, pplev) 956 ncret = nf90_get_var(ncid, ncvarid, pplev(0:nxmax-1,0:nymax-1,1:nuvzmax,cm_index)) 957 958 ncret = nf90_inq_varid(ncid, 'cloudsh', ncvarid) 959 ncret = nf90_get_var(ncid, ncvarid, cloudsh(0:nxmax-1,0:nymax-1,cm_index)) 960 961 962 853 963 854 964 PRINT *, 'SUM(tt(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)): ', & 855 965 & SUM(tt(0:nxmax-1,0:nymax-1,1:nzmax, cm_index)) 856 966 967 968 PRINT *, 'SUM(clouds(0:nxmax-1, 0:nymax-1, 1:nzmax, cm_index)): ', & 969 & SUM(clouds(0:nxmax-1,0:nymax-1,1:nzmax, cm_index)) 857 970 858 971
Note: See TracChangeset
for help on using the changeset viewer.