Changeset 4877 for palm/trunk/SOURCE


Ignore:
Timestamp:
Feb 17, 2021 4:17:35 PM (3 years ago)
Author:
suehring
Message:

Bugfix in initialization of vertical surfaces with roughness and surface heat fluxes

Location:
palm/trunk/SOURCE
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/Makefile

    r4828 r4877  
    2525# -----------------
    2626# $Id$
     27# add dependency for init_3d_model
     28#
     29# 4828 2021-01-05 11:21:41Z Giersch
    2730# Add depedency for indoor model
    2831#
     
    720723        cpulog_mod.o \
    721724        disturb_heatflux.o \
     725        exchange_horiz_mod.o \
    722726        large_scale_forcing_nudging_mod.o \
    723727        model_1d_mod.o \
  • palm/trunk/SOURCE/init_3d_model.f90

    r4848 r4877  
    2424! -----------------
    2525! $Id$
     26! Bugfix in initialization of vertical surfaces with roughness and surface heat fluxes
     27!
     28! 4848 2021-01-21 15:51:51Z gronemeier
    2629! replaced use_syn_turb_gen by syn_turb_gen
    2730!
     
    166169
    167170    USE control_parameters
     171
     172    USE exchange_horiz_mod,                                                                        &
     173        ONLY:  exchange_horiz_2d
    168174
    169175    USE grid_variables,                                                                            &
     
    207213               pids_id,                                                                            &
    208214               real_2d,                                                                            &
     215               resize_array,                                                                       &
    209216               vars_pids
    210217
     
    15081515!--       Read variable
    15091516          CALL get_variable( pids_id, 'z0', tmp_2d%var, nxl, nxr, nys, nyn )
     1517          CALL resize_array( tmp_2d%var, nys, nyn, nxl, nxr )
     1518          CALL exchange_horiz_2d( tmp_2d%var )
    15101519!
    15111520!--       Initialize roughness length. Note, z0 will be only initialized at default-type surfaces.
     
    15341543!--       Read variable
    15351544          CALL get_variable( pids_id, 'shf', tmp_2d%var, nxl, nxr, nys, nyn )
     1545          CALL resize_array( tmp_2d%var, nys, nyn, nxl, nxr )
     1546          CALL exchange_horiz_2d( tmp_2d%var )
    15361547!
    15371548!--       Initialize heat flux. Note, shf will be only initialized at default-type surfaces. At
     
    15611572!--          Read variable
    15621573             CALL get_variable( pids_id, 'qsws', tmp_2d%var, nxl, nxr, nys, nyn )
     1574             CALL resize_array( tmp_2d%var, nys, nyn, nxl, nxr )
     1575             CALL exchange_horiz_2d( tmp_2d%var )
    15631576!
    15641577!--          Initialize latent heat flux. Note, qsws will be only initialized at default-type surfaces.
     
    15901603!--          Read variable
    15911604             CALL get_variable( pids_id, 'ssws', tmp_2d%var, nxl, nxr, nys, nyn )
     1605             CALL resize_array( tmp_2d%var, nys, nyn, nxl, nxr )
     1606             CALL exchange_horiz_2d( tmp_2d%var )
    15921607!
    15931608!--          Initialize passive scalar flux. Initialize horizontal surface elements.
  • palm/trunk/SOURCE/netcdf_data_input_mod.f90

    r4828 r4877  
    2424! -----------------
    2525! $Id$
     26! Add interface for resize_array and add subroutine to resize 2d-real arrays
     27!
     28! 4828 2021-01-05 11:21:41Z Giersch
    2629! Check if netCDF file actually exists before opening it for reading.
    2730!
     
    787790    END INTERFACE get_attribute
    788791
     792    INTERFACE resize_array
     793       MODULE PROCEDURE resize_array_2d_int8
     794       MODULE PROCEDURE resize_array_2d_int32
     795       MODULE PROCEDURE resize_array_2d_real
     796       MODULE PROCEDURE resize_array_3d_int8
     797       MODULE PROCEDURE resize_array_3d_real
     798       MODULE PROCEDURE resize_array_4d_real
     799    END INTERFACE resize_array
     800
    789801!
    790802!-- Public data structures
     
    867879           netcdf_data_input_surface_data,                                                         &
    868880           netcdf_data_input_topo,                                                                 &
    869            open_read_file
     881           open_read_file,                                                                         &
     882           resize_array
    870883
    871884
     
    34273440
    34283441 END SUBROUTINE resize_array_2d_int32
     3442
     3443!--------------------------------------------------------------------------------------------------!
     3444! Description:
     3445! ------------
     3446!> Resize 2D float array: (nys:nyn,nxl:nxr) -> (nysg:nyng,nxlg:nxrg)
     3447!--------------------------------------------------------------------------------------------------!
     3448 SUBROUTINE resize_array_2d_real( var, js, je, is, ie )
     3449
     3450    IMPLICIT NONE
     3451
     3452    INTEGER(iwp) ::  ie  !< upper index bound along x direction
     3453    INTEGER(iwp) ::  is  !< lower index bound along x direction
     3454    INTEGER(iwp) ::  je  !< upper index bound along y direction
     3455    INTEGER(iwp) ::  js  !< lower index bound along y direction
     3456
     3457    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  var     !< treated variable
     3458    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  var_tmp !< temporary copy
     3459!
     3460!-- Allocate temporary variable
     3461    ALLOCATE( var_tmp(js-nbgp:je+nbgp,is-nbgp:ie+nbgp) )
     3462!
     3463!-- Temporary copy of the variable
     3464    var_tmp(js:je,is:ie) = var(js:je,is:ie)
     3465!
     3466!-- Resize the array
     3467    DEALLOCATE( var )
     3468    ALLOCATE( var(js-nbgp:je+nbgp,is-nbgp:ie+nbgp) )
     3469!
     3470!-- Transfer temporary copy back to original array
     3471    var(js:je,is:ie) = var_tmp(js:je,is:ie)
     3472
     3473 END SUBROUTINE resize_array_2d_real
    34293474
    34303475
  • palm/trunk/SOURCE/surface_mod.f90

    r4850 r4877  
    2525! -----------------
    2626! $Id$
     27! bugfix in init_single_surface_properties for vertical surfaces
     28!
     29! 4850 2021-01-21 17:59:25Z suehring
    2730! +t_prev
    2831!
     
    31063109
    31073110    REAL(wp), DIMENSION(1:ns) ::  var_surf  !< 1D surface variable that should be initialized
    3108     REAL(wp), DIMENSION(nys:nyn,nxl:nxr) ::  var_2d  !< input variable
     3111    REAL(wp), DIMENSION(nysg:nyng,nxlg:nxrg) ::  var_2d  !< input variable
    31093112
    31103113    DO  m = 1, ns
Note: See TracChangeset for help on using the changeset viewer.