psmile_loc_trans_int.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_Loc_Trans_int
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_loc_trans_int ( task, nbr_fields, &
00012                                         len_in,  data_in,  &
00013                                         len_out, data_out, field_id )
00014 !
00015 ! !USES:
00016 !
00017       use PRISM_constants, only: PRISM_UNDEFINED, PRISM_Error_Arg
00018       Use PSMILe, dummy_interface => PSMILe_Loc_Trans_int
00019 
00020       Implicit None
00021 !
00022 ! !INPUT PARAMETERS:
00023 !
00024       Integer, Intent (In)                :: task
00025 
00026 !     Coded task to be fulfilled 
00027 
00028       Integer, Intent (In)                :: nbr_fields
00029 
00030 !     number of physical fields contained in the data 
00031 
00032       Integer, Intent (In)                :: len_in
00033 
00034 !     Length of input array
00035 
00036       Integer, Intent (In)                :: data_in(len_in,nbr_fields)
00037 
00038 !     Input data
00039 
00040       Integer, Intent (In)                :: len_out
00041 
00042 !     Length of (gathered) output array
00043 
00044       Integer, Optional, Intent (In)      :: field_id
00045 
00046 !     Field Id to access the mask for the transformed field
00047 !
00048 ! !INPUT/OUTPUT PARAMETERS:
00049 !
00050       Integer, Intent (InOut)             :: data_out(len_out,nbr_fields)
00051 
00052 !     Transformed data
00053 !
00054 ! !LOCAL VARIABLES
00055 !
00056       Integer :: i
00057 !
00058 ! !DESCRIPTION:
00059 !
00060 ! Subroutine "PSMILe_Loc_Trans_int" performs some simple local transformations
00061 !
00062 !
00063 ! !REVISION HISTORY:
00064 !
00065 !   Date      Programmer   Description
00066 ! ----------  ----------   -----------
00067 ! 03.07.03    R. Redler    created
00068 !
00069 !EOP
00070 !----------------------------------------------------------------------
00071 !
00072 ! $Id: psmile_loc_trans_int.F90 2325 2010-04-21 15:00:07Z valcke $
00073 ! $Author: valcke $
00074 !
00075    Character(len=len_cvs_string), save :: mycvs = 
00076        '$Id: psmile_loc_trans_int.F90 2325 2010-04-21 15:00:07Z valcke $'
00077 !
00078 !----------------------------------------------------------------------
00079 !
00080          select case ( task )
00081 
00082          case ( PSMILe_scat )
00083             
00084             if ( Fields(field_id)%mask_id == PRISM_UNDEFINED ) then
00085                data_out = data_in
00086             else
00087                do i = 1, nbr_fields
00088                   data_out(:,i) = unpack ( data_in(:,i), &
00089                        Masks(Fields(field_id)%mask_id)%mask_array, &
00090                        data_out(:,i) )
00091                enddo
00092             endif
00093 
00094          case ( PSMILe_gath )
00095 
00096             if ( Fields(field_id)%mask_id == PRISM_UNDEFINED ) then
00097                data_out = data_in
00098             else
00099                data_out(:,i) = pack ( data_in(:,i), Masks(Fields(field_id)%mask_id)%mask_array )
00100             endif
00101 
00102          case default
00103 
00104            print *, task, ' is not a valid number, no action performed '
00105 
00106          end select
00107 
00108       end subroutine PSMILe_Loc_Trans_int

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1