Changeset 3717 for palm/trunk/SOURCE


Ignore:
Timestamp:
Feb 5, 2019 5:21:16 PM (5 years ago)
Author:
suehring
Message:

Bugfix, do not set boundary conditions for pt in neutral runs; enable checks + additional checks for virtual measurements

Location:
palm/trunk/SOURCE
Files:
3 edited

Legend:

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

    r3655 r3717  
    2525! -----------------
    2626! $Id$
     27! Bugfix, do not set boundary conditions for potential temperature in neutral
     28! runs.
     29!
     30! 3655 2019-01-07 16:51:22Z knoop
    2731! OpenACC port for SPEC
    2832!
     
    235239               humidity, ibc_pt_b, ibc_pt_t, ibc_q_b, ibc_q_t, ibc_s_b,        &
    236240               ibc_s_t, ibc_uv_b, ibc_uv_t, intermediate_timestep_count,       &
    237                nesting_offline, nudging, ocean_mode, passive_scalar, rans_mode,&
    238                rans_tke_e, tsc, salsa, use_cmax
     241               nesting_offline, neutral, nudging, ocean_mode, passive_scalar,  &
     242               rans_mode, rans_tke_e, tsc, salsa, use_cmax
    239243
    240244    USE grid_variables,                                                        &
     
    328332!-- the sea surface temperature of the coupled ocean model.
    329333!-- Dirichlet
    330     IF ( ibc_pt_b == 0 )  THEN
    331        DO  l = 0, 1
    332 !
    333 !--       Set kb, for upward-facing surfaces value at topography top (k-1) is set,
    334 !--       for downward-facing surfaces at topography bottom (k+1).
    335           kb = MERGE( -1, 1, l == 0 )
    336           !$OMP PARALLEL DO PRIVATE( i, j, k )
    337           DO  m = 1, bc_h(l)%ns
    338              i = bc_h(l)%i(m)           
    339              j = bc_h(l)%j(m)
    340              k = bc_h(l)%k(m)
    341              pt_p(k+kb,j,i) = pt(k+kb,j,i)
    342           ENDDO
    343        ENDDO
    344 !
    345 !-- Neumann, zero-gradient
    346     ELSEIF ( ibc_pt_b == 1 )  THEN
    347        DO  l = 0, 1
    348 !
    349 !--       Set kb, for upward-facing surfaces value at topography top (k-1) is set,
    350 !--       for downward-facing surfaces at topography bottom (k+1).
    351           kb = MERGE( -1, 1, l == 0 )
    352           !$OMP PARALLEL DO PRIVATE( i, j, k )
    353           !$ACC PARALLEL LOOP PRIVATE(i, j, k) &
    354           !$ACC PRESENT(bc_h, pt_p)
    355           DO  m = 1, bc_h(l)%ns
    356              i = bc_h(l)%i(m)           
    357              j = bc_h(l)%j(m)
    358              k = bc_h(l)%k(m)
    359              pt_p(k+kb,j,i) = pt_p(k,j,i)
    360           ENDDO
    361        ENDDO
    362     ENDIF
    363 
    364 !
    365 !-- Temperature at top boundary
    366     IF ( ibc_pt_t == 0 )  THEN
    367         pt_p(nzt+1,:,:) = pt(nzt+1,:,:)
    368 !
    369 !--     In case of nudging adjust top boundary to pt which is
    370 !--     read in from NUDGING-DATA
    371         IF ( nudging )  THEN
    372            pt_p(nzt+1,:,:) = pt_init(nzt+1)
    373         ENDIF
    374     ELSEIF ( ibc_pt_t == 1 )  THEN
    375         pt_p(nzt+1,:,:) = pt_p(nzt,:,:)
    376     ELSEIF ( ibc_pt_t == 2 )  THEN
    377         !$ACC KERNELS PRESENT(pt_p, dzu)
    378         pt_p(nzt+1,:,:) = pt_p(nzt,:,:) + bc_pt_t_val * dzu(nzt+1)
    379         !$ACC END KERNELS
     334    IF ( .NOT. neutral )  THEN
     335       IF ( ibc_pt_b == 0 )  THEN
     336          DO  l = 0, 1
     337!     
     338!--          Set kb, for upward-facing surfaces value at topography top (k-1)
     339!--          is set, for downward-facing surfaces at topography bottom (k+1).
     340             kb = MERGE( -1, 1, l == 0 )
     341             !$OMP PARALLEL DO PRIVATE( i, j, k )
     342             DO  m = 1, bc_h(l)%ns
     343                i = bc_h(l)%i(m)           
     344                j = bc_h(l)%j(m)
     345                k = bc_h(l)%k(m)
     346                pt_p(k+kb,j,i) = pt(k+kb,j,i)
     347             ENDDO
     348          ENDDO
     349!     
     350!--    Neumann, zero-gradient
     351       ELSEIF ( ibc_pt_b == 1 )  THEN
     352          DO  l = 0, 1
     353!     
     354!--          Set kb, for upward-facing surfaces value at topography top (k-1)
     355!--          is set, for downward-facing surfaces at topography bottom (k+1).
     356             kb = MERGE( -1, 1, l == 0 )
     357             !$OMP PARALLEL DO PRIVATE( i, j, k )
     358             !$ACC PARALLEL LOOP PRIVATE(i, j, k) &
     359             !$ACC PRESENT(bc_h, pt_p)
     360             DO  m = 1, bc_h(l)%ns
     361                i = bc_h(l)%i(m)           
     362                j = bc_h(l)%j(m)
     363                k = bc_h(l)%k(m)
     364                pt_p(k+kb,j,i) = pt_p(k,j,i)
     365             ENDDO
     366          ENDDO
     367       ENDIF
     368       
     369!     
     370!--    Temperature at top boundary
     371       IF ( ibc_pt_t == 0 )  THEN
     372           pt_p(nzt+1,:,:) = pt(nzt+1,:,:)
     373!     
     374!--        In case of nudging adjust top boundary to pt which is
     375!--        read in from NUDGING-DATA
     376           IF ( nudging )  THEN
     377              pt_p(nzt+1,:,:) = pt_init(nzt+1)
     378           ENDIF
     379       ELSEIF ( ibc_pt_t == 1 )  THEN
     380           pt_p(nzt+1,:,:) = pt_p(nzt,:,:)
     381       ELSEIF ( ibc_pt_t == 2 )  THEN
     382           !$ACC KERNELS PRESENT(pt_p, dzu)
     383           pt_p(nzt+1,:,:) = pt_p(nzt,:,:) + bc_pt_t_val * dzu(nzt+1)
     384           !$ACC END KERNELS
     385       ENDIF
    380386    ENDIF
    381387
  • palm/trunk/SOURCE/module_interface.f90

    r3711 r3717  
    2525! -----------------
    2626! $Id$
     27! Add check_parameters routine for virtual measurements
     28!
     29! 3711 2019-01-31 13:44:26Z knoop
    2730! Introduced module_interface_init_checks for post-init checks
    2831!
     
    297300
    298301   USE virtual_measurement_mod,                                                &
    299        ONLY:  vm_init,                                                         &
     302       ONLY:  vm_check_parameters,                                             &
     303              vm_init,                                                         &
    300304              vm_last_actions,                                                 &
    301305              vm_parin
     
    492496   IF ( syn_turb_gen )         CALL stg_check_parameters
    493497   IF ( urban_surface )        CALL usm_check_parameters
     498   IF ( virtual_measurement )  CALL vm_check_parameters
    494499   IF ( wind_turbine )         CALL wtm_check_parameters
    495500   IF ( user_module_enabled )  CALL user_check_parameters
  • palm/trunk/SOURCE/virtual_measurement_mod.f90

    r3706 r3717  
    2525! -----------------
    2626! $Id$
     27! Additional check + error numbers adjusted
     28!
     29! 3706 2019-01-29 20:02:26Z suehring
    2730! unused variables removed
    2831!
     
    313316 
    314317    USE netcdf_data_input_mod,                                                 &
    315         ONLY:  input_pids_static
     318        ONLY:  input_pids_static, input_pids_vm
    316319       
    317320    IMPLICIT NONE
    318    
     321
     322!
     323!-- Virtual measurements require a setup file.
     324    IF ( virtual_measurement  .AND.  .NOT. input_pids_vm )  THEN
     325       message_string = 'If virtual measurements are taken, a setup input ' // &
     326                        'file for the site locations is mandatory.'
     327       CALL message( 'vm_check_parameters', 'PA0533', 1, 2, 0, 6, 0 )
     328    ENDIF   
    319329!
    320330!-- In case virtual measurements are taken, a static input file is required.
     
    325335       message_string = 'If virtual measurements are taken, a static input ' //&
    326336                        'file is mandatory.'
    327        CALL message( 'vm_check_parameters', 'PA0000', 1, 2, 0, 6, 0 )
     337       CALL message( 'vm_check_parameters', 'PA0534', 1, 2, 0, 6, 0 )
    328338    ENDIF
    329339 
     
    522532                           TRIM( vmea(l)%feature_type ) //                     &
    523533                           ' is not allowed.'
    524           CALL message( 'vm_init', 'PA0000', 1, 2, 0, 6, 0 )
     534          CALL message( 'vm_init', 'PA0535', 1, 2, 0, 6, 0 )
    525535       ENDIF
    526536!
Note: See TracChangeset for help on using the changeset viewer.