Changeset 216 for palm/trunk/SOURCE/netcdf.f90
- Timestamp:
- Nov 25, 2008 7:12:43 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/netcdf.f90
r198 r216 7 7 ! Current revisions: 8 8 ! ------------------ 9 ! 9 ! Origin of the xy-coordinate system shifted from the center of the first 10 ! grid cell (indices i=0, j=0) to the south-left corner of this cell. 10 11 ! 11 12 ! Former revisions: … … 457 458 458 459 ! 459 !-- Write data for x and xu axis (shifted by -dx/2)460 !-- Write data for x (shifted by +dx/2) and xu axis 460 461 ALLOCATE( netcdf_data(0:nx+1) ) 461 462 462 463 DO i = 0, nx+1 463 netcdf_data(i) = i* dx464 netcdf_data(i) = ( i + 0.5 ) * dx 464 465 ENDDO 465 466 … … 469 470 470 471 DO i = 0, nx+1 471 netcdf_data(i) = ( i - 0.5 )* dx472 netcdf_data(i) = i * dx 472 473 ENDDO 473 474 … … 480 481 481 482 ! 482 !-- Write data for y and yv axis (shifted by -dy/2)483 !-- Write data for y (shifted by +dy/2) and yv axis 483 484 ALLOCATE( netcdf_data(0:ny+1) ) 484 485 485 486 DO i = 0, ny+1 486 netcdf_data(i) = i* dy487 netcdf_data(i) = ( i + 0.5 ) * dy 487 488 ENDDO 488 489 … … 492 493 493 494 DO i = 0, ny+1 494 netcdf_data(i) = ( i - 0.5 )* dy495 netcdf_data(i) = i * dy 495 496 ENDDO 496 497 … … 1034 1035 1035 1036 ! 1036 !-- Write data for x and xu axis (shifted by -dx/2)1037 !-- Write data for x (shifted by +dx/2) and xu axis 1037 1038 ALLOCATE( netcdf_data(0:nx+1) ) 1038 1039 1039 1040 DO i = 0, nx+1 1040 netcdf_data(i) = i* dx1041 netcdf_data(i) = ( i + 0.5 ) * dx 1041 1042 ENDDO 1042 1043 … … 1046 1047 1047 1048 DO i = 0, nx+1 1048 netcdf_data(i) = ( i - 0.5 )* dx1049 netcdf_data(i) = i * dx 1049 1050 ENDDO 1050 1051 … … 1057 1058 1058 1059 ! 1059 !-- Write data for y and yv axis (shifted by -dy/2)1060 !-- Write data for y (shifted by +dy/2) and yv axis 1060 1061 ALLOCATE( netcdf_data(0:ny+1) ) 1061 1062 1062 1063 DO i = 0, ny+1 1063 netcdf_data(i) = i* dy1064 netcdf_data(i) = ( i + 0.5 ) * dy 1064 1065 ENDDO 1065 1066 … … 1069 1070 1070 1071 DO i = 0, ny+1 1071 netcdf_data(i) = ( i - 0.5 )* dy1072 netcdf_data(i) = i * dy 1072 1073 ENDDO 1073 1074 … … 1531 1532 1532 1533 ! 1533 !-- Write y_xz data 1534 !-- Write y_xz data (shifted by +dy/2) 1535 DO i = 1, ns 1536 IF( section(i,2) == -1 ) THEN 1537 netcdf_data(i) = -1.0 ! section averaged along y 1538 ELSE 1539 netcdf_data(i) = ( section(i,2) + 0.5 ) * dy 1540 ENDIF 1541 ENDDO 1542 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_y_xz(av), netcdf_data, & 1543 start = (/ 1 /), count = (/ ns /) ) 1544 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 163 ) 1545 1546 ! 1547 !-- Write yv_xz data 1534 1548 DO i = 1, ns 1535 1549 IF( section(i,2) == -1 ) THEN … … 1539 1553 ENDIF 1540 1554 ENDDO 1541 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_y_xz(av), netcdf_data, &1542 start = (/ 1 /), count = (/ ns /) )1543 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 163 )1544 1545 !1546 !-- Write yv_xz data1547 DO i = 1, ns1548 IF( section(i,2) == -1 ) THEN1549 netcdf_data(i) = -1.0 ! section averaged along y1550 ELSE1551 netcdf_data(i) = ( section(i,2) - 0.5 ) * dy1552 ENDIF1553 ENDDO1554 1555 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_yv_xz(av), & 1555 1556 netcdf_data, start = (/ 1 /), & … … 1568 1569 1569 1570 ! 1570 !-- Write data for x and xu axis (shifted by -dx/2)1571 !-- Write data for x (shifted by +dx/2) and xu axis 1571 1572 ALLOCATE( netcdf_data(0:nx+1) ) 1572 1573 1573 1574 DO i = 0, nx+1 1574 netcdf_data(i) = i* dx1575 netcdf_data(i) = ( i + 0.5 ) * dx 1575 1576 ENDDO 1576 1577 … … 1580 1581 1581 1582 DO i = 0, nx+1 1582 netcdf_data(i) = ( i - 0.5 )* dx1583 netcdf_data(i) = i * dx 1583 1584 ENDDO 1584 1585 … … 2042 2043 2043 2044 ! 2044 !-- Write x_yz data 2045 !-- Write x_yz data (shifted by +dx/2) 2046 DO i = 1, ns 2047 IF( section(i,3) == -1 ) THEN 2048 netcdf_data(i) = -1.0 ! section averaged along x 2049 ELSE 2050 netcdf_data(i) = ( section(i,3) + 0.5 ) * dx 2051 ENDIF 2052 ENDDO 2053 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_x_yz(av), netcdf_data, & 2054 start = (/ 1 /), count = (/ ns /) ) 2055 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 202 ) 2056 2057 ! 2058 !-- Write x_yz data (xu grid) 2045 2059 DO i = 1, ns 2046 2060 IF( section(i,3) == -1 ) THEN … … 2050 2064 ENDIF 2051 2065 ENDDO 2052 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_x_yz(av), netcdf_data, &2053 start = (/ 1 /), count = (/ ns /) )2054 IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 202 )2055 2056 !2057 !-- Write x_yz data (xu grid)2058 DO i = 1, ns2059 IF( section(i,3) == -1 ) THEN2060 netcdf_data(i) = -1.0 ! section averaged along x2061 ELSE2062 netcdf_data(i) = (section(i,3)-0.5) * dx2063 ENDIF2064 ENDDO2065 2066 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_xu_yz(av), netcdf_data, & 2066 2067 start = (/ 1 /), count = (/ ns /) ) … … 2078 2079 2079 2080 ! 2080 !-- Write data for y and yv axis (shifted by -dy/2)2081 !-- Write data for y (shifted by +dy/2) and yv axis 2081 2082 ALLOCATE( netcdf_data(0:ny+1) ) 2082 2083 2083 2084 DO j = 0, ny+1 2084 netcdf_data(j) = j* dy2085 netcdf_data(j) = ( j + 0.5 ) * dy 2085 2086 ENDDO 2086 2087 … … 2090 2091 2091 2092 DO j = 0, ny+1 2092 netcdf_data(j) = ( j - 0.5 )* dy2093 netcdf_data(j) = j * dy 2093 2094 ENDDO 2094 2095
Note: See TracChangeset
for help on using the changeset viewer.