Changeset 4272 for palm/trunk


Ignore:
Timestamp:
Oct 23, 2019 3:18:57 PM (4 years ago)
Author:
schwenkel
Message:

further modularization of boundary conditions: moving boundary conditions to their modules

Location:
palm/trunk/SOURCE
Files:
5 edited

Legend:

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

    r4268 r4272  
    2525! -----------------
    2626! $Id$
     27! Further modularization of boundary conditions: moved boundary conditions to
     28! respective modules
     29!
     30! 4268 2019-10-17 11:29:38Z schwenkel
    2731! Removing bulk cloud variables to respective module
    2832!
     
    6872        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,  &
    6973               dzu, pt, pt_init, pt_p, q,                                      &
    70                q_p, s, s_p, sa, sa_p, u, u_init, u_m_l, u_m_n,                 &
     74               q_p, s, s_p, u, u_init, u_m_l, u_m_n,                 &
    7175               u_m_r, u_m_s, u_p, v, v_init, v_m_l, v_m_n, v_m_r, v_m_s, v_p,  &
    7276               w, w_p, w_m_l, w_m_n, w_m_r, w_m_s
    7377
    74     USE chemistry_model_mod,                                                   &
    75         ONLY:  chem_boundary_conds
    76 
    7778    USE control_parameters,                                                    &
    78         ONLY:  air_chemistry, bc_dirichlet_l,                                  &
     79        ONLY:  bc_dirichlet_l,                                  &
    7980               bc_dirichlet_s, bc_radiation_l, bc_radiation_n, bc_radiation_r, &
    8081               bc_radiation_s, bc_pt_t_val, bc_q_t_val, bc_s_t_val,            &
     
    8283               humidity, ibc_pt_b, ibc_pt_t, ibc_q_b, ibc_q_t, ibc_s_b,        &
    8384               ibc_s_t, ibc_uv_b, ibc_uv_t, intermediate_timestep_count,       &
    84                nesting_offline, neutral, nudging, ocean_mode, passive_scalar,  &
    85                tsc, salsa, use_cmax
     85               nesting_offline, neutral, nudging, passive_scalar,  &
     86               tsc, use_cmax
    8687
    8788    USE grid_variables,                                                        &
     
    9293
    9394    USE kinds
    94 
    95     USE ocean_mod,                                                             &
    96         ONLY:  ibc_sa_t
    9795
    9896    USE pegrid
     
    10199        ONLY : nesting_mode
    102100 
    103     USE salsa_mod,                                                             &
    104         ONLY:  salsa_boundary_conds
    105 
    106101    USE surface_mod,                                                           &
    107102        ONLY :  bc_h
     
    188183             !$ACC PRESENT(bc_h, pt_p)
    189184             DO  m = 1, bc_h(l)%ns
    190                 i = bc_h(l)%i(m)           
     185                i = bc_h(l)%i(m)
    191186                j = bc_h(l)%j(m)
    192187                k = bc_h(l)%k(m)
     
    215210    ENDIF
    216211!
    217 !-- Boundary conditions for salinity
    218     IF ( ocean_mode )  THEN
    219 !
    220 !--    Bottom boundary: Neumann condition because salinity flux is always
    221 !--    given.
    222        DO  l = 0, 1
    223           !$OMP PARALLEL DO PRIVATE( i, j, k )
    224           DO  m = 1, bc_h(l)%ns
    225              i = bc_h(l)%i(m)
    226              j = bc_h(l)%j(m)
    227              k = bc_h(l)%k(m)
    228              sa_p(k+bc_h(l)%koff,j,i) = sa_p(k,j,i)
    229           ENDDO
    230        ENDDO
    231 !
    232 !--    Top boundary: Dirichlet or Neumann
    233        IF ( ibc_sa_t == 0 )  THEN
    234            sa_p(nzt+1,:,:) = sa(nzt+1,:,:)
    235        ELSEIF ( ibc_sa_t == 1 )  THEN
    236            sa_p(nzt+1,:,:) = sa_p(nzt,:,:)
    237        ENDIF
    238 
    239     ENDIF
    240 
    241 !
    242212!-- Boundary conditions for total water content,
    243213!-- bottom and top boundary (see also temperature)
     
    327297!-- Set boundary conditions for subgrid TKE and dissipation (RANS mode)
    328298    CALL tcm_boundary_conds
    329 !
    330 !-- Top/bottom boundary conditions for chemical species
    331     IF ( air_chemistry )  CALL chem_boundary_conds( 'set_bc_bottomtop' )
    332299!
    333300!-- In case of inflow or nest boundary at the south boundary the boundary for v
     
    386353       IF ( passive_scalar )  s_p(:,:,nxr+1) = s_p(:,:,nxr)
    387354    ENDIF
    388 
    389 !
    390 !-- Lateral boundary conditions for chemical species
    391     IF ( air_chemistry )  CALL chem_boundary_conds( 'set_bc_lateral' )   
    392355
    393356!
     
    883846          ENDDO
    884847
    885 #if defined( __parallel )   
     848#if defined( __parallel )
    886849          IF ( collective_wait )  CALL MPI_BARRIER( comm1dy, ierr )
    887850          CALL MPI_ALLREDUCE( c_u_m_l(nzb+1), c_u_m(nzb+1), nzt-nzb, MPI_REAL, &
    888                               MPI_SUM, comm1dy, ierr )   
     851                              MPI_SUM, comm1dy, ierr )
    889852          IF ( collective_wait )  CALL MPI_BARRIER( comm1dy, ierr )
    890853          CALL MPI_ALLREDUCE( c_v_m_l(nzb+1), c_v_m(nzb+1), nzt-nzb, MPI_REAL, &
    891                               MPI_SUM, comm1dy, ierr ) 
     854                              MPI_SUM, comm1dy, ierr )
    892855          IF ( collective_wait )  CALL MPI_BARRIER( comm1dy, ierr )
    893856          CALL MPI_ALLREDUCE( c_w_m_l(nzb+1), c_w_m(nzb+1), nzt-nzb, MPI_REAL, &
    894                               MPI_SUM, comm1dy, ierr ) 
     857                              MPI_SUM, comm1dy, ierr )
    895858#else
    896859          c_u_m = c_u_m_l
     
    952915    ENDIF
    953916
    954     IF ( salsa )  THEN
    955        CALL salsa_boundary_conds
    956     ENDIF
    957 
    958917 END SUBROUTINE boundary_conds
  • palm/trunk/SOURCE/chemistry_model_mod.f90

    r4268 r4272  
    2727! -----------------
    2828! $Id$
     29! Further modularization of boundary conditions: moved boundary conditions to
     30! respective modules
     31!
     32! 4268 2019-10-17 11:29:38Z schwenkel
    2933! Moving module specific boundary conditions from time_integration to module
    3034!
     
    819823
    820824!
    821 !--       Boundary conditions for prognostic quantitites of other modules:
    822 !--       Here, only decycling is carried out
    823 
    824           DO  lsp = 1, nvar
    825              lsp_usr = 1
    826              DO WHILE ( TRIM( cs_name( lsp_usr ) ) /= 'novalue' )
    827                 IF ( TRIM( chem_species(lsp)%name ) == TRIM( cs_name(lsp_usr) ) )  THEN
    828                    CALL chem_boundary_conds( chem_species(lsp)%conc_p,                          &
    829                                              chem_species(lsp)%conc_pr_init )
    830                 ENDIF
    831                 lsp_usr = lsp_usr + 1
    832              ENDDO
    833           ENDDO
     825!-- Top/bottom boundary conditions for chemical species
     826    CALL chem_boundary_conds( 'set_bc_bottomtop' )
     827!
     828!-- Lateral boundary conditions for chemical species
     829    CALL chem_boundary_conds( 'set_bc_lateral' )
     830
     831!
     832!--  Boundary conditions for prognostic quantitites of other modules:
     833!--  Here, only decycling is carried out
     834     DO  lsp = 1, nvar
     835        lsp_usr = 1
     836        DO WHILE ( TRIM( cs_name( lsp_usr ) ) /= 'novalue' )
     837           IF ( TRIM( chem_species(lsp)%name ) == TRIM( cs_name(lsp_usr) ) )  THEN
     838              CALL chem_boundary_conds( chem_species(lsp)%conc_p,                          &
     839                                        chem_species(lsp)%conc_pr_init )
     840           ENDIF
     841           lsp_usr = lsp_usr + 1
     842        ENDDO
     843     ENDDO
    834844
    835845
  • palm/trunk/SOURCE/module_interface.f90

    r4268 r4272  
    2525! -----------------
    2626! $Id$
     27! Further modularization of boundary conditions: moved boundary conditions to
     28! respective modules
     29!
     30! 4268 2019-10-17 11:29:38Z schwenkel
    2731! Introduction of module_interface_boundary_conditions
    2832!
     
    375379               ocean_actions,                                                  &
    376380               ocean_prognostic_equations,                                     &
     381               ocean_boundary_conditions,                                      &
    377382               ocean_swap_timelevel,                                           &
    378383               ocean_3d_data_averaging,                                        &
     
    12961301    IF ( bulk_cloud_model    )  CALL bcm_boundary_conditions
    12971302    IF ( air_chemistry       )  CALL chem_boundary_conditions
     1303    IF ( ocean_mode          )  CALL ocean_boundary_conditions
    12981304    IF ( salsa               )  CALL salsa_boundary_conditions
    12991305
  • palm/trunk/SOURCE/ocean_mod.f90

    r4196 r4272  
    2525! -----------------
    2626! $Id$
     27! Further modularization of boundary conditions: moved boundary conditions to
     28! respective modules
     29!
     30! 4196 2019-08-29 11:02:06Z gronemeier
    2731! Consider rotation of model domain for calculating the Stokes drift
    2832!
     
    8185        ONLY:  sums_wssas_ws_l
    8286
     87    USE indices,                                                               &
     88        ONLY:  advc_flags_s, nxl, nxr, nyn, nys, nzb, nzt, wall_flags_0
     89
     90    USE surface_mod,                                                           &
     91        ONLY:  bc_h, surf_def_v, surf_def_h, surf_lsm_h, surf_lsm_v,           &
     92               surf_usm_h, surf_usm_v
    8393
    8494    IMPLICIT NONE
     
    192202    END INTERFACE ocean_prognostic_equations
    193203
     204    INTERFACE ocean_boundary_conditions
     205       MODULE PROCEDURE ocean_boundary_conditions
     206    END INTERFACE ocean_boundary_conditions
     207
    194208    INTERFACE ocean_swap_timelevel
    195209       MODULE PROCEDURE ocean_swap_timelevel
     
    236250           ocean_swap_timelevel, ocean_rrd_global, ocean_rrd_local,            &
    237251           ocean_wrd_global, ocean_wrd_local, ocean_3d_data_averaging,         &
    238            stokes_drift_terms, wave_breaking_term
     252           ocean_boundary_conditions, stokes_drift_terms, wave_breaking_term
    239253
    240254
     
    257271    USE indices,                                                               &
    258272        ONLY:  nxl, nxr, nyn, nys, nzb, nzt
    259 
    260     USE surface_mod,                                                           &
    261         ONLY :  bc_h
    262273
    263274    IMPLICIT NONE
     
    370381    USE indices,                                                               &
    371382        ONLY:  nzb, nzt
    372 
    373     USE surface_mod,                                                           &
    374        ONLY :  bc_h
    375383
    376384    IMPLICIT NONE
     
    15851593    USE diffusion_s_mod,                                                       &
    15861594        ONLY:  diffusion_s
    1587 
    1588     USE indices,                                                               &
    1589         ONLY:  advc_flags_s, nxl, nxr, nyn, nys, nzb, nzt, wall_flags_0
    1590 
    1591     USE surface_mod,                                                           &
    1592         ONLY:  surf_def_v, surf_def_h, surf_lsm_h, surf_lsm_v, surf_usm_h,     &
    1593                surf_usm_v
    15941595
    15951596    IMPLICIT NONE
     
    17571758    USE diffusion_s_mod,                                                       &
    17581759        ONLY:  diffusion_s
    1759 
    1760     USE indices,                                                               &
    1761         ONLY:  advc_flags_s, nzb, nzt, wall_flags_0
    1762 
    1763     USE surface_mod,                                                           &
    1764         ONLY:  surf_def_v, surf_def_h, surf_lsm_h, surf_lsm_v, surf_usm_h,     &
    1765                surf_usm_v
    17661760
    17671761    IMPLICIT NONE
     
    18621856 END SUBROUTINE ocean_prognostic_equations_ij
    18631857
     1858!------------------------------------------------------------------------------!
     1859! Description:
     1860! ------------
     1861!> Boundary conditions for ocean model
     1862!------------------------------------------------------------------------------!
     1863 SUBROUTINE ocean_boundary_conditions
     1864
     1865    IMPLICIT NONE
     1866
     1867    INTEGER(iwp) ::  i                            !< grid index x direction.
     1868    INTEGER(iwp) ::  j                            !< grid index y direction.
     1869    INTEGER(iwp) ::  k                            !< grid index z direction.
     1870    INTEGER(iwp) ::  l                            !< running index boundary type, for up- and downward-facing walls.
     1871    INTEGER(iwp) ::  m                            !< running index surface elements.
     1872
     1873!
     1874!--    Boundary conditions for salinity
     1875!--    Bottom boundary: Neumann condition because salinity flux is always
     1876!--    given.
     1877       DO  l = 0, 1
     1878          !$OMP PARALLEL DO PRIVATE( i, j, k )
     1879          DO  m = 1, bc_h(l)%ns
     1880             i = bc_h(l)%i(m)
     1881             j = bc_h(l)%j(m)
     1882             k = bc_h(l)%k(m)
     1883             sa_p(k+bc_h(l)%koff,j,i) = sa_p(k,j,i)
     1884          ENDDO
     1885       ENDDO
     1886!
     1887!--    Top boundary: Dirichlet or Neumann
     1888       IF ( ibc_sa_t == 0 )  THEN
     1889           sa_p(nzt+1,:,:) = sa(nzt+1,:,:)
     1890       ELSEIF ( ibc_sa_t == 1 )  THEN
     1891           sa_p(nzt+1,:,:) = sa_p(nzt,:,:)
     1892       ENDIF
     1893
     1894 END SUBROUTINE ocean_boundary_conditions
    18641895
    18651896!------------------------------------------------------------------------------!
  • palm/trunk/SOURCE/salsa_mod.f90

    r4270 r4272  
    2626! -----------------
    2727! $Id$
     28! Further modularization of boundary conditions: moved boundary conditions to
     29! respective modules
     30!
     31! 4270 2019-10-23 10:46:20Z monakurppa
    2832! - Implement offline nesting for salsa
    2933! - Alphabetic ordering for module interfaces
     
    80908094    INTEGER(iwp) ::  ig              !< index for salsa gases
    80918095
     8096
     8097!
     8098!-- moved from boundary_conds
     8099    CALL salsa_boundary_conds
    80928100!
    80938101!-- Boundary conditions for prognostic quantitites of other modules:
Note: See TracChangeset for help on using the changeset viewer.