psmile_reshape_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_Reshape_2d_real
00008 !
00009 ! !INTERFACE:
00010 !
00011       subroutine psmile_reshape_2d_real (source, source_shape, sub_range, &
00012                                          dest,   dest_shape, ierror)
00013 !
00014 ! !USES:
00015 !
00016       use PRISM_constants
00017 !
00018       use PSMILe!, dummy_interface => PSMILe_Reshape_2d_real
00019 
00020       Implicit none
00021 !
00022 ! !INPUT PARAMETERS:
00023 !
00024       Integer,          Intent (In)       :: source_shape (2, ndim_2d)
00025 
00026 !     Dimension of source array "source"
00027 
00028       Integer,          Intent (In)       :: sub_range (2, ndim_2d)
00029 
00030 !     Range of source to be copied
00031 
00032       Real, Intent (In)                   ::          
00033          source (source_shape(1,1):source_shape(2,1), 
00034                  source_shape(1,2):source_shape(2,2))
00035 
00036 !     Array containg the sub-array to be copied
00037 
00038       Integer,          Intent (In)       :: dest_shape (2, ndim_2d)
00039 !
00040 ! !OUTPUT PARAMETERS:
00041 !
00042 
00043       Real, Intent (InOut)                ::    
00044          dest (dest_shape(1,1):dest_shape(2,1), 
00045                dest_shape(1,2):dest_shape(2,2))
00046 
00047 !     Array returning the sub-array which was copied
00048 
00049       Integer,          Intent (Out)      :: ierror
00050 
00051 !     Returns the error code of PSMILe_Reshape_2d_real;
00052 !             ierror = 0 : No error
00053 !             ierror > 0 : Severe error
00054 !
00055 ! !LOCAL VARIABLES
00056 !
00057       Integer             :: i, j
00058 !
00059 ! !DESCRIPTION:
00060 !
00061 ! Subroutine "PSMILe_Reshape_2d_real" copies the subarray
00062 !    "source(sub_range(1,1):sub_range(2,1),
00063 !            sub_range(1,2):sub_range(2,2))"
00064 ! into the destination array "dest(:, :)"
00065 !
00066 ! Note: The routine is used to copy to/from an array which is stored
00067 !       as 1-dimensional vector.
00068 !
00069 !
00070 ! !REVISION HISTORY:
00071 !   Date      Programmer   Description
00072 ! ----------  ----------   -----------
00073 ! 02.05.09    H. Ritzdorf  created
00074 !
00075 !EOP
00076 !----------------------------------------------------------------------
00077 !
00078 ! $Id: psmile_reshape_2d_real.F90,v 1.1.2.1 2009/07/07 15:18:05 ritzdorf Exp $
00079 ! $Author: ritzdorf $
00080 
00081    Character(len=len_cvs_string), save :: mycvs = 
00082        '$Id: psmile_reshape_2d_real.F90,v 1.1.2.1 2009/07/07 15:18:05 ritzdorf Exp $'
00083 !
00084 !----------------------------------------------------------------------
00085 !
00086 !  Initialization
00087 !
00088       ierror = 0
00089 !
00090       dest   (sub_range(1,1):sub_range(2,1),   &
00091               sub_range(1,2):sub_range(2,2)) = &
00092       source (sub_range(1,1):sub_range(2,1),   &
00093               sub_range(1,2):sub_range(2,2))
00094 !
00095       end subroutine PSMILe_Reshape_2d_real

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1