psmile_extent_subgrid_2d_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_Extent_Subgrid_2d_real
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_extent_subgrid_2d_real (         &
00012                     array, idlow, idhigh, jdlow, jdhigh, &
00013                            nbr_corners,                  &
00014                            ibeg, iend, jbeg, jend,       &
00015                     extent, ierror)
00016 !
00017 ! !USES:
00018 !
00019       use PRISM_constants
00020 !
00021       use PSMILe, dummy_interface => PSMILe_Extent_Subgrid_2d_real
00022 
00023       implicit none
00024 !
00025 ! !INPUT PARAMETERS:
00026 !
00027       Integer, Intent (In)             :: idlow, idhigh
00028       Integer, Intent (In)             :: jdlow, jdhigh
00029       Integer, Intent (In)             :: nbr_corners
00030 
00031 !     Dimensions of "array"
00032 
00033       Real, Intent (In)                :: array (idlow:idhigh, 
00034                                                  jdlow:jdhigh, 
00035                                                  nbr_corners)
00036 
00037 !     Fully dimensioned Array for which the extent of the subarray
00038 !     should be computed.
00039 
00040       Integer, Intent (In)             :: ibeg, iend, jbeg, jend
00041 
00042 !     Definintion of the subgrid
00043 !
00044 !
00045 ! !OUTPUT PARAMETERS:
00046 !
00047       Real, Intent (Out)               :: extent (2)
00048 
00049 !     Returns the extent of subarray "array (ibeg:iend, jbeg:jend,
00050 !                                            1:nbr_corners)"
00051 
00052       Integer, Intent (Out)            :: ierror
00053 
00054 !     Returns the error code of PSMILe_Extent_Subgrid_2d_real;
00055 !             ierror = 0 : No error
00056 !             ierror > 0 : Severe error
00057 !
00058 ! !DESCRIPTION:
00059 !
00060 ! Subroutine "PSMILe_Extent_Subgrid_2d_real" computes the extent
00061 ! of the subgrid contained in array~(ibeg:iend,~jbeg:jend,~nbr_corners).
00062 !
00063 ! !REVISION HISTORY:
00064 !
00065 !   Date      Programmer   Description
00066 ! ----------  ----------   -----------
00067 ! 01.12.03    H. Ritzdorf  created
00068 !
00069 !EOP
00070 !----------------------------------------------------------------------
00071 !
00072 ! $Id: psmile_extent_subgrid_2d_real.F90 2325 2010-04-21 15:00:07Z valcke $
00073 ! $Author: valcke $
00074 !
00075    Character(len=len_cvs_string), save :: mycvs = 
00076        '$Id: psmile_extent_subgrid_2d_real.F90 2325 2010-04-21 15:00:07Z valcke $'
00077 !
00078 !----------------------------------------------------------------------
00079 
00080 #ifdef VERBOSE
00081       print *, trim(ch_id), ': PSMILe_Extent_Subgrid_2d_real'
00082 
00083       call psmile_flushstd
00084 #endif /* VERBOSE */
00085 !
00086 !  Initialization
00087 !
00088       ierror = 0
00089 !
00090 !===> Evaluation of face points only is not correct
00091 !     HR: A checkboard access would help to decrease the number of
00092 !         acesses. However, this would imply, that the corner volumes
00093 !         would always fit.
00094 !
00095 !     Try, to help the compiler; is this necessary ?
00096 !
00097       if (ibeg == idlow .and. iend == idhigh) then
00098          if (jbeg == jdlow .and. jend == jdhigh) then
00099             extent (1) = MINVAL (array)
00100             extent (2) = MAXVAL (array)
00101          else 
00102             extent (1) = MINVAL (array (:, jbeg:jend, 1:nbr_corners))
00103             extent (2) = MAXVAL (array (:, jbeg:jend, 1:nbr_corners))
00104          endif
00105       else
00106          extent (1) = MINVAL (array (ibeg:iend, jbeg:jend, 1:nbr_corners))
00107          extent (2) = MAXVAL (array (ibeg:iend, jbeg:jend, 1:nbr_corners))
00108       endif
00109 !
00110 !===> All done
00111 !
00112 #ifdef VERBOSE
00113       print *, trim(ch_id), ': PSMILe_Extent_Subgrid_2d_real eof', &
00114                             ': ierror =', ierror
00115 !                         , '; extent =', extent
00116 
00117       call psmile_flushstd
00118 #endif /* VERBOSE */
00119 !
00120       end subroutine PSMILe_Extent_Subgrid_2d_real

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1