Changeset 3947 for palm


Ignore:
Timestamp:
May 3, 2019 7:56:44 AM (6 years ago)
Author:
hellstea
Message:

Child-domain size checks extended

File:
1 edited

Legend:

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

    r3946 r3947  
    2525! -----------------
    2626! $Id$
     27! The checks included in 3946 are extended for the z-direction and moved into its
     28! own subroutine called from pmci_define_index_mapping.
     29!
     30! 3946 2019-05-02 14:18:59Z hellstea
    2731! Check added for child domains too small in terms of number of parent-grid cells so
    2832! that anterpolation is not possible. Checks added for too wide anterpolation buffer
     
    17291733            iplg, iprg, jpsg, jpng
    17301734       FLUSH( 9 )
    1731 !       
    1732 !--    Check if the child domain is too small in terms of number of parent-grid cells
    1733 !--    covered so that anterpolation buffers fill the whole domain so that anterpolation
    1734 !--    not possible. Also, check that anterpolation_buffer_width is not too large to 
    1735 !--    prevent anterpolation.
    1736        IF ( nesting_mode == 'two-way')  THEN
    1737 !
    1738 !--       First x-direction
    1739           IF ( iplg + 3 + anterpolation_buffer_width > iprg - 3 - anterpolation_buffer_width )  THEN
    1740              IF ( iprg - iplg + 1 < 7 )  THEN
    1741 !
    1742 !--             Error
    1743                 WRITE( message_string, * ) 'child domain too narrow for anterpolation in x-direction'
    1744                 CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0652', 3, 2, 0, 6, 0 )
    1745              ELSE IF ( iprg - iplg + 1 < 11 )  THEN
    1746 !               
    1747 !--             Warning
    1748                 WRITE( message_string, * ) 'anterpolation_buffer_width value too high, reset to 0'
    1749                 CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0653', 0, 1, 0, 6, 0 )
    1750                 anterpolation_buffer_width = 0
    1751              ELSE
    1752 !               
    1753 !--             Informative message
    1754                 WRITE( message_string, * ) 'anterpolation_buffer_width value too high, reset to default value 2'
    1755                 CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0654', 0, 0, 0, 6, 0 )
    1756                 anterpolation_buffer_width = 2
    1757              ENDIF
    1758           ENDIF
    1759 !
    1760 !--       Then y-direction         
    1761           IF ( jpsg + 3 + anterpolation_buffer_width > jpng - 3 - anterpolation_buffer_width )  THEN
    1762              IF ( jpng - jpsg + 1 < 7 )  THEN
    1763 !
    1764 !--             Error
    1765                 WRITE( message_string, * ) 'child domain too narrow for anterpolation in y-direction'
    1766                 CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0652', 3, 2, 0, 6, 0 )
    1767              ELSE IF ( jpng - jpsg + 1 < 11 )  THEN
    1768 !               
    1769 !--             Warning
    1770                 WRITE( message_string, * ) 'anterpolation_buffer_width value too high, reset to 0'
    1771                 CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0653', 0, 1, 0, 6, 0 )
    1772                 anterpolation_buffer_width = 0
    1773              ELSE
    1774 !               
    1775 !--             Informative message
    1776                 WRITE( message_string, * ) 'anterpolation_buffer_width value too high, reset to default value 2'
    1777                 CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0654', 0, 0, 0, 6, 0 )
    1778                 anterpolation_buffer_width = 2
    1779              ENDIF
    1780           ENDIF
    1781 
    1782        ENDIF
    17831735       
    17841736    END SUBROUTINE pmci_map_fine_to_coarse_grid
     
    18391791       WRITE( 9, "('kcto, kctw = ', 2(i3,2x))" ) kcto, kctw
    18401792       FLUSH( 9 )
     1793!       
     1794!--    In case of two-way coupling, check that the child domain is sufficiently
     1795!--    large in terms of the number of parent-grid cells covered. Otherwise
     1796!--    anterpolation is not possible.
     1797       IF ( nesting_mode == 'two-way')  THEN
     1798          CALL pmci_check_child_domain_size
     1799       ENDIF
    18411800       
    18421801       ALLOCATE( iflu(ipla:ipra) )
     
    20892048
    20902049    END SUBROUTINE pmci_define_index_mapping
     2050
     2051
     2052
     2053    SUBROUTINE pmci_check_child_domain_size
     2054!       
     2055!--    Check if the child domain is too small in terms of number of parent-grid cells
     2056!--    covered so that anterpolation buffers fill the whole domain so that anterpolation
     2057!--    not possible. Also, check that anterpolation_buffer_width is not too large to 
     2058!--    prevent anterpolation.
     2059       IMPLICIT NONE
     2060     
     2061!
     2062!--    First x-direction
     2063       IF ( iplg + 3 + anterpolation_buffer_width > iprg - 3 - anterpolation_buffer_width )  THEN
     2064          IF ( iprg - iplg + 1 < 7 )  THEN
     2065!
     2066!--          Error
     2067             WRITE( message_string, * ) 'child domain too narrow for anterpolation in x-direction'
     2068             CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0652', 3, 2, 0, 6, 0 )
     2069          ELSE IF ( iprg - iplg + 1 < 11 )  THEN
     2070!               
     2071!--          Warning
     2072             WRITE( message_string, * ) 'anterpolation_buffer_width value too high, reset to 0'
     2073             CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0653', 0, 1, 0, 6, 0 )
     2074             anterpolation_buffer_width = 0
     2075          ELSE
     2076!               
     2077!--          Informative message
     2078             WRITE( message_string, * ) 'anterpolation_buffer_width value too high, reset to default value 2'
     2079             CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0654', 0, 0, 0, 6, 0 )
     2080             anterpolation_buffer_width = 2
     2081          ENDIF
     2082       ENDIF
     2083!
     2084!--    Then y-direction         
     2085       IF ( jpsg + 3 + anterpolation_buffer_width > jpng - 3 - anterpolation_buffer_width )  THEN
     2086          IF ( jpng - jpsg + 1 < 7 )  THEN
     2087!
     2088!--          Error
     2089             WRITE( message_string, * ) 'child domain too narrow for anterpolation in y-direction'
     2090             CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0652', 3, 2, 0, 6, 0 )
     2091          ELSE IF ( jpng - jpsg + 1 < 11 )  THEN
     2092!               
     2093!--          Warning
     2094             WRITE( message_string, * ) 'anterpolation_buffer_width value too high, reset to 0'
     2095             CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0653', 0, 1, 0, 6, 0 )
     2096             anterpolation_buffer_width = 0
     2097          ELSE
     2098!               
     2099!--          Informative message
     2100             WRITE( message_string, * ) 'anterpolation_buffer_width value too high, reset to default value 2'
     2101             CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0654', 0, 0, 0, 6, 0 )
     2102             anterpolation_buffer_width = 2
     2103          ENDIF
     2104       ENDIF
     2105!
     2106!--    Finally z-direction               
     2107       IF ( kctw - 1 - anterpolation_buffer_width < 1 )  THEN
     2108          IF ( kctw - 1 < 1 )  THEN
     2109!
     2110!--          Error
     2111             WRITE( message_string, * ) 'child domain too shallow for anterpolation in z-direction'
     2112             CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0652', 3, 2, 0, 6, 0 )
     2113          ELSE IF ( kctw - 3 < 1 )  THEN
     2114!               
     2115!--          Warning
     2116             WRITE( message_string, * ) 'anterpolation_buffer_width value too high, reset to 0'
     2117             CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0653', 0, 1, 0, 6, 0 )
     2118             anterpolation_buffer_width = 0
     2119          ELSE
     2120!               
     2121!--          Informative message
     2122             WRITE( message_string, * ) 'anterpolation_buffer_width value too high, reset to default value 2'
     2123             CALL message( 'pmci_map_fine_to_coarse_grid', 'PA0654', 0, 0, 0, 6, 0 )
     2124             anterpolation_buffer_width = 2 
     2125          ENDIF
     2126       ENDIF
     2127
     2128    END SUBROUTINE pmci_check_child_domain_size
     2129
     2130
    20912131   
    2092 
    2093 
    20942132    SUBROUTINE pmci_allocate_workarrays
    20952133!
Note: See TracChangeset for help on using the changeset viewer.