psmile_copy_subarray_2d_log.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_Copy_subarray_2d_log
00008 !
00009 ! !INTERFACE:
00010 !
00011       subroutine psmile_copy_subarray_2d_log (dest_vector, size, &
00012                         darray, idlow, idhigh, jdlow, jdhigh, &
00013                                 ibeg,  iend,   jbeg,  jend,   ierror)
00014 !
00015 ! !USES:
00016 !
00017       use PRISM_constants
00018 !
00019       use PSMILe, dummy_interface => PSMILe_Copy_subarray_2d_log
00020 
00021       implicit none
00022 !
00023 ! !INPUT PARAMETERS:
00024 !
00025       integer(kind=int64), Intent (In)    :: size
00026 
00027 !     Size (length) of destination vector "dest"
00028 
00029       integer, Intent (In)                :: idlow
00030 
00031 !     Lowest  first  dimension of array "darray"
00032 
00033       integer, Intent (In)                :: idhigh
00034 
00035 !     Highest first  dimension of array "darray"
00036 
00037       integer, Intent (In)                :: jdlow
00038 
00039 !     Lowest  second dimension of array "darray"
00040 
00041       integer, Intent (In)                :: jdhigh
00042 
00043 !     Highest second dimension of array "darray"
00044 
00045       logical, Intent (In)                :: darray (idlow:idhigh, 
00046                                                      jdlow:jdhigh)
00047 
00048 !     Array containg the sub-array to be copied
00049 
00050       integer, Intent (In)                :: ibeg
00051 
00052 !     Lowest  first  index of sub-array to be copied
00053 
00054       integer, Intent (In)                :: iend
00055 
00056 !     Highest first index of sub-array to be copied
00057 
00058       integer, Intent (In)                :: jbeg
00059 
00060 !     Lowest  second index of sub-array to be copied
00061 
00062       integer, Intent (In)                :: jend
00063 !
00064 ! !OUTPUT PARAMETERS:
00065 !
00066       Logical, Intent (Out)               :: dest_vector (size)
00067 
00068 !     Destintation vector
00069 
00070       integer, Intent (Out)               :: ierror
00071 
00072 !     Returns the error code of PSMILe_Copy_subarray_2d_log;
00073 !             ierror = 0 : No error
00074 !             ierror > 0 : Severe error
00075 !
00076 ! !LOCAL VARIABLES
00077 !
00078       integer             :: i, j, leni
00079       integer(kind=int64) :: ip
00080 !
00081 ! !DESCRIPTION:
00082 !
00083 ! Subroutine "PSMILe_Copy_subarray_2d_log" copies the subarray
00084 ! darray (ibeg:iend, jbeg:jend) into the 1-dimensional destination
00085 ! vector "dest_vector".
00086 !
00087 !
00088 ! !REVISION HISTORY:
00089 !
00090 !   Date      Programmer   Description
00091 ! ----------  ----------   -----------
00092 ! 01.12.03    H. Ritzdorf  created
00093 !
00094 !EOP
00095 !----------------------------------------------------------------------
00096 !
00097 ! $Id: psmile_copy_subarray_2d_log.F90 2325 2010-04-21 15:00:07Z valcke $
00098 ! $Author: valcke $
00099 
00100    Character(len=len_cvs_string), save :: mycvs = 
00101        '$Id: psmile_copy_subarray_2d_log.F90 2325 2010-04-21 15:00:07Z valcke $'
00102 !
00103 !----------------------------------------------------------------------
00104 !
00105 !  Initialization
00106 !
00107 ! ??? waere es moeglich dest_array als
00108 !  dest_array (sub(1,1):sub(2,1), sub(1,2):sub(2,2), sub (1,3):sub(2,3))
00109 ! zu deklariren und dann
00110 !
00111 !  dest_array = darray (sub(1,1):sub(2,1), sub(1,2):sub(2,2), sub (1,3):sub(2,3)
00112 !  asuzufuehren ?
00113 !
00114 !
00115       ierror = 0
00116 !
00117       ip = 1
00118 !
00119       leni = iend - ibeg + 1
00120 !
00121          do j = jbeg, jend
00122 !cdir vector
00123             do i = ibeg, iend
00124             dest_vector (ip+(i-ibeg)) = darray (i, j)
00125             enddo
00126 
00127             ip = ip + leni
00128          enddo
00129 !
00130       end subroutine PSMILe_Copy_subarray_2d_log

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1