psmile_range_subgrid_1d_real.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_Range_Subgrid_1d_real
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_range_subgrid_1d_real (          &
00012                     array, idlow, idhigh, nbr_corners,   &
00013                            ibeg,  iend,                  &
00014                     rinter, inter, ierror)
00015 !
00016 ! !USES:
00017 !
00018       use PRISM_constants
00019 !
00020       use PSMILe, dummy_interface => PSMILe_Range_Subgrid_1d_real
00021 
00022       implicit none
00023 !
00024 ! !INPUT PARAMETERS:
00025 !
00026       integer, Intent (In)             :: idlow, idhigh, nbr_corners
00027 
00028 !     Dimensions of "array"
00029 
00030       real, Intent (In)                :: array (idlow:idhigh, nbr_corners)
00031 
00032 !     Fully dimensioned Array for which the range of intersection "rinter"
00033 !     should be computed.
00034 
00035       integer, Intent (In)             :: ibeg, iend
00036 
00037 !     Definintion of the subgrid
00038 
00039       Real, Intent (In)                :: rinter (2)
00040 
00041 !     Specifies the intersection for which the range should be found.
00042 !
00043 ! !OUTPUT PARAMETERS:
00044 !
00045       Integer, Intent (Out)            :: inter (2)
00046 
00047 !     Returns the range of the intersection
00048 
00049       integer, Intent (Out)            :: ierror
00050 
00051 !     Returns the error code of PSMILe_Range_Subgrid_1d_real;
00052 !             ierror = 0 : No error
00053 !             ierror > 0 : Severe error
00054 !
00055 ! !LOCAL VARIABLES
00056 !
00057       integer            :: i
00058 !
00059 ! !DESCRIPTION:
00060 !
00061 ! Subroutine "PSMILe_Range_Subgrid_1d_real" computes the range of
00062 ! of grid contained in array~(ibeg:iend,~nbr_corners) which contains
00063 ! the intersection "rinter".
00064 !
00065 !
00066 ! !REVISION HISTORY:
00067 !
00068 !   Date      Programmer   Description
00069 ! ----------  ----------   -----------
00070 ! 03.06.17    H. Ritzdorf  created
00071 !
00072 !EOP
00073 !----------------------------------------------------------------------
00074 !
00075 ! $Id: psmile_range_subgrid_1d_real.F90 2687 2010-10-28 15:15:52Z coquart $
00076 ! $Author: coquart $
00077 !
00078    Character(len=len_cvs_string), save :: mycvs = 
00079        '$Id: psmile_range_subgrid_1d_real.F90 2687 2010-10-28 15:15:52Z coquart $'
00080 !
00081 !----------------------------------------------------------------------
00082 !
00083 #ifdef VERBOSE
00084       print *, trim(ch_id), ': PSMILe_Range_Subgrid_1d_real'
00085 
00086       call psmile_flushstd
00087 #endif /* VERBOSE */
00088 !
00089 !  Initialization
00090 !
00091       ierror = 0
00092 !
00093       inter (1) = iend + 1
00094       inter (2) = ibeg - 1
00095 !
00096 !  Get range of the intersection "rinter"
00097 !
00098 !cdir vector
00099          do i = ibeg, iend
00100          if (max(array (i,1), array(i,2)) >= rinter (1) .and. &
00101              min(array (i,1), array(i,2)) <= rinter (2)) then
00102             inter (1) = min (inter (1), i)
00103             inter (2) = max (inter (2), i)
00104          endif
00105          enddo
00106 !
00107 !===> All done
00108 !
00109 #ifdef VERBOSE
00110       print *, trim(ch_id), ': PSMILe_Range_Subgrid_1d_real eof', &
00111                             ': ierror =', ierror, &
00112                             '; inter  =', inter
00113 
00114       call psmile_flushstd
00115 #endif /* VERBOSE */
00116 !
00117       end subroutine PSMILe_Range_Subgrid_1d_real

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1