Changeset 19 for palm/trunk/SOURCE/prognostic_equations.f90

Ignore:
Timestamp:
Feb 23, 2007 4:53:48 AM (15 years ago)
Message:

preliminary version of modified boundary conditions at top

File:
1 edited

Unmodified
Removed
• palm/trunk/SOURCE/prognostic_equations.f90

 r4 ! Actual revisions: ! ----------------- ! ! Calculation of e, q, and pt extended for gridpoint nzt, ! handling of given temperature/humidity/scalar fluxes at top surface ! ! Former revisions: ! Description: ! ------------ ! Solving the prognostic equations and advecting particles. ! Solving the prognostic equations. !------------------------------------------------------------------------------! !--       Tendency terms IF ( scalar_advec == 'bc-scheme' )  THEN CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tend ) CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tswst, tend ) ELSE IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' ) & THEN CALL diffusion_s( i, j, ddzu, ddzw, kh_m, pt_m, shf_m, tend ) CALL diffusion_s( i, j, ddzu, ddzw, kh_m, pt_m, shf_m, & tswst_m, tend ) ELSE CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tend ) CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tswst, tend ) ENDIF ENDIF ! !--       Prognostic equation for potential temperature DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt pt_p(k,j,i) = ( 1 - sat ) * pt_m(k,j,i) + sat * pt(k,j,i) + & dt_3d * (                                           & IF ( timestep_scheme(1:5) == 'runge' )  THEN IF ( intermediate_timestep_count == 1 )  THEN DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt tpt_m(k,j,i) = tend(k,j,i) ENDDO ELSEIF ( intermediate_timestep_count < & intermediate_timestep_count_max )  THEN DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt tpt_m(k,j,i) = -9.5625 * tend(k,j,i) + 5.3125 * tpt_m(k,j,i) ENDDO !--          Tendency-terms IF ( scalar_advec == 'bc-scheme' )  THEN CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, tend ) CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, qswst, tend ) ELSE IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' ) THEN THEN CALL diffusion_s( i, j, ddzu, ddzw, kh_m, q_m, qsws_m, & qswst_m, tend ) ELSE CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, qswst, & tend ) ELSE CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, tend ) ENDIF ENDIF ! !--          Prognostic equation for total water content / scalar DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt q_p(k,j,i) = ( 1 - sat ) * q_m(k,j,i) + sat * q(k,j,i) +       & dt_3d * (                                         & IF ( timestep_scheme(1:5) == 'runge' )  THEN IF ( intermediate_timestep_count == 1 )  THEN DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt tq_m(k,j,i) = tend(k,j,i) ENDDO ELSEIF ( intermediate_timestep_count < & intermediate_timestep_count_max )  THEN DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt tq_m(k,j,i) = -9.5625 * tend(k,j,i) + 5.3125 * tq_m(k,j,i) ENDDO !--          reasons in the course of the integration. In such cases the old TKE !--          value is reduced by 90%. DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt e_p(k,j,i) = ( 1 - sat ) * e_m(k,j,i) + sat * e(k,j,i) +       & dt_3d * (                                         & IF ( timestep_scheme(1:5) == 'runge' )  THEN IF ( intermediate_timestep_count == 1 )  THEN DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt te_m(k,j,i) = tend(k,j,i) ENDDO ELSEIF ( intermediate_timestep_count < & intermediate_timestep_count_max )  THEN DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt te_m(k,j,i) = -9.5625 * tend(k,j,i) + 5.3125 * te_m(k,j,i) ENDDO IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' ) & THEN CALL diffusion_s( i, j, ddzu, ddzw, kh_m, pt_m, shf_m, tend ) CALL diffusion_s( i, j, ddzu, ddzw, kh_m, pt_m, shf_m, & tswst_m, tend ) ELSE CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tend ) CALL diffusion_s( i, j, ddzu, ddzw, kh, pt, shf, tswst, tend ) ENDIF ! !--          Prognostic equation for potential temperature DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt pt_p(k,j,i) = ( 1.0-tsc(1) ) * pt_m(k,j,i) + tsc(1)*pt(k,j,i) +& dt_3d * (                                        & IF ( timestep_scheme(1:5) == 'runge' )  THEN IF ( intermediate_timestep_count == 1 )  THEN DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt tpt_m(k,j,i) = tend(k,j,i) ENDDO ELSEIF ( intermediate_timestep_count < & intermediate_timestep_count_max )  THEN DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt tpt_m(k,j,i) = -9.5625 * tend(k,j,i) + & 5.3125 * tpt_m(k,j,i) IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )& THEN CALL diffusion_s( i, j, ddzu, ddzw, kh_m, q_m, qsws_m, tend ) CALL diffusion_s( i, j, ddzu, ddzw, kh_m, q_m, qsws_m, & qswst_m, tend ) ELSE CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, tend ) CALL diffusion_s( i, j, ddzu, ddzw, kh, q, qsws, qswst, & tend ) ENDIF ! !--             Prognostic equation for total water content / scalar DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt q_p(k,j,i) = ( 1.0-tsc(1) ) * q_m(k,j,i) + tsc(1)*q(k,j,i) +& dt_3d * (                                      & IF ( timestep_scheme(1:5) == 'runge' )  THEN IF ( intermediate_timestep_count == 1 )  THEN DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt tq_m(k,j,i) = tend(k,j,i) ENDDO ELSEIF ( intermediate_timestep_count < & intermediate_timestep_count_max )  THEN DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt tq_m(k,j,i) = -9.5625 * tend(k,j,i) + & 5.3125 * tq_m(k,j,i) !--             reasons in the course of the integration. In such cases the old !--             TKE value is reduced by 90%. DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt e_p(k,j,i) = ( 1.0-tsc(1) ) * e_m(k,j,i) + tsc(1)*e(k,j,i) +& dt_3d * (                                      & IF ( timestep_scheme(1:5) == 'runge' )  THEN IF ( intermediate_timestep_count == 1 )  THEN DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt te_m(k,j,i) = tend(k,j,i) ENDDO ELSEIF ( intermediate_timestep_count < & intermediate_timestep_count_max )  THEN DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt te_m(k,j,i) = -9.5625 * tend(k,j,i) + & 5.3125 * te_m(k,j,i) !-- pt-tendency terms with no communication IF ( scalar_advec == 'bc-scheme' )  THEN CALL diffusion_s( ddzu, ddzw, kh, pt, shf, tend ) CALL diffusion_s( ddzu, ddzw, kh, pt, shf, tswst, tend ) ELSE IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN ENDIF IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN CALL diffusion_s( ddzu, ddzw, kh_m, pt_m, shf_m, tend ) CALL diffusion_s( ddzu, ddzw, kh_m, pt_m, shf_m, tswst_m, tend ) ELSE CALL diffusion_s( ddzu, ddzw, kh, pt, shf, tend ) CALL diffusion_s( ddzu, ddzw, kh, pt, shf, tswst, tend ) ENDIF ENDIF DO  i = nxl, nxr DO  j = nys, nyn DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt pt_p(k,j,i) = ( 1 - sat ) * pt_m(k,j,i) + sat * pt(k,j,i) +       & dt_3d * (                                           & DO  i = nxl, nxr DO  j = nys, nyn DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt tpt_m(k,j,i) = tend(k,j,i) ENDDO DO  i = nxl, nxr DO  j = nys, nyn DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt tpt_m(k,j,i) = -9.5625 * tend(k,j,i) + 5.3125 * tpt_m(k,j,i) ENDDO !--    Scalar/q-tendency terms with no communication IF ( scalar_advec == 'bc-scheme' )  THEN CALL diffusion_s( ddzu, ddzw, kh, q, qsws, tend ) CALL diffusion_s( ddzu, ddzw, kh, q, qsws, qswst, tend ) ELSE IF ( tsc(2) == 2.0  .OR.  timestep_scheme(1:5) == 'runge' )  THEN ENDIF IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN CALL diffusion_s( ddzu, ddzw, kh_m, q_m, qsws_m, tend ) CALL diffusion_s( ddzu, ddzw, kh_m, q_m, qsws_m, qswst_m, tend ) ELSE CALL diffusion_s( ddzu, ddzw, kh, q, qsws, tend ) CALL diffusion_s( ddzu, ddzw, kh, q, qsws, qswst, tend ) ENDIF ENDIF DO  i = nxl, nxr DO  j = nys, nyn DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt q_p(k,j,i) = ( 1 - sat ) * q_m(k,j,i) + sat * q(k,j,i) +       & dt_3d * (                                         & DO  i = nxl, nxr DO  j = nys, nyn DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt tq_m(k,j,i) = tend(k,j,i) ENDDO DO  i = nxl, nxr DO  j = nys, nyn DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt tq_m(k,j,i) = -9.5625 * tend(k,j,i) + 5.3125 * tq_m(k,j,i) ENDDO DO  i = nxl, nxr DO  j = nys, nyn DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt e_p(k,j,i) = ( 1 - sat ) * e_m(k,j,i) + sat * e(k,j,i) +       & dt_3d * (                                         & DO  i = nxl, nxr DO  j = nys, nyn DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt te_m(k,j,i) = tend(k,j,i) ENDDO DO  i = nxl, nxr DO  j = nys, nyn DO  k = nzb_s_inner(j,i)+1, nzt-1 DO  k = nzb_s_inner(j,i)+1, nzt te_m(k,j,i) = -9.5625 * tend(k,j,i) + 5.3125 * te_m(k,j,i) ENDDO
Note: See TracChangeset for help on using the changeset viewer.