Ignore:
Timestamp:
Feb 16, 2019 3:15:23 PM (3 years ago)
Author:
gronemeier
Message:

bugfix: set user-defined statistic regions within new routine user_init_arrays and initialize rmask before this routine is called. This ensures that the correct number of grid points is calculated for each statistic region within init_3d_model.
(init_3d_model, module_interface, user_module)
bugfix: update former revisions section (modules, parin)

File:
1 edited

Legend:

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

    r3703 r3747  
    2525! -----------------
    2626! $Id$
     27! Add routine user_init_arrays
     28!
     29! 3703 2019-01-29 16:43:53Z knoop
    2730! An example for a user defined global variable has been added (Giersch)
    2831!
     
    120123       user_define_netcdf_grid, &
    121124       user_init, &
     125       user_init_arrays, &
    122126       user_header, &
    123127       user_actions, &
     
    160164       MODULE PROCEDURE user_define_netcdf_grid
    161165    END INTERFACE user_define_netcdf_grid
    162    
    163166
    164167    INTERFACE user_init
    165168       MODULE PROCEDURE user_init
    166169    END INTERFACE user_init
     170
     171    INTERFACE user_init_arrays
     172       MODULE PROCEDURE user_init_arrays
     173    END INTERFACE user_init_arrays
    167174
    168175    INTERFACE user_header
     
    433440! Description:
    434441! ------------
     442!> Initialize user-defined arrays
     443!------------------------------------------------------------------------------!
     444 SUBROUTINE user_init_arrays
     445
     446
     447    INTEGER(iwp) :: i       !< loop index
     448    INTEGER(iwp) :: j       !< loop index
     449    INTEGER(iwp) :: region  !< index for loop over statistic regions
     450
     451!
     452!-- Allocate user-defined arrays and set flags for statistic regions.
     453!-- Sample for user-defined output
     454!    ALLOCATE( u2(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
     455!    ALLOCATE( ustvst(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
     456
     457!
     458!-- Example for defining a statistic region:
     459!     IF ( statistic_regions >= 1 )  THEN
     460!        region = 1
     461!
     462!        rmask(:,:,region) = 0.0_wp
     463!        DO  i = nxl, nxr
     464!           IF ( i >= INT( 0.25 * nx ) .AND. i <= INT( 0.75 * nx ) )  THEN
     465!              DO  j = nys, nyn
     466!                 IF ( i >= INT( 0.25 * ny ) .AND. i <= INT( 0.75 * ny ) )  THEN
     467!                    rmask(j,i,region) = 1.0_wp
     468!                 ENDIF
     469!              ENDDO
     470!           ENDIF
     471!        ENDDO
     472!
     473!     ENDIF
     474
     475 END SUBROUTINE user_init_arrays
     476
     477
     478!------------------------------------------------------------------------------!
     479! Description:
     480! ------------
    435481!> Execution of user-defined initializing actions
    436482!------------------------------------------------------------------------------!
     
    442488!-- Here the user-defined initializing actions follow:
    443489!-- Sample for user-defined output
    444 !    ALLOCATE( u2(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
    445 !    ALLOCATE( ustvst(nzb:nzt+1,nysg:nyng,nxlg:nxrg) );  ustvst = 0.0_wp
     490!    ustvst = 0.0_wp
    446491
    447492
Note: See TracChangeset for help on using the changeset viewer.