Changeset 4507


Ignore:
Timestamp:
Apr 22, 2020 6:21:45 PM (5 years ago)
Author:
gronemeier
Message:

netcdf_data_input_mod:

  • bugfix: check terrain height for fill values directly after reading (PA0550)
  • changes:
    • remove check for negative zt (PA0551)
    • add reference height from input file to PALM reference height (origin_z)

init_grid:

  • update origin_z with shifting height of orography (oro_min)
  • remove message PA0505
Location:
palm/trunk/SOURCE
Files:
2 edited

Legend:

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

    r4457 r4507  
    2525! -----------------
    2626! $Id$
     27! update origin_z with shifting height of orography (oro_min)
     28!
     29! 4457 2020-03-11 14:20:43Z raasch
    2730! use statement for exchange horiz added,
    2831! bugfix for call of exchange horiz 2d
     
    936939
    937940    USE control_parameters,                                                    &
    938         ONLY:  bc_lr_cyc, bc_ns_cyc, message_string, ocean_mode
     941        ONLY:  bc_lr_cyc, bc_ns_cyc, ocean_mode
    939942
    940943    USE exchange_horiz_mod,                                                    &
     
    946949
    947950    USE netcdf_data_input_mod,                                                 &
    948         ONLY:  buildings_f, building_id_f, building_type_f, input_pids_static, &
     951        ONLY:  buildings_f, building_id_f, building_type_f,                    &
     952               init_model,                                                     &
     953               input_pids_static,                                              &
    949954               terrain_height_f
    950955
     
    983988
    984989!
    985 !-- Reference lowest terrain height to zero. In case the minimum terrain height
    986 !-- is non-zero, all grid points of the lower vertical grid levels might be
    987 !-- entirely below the surface, meaning a waste of computational resources.
    988 !-- In order to avoid this, remove the lowest terrain height. Please note,
    989 !-- in case of a nested run, the global minimum from all parent and childs
    990 !-- need to be remove to avoid steep edges at the child-domain boundaries.
     990!-- Reference lowest terrain height to zero. This ensures that first,
     991!-- non-required gird levels (those which lie entirely below the minimum
     992!-- orography) are avoided, and second, that also negative orography can be used
     993!-- within the input file.
     994!-- Please note, in case of a nested run, the global minimum from all parent and
     995!-- childs need to be remove to avoid steep edges at the child-domain boundaries.
    991996    IF ( input_pids_static )  THEN
    992997   
     
    9981003#endif
    9991004       terrain_height_f%var = terrain_height_f%var - oro_min
    1000 !                           
    1001 !--    Give an informative message that terrain height is referenced to zero   
    1002        IF ( oro_min > 0.0_wp )  THEN
    1003           WRITE( message_string, * ) 'Terrain height was internally shifted '//&
    1004                           'downwards by ', oro_min, 'meter(s) to save ' //     &
    1005                           'computational resources.'
    1006           CALL message( 'init_grid', 'PA0505', 0, 0, 0, 6, 0 )
    1007        ENDIF
     1005!
     1006!--    Update reference height used within output files
     1007       init_model%origin_z = init_model%origin_z + oro_min
     1008
    10081009    ENDIF   
    10091010   
     
    26042605
    26052606 END SUBROUTINE set_topo_flags
    2606 
    2607 
    2608 
    2609 
  • palm/trunk/SOURCE/netcdf_data_input_mod.f90

    r4457 r4507  
    2525! -----------------
    2626! $Id$
     27! - bugfix: check terrain height for fill values directly after reading
     28! - changes:
     29!   - remove check for negative zt
     30!   - add reference height from input file upon PALM reference height (origin_z)
     31!
     32! 4457 2020-03-11 14:20:43Z raasch
    2733! use statement for exchange horiz added,
    2834! bugfixes for calls of exchange horiz 2d
     
    988994!
    989995!--    Copy latitude, longitude, origin_z, rotation angle on init type
     996!--    NOTE: A shifting height might have already been saved to orgin_z in
     997!--    init_grid; therefore, do not override but add the reference height from
     998!--    the input file.
    990999       init_model%latitude        = input_file_atts%origin_lat
    9911000       init_model%longitude       = input_file_atts%origin_lon
     
    9931002       init_model%origin_x        = input_file_atts%origin_x
    9941003       init_model%origin_y        = input_file_atts%origin_y
    995        init_model%origin_z        = input_file_atts%origin_z 
     1004       init_model%origin_z        = init_model%origin_z + input_file_atts%origin_z
    9961005       init_model%rotation_angle  = input_file_atts%rotation_angle 
    9971006
     
    25532562          ENDIF
    25542563       ENDIF
    2555 !
    2556 !--    In case no terrain height is provided by static input file, allocate
    2557 !--    array nevertheless and set terrain height to 0, which simplifies
    2558 !--    topography initialization.
    2559        IF ( .NOT. terrain_height_f%from_file )  THEN
     2564
     2565       IF ( terrain_height_f%from_file )  THEN
     2566!
     2567!--       Check orography for fill-values.
     2568!--       For the moment, give an error message. More advanced methods, e.g. a
     2569!--       nearest neighbor algorithm as used in GIS systems might be implemented
     2570!--       later.
     2571!--       NOTE: This check must be placed here as terrain_height_f is altered
     2572!--       within init_grid which is called before netcdf_data_input_check_static
     2573          IF ( ANY( terrain_height_f%var == terrain_height_f%fill ) )  THEN
     2574             message_string = 'NetCDF variable zt is not ' //                  &
     2575                              'allowed to have missing data'
     2576             CALL message( 'netcdf_data_input_mod', 'PA0550', 2, 2, myid, 6, 0 )
     2577          ENDIF
     2578       ELSE
     2579!
     2580!--       In case no terrain height is provided by static input file, allocate
     2581!--       array nevertheless and set terrain height to 0, which simplifies
     2582!--       topography initialization.
    25602583          ALLOCATE ( terrain_height_f%var(nys:nyn,nxl:nxr) )
    25612584          terrain_height_f%var = 0.0_wp
     
    31613184             CALL message( 'netcdf_data_input_mod', 'PA0580', 1, 2, 0, 6, 0 )
    31623185          ENDIF
    3163        ENDIF
    3164 !
    3165 !--    Check orography for fill-values. For the moment, give an error message.
    3166 !--    More advanced methods, e.g. a nearest neighbor algorithm as used in GIS
    3167 !--    systems might be implemented later.
    3168 !--    Please note, if no terrain height is provided, it is set to 0.
    3169        IF ( ANY( terrain_height_f%var == terrain_height_f%fill ) )  THEN
    3170           message_string = 'NetCDF variable zt is not ' //                     &
    3171                            'allowed to have missing data'
    3172           CALL message( 'netcdf_data_input_mod', 'PA0550', 2, 2, myid, 6, 0 )
    3173        ENDIF
    3174 !
    3175 !--    Check for negative terrain heights
    3176        IF ( ANY( terrain_height_f%var < 0.0_wp ) )  THEN
    3177           message_string = 'NetCDF variable zt is not ' //                     &
    3178                            'allowed to have negative values'
    3179           CALL message( 'netcdf_data_input_mod', 'PA0551', 2, 2, myid, 6, 0 )
    31803186       ENDIF
    31813187!
Note: See TracChangeset for help on using the changeset viewer.