SUBROUTINE user_spectra( mode, m, pr ) !------------------------------------------------------------------------------! ! Actual revisions: ! ----------------- ! ! ! Former revisions: ! ----------------- ! $Id: user_spectra.f90 226 2009-02-02 07:39:34Z raasch $ ! ! 211 2008-11-11 04:46:24Z raasch ! Former file user_interface.f90 split into one file per subroutine ! ! Description: ! ------------ ! Calculation of user-defined spectra. ! See section 3.5.4 on how to define, calculate, and output user defined ! quantities. !------------------------------------------------------------------------------! USE arrays_3d USE indices USE spectrum USE statistics USE user IMPLICIT NONE CHARACTER (LEN=*) :: mode INTEGER :: i, j, k, m, pr ! !-- Sample on how to calculate spectra of user-defined quantities. !-- Each quantity is identified by the corresponding user profile index !-- "pr_palm+#" where "#" is an integer starting from 1. These !-- user-profile-numbers must also be assigned to the respective strings !-- given by data_output_pr_user in routine user_check_data_output_pr. IF ( mode == 'preprocess' ) THEN SELECT CASE ( TRIM( data_output_sp(m) ) ) CASE ( 'u', 'v', 'w', 'pt', 'q' ) !-- Not allowed here since these are the standard quantities used in !-- preprocess_spectra. ! CASE ( 'u*v*' ) ! pr = pr_palm+1 ! d(nzb+1:nzt,nys:nyn,nxl:nxr) = ustvst(nzb+1:nzt,nys:nyn,nxl:nxr) CASE DEFAULT PRINT*, '+++ user_spectra/preprocess: Spectra of ', & TRIM( data_output_sp(m) ), ' can not be calculated' END SELECT ELSEIF ( mode == 'data_output' ) THEN SELECT CASE ( TRIM( data_output_sp(m) ) ) CASE ( 'u', 'v', 'w', 'pt', 'q' ) !-- Not allowed here since these are the standard quantities used in !-- data_output_spectra. ! CASE ( 'u*v*' ) ! pr = 6 CASE DEFAULT PRINT*, '+++ user_spectra/data_output: Spectra of ', & TRIM( data_output_sp(m) ), ' are not defined' END SELECT ENDIF END SUBROUTINE user_spectra