Changeset 4449


Ignore:
Timestamp:
Mar 9, 2020 2:43:16 PM (4 years ago)
Author:
suehring
Message:

Bugfix in 1D model: Set intermediate_timestep_count back to zero after 1D-model integration. This is required e.g. for initial calls of calc_mean_profile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/model_1d_mod.f90

    r4360 r4449  
    2525! -----------------
    2626! $Id$
     27! Set intermediate_timestep_count back to zero after 1D-model integration.
     28! This is required e.g. for initial calls of calc_mean_profile.
     29!
     30! 4360 2020-01-07 11:25:50Z suehring
    2731! Corrected "Former revisions" section
    28 ! 
     32!
    2933! 3655 2019-01-07 16:51:22Z knoop
    3034! Modularization of all bulk cloud physics code components
     
    3741! ------------
    3842!> 1D-model to initialize the 3D-arrays.
    39 !> The temperature profile is set as steady and a corresponding steady solution 
     43!> The temperature profile is set as steady and a corresponding steady solution
    4044!> of the wind profile is being computed.
    4145!> All subroutines required can be found within this file.
     
    5559    USE basic_constants_and_equations_mod,                                     &
    5660        ONLY:  g, kappa, pi
    57    
     61
    5862    USE control_parameters,                                                    &
    5963        ONLY:  constant_diffusion, constant_flux_layer, dissipation_1d, f,     &
     
    6670    USE indices,                                                               &
    6771        ONLY:  nzb, nzb_diff, nzt
    68    
     72
    6973    USE kinds
    7074
    7175    USE pegrid,                                                                &
    7276        ONLY:  myid
    73        
     77
    7478
    7579    IMPLICIT NONE
     
    177181
    178182 SUBROUTINE init_1d_model
    179  
     183
    180184    USE grid_variables,                                                        &
    181185        ONLY:  dx, dy
     
    273277    vsws1d = 0.0_wp
    274278    z01d  = roughness_length
    275     z0h1d = z0h_factor * z01d 
     279    z0h1d = z0h_factor * z01d
    276280    IF ( humidity )  qs1d = 0.0_wp
    277281
     
    308312!> Runge-Kutta time differencing scheme for the 1D-model.
    309313!------------------------------------------------------------------------------!
    310  
     314
    311315 SUBROUTINE time_integration_1d
    312316
     
    350354
    351355!
    352 !--       Compute all tendency terms. If a constant-flux layer is simulated, 
     356!--       Compute all tendency terms. If a constant-flux layer is simulated,
    353357!--       k starts at nzb+2.
    354358          DO  k = nzb_diff, nzt
     
    438442!
    439443!--       Tendency terms at the top of the constant-flux layer.
    440 !--       Finite differences of the momentum fluxes are computed using half the 
    441 !--       normal grid length (2.0*ddzw(k)) for the sake of enhanced accuracy 
     444!--       Finite differences of the momentum fluxes are computed using half the
     445!--       normal grid length (2.0*ddzw(k)) for the sake of enhanced accuracy
    442446          IF ( constant_flux_layer )  THEN
    443447
     
    574578!
    575579!--       Boundary conditions for the prognostic variables.
    576 !--       At the top boundary (nzt+1) u, v, e, and diss keep their initial 
     580!--       At the top boundary (nzt+1) u, v, e, and diss keep their initial
    577581!--       values (ug(nzt+1), vg(nzt+1), 0, 0).
    578582!--       At the bottom boundary, Dirichlet condition is used for u and v (0)
     
    627631!
    628632!--          Compute the Richardson-flux numbers,
    629 !--          first at the top of the constant-flux layer using u* of the 
     633!--          first at the top of the constant-flux layer using u* of the
    630634!--          previous time step (+1E-30, if u* = 0), then in the remaining area.
    631635!--          There the rif-numbers of the previous time step are used.
     
    707711
    708712!
    709 !--             Boundary condition for the turbulent kinetic energy and 
     713!--             Boundary condition for the turbulent kinetic energy and
    710714!--             dissipation rate at the top of the constant-flux layer.
    711715!--             Additional Neumann condition de/dz = 0 at nzb is set to ensure
     
    723727                IF ( humidity ) THEN
    724728!
    725 !--                Compute q* 
     729!--                Compute q*
    726730                   IF ( rif1d(nzb+1) >= 0.0_wp )  THEN
    727731!
     
    857861
    858862    ENDDO   ! time loop
    859 
     863!
     864!-- Set intermediate_timestep_count back to zero. This is required e.g. for
     865!-- initial calls of calc_mean_profile.
     866    intermediate_timestep_count = 0
    860867
    861868 END SUBROUTINE time_integration_1d
     
    867874!> Compute and print out quantities for run control of the 1D model.
    868875!------------------------------------------------------------------------------!
    869  
     876
    870877 SUBROUTINE run_control_1d
    871878
     
    874881
    875882    INTEGER(iwp) ::  k     !< loop index
    876    
     883
    877884    REAL(wp) ::  alpha     !< angle of wind vector at top of constant-flux layer
    878885    REAL(wp) ::  energy    !< kinetic energy
     
    938945!> Compute the time step w.r.t. the diffusion criterion
    939946!------------------------------------------------------------------------------!
    940  
     947
    941948 SUBROUTINE timestep_1d
    942949
     
    978985                                  'dt_1d = ',dt_1d,' s   simulation stopped!'
    979986       CALL message( 'timestep_1d', 'PA0192', 1, 2, 0, 6, 0 )
    980        
     987
    981988    ENDIF
    982989
     
    990997!> List output of profiles from the 1D-model
    991998!------------------------------------------------------------------------------!
    992  
     999
    9931000 SUBROUTINE print_1d_model
    9941001
Note: See TracChangeset for help on using the changeset viewer.