source: palm/trunk/SOURCE/ls_forcing.f90 @ 1682

Last change on this file since 1682 was 1682, checked in by knoop, 8 years ago

Code annotations made doxygen readable

  • Property svn:keywords set to Id
File size: 21.7 KB
Line 
1!> @file ls_forcing.f90
2!--------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the terms
6! of the GNU General Public License as published by the Free Software Foundation,
7! either version 3 of the License, or (at your option) any later version.
8!
9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12!
13! You should have received a copy of the GNU General Public License along with
14! PALM. If not, see <http://www.gnu.org/licenses/>.
15!
16! Copyright 1997-2014 Leibniz Universitaet Hannover
17!--------------------------------------------------------------------------------!
18!
19! Current revisions:
20! ------------------
21! Code annotations made doxygen readable
22!
23! Former revisions:
24! -----------------
25! $Id: ls_forcing.f90 1682 2015-10-07 23:56:08Z knoop $
26!
27! 1602 2015-06-22 07:50:56Z heinze
28! PA0370 changed to PA0363
29!
30! 1382 2014-04-30 12:15:41Z boeske
31! Renamed variables which store large scale forcing tendencies
32! pt_lsa -> td_lsa_lpt, pt_subs -> td_sub_lpt,
33! q_lsa  -> td_lsa_q,   q_subs  -> td_sub_q,
34! high|lowpt_lsa -> high|low_td_lsa_lpt, ...
35!
36! 1365 2014-04-22 15:03:56Z boeske
37! Usage of large scale forcing for pt and q enabled:
38! Added new subroutine ls_advec for horizontal large scale advection and large
39! scale subsidence,
40! error message in init_ls_forcing specified,
41! variable t renamed nt
42!
43! 1353 2014-04-08 15:21:23Z heinze
44! REAL constants provided with KIND-attribute
45!
46! 1320 2014-03-20 08:40:49Z raasch
47! ONLY-attribute added to USE-statements,
48! kind-parameters added to all INTEGER and REAL declaration statements,
49! kinds are defined in new module kinds,
50! comment fields (!:) to be used for variable explanations added to
51! all variable declaration statements
52!
53! 1318 2014-03-17 13:35:16Z raasch
54! module interfaces removed
55!
56! 1299 2014-03-06 13:15:21Z heinze
57! Ensure a zero large scale vertical velocity at the surface
58! Bugfix: typo in case of boundary condition in if-clause
59!
60! 1276 2014-01-15 13:40:41Z heinze
61! Use LSF_DATA also in case of Dirichlet bottom boundary condition for scalars
62!
63! 1249 2013-11-06 10:45:47Z heinze
64! remove call of user module
65! reformatting
66!
67! 1241 2013-10-30 11:36:58Z heinze
68! Initial revision
69!
70! Description:
71! ------------
72!> Calculates large scale forcings (geostrophic wind and subsidence velocity) as
73!> well as surfaces fluxes dependent on time given in an external file (LSF_DATA).
74!> Code is based in parts on DALES and UCLA-LES.
75!--------------------------------------------------------------------------------!
76 MODULE ls_forcing_mod
77 
78
79    PRIVATE
80    PUBLIC init_ls_forcing, ls_forcing_surf, ls_forcing_vert, ls_advec
81    SAVE
82
83    INTERFACE ls_advec
84       MODULE PROCEDURE ls_advec
85       MODULE PROCEDURE ls_advec_ij
86    END INTERFACE ls_advec
87
88 CONTAINS
89
90!------------------------------------------------------------------------------!
91! Description:
92! ------------
93!> @todo Missing subroutine description.
94!------------------------------------------------------------------------------!
95    SUBROUTINE init_ls_forcing
96
97       USE arrays_3d,                                                          &
98           ONLY:  p_surf, pt_surf, q_surf, qsws_surf, shf_surf, td_lsa_lpt,    &
99                  td_lsa_q, td_sub_lpt, td_sub_q, time_surf, time_vert,        &
100                  ug_vert, vg_vert, wsubs_vert, zu
101
102       USE control_parameters,                                                 &
103           ONLY:  end_time, lsf_surf, lsf_vert, message_string, nlsf
104
105       USE indices,                                                            &
106           ONLY:  ngp_sums_ls, nzb, nz, nzt
107
108       USE kinds
109
110       USE statistics,                                                         &
111           ONLY:  sums_ls_l
112
113
114       IMPLICIT NONE
115
116       CHARACTER(100) ::  chmess      !<
117       CHARACTER(1)   ::  hash        !<
118
119       INTEGER(iwp) ::  ierrn         !<
120       INTEGER(iwp) ::  finput = 90   !<
121       INTEGER(iwp) ::  k             !<
122       INTEGER(iwp) ::  nt             !<
123
124       REAL(wp) ::  fac               !<
125       REAL(wp) ::  highheight        !<
126       REAL(wp) ::  highug_vert       !<
127       REAL(wp) ::  highvg_vert       !<
128       REAL(wp) ::  highwsubs_vert    !<
129       REAL(wp) ::  lowheight         !<
130       REAL(wp) ::  lowug_vert        !<
131       REAL(wp) ::  lowvg_vert        !<
132       REAL(wp) ::  lowwsubs_vert     !<
133       REAL(wp) ::  high_td_lsa_lpt   !<
134       REAL(wp) ::  low_td_lsa_lpt    !<
135       REAL(wp) ::  high_td_lsa_q     !<
136       REAL(wp) ::  low_td_lsa_q      !<
137       REAL(wp) ::  high_td_sub_lpt   !<
138       REAL(wp) ::  low_td_sub_lpt    !<
139       REAL(wp) ::  high_td_sub_q     !<
140       REAL(wp) ::  low_td_sub_q      !<
141       REAL(wp) ::  r_dummy           !<
142
143       ALLOCATE( p_surf(0:nlsf), pt_surf(0:nlsf), q_surf(0:nlsf),              &
144                 qsws_surf(0:nlsf), shf_surf(0:nlsf),                          &
145                 td_lsa_lpt(nzb:nzt+1,0:nlsf), td_lsa_q(nzb:nzt+1,0:nlsf),     &
146                 td_sub_lpt(nzb:nzt+1,0:nlsf), td_sub_q(nzb:nzt+1,0:nlsf),     &
147                 time_vert(0:nlsf), time_surf(0:nlsf),                         &
148                 ug_vert(nzb:nzt+1,0:nlsf), vg_vert(nzb:nzt+1,0:nlsf),         &
149                 wsubs_vert(nzb:nzt+1,0:nlsf) )
150
151       p_surf = 0.0_wp; pt_surf = 0.0_wp; q_surf = 0.0_wp; qsws_surf = 0.0_wp
152       shf_surf = 0.0_wp; time_vert = 0.0_wp; td_lsa_lpt = 0.0_wp
153       td_lsa_q = 0.0_wp; td_sub_lpt = 0.0_wp; td_sub_q = 0.0_wp
154       time_surf = 0.0_wp; ug_vert = 0.0_wp; vg_vert = 0.0_wp
155       wsubs_vert = 0.0_wp
156
157!
158!--    Array for storing large scale forcing and nudging tendencies at each
159!--    timestep for data output
160       ALLOCATE( sums_ls_l(nzb:nzt+1,0:7) )
161       sums_ls_l = 0.0_wp
162
163       ngp_sums_ls = (nz+2)*6
164
165       OPEN ( finput, FILE='LSF_DATA', STATUS='OLD', &
166              FORM='FORMATTED', IOSTAT=ierrn )
167
168       IF ( ierrn /= 0 )  THEN
169          message_string = 'file LSF_DATA does not exist'
170          CALL message( 'ls_forcing', 'PA0368', 1, 2, 0, 6, 0 )
171       ENDIF
172
173       ierrn = 0
174!
175!--    First three lines of LSF_DATA contain header
176       READ ( finput, FMT='(a100)', IOSTAT=ierrn ) chmess
177       READ ( finput, FMT='(a100)', IOSTAT=ierrn ) chmess
178       READ ( finput, FMT='(a100)', IOSTAT=ierrn ) chmess
179
180       IF ( ierrn /= 0 )  THEN
181          message_string = 'errors in file LSF_DATA'
182          CALL message( 'ls_forcing', 'PA0369', 1, 2, 0, 6, 0 )
183       ENDIF
184
185!
186!--    Surface values are read in
187       nt     = 0
188       ierrn = 0
189
190       DO WHILE ( time_surf(nt) < end_time )
191          nt = nt + 1
192          READ ( finput, *, IOSTAT = ierrn ) time_surf(nt), shf_surf(nt),      &
193                                             qsws_surf(nt), pt_surf(nt),       &
194                                             q_surf(nt), p_surf(nt)
195
196          IF ( ierrn < 0 )  THEN
197            WRITE ( message_string, * ) 'No time dependent surface variables ',&
198                              'in&LSF_DATA for end of run found'
199
200             CALL message( 'ls_forcing', 'PA0363', 1, 2, 0, 6, 0 )
201          ENDIF
202       ENDDO
203
204
205       IF ( time_surf(1) > end_time )  THEN
206          WRITE ( message_string, * ) 'No time dependent surface variables in ',&
207                                     '&LSF_DATA for end of run found - ',      &
208                                     'lsf_surf is set to FALSE'
209          CALL message( 'ls_forcing', 'PA0371', 0, 0, 0, 6, 0 )
210          lsf_surf = .FALSE.
211       ENDIF
212
213!
214!--    Go to the end of the list with surface variables
215       DO WHILE ( ierrn == 0 )
216          READ ( finput, *, IOSTAT = ierrn ) r_dummy
217       ENDDO
218
219!
220!--    Profiles of ug, vg and w_subs are read in (large scale forcing)
221
222       nt = 0
223       DO WHILE ( time_vert(nt) < end_time )
224          nt = nt + 1
225          hash = "#"
226          ierrn = 1 ! not zero
227!
228!--       Search for the next line consisting of "# time",
229!--       from there onwards the profiles will be read
230          DO WHILE ( .NOT. ( hash == "#" .AND. ierrn == 0 ) ) 
231             READ ( finput, *, IOSTAT=ierrn ) hash, time_vert(nt)
232             IF ( ierrn < 0 )  THEN
233                WRITE( message_string, * ) 'No time dependent vertical profiles',&
234                                 ' in&LSF_DATA for end of run found'
235                CALL message( 'ls_forcing', 'PA0372', 1, 2, 0, 6, 0 )
236             ENDIF
237          ENDDO
238
239          IF ( nt == 1 .AND. time_vert(nt) > end_time ) EXIT
240
241          READ ( finput, *, IOSTAT=ierrn ) lowheight, lowug_vert, lowvg_vert,  &
242                                           lowwsubs_vert, low_td_lsa_lpt,      &
243                                           low_td_lsa_q, low_td_sub_lpt,       &
244                                           low_td_sub_q
245          IF ( ierrn /= 0 )  THEN
246             message_string = 'errors in file LSF_DATA'
247             CALL message( 'ls_forcing', 'PA0369', 1, 2, 0, 6, 0 )
248          ENDIF
249
250          READ ( finput, *, IOSTAT=ierrn ) highheight, highug_vert,            &
251                                           highvg_vert, highwsubs_vert,        &
252                                           high_td_lsa_lpt, high_td_lsa_q,     &
253                                           high_td_sub_lpt, high_td_sub_q
254     
255          IF ( ierrn /= 0 )  THEN
256             message_string = 'errors in file LSF_DATA'
257             CALL message( 'ls_forcing', 'PA0369', 1, 2, 0, 6, 0 )
258          ENDIF
259
260
261          DO  k = nzb, nzt+1
262             IF ( highheight < zu(k) )  THEN
263                lowheight      = highheight
264                lowug_vert     = highug_vert
265                lowvg_vert     = highvg_vert
266                lowwsubs_vert  = highwsubs_vert
267                low_td_lsa_lpt = high_td_lsa_lpt
268                low_td_lsa_q   = high_td_lsa_q
269                low_td_sub_lpt = high_td_sub_lpt
270                low_td_sub_q   = high_td_sub_q
271
272                ierrn = 0
273                READ ( finput, *, IOSTAT=ierrn ) highheight, highug_vert,      &
274                                                 highvg_vert, highwsubs_vert,  &
275                                                 high_td_lsa_lpt,              &
276                                                 high_td_lsa_q,                &
277                                                 high_td_sub_lpt, high_td_sub_q
278
279                IF ( ierrn /= 0 )  THEN
280                   WRITE( message_string, * ) 'zu(nzt+1) = ', zu(nzt+1), 'm ', &
281                        'is higher than the maximum height in LSF_DATA which ',&
282                        'is ', lowheight, 'm. Interpolation on PALM ',         &
283                        'grid is not possible.'
284                   CALL message( 'ls_forcing', 'PA0395', 1, 2, 0, 6, 0 )
285                ENDIF
286
287             ENDIF
288
289!
290!--          Interpolation of prescribed profiles in space
291             fac = (highheight-zu(k))/(highheight - lowheight)
292
293             ug_vert(k,nt)    = fac * lowug_vert                               &
294                                + ( 1.0_wp - fac ) * highug_vert
295             vg_vert(k,nt)    = fac * lowvg_vert                               &
296                                + ( 1.0_wp - fac ) * highvg_vert
297             wsubs_vert(k,nt) = fac * lowwsubs_vert                            &
298                                + ( 1.0_wp - fac ) * highwsubs_vert
299
300             td_lsa_lpt(k,nt) = fac * low_td_lsa_lpt                           &
301                                + ( 1.0_wp - fac ) * high_td_lsa_lpt
302             td_lsa_q(k,nt)   = fac * low_td_lsa_q                             &
303                                + ( 1.0_wp - fac ) * high_td_lsa_q
304             td_sub_lpt(k,nt) = fac * low_td_sub_lpt                           &
305                                + ( 1.0_wp - fac ) * high_td_sub_lpt
306             td_sub_q(k,nt)   = fac * low_td_sub_q                             &
307                                + ( 1.0_wp - fac ) * high_td_sub_q
308
309          ENDDO
310
311       ENDDO 
312
313!
314!--    Large scale vertical velocity has to be zero at the surface
315       wsubs_vert(nzb,:) = 0.0_wp
316 
317       IF ( time_vert(1) > end_time )  THEN
318          WRITE ( message_string, * ) 'Time dependent large scale profile ',   &
319                             'forcing from&LSF_DATA sets in after end of ' ,   &
320                             'simulation - lsf_vert is set to FALSE'
321          CALL message( 'ls_forcing', 'PA0373', 0, 0, 0, 6, 0 )
322          lsf_vert = .FALSE.
323       ENDIF
324
325       CLOSE( finput )
326
327
328    END SUBROUTINE init_ls_forcing 
329
330
331!------------------------------------------------------------------------------!
332! Description:
333! ------------
334!> @todo Missing subroutine description.
335!------------------------------------------------------------------------------!
336    SUBROUTINE ls_forcing_surf ( time )
337
338       USE arrays_3d,                                                          &
339           ONLY:  p_surf, pt_surf, q_surf, qsws, qsws_surf, shf, shf_surf,     &
340                  time_surf, time_vert, ug, ug_vert, vg, vg_vert
341
342       USE control_parameters,                                                 &
343           ONLY:  bc_q_b, ibc_pt_b, ibc_q_b, pt_surface, q_surface,            &
344                  surface_pressure
345
346       USE kinds
347
348       IMPLICIT NONE
349
350       INTEGER(iwp) ::  nt                     !<
351
352       REAL(wp)             :: fac            !<
353       REAL(wp), INTENT(in) :: time           !<
354
355!
356!--    Interpolation in time of LSF_DATA at the surface
357       nt = 1
358       DO WHILE ( time > time_surf(nt) )
359          nt = nt + 1
360       ENDDO
361       IF ( time /= time_surf(nt) )  THEN
362         nt = nt - 1
363       ENDIF
364
365       fac = ( time -time_surf(nt) ) / ( time_surf(nt+1) - time_surf(nt) )
366
367       IF ( ibc_pt_b == 0 )  THEN
368!
369!--       In case of Dirichlet boundary condition shf must not
370!--       be set - it is calculated via MOST in prandtl_fluxes
371          pt_surface = pt_surf(nt) + fac * ( pt_surf(nt+1) - pt_surf(nt) )
372
373       ELSEIF ( ibc_pt_b == 1 )  THEN
374!
375!--       In case of Neumann boundary condition pt_surface is needed for
376!--       calculation of reference density
377          shf        = shf_surf(nt) + fac * ( shf_surf(nt+1) - shf_surf(nt) )
378          pt_surface = pt_surf(nt) + fac * ( pt_surf(nt+1) - pt_surf(nt) )
379
380       ENDIF
381
382       IF ( ibc_q_b == 0 )  THEN
383!
384!--       In case of Dirichlet boundary condition qsws must not
385!--       be set - it is calculated via MOST in prandtl_fluxes
386          q_surface = q_surf(nt) + fac * ( q_surf(nt+1) - q_surf(nt) )
387
388       ELSEIF ( ibc_q_b == 1 )  THEN
389
390          qsws = qsws_surf(nt) + fac * ( qsws_surf(nt+1) - qsws_surf(nt) )
391
392       ENDIF
393
394       surface_pressure = p_surf(nt) + fac * ( p_surf(nt+1) - p_surf(nt) )
395
396    END SUBROUTINE ls_forcing_surf 
397
398
399!------------------------------------------------------------------------------!
400! Description:
401! ------------
402!> @todo Missing subroutine description.
403!------------------------------------------------------------------------------!
404    SUBROUTINE ls_forcing_vert ( time )
405
406       USE arrays_3d,                                                          &
407           ONLY:  time_vert, ug, ug_vert, vg, vg_vert, w_subs, wsubs_vert
408
409       USE control_parameters,                                                 &
410           ONLY:  large_scale_subsidence
411
412       USE kinds
413
414       IMPLICIT NONE
415
416       INTEGER(iwp) ::  nt                     !<
417
418       REAL(wp)             ::  fac           !<
419       REAL(wp), INTENT(in) ::  time          !<
420
421!
422!--    Interpolation in time of LSF_DATA for ug, vg and w_subs
423       nt = 1
424       DO WHILE ( time > time_vert(nt) )
425          nt = nt + 1
426       ENDDO
427       IF ( time /= time_vert(nt) )  THEN
428         nt = nt - 1
429       ENDIF
430
431       fac = ( time-time_vert(nt) ) / ( time_vert(nt+1)-time_vert(nt) )
432
433       ug     = ug_vert(:,nt) + fac * ( ug_vert(:,nt+1) - ug_vert(:,nt) )
434       vg     = vg_vert(:,nt) + fac * ( vg_vert(:,nt+1) - vg_vert(:,nt) )
435
436       IF ( large_scale_subsidence )  THEN
437          w_subs = wsubs_vert(:,nt)                                            &
438                   + fac * ( wsubs_vert(:,nt+1) - wsubs_vert(:,nt) )
439       ENDIF
440
441    END SUBROUTINE ls_forcing_vert
442
443
444!------------------------------------------------------------------------------!
445! Description:
446! ------------
447!> Call for all grid points
448!------------------------------------------------------------------------------!
449    SUBROUTINE ls_advec ( time, prog_var )
450
451       USE arrays_3d,                                                          &
452           ONLY:  td_lsa_lpt, td_lsa_q, td_sub_lpt, td_sub_q, tend, time_vert       
453       
454       USE control_parameters,                                                 &
455           ONLY:  large_scale_subsidence, use_subsidence_tendencies
456       
457       USE indices
458       
459       USE kinds
460
461       IMPLICIT NONE
462
463       CHARACTER (LEN=*) ::  prog_var   !<
464
465       REAL(wp), INTENT(in)  :: time    !<
466       REAL(wp) :: fac                  !< 
467
468       INTEGER(iwp) ::  i               !<
469       INTEGER(iwp) ::  j               !<
470       INTEGER(iwp) ::  k               !<
471       INTEGER(iwp) ::  nt               !<
472
473!
474!--    Interpolation in time of LSF_DATA
475       nt = 1
476       DO WHILE ( time > time_vert(nt) )
477          nt = nt + 1
478       ENDDO
479       IF ( time /= time_vert(nt) )  THEN
480         nt = nt - 1
481       ENDIF
482
483       fac = ( time-time_vert(nt) ) / ( time_vert(nt+1)-time_vert(nt) )
484
485!
486!--    Add horizontal large scale advection tendencies of pt and q
487       SELECT CASE ( prog_var )
488
489          CASE ( 'pt' )
490
491             DO  i = nxl, nxr
492                DO  j = nys, nyn
493                   DO  k = nzb_u_inner(j,i)+1, nzt
494                      tend(k,j,i) = tend(k,j,i) + td_lsa_lpt(k,nt) + fac *     &
495                                    ( td_lsa_lpt(k,nt+1) - td_lsa_lpt(k,nt) )
496                   ENDDO
497                ENDDO
498             ENDDO
499
500          CASE ( 'q' )
501
502             DO  i = nxl, nxr
503                DO  j = nys, nyn
504                   DO  k = nzb_u_inner(j,i)+1, nzt
505                      tend(k,j,i) = tend(k,j,i) + td_lsa_q(k,nt) + fac *       &
506                                    ( td_lsa_q(k,nt+1) - td_lsa_q(k,nt) )
507                   ENDDO
508                ENDDO
509             ENDDO
510
511       END SELECT
512
513!
514!--    Subsidence of pt and q with prescribed subsidence tendencies
515       IF ( large_scale_subsidence .AND. use_subsidence_tendencies )  THEN
516
517          SELECT CASE ( prog_var )
518
519             CASE ( 'pt' )
520
521                DO  i = nxl, nxr
522                   DO  j = nys, nyn
523                      DO  k = nzb_u_inner(j,i)+1, nzt
524                         tend(k,j,i) = tend(k,j,i) + td_sub_lpt(k,nt) + fac *  &
525                                       ( td_sub_lpt(k,nt+1) - td_sub_lpt(k,nt) )
526                      ENDDO
527                   ENDDO
528                ENDDO
529 
530             CASE ( 'q' )
531
532                DO  i = nxl, nxr
533                   DO  j = nys, nyn
534                      DO  k = nzb_u_inner(j,i)+1, nzt
535                         tend(k,j,i) = tend(k,j,i) + td_sub_q(k,nt) + fac *    &
536                                       ( td_sub_q(k,nt+1) - td_sub_q(k,nt) )
537                      ENDDO
538                   ENDDO
539                ENDDO
540
541          END SELECT
542
543       ENDIF
544
545    END SUBROUTINE ls_advec
546
547
548!------------------------------------------------------------------------------!
549! Description:
550! ------------
551!> Call for grid point i,j
552!------------------------------------------------------------------------------!
553    SUBROUTINE ls_advec_ij ( i, j, time, prog_var )
554
555       USE arrays_3d,                                                          &
556           ONLY:  td_lsa_lpt, td_lsa_q, td_sub_lpt, td_sub_q, tend, time_vert       
557       
558       USE control_parameters,                                                 &
559           ONLY:  large_scale_subsidence, use_subsidence_tendencies
560       
561       USE indices
562       
563       USE kinds
564
565       IMPLICIT NONE
566
567       CHARACTER (LEN=*) ::  prog_var   !<
568
569       REAL(wp), INTENT(in)  :: time    !<
570       REAL(wp) :: fac                  !<
571
572       INTEGER(iwp) ::  i               !<
573       INTEGER(iwp) ::  j               !<
574       INTEGER(iwp) ::  k               !<
575       INTEGER(iwp) ::  nt               !<
576
577!
578!--    Interpolation in time of LSF_DATA
579       nt = 1
580       DO WHILE ( time > time_vert(nt) )
581          nt = nt + 1
582       ENDDO
583       IF ( time /= time_vert(nt) )  THEN
584         nt = nt - 1
585       ENDIF
586
587       fac = ( time-time_vert(nt) ) / ( time_vert(nt+1)-time_vert(nt) )
588
589!
590!--    Add horizontal large scale advection tendencies of pt and q
591       SELECT CASE ( prog_var )
592
593          CASE ( 'pt' )
594
595             DO  k = nzb_u_inner(j,i)+1, nzt
596                tend(k,j,i) = tend(k,j,i) + td_lsa_lpt(k,nt)                   &
597                              + fac * ( td_lsa_lpt(k,nt+1) - td_lsa_lpt(k,nt) )
598             ENDDO
599
600          CASE ( 'q' )
601
602             DO  k = nzb_u_inner(j,i)+1, nzt
603                tend(k,j,i) = tend(k,j,i) + td_lsa_q(k,nt)                     &
604                              + fac * ( td_lsa_q(k,nt+1) - td_lsa_q(k,nt) )
605             ENDDO
606
607       END SELECT
608
609!
610!--    Subsidence of pt and q with prescribed profiles
611       IF ( large_scale_subsidence .AND. use_subsidence_tendencies )  THEN
612
613          SELECT CASE ( prog_var )
614
615             CASE ( 'pt' )
616
617                DO  k = nzb_u_inner(j,i)+1, nzt
618                   tend(k,j,i) = tend(k,j,i) + td_sub_lpt(k,nt) + fac *        &
619                                 ( td_sub_lpt(k,nt+1) - td_sub_lpt(k,nt) )
620                ENDDO
621 
622             CASE ( 'q' )
623
624                DO  k = nzb_u_inner(j,i)+1, nzt
625                   tend(k,j,i) = tend(k,j,i) + td_sub_q(k,nt) + fac *          &
626                                 ( td_sub_q(k,nt+1) - td_sub_q(k,nt) )
627                ENDDO
628
629          END SELECT
630
631       ENDIF
632
633    END SUBROUTINE ls_advec_ij
634
635
636 END MODULE ls_forcing_mod
Note: See TracBrowser for help on using the repository browser.