Changeset 1960 for palm/trunk/SOURCE/data_output_2d.f90
- Timestamp:
- Jul 12, 2016 4:34:24 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/data_output_2d.f90
r1852 r1960 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Scalar surface flux added 22 ! Rename INTEGER variable s into s_ind, as s is already assigned to scalar 22 23 ! 23 24 ! Former revisions: … … 138 139 USE arrays_3d, & 139 140 ONLY: dzw, e, nr, ol, p, pt, precipitation_amount, precipitation_rate,& 140 prr,q, qc, ql, ql_c, ql_v, ql_vp, qr, qsws, rho, s a, shf, tend,&141 ts, u, us, v, vpt, w, z0, z0h, z0q, zu, zw141 prr,q, qc, ql, ql_c, ql_v, ql_vp, qr, qsws, rho, s, sa, shf, & 142 ssws, tend, ts, u, us, v, vpt, w, z0, z0h, z0q, zu, zw 142 143 143 144 USE averaging … … 224 225 INTEGER(iwp) :: nzt_do !< upper limit of the data field (usually nzt+1) 225 226 INTEGER(iwp) :: psi !< 226 INTEGER(iwp) :: s 227 INTEGER(iwp) :: s_ind !< 227 228 INTEGER(iwp) :: sender !< 228 229 INTEGER(iwp) :: ind(4) !< … … 268 269 269 270 CASE ( 'xy' ) 270 s = 1271 s_ind = 1 271 272 ALLOCATE( level_z(nzb:nzt+1), local_2d(nxlg:nxrg,nysg:nyng) ) 272 273 273 274 IF ( netcdf_data_format > 4 ) THEN 274 275 ns = 1 275 DO WHILE ( section(ns,s ) /= -9999 .AND. ns <= 100 )276 DO WHILE ( section(ns,s_ind) /= -9999 .AND. ns <= 100 ) 276 277 ns = ns + 1 277 278 ENDDO … … 298 299 299 300 CASE ( 'xz' ) 300 s = 2301 s_ind = 2 301 302 ALLOCATE( local_2d(nxlg:nxrg,nzb:nzt+1) ) 302 303 303 304 IF ( netcdf_data_format > 4 ) THEN 304 305 ns = 1 305 DO WHILE ( section(ns,s ) /= -9999 .AND. ns <= 100 )306 DO WHILE ( section(ns,s_ind) /= -9999 .AND. ns <= 100 ) 306 307 ns = ns + 1 307 308 ENDDO … … 329 330 330 331 CASE ( 'yz' ) 331 s = 3332 s_ind = 3 332 333 ALLOCATE( local_2d(nysg:nyng,nzb:nzt+1) ) 333 334 334 335 IF ( netcdf_data_format > 4 ) THEN 335 336 ns = 1 336 DO WHILE ( section(ns,s ) /= -9999 .AND. ns <= 100 )337 DO WHILE ( section(ns,s_ind) /= -9999 .AND. ns <= 100 ) 337 338 ns = ns + 1 338 339 ENDDO … … 1070 1071 CASE ( 's_xy', 's_xz', 's_yz' ) 1071 1072 IF ( av == 0 ) THEN 1072 to_be_resorted => q1073 to_be_resorted => s 1073 1074 ELSE 1074 1075 to_be_resorted => s_av … … 1117 1118 two_d = .TRUE. 1118 1119 level_z(nzb+1) = zu(nzb+1) 1120 1121 CASE ( 'ssws*_xy' ) ! 2d-array 1122 IF ( av == 0 ) THEN 1123 DO i = nxlg, nxrg 1124 DO j = nysg, nyng 1125 local_pf(i,j,nzb+1) = ssws(j,i) 1126 ENDDO 1127 ENDDO 1128 ELSE 1129 DO i = nxlg, nxrg 1130 DO j = nysg, nyng 1131 local_pf(i,j,nzb+1) = ssws_av(j,i) 1132 ENDDO 1133 ENDDO 1134 ENDIF 1135 resorted = .TRUE. 1136 two_d = .TRUE. 1137 level_z(nzb+1) = zu(nzb+1) 1119 1138 1120 1139 CASE ( 't*_xy' ) ! 2d-array … … 1303 1322 !-- section mode chosen. 1304 1323 is = 1 1305 loop1: DO WHILE ( section(is,s ) /= -9999 .OR. two_d )1324 loop1: DO WHILE ( section(is,s_ind) /= -9999 .OR. two_d ) 1306 1325 1307 1326 SELECT CASE ( mode ) … … 1313 1332 layer_xy = nzb+1 1314 1333 ELSE 1315 layer_xy = section(is,s )1334 layer_xy = section(is,s_ind) 1316 1335 ENDIF 1317 1336 … … 1347 1366 ! 1348 1367 !-- If required, carry out averaging along z 1349 IF ( section(is,s ) == -1 .AND. .NOT. two_d ) THEN1368 IF ( section(is,s_ind) == -1 .AND. .NOT. two_d ) THEN 1350 1369 1351 1370 local_2d = 0.0_wp … … 1537 1556 ! 1538 1557 !-- If required, carry out averaging along y 1539 IF ( section(is,s ) == -1 ) THEN1558 IF ( section(is,s_ind) == -1 ) THEN 1540 1559 1541 1560 ALLOCATE( local_2d_l(nxlg:nxrg,nzb_do:nzt_do) ) … … 1570 1589 !-- Just store the respective section on the local array 1571 1590 !-- (but only if it is available on this PE!) 1572 IF ( section(is,s ) >= nys .AND. section(is,s) <= nyn ) &1591 IF ( section(is,s_ind) >= nys .AND. section(is,s_ind) <= nyn ) & 1573 1592 THEN 1574 local_2d = local_pf(:,section(is,s ),nzb_do:nzt_do)1593 local_2d = local_pf(:,section(is,s_ind),nzb_do:nzt_do) 1575 1594 ENDIF 1576 1595 … … 1584 1603 !-- sections reside. Cross sections averaged along y are 1585 1604 !-- output on the respective first PE along y (myidy=0). 1586 IF ( ( section(is,s ) >= nys .AND.&1587 section(is,s ) <= nyn ) .OR.&1588 ( section(is,s ) == -1 .AND. myidy == 0 ) ) THEN1605 IF ( ( section(is,s_ind) >= nys .AND. & 1606 section(is,s_ind) <= nyn ) .OR. & 1607 ( section(is,s_ind) == -1 .AND. myidy == 0 ) ) THEN 1589 1608 #if defined( __netcdf ) 1590 1609 ! … … 1615 1634 DO i = 0, io_blocks-1 1616 1635 IF ( i == io_group ) THEN 1617 IF ( ( section(is,s ) >= nys .AND.&1618 section(is,s ) <= nyn ) .OR.&1619 ( section(is,s ) == -1 .AND.&1636 IF ( ( section(is,s_ind) >= nys .AND. & 1637 section(is,s_ind) <= nyn ) .OR. & 1638 ( section(is,s_ind) == -1 .AND. & 1620 1639 nys-1 == -1 ) ) & 1621 1640 THEN … … 1643 1662 ! 1644 1663 !-- Local array can be relocated directly. 1645 IF ( ( section(is,s ) >= nys .AND.&1646 section(is,s ) <= nyn ) .OR.&1647 ( section(is,s ) == -1 .AND. nys-1 == -1 ) )&1648 THEN1664 IF ( ( section(is,s_ind) >= nys .AND. & 1665 section(is,s_ind) <= nyn ) .OR. & 1666 ( section(is,s_ind) == -1 .AND. & 1667 nys-1 == -1 ) ) THEN 1649 1668 total_2d(nxlg:nxrg,nzb_do:nzt_do) = local_2d 1650 1669 ENDIF … … 1691 1710 !-- If the cross section resides on the PE, send the 1692 1711 !-- local index limits, otherwise send -9999 to PE0. 1693 IF ( ( section(is,s ) >= nys .AND.&1694 section(is,s ) <= nyn ) .OR.&1695 ( section(is,s ) == -1 .AND. nys-1 == -1 ) ) &1712 IF ( ( section(is,s_ind) >= nys .AND. & 1713 section(is,s_ind) <= nyn ) .OR. & 1714 ( section(is,s_ind) == -1 .AND. nys-1 == -1 ) ) & 1696 1715 THEN 1697 1716 ind(1) = nxlg; ind(2) = nxrg … … 1756 1775 ! 1757 1776 !-- If required, carry out averaging along x 1758 IF ( section(is,s ) == -1 ) THEN1777 IF ( section(is,s_ind) == -1 ) THEN 1759 1778 1760 1779 ALLOCATE( local_2d_l(nysg:nyng,nzb_do:nzt_do) ) … … 1789 1808 !-- Just store the respective section on the local array 1790 1809 !-- (but only if it is available on this PE!) 1791 IF ( section(is,s ) >= nxl .AND. section(is,s) <= nxr ) &1810 IF ( section(is,s_ind) >= nxl .AND. section(is,s_ind) <= nxr ) & 1792 1811 THEN 1793 local_2d = local_pf(section(is,s ),:,nzb_do:nzt_do)1812 local_2d = local_pf(section(is,s_ind),:,nzb_do:nzt_do) 1794 1813 ENDIF 1795 1814 … … 1803 1822 !-- sections reside. Cross sections averaged along x are 1804 1823 !-- output on the respective first PE along x (myidx=0). 1805 IF ( ( section(is,s ) >= nxl .AND. &1806 section(is,s ) <= nxr ) .OR. &1807 ( section(is,s ) == -1 .AND. myidx == 0 ) ) THEN1824 IF ( ( section(is,s_ind) >= nxl .AND. & 1825 section(is,s_ind) <= nxr ) .OR. & 1826 ( section(is,s_ind) == -1 .AND. myidx == 0 ) ) THEN 1808 1827 #if defined( __netcdf ) 1809 1828 ! … … 1834 1853 DO i = 0, io_blocks-1 1835 1854 IF ( i == io_group ) THEN 1836 IF ( ( section(is,s ) >= nxl .AND.&1837 section(is,s ) <= nxr ) .OR.&1838 ( section(is,s ) == -1 .AND.&1855 IF ( ( section(is,s_ind) >= nxl .AND. & 1856 section(is,s_ind) <= nxr ) .OR. & 1857 ( section(is,s_ind) == -1 .AND. & 1839 1858 nxl-1 == -1 ) ) & 1840 1859 THEN … … 1862 1881 ! 1863 1882 !-- Local array can be relocated directly. 1864 IF ( ( section(is,s ) >= nxl .AND.&1865 section(is,s ) <= nxr ) .OR.&1866 ( section(is,s ) == -1 .AND. nxl-1 == -1 ) ) &1883 IF ( ( section(is,s_ind) >= nxl .AND. & 1884 section(is,s_ind) <= nxr ) .OR. & 1885 ( section(is,s_ind) == -1 .AND. nxl-1 == -1 ) ) & 1867 1886 THEN 1868 1887 total_2d(nysg:nyng,nzb_do:nzt_do) = local_2d … … 1910 1929 !-- If the cross section resides on the PE, send the 1911 1930 !-- local index limits, otherwise send -9999 to PE0. 1912 IF ( ( section(is,s ) >= nxl .AND.&1913 section(is,s ) <= nxr ) .OR.&1914 ( section(is,s ) == -1 .AND. nxl-1 == -1 ) ) &1931 IF ( ( section(is,s_ind) >= nxl .AND. & 1932 section(is,s_ind) <= nxr ) .OR. & 1933 ( section(is,s_ind) == -1 .AND. nxl-1 == -1 ) ) & 1915 1934 THEN 1916 1935 ind(1) = nysg; ind(2) = nyng … … 2148 2167 ! 2149 2168 !-- Close plot output file. 2150 file_id = 20 + s 2169 file_id = 20 + s_ind 2151 2170 2152 2171 IF ( data_output_2d_on_each_pe ) THEN
Note: See TracChangeset
for help on using the changeset viewer.