Definition of user-defined domains

By default, the values of the time series quantities and the horizontally averaged vertical profiles always refer to the total model domain. Independently, up to 9 time series or profiles for different user-defined domains can be computed and plotted additionally. Steering in principle is done via the initialization parameter statistic_regions.

The exact definition of these domains has to be made by the user within the user-defined routine user_init. The domains are defined with a mask array named rmask, which has to be given the value 1.0 for all horizontal grid points belonging to the user-defined domain and the value 0.0, where grid points do not belong to the user-defined domain. In the model rmask is declared as:

REAL :: rmask(nysg:nyng,nxlg:nxrg,0:9) .

The first two indices denote the array bounds (including the ghost points) in y and x-direction for each domain (see the corresponding description of Parallelization; don't confuse this with the user-defined domain!). The third index determines the user-defined domain, where 0 indicates the total model domain and 1 to 9 the user-defined domains.

The following example should illustrate this. Two domains are defined by the user. The first is determined by all grid points which lie within a circle whose center is equal to the (horizontal) center of the model domain and whose diameter is equal to half of the total horizontal domain size (square total domain assumed). The second domain should be defined by all points outside of this domain. This may be obtained by the following lines of code in user_init:

USE grid_variables
USE indices
USE statistics
   .
   .
   .
disc_center_x = dx * (nx + 1)/2
disc_center_y = dy * (ny + 1)/2
disc_radius = 0.5 * disc_center_x
DO  i = nxlg, nxrg
   x = i * dx
   DO  j = nysg, nyng
      y = j * dy
      radial_distance = SQRT( ( x - disc_center_x )**2 + &
           ( y - disc_center_y )**2 )
      IF ( radial_distance > disc_radius )  THEN
         rmask(j,i,1) = 0.0
         rmask(j,i,2) = 1.0
      ELSE
         rmask(j,i,1) = 1.0
         rmask(j,i,2) = 0.0
      ENDIF
   ENDDO
ENDDO

The module statistics must be used because it contains rmask. Likewise the modules grid_variables and indices are necessary in this example because grid spacing and indices are used. All array elements of rmask (rmask(:,:,:) are preset by the model with 1.0. In no case this assignment must be changed for the total domain (rmask(:,:,0))!

Computations and output for the user-defined domains only take place if the user sets statistic_regions1. Beyond that, names for the user-defined domains can be assigned via the initialization parameter region. Output of the names of the selected user-defined domains happens in the local files HEADER and RUN_CONTROL within the user-defined routine user_header.

Last modified 3 years ago Last modified on Mar 2, 2021 5:07:17 PM