Changeset 1795 for palm/trunk/SOURCE
- Timestamp:
- Mar 18, 2016 3:00:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/check_parameters.f90
r1789 r1795 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Bugfix: setting of initial scalar profile in ocean 22 22 ! 23 23 ! Former revisions: … … 1543 1543 i = 1 1544 1544 gradient = 0.0_wp 1545 q_vertical_gradient_level_ind(1) = 0 1546 DO k = 1, nzt+1 1547 IF ( i < 11 ) THEN 1548 IF ( q_vertical_gradient_level(i) < zu(k) .AND. & 1549 q_vertical_gradient_level(i) >= 0.0_wp ) THEN 1550 gradient = q_vertical_gradient(i) / 100.0_wp 1551 q_vertical_gradient_level_ind(i) = k - 1 1552 i = i + 1 1545 1546 IF ( .NOT. ocean ) THEN 1547 1548 q_vertical_gradient_level_ind(1) = 0 1549 DO k = 1, nzt+1 1550 IF ( i < 11 ) THEN 1551 IF ( q_vertical_gradient_level(i) < zu(k) .AND. & 1552 q_vertical_gradient_level(i) >= 0.0_wp ) THEN 1553 gradient = q_vertical_gradient(i) / 100.0_wp 1554 q_vertical_gradient_level_ind(i) = k - 1 1555 i = i + 1 1556 ENDIF 1553 1557 ENDIF 1554 ENDIF 1555 IF ( gradient /= 0.0_wp ) THEN 1556 IF ( k /= 1 ) THEN 1557 q_init(k) = q_init(k-1) + dzu(k) * gradient 1558 IF ( gradient /= 0.0_wp ) THEN 1559 IF ( k /= 1 ) THEN 1560 q_init(k) = q_init(k-1) + dzu(k) * gradient 1561 ELSE 1562 q_init(k) = q_init(k-1) + dzu(k) * gradient 1563 ENDIF 1558 1564 ELSE 1559 q_init(k) = q_init(k-1) + dzu(k) * gradient1565 q_init(k) = q_init(k-1) 1560 1566 ENDIF 1561 ELSE 1562 q_init(k) = q_init(k-1) 1563 ENDIF 1564 ! 1565 !-- Avoid negative humidities 1566 IF ( q_init(k) < 0.0_wp ) THEN 1567 q_init(k) = 0.0_wp 1568 ENDIF 1569 ENDDO 1570 1567 ! 1568 !-- Avoid negative humidities 1569 IF ( q_init(k) < 0.0_wp ) THEN 1570 q_init(k) = 0.0_wp 1571 ENDIF 1572 ENDDO 1573 1574 ELSE 1575 1576 q_vertical_gradient_level_ind(1) = nzt+1 1577 DO k = nzt, 0, -1 1578 IF ( i < 11 ) THEN 1579 IF ( q_vertical_gradient_level(i) > zu(k) .AND. & 1580 q_vertical_gradient_level(i) <= 0.0_wp ) THEN 1581 gradient = q_vertical_gradient(i) / 100.0_wp 1582 q_vertical_gradient_level_ind(i) = k + 1 1583 i = i + 1 1584 ENDIF 1585 ENDIF 1586 IF ( gradient /= 0.0_wp ) THEN 1587 IF ( k /= nzt ) THEN 1588 q_init(k) = q_init(k+1) - dzu(k+1) * gradient 1589 ELSE 1590 q_init(k) = q_surface - 0.5_wp * dzu(k+1) * gradient 1591 q_init(k+1) = q_surface + 0.5_wp * dzu(k+1) * gradient 1592 ENDIF 1593 ELSE 1594 q_init(k) = q_init(k+1) 1595 ENDIF 1596 ! 1597 !-- Avoid negative humidities 1598 IF ( q_init(k) < 0.0_wp ) THEN 1599 q_init(k) = 0.0_wp 1600 ENDIF 1601 ENDDO 1602 1603 ENDIF 1571 1604 ! 1572 1605 !-- In case of no given humidity gradients, choose zero gradient
Note: See TracChangeset
for help on using the changeset viewer.