Changeset 4347 for palm/trunk/SOURCE


Ignore:
Timestamp:
Dec 18, 2019 1:18:33 PM (4 years ago)
Author:
suehring
Message:

Check for realistically initial values of mixing ratio implemented. Mixing ratio must not exceed its saturation value, else surface fluxes in the land-surface scheme may become unrealistic. Test cases updated

Location:
palm/trunk/SOURCE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/Makefile

    r4331 r4347  
    2525# -----------------
    2626# $Id$
     27# add dependency to basic_constants_and_equations_mod for dynamics_mod
     28#
     29# 4331 2019-12-10 18:25:02Z suehring
    2730# Move diagnostic surface output to diagnostic_output_quantities
    2831#
     
    553556        surface_mod.o
    554557dynamics_mod.o: \
     558        basic_constants_and_equations_mod.o \
    555559        mod_kinds.o \
    556560        surface_mod.o \
  • palm/trunk/SOURCE/dynamics_mod.f90

    r4281 r4347  
    2525! -----------------
    2626! $Id$
     27! Implement post-initialization check for realistically inital values of mixing ratio
     28!
     29! 4281 2019-10-29 15:15:39Z schwenkel
    2730! Moved boundary conditions in dynamics module
    2831!
     
    4447        ONLY:  c_u, c_u_m, c_u_m_l, c_v, c_v_m, c_v_m_l, c_w, c_w_m, c_w_m_l,  &
    4548               dzu, &
     49               exner, &
     50               hyp, &
    4651               pt, pt_1, pt_2, pt_init, pt_p, &
    4752               q, q_1, q_2, q_p, &
     
    5055               v, v_1, v_2, v_p, v_init, v_m_l, v_m_n, v_m_r, v_m_s, &
    5156               w, w_1, w_2, w_p, w_m_l, w_m_n, w_m_r, w_m_s
     57
     58    USE basic_constants_and_equations_mod,                                                         &
     59        ONLY:  magnus,                                                                             &
     60               rd_d_rv
    5261
    5362    USE control_parameters, &
     
    7483               intermediate_timestep_count, &
    7584               length, &
     85               message_string, &
    7686               nesting_offline, &
    7787               nudging, &
     
    455465 SUBROUTINE dynamics_init_checks
    456466
     467    INTEGER(iwp) ::  i !< loop index in x-direction
     468    INTEGER(iwp) ::  j !< loop index in y-direction
     469    INTEGER(iwp) ::  k !< loop index in z-direction
     470
     471    LOGICAL      ::  realistic_q = .TRUE. !< flag indicating realistic mixing ratios
     472
     473    REAL(wp)     ::  e_s !< saturation water vapor pressure
     474    REAL(wp)     ::  q_s !< saturation mixing ratio
     475    REAL(wp)     ::  t_l !< actual temperature
     476
     477!
     478!-- Check for realistic initial mixing ratio. This must be in a realistic phyiscial range and must
     479!-- not exceed the saturation mixing ratio by more than 2 percent. Please note, the check is
     480!-- performed for each grid point (not just for a vertical profile), in order to cover also
     481!-- three-dimensional initialization.
     482    IF ( humidity  .AND.  .NOT. neutral )  THEN
     483       DO  i = nxl, nxr
     484          DO  j = nys, nyn
     485             DO  k = nzb+1, nzt
     486!
     487!--             Calculate actual temperature, water vapor saturation pressure, and based on this
     488!--             the saturation mixing ratio.
     489                t_l = exner(k) * pt(k,j,i)
     490                e_s = magnus( t_l )
     491                q_s = rd_d_rv * e_s / ( hyp(k) - e_s )
     492
     493                IF ( q(k,j,i) > 1.02_wp * q_s )  realistic_q = .FALSE.
     494             ENDDO
     495          ENDDO
     496       ENDDO
     497!
     498!--    Since the check is performed locally, merge the logical flag from all mpi ranks,
     499!--    in order to do not print the error message multiple times.
     500#if defined( __parallel )
     501       CALL MPI_ALLREDUCE( MPI_IN_PLACE, realistic_q, 1, MPI_LOGICAL, MPI_LAND, comm2d, ierr)
     502#endif
     503
     504       IF ( .NOT. realistic_q )  THEN
     505          message_string = 'The initial mixing ratio exceeds the saturation mixing ratio.'
     506          CALL message( 'dynamic_init_checks', 'PA0697', 2, 2, 0, 6, 0 )
     507       ENDIF
     508    ENDIF
    457509
    458510 END SUBROUTINE dynamics_init_checks
Note: See TracChangeset for help on using the changeset viewer.