cont1.f 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. subroutine cont1
  2. use lsgvar
  3. implicit none
  4. !
  5. ! ------------------------------------------------------------------
  6. !
  7. !**** *cont1*.
  8. !
  9. ! by E. Maier-Reimer.
  10. ! Last modified by U. Mikolajewicz 9/87.
  11. !
  12. ! Purpose.
  13. ! --------
  14. ! *cont1* computes the vertical velocities *w* from the total
  15. ! velocities *utot* and *vtot* using the equation of continuity.
  16. !
  17. !** Input.
  18. ! ------
  19. ! utot,vtot horizontal velocities ( common/lsgfie/).
  20. !
  21. ! Output.
  22. ! -------
  23. ! w vertical velocities (common/lsgfie/).
  24. ! trup sum of vertical transports up (m**3/s).
  25. ! trdo " " " " down " .
  26. ! both in common /lsgdia/.
  27. !
  28. ! Interface.
  29. ! ----------
  30. ! *call* *cont1*.
  31. !
  32. ! ------------------------------------------------------------
  33. !
  34. ! Declaration of local variables.
  35. ! -------------------------------
  36. integer :: i,j,k,il
  37. real (kind=8) :: hordiv,wups
  38. !
  39. !* 1. Initialisation.
  40. ! ---------------
  41. w(:,:,:) = 0.0
  42. !
  43. !* 2. Computation of the vertical velocity from bottom upward.
  44. ! --------------------------------------------------------
  45. !
  46. ! Determination of the values of the neighbour cell.
  47. !
  48. do k=ken-1,1,-1
  49. do j=3,jen-2
  50. do i=1,ien
  51. il=i-1
  52. if (il<1) il=ien
  53. hordiv=utot(il,j,k+1)*delta(il,j,k+1)*dphi-utot(i,j,k+1) &
  54. & *delta(i,j,k+1)*dphi+vtot(i,j+1,k+1)*delta(i,j+1,k+1) &
  55. & *dl(j+1)-vtot(il,j-1,k+1)*delta(il,j-1,k+1)*dl(j-1)
  56. w(i,j,k)=w(i,j,k+1)+hordiv/(dl(j)*dphi)*wet(i,j,k+1)
  57. end do
  58. end do
  59. end do
  60. !
  61. !* 3. Computation of control parameters.
  62. ! ----------------------------------
  63. ! The parameters *trup* and *trdo* describe the sum of
  64. ! the transports up and down.
  65. !
  66. do k=1,ken
  67. trup(k)=0.
  68. trdo(k)=0.
  69. do j=1,jen
  70. do i=1,ien
  71. wups=sign(0.5_8,w(i,j,k))
  72. trup(k)=trup(k)+w(i,j,k)*(wups+abs(wups))*dlh(i,j)
  73. trdo(k)=trdo(k)+w(i,j,k)*(abs(wups)-wups)*dlh(i,j)
  74. end do
  75. end do
  76. trup(k)=trup(k)*dphi
  77. trdo(k)=trdo(k)*dphi
  78. end do
  79. return
  80. end subroutine cont1