Changeset 95 for palm/trunk/SOURCE/prognostic_equations.f90
 Timestamp:
 Jun 2, 2007 4:48:38 PM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SOURCE/prognostic_equations.f90
r94 r95 4 4 ! Actual revisions: 5 5 !  6 ! prognostic equation for salinity 6 7 ! new argument zw in calls of diffusion_e 7 8 ! … … 414 415 415 416 ! 417 ! If required, compute prognostic equation for salinity 418 IF ( ocean ) THEN 419 420 CALL cpu_log( log_point(37), 'saequation', 'start' ) 421 422 ! 423 ! satendency terms with communication 424 sat = tsc(1) 425 sbt = tsc(2) 426 IF ( scalar_advec == 'bcscheme' ) THEN 427 428 IF ( timestep_scheme(1:5) /= 'runge' ) THEN 429 ! 430 ! BottChlond scheme always uses Euler time step when leapfrog is 431 ! switched on. Thus: 432 sat = 1.0 433 sbt = 1.0 434 ENDIF 435 tend = 0.0 436 CALL advec_s_bc( sa, 'sa' ) 437 ELSE 438 IF ( tsc(2) /= 2.0 ) THEN 439 IF ( scalar_advec == 'upsscheme' ) THEN 440 tend = 0.0 441 CALL advec_s_ups( sa, 'sa' ) 442 ENDIF 443 ENDIF 444 ENDIF 445 446 ! 447 ! sa terms with no communication 448 DO i = nxl, nxr 449 DO j = nys, nyn 450 ! 451 ! Tendencyterms 452 IF ( scalar_advec == 'bcscheme' ) THEN 453 CALL diffusion_s( i, j, ddzu, ddzw, kh, sa, saswsb, saswst, & 454 tend ) 455 ELSE 456 IF ( tsc(2) == 2.0 .OR. timestep_scheme(1:5) == 'runge' ) THEN 457 tend(:,j,i) = 0.0 458 CALL advec_s_pw( i, j, sa ) 459 ELSE 460 IF ( scalar_advec /= 'upsscheme' ) THEN 461 tend(:,j,i) = 0.0 462 CALL advec_s_up( i, j, sa ) 463 ENDIF 464 ENDIF 465 CALL diffusion_s( i, j, ddzu, ddzw, kh, sa, saswsb, saswst, & 466 tend ) 467 ENDIF 468 469 CALL user_actions( i, j, 'satendency' ) 470 471 ! 472 ! Prognostic equation for salinity 473 DO k = nzb_s_inner(j,i)+1, nzt 474 sa_p(k,j,i) = sat * sa(k,j,i) + & 475 dt_3d * ( & 476 sbt * tend(k,j,i) + tsc(3) * tsa_m(k,j,i) & 477 )  & 478 tsc(5) * rdf(k) * ( sa(k,j,i)  sa_init(k) ) 479 IF ( sa_p(k,j,i) < 0.0 ) sa_p(k,j,i) = 0.1 * sa(k,j,i) 480 ENDDO 481 482 ! 483 ! Calculate tendencies for the next RungeKutta step 484 IF ( timestep_scheme(1:5) == 'runge' ) THEN 485 IF ( intermediate_timestep_count == 1 ) THEN 486 DO k = nzb_s_inner(j,i)+1, nzt 487 tsa_m(k,j,i) = tend(k,j,i) 488 ENDDO 489 ELSEIF ( intermediate_timestep_count < & 490 intermediate_timestep_count_max ) THEN 491 DO k = nzb_s_inner(j,i)+1, nzt 492 tsa_m(k,j,i) = 9.5625 * tend(k,j,i) + & 493 5.3125 * tsa_m(k,j,i) 494 ENDDO 495 ENDIF 496 ENDIF 497 498 ENDDO 499 ENDDO 500 501 CALL cpu_log( log_point(37), 'saequation', 'stop' ) 502 503 ENDIF 504 505 ! 416 506 ! If required, compute prognostic equation for total water content / scalar 417 507 IF ( humidity .OR. passive_scalar ) THEN … … 647 737 ! be called for the standard PiascekWilliams advection scheme. 648 738 ! 649 ! The call of this subroutine is embedded in two DO loops over i and j, thus 650 ! communication between CPUs is not allowed in this subroutine. 739 ! Here the calls of most subroutines are embedded in two DO loops over i and j, 740 ! so communication between CPUs is not allowed (does not make sense) within 741 ! these loops. 651 742 ! 652 743 ! (Optimized to avoid cache missings, i.e. for Power4/5architectures.) … … 883 974 ENDDO 884 975 ENDIF 976 ENDIF 977 978 ! 979 ! If required, compute prognostic equation for salinity 980 IF ( ocean ) THEN 981 982 ! 983 ! Tendencyterms for salinity 984 tend(:,j,i) = 0.0 985 IF ( tsc(2) == 2.0 .OR. timestep_scheme(1:5) == 'runge' ) & 986 THEN 987 CALL advec_s_pw( i, j, sa ) 988 ELSE 989 CALL advec_s_up( i, j, sa ) 990 ENDIF 991 CALL diffusion_s( i, j, ddzu, ddzw, kh, sa, saswsb, saswst, & 992 tend ) 993 994 CALL user_actions( i, j, 'satendency' ) 995 996 ! 997 ! Prognostic equation for salinity 998 DO k = nzb_s_inner(j,i)+1, nzt 999 sa_p(k,j,i) = tsc(1) * sa(k,j,i) + & 1000 dt_3d * ( & 1001 tsc(2) * tend(k,j,i) + tsc(3) * tsa_m(k,j,i) & 1002 )  & 1003 tsc(5) * rdf(k) * ( sa(k,j,i)  sa_init(k) ) 1004 IF ( sa_p(k,j,i) < 0.0 ) sa_p(k,j,i) = 0.1 * sa(k,j,i) 1005 ENDDO 1006 1007 ! 1008 ! Calculate tendencies for the next RungeKutta step 1009 IF ( timestep_scheme(1:5) == 'runge' ) THEN 1010 IF ( intermediate_timestep_count == 1 ) THEN 1011 DO k = nzb_s_inner(j,i)+1, nzt 1012 tsa_m(k,j,i) = tend(k,j,i) 1013 ENDDO 1014 ELSEIF ( intermediate_timestep_count < & 1015 intermediate_timestep_count_max ) THEN 1016 DO k = nzb_s_inner(j,i)+1, nzt 1017 tsa_m(k,j,i) = 9.5625 * tend(k,j,i) + & 1018 5.3125 * tsa_m(k,j,i) 1019 ENDDO 1020 ENDIF 1021 ENDIF 1022 885 1023 ENDIF 886 1024 … … 1363 1501 1364 1502 ! 1503 ! If required, compute prognostic equation for salinity 1504 IF ( ocean ) THEN 1505 1506 CALL cpu_log( log_point(37), 'saequation', 'start' ) 1507 1508 ! 1509 ! satendency terms with communication 1510 sat = tsc(1) 1511 sbt = tsc(2) 1512 IF ( scalar_advec == 'bcscheme' ) THEN 1513 1514 IF ( timestep_scheme(1:5) /= 'runge' ) THEN 1515 ! 1516 ! BottChlond scheme always uses Euler time step when leapfrog is 1517 ! switched on. Thus: 1518 sat = 1.0 1519 sbt = 1.0 1520 ENDIF 1521 tend = 0.0 1522 CALL advec_s_bc( sa, 'sa' ) 1523 ELSE 1524 IF ( tsc(2) /= 2.0 ) THEN 1525 IF ( scalar_advec == 'upsscheme' ) THEN 1526 tend = 0.0 1527 CALL advec_s_ups( sa, 'sa' ) 1528 ENDIF 1529 ENDIF 1530 ENDIF 1531 1532 ! 1533 ! Scalar/qtendency terms with no communication 1534 IF ( scalar_advec == 'bcscheme' ) THEN 1535 CALL diffusion_s( ddzu, ddzw, kh, sa, saswsb, saswst, tend ) 1536 ELSE 1537 IF ( tsc(2) == 2.0 .OR. timestep_scheme(1:5) == 'runge' ) THEN 1538 tend = 0.0 1539 CALL advec_s_pw( sa ) 1540 ELSE 1541 IF ( scalar_advec /= 'upsscheme' ) THEN 1542 tend = 0.0 1543 CALL advec_s_up( sa ) 1544 ENDIF 1545 ENDIF 1546 CALL diffusion_s( ddzu, ddzw, kh, sa, saswsb, saswst, tend ) 1547 ENDIF 1548 1549 CALL user_actions( 'satendency' ) 1550 1551 ! 1552 ! Prognostic equation for salinity 1553 DO i = nxl, nxr 1554 DO j = nys, nyn 1555 DO k = nzb_s_inner(j,i)+1, nzt 1556 sa_p(k,j,i) = sat * sa(k,j,i) + & 1557 dt_3d * ( & 1558 sbt * tend(k,j,i) + tsc(3) * tsa_m(k,j,i) & 1559 )  & 1560 tsc(5) * rdf(k) * ( sa(k,j,i)  sa_init(k) ) 1561 IF ( sa_p(k,j,i) < 0.0 ) sa_p(k,j,i) = 0.1 * sa(k,j,i) 1562 ENDDO 1563 ENDDO 1564 ENDDO 1565 1566 ! 1567 ! Calculate tendencies for the next RungeKutta step 1568 IF ( timestep_scheme(1:5) == 'runge' ) THEN 1569 IF ( intermediate_timestep_count == 1 ) THEN 1570 DO i = nxl, nxr 1571 DO j = nys, nyn 1572 DO k = nzb_s_inner(j,i)+1, nzt 1573 tsa_m(k,j,i) = tend(k,j,i) 1574 ENDDO 1575 ENDDO 1576 ENDDO 1577 ELSEIF ( intermediate_timestep_count < & 1578 intermediate_timestep_count_max ) THEN 1579 DO i = nxl, nxr 1580 DO j = nys, nyn 1581 DO k = nzb_s_inner(j,i)+1, nzt 1582 tsa_m(k,j,i) = 9.5625 * tend(k,j,i) + & 1583 5.3125 * tsa_m(k,j,i) 1584 ENDDO 1585 ENDDO 1586 ENDDO 1587 ENDIF 1588 ENDIF 1589 1590 CALL cpu_log( log_point(37), 'saequation', 'stop' ) 1591 1592 ENDIF 1593 1594 ! 1365 1595 ! If required, compute prognostic equation for total water content / scalar 1366 1596 IF ( humidity .OR. passive_scalar ) THEN
Note: See TracChangeset
for help on using the changeset viewer.