psmile_get_true_mask_entries.F90

Go to the documentation of this file.
00001 !-----------------------------------------------------------------------
00002 ! Copyright 2006-2010, NEC Europe Ltd., London, UK.
00003 ! All rights reserved. Use is subject to OASIS4 license terms.
00004 !-----------------------------------------------------------------------
00005 !BOP
00006 !
00007 ! !ROUTINE: PSMILe_get_true_mask_entries
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_get_true_mask_entries (mask_array, mask_shape, &
00012                                                inter, n_true, ierror)
00013 !
00014 ! !USES:
00015 !
00016       use PRISM_constants
00017 !
00018       use PSMILe, dummy_interface => PSMILe_get_true_mask_entries
00019 
00020       implicit none
00021 !
00022 ! !INPUT PARAMETERS:
00023 !
00024       Integer, Intent (In)               :: mask_shape (2, ndim_3d)
00025 !
00026 !     Dimensions of mask array "mask_array"
00027 !
00028       Logical, Intent (In)               :: mask_array (                     
00029                                             mask_shape(1,1):mask_shape(2,1), 
00030                                             mask_shape(1,2):mask_shape(2,2), 
00031                                             mask_shape(1,3):mask_shape(2,3))
00032 !
00033 !     Mask array to be controlled
00034 !
00035       Integer, Intent (In)               :: inter (2, ndim_3d)
00036 
00037 !     Sub-region to be controlled
00038 !
00039 ! !OUTPUT PARAMETERS:
00040 !
00041       Integer, Intent (Out)             :: n_true
00042 
00043 !     Returns the number of mask entries which are true
00044 !
00045       Integer, Intent (Out)             :: ierror
00046 
00047 !     Returns the error code of PSMILe_get_true_mask_entries;
00048 !             ierror = 0 : No error
00049 !             ierror > 0 : Severe error
00050 !
00051 ! !LOCAL VARIABLES
00052 !
00053 ! !DESCRIPTION:
00054 !
00055 ! Subroutine "PSMILe_get_true_mask_entries" returns the number of
00056 ! mask entries in "mask_array (inter (1,*):inter(2,*))" which have the
00057 ! logical value "true".
00058 !
00059 ! !REVISION HISTORY:
00060 !
00061 !   Date      Programmer   Description
00062 ! ----------  ----------   -----------
00063 ! 08.02.05    H. Ritzdorf  created
00064 !
00065 !EOP
00066 !----------------------------------------------------------------------
00067 !
00068 ! $Id: psmile_get_true_mask_entries.F90 2325 2010-04-21 15:00:07Z valcke $
00069 ! $Author: valcke $
00070 !
00071    Character(len=len_cvs_string), save :: mycvs = 
00072        '$Id: psmile_get_true_mask_entries.F90 2325 2010-04-21 15:00:07Z valcke $'
00073 !
00074 !----------------------------------------------------------------------
00075 !
00076 #ifdef VERBOSE
00077       print 9990, trim(ch_id)
00078 
00079       call psmile_flushstd
00080 #endif /* VERBOSE */
00081 !
00082 !  Initialization
00083 !
00084       ierror = 0
00085 !
00086       n_true = count (mask_array(inter(1,1):inter(2,1), &
00087                                  inter(1,2):inter(2,2), &
00088                                  inter(2,3):inter(2,3)) )
00089 !
00090 #ifdef VERBOSE
00091       print 9980, trim(ch_id), ierror, n_true
00092       call psmile_flushstd
00093 #endif /* VERBOSE */
00094 
00095 !
00096 !  Formats:
00097 !
00098 
00099 #ifdef VERBOSE
00100 
00101 9990 format (1x, a, ': psmile_get_true_mask_entries:')
00102 9980 format (1x, a, ': psmile_get_true_mask_entries: eof ierror =', i3, &
00103                     '; n_true =', i7)
00104 
00105 #endif /* VERBOSE */ 
00106 
00107       end subroutine PSMILe_get_true_mask_entries

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1