psmile_loc_trans_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_Loc_Trans_real
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_loc_trans_real ( 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_real
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       Real, 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       Real, 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_real" performs some simple local transformations
00061 !
00062 !
00063 ! !REVISION HISTORY:
00064 !   Date      Programmer   Description
00065 ! ----------  ----------   -----------
00066 ! 03.07.03    R. Redler    created
00067 !
00068 !EOP
00069 !----------------------------------------------------------------------
00070 !
00071 ! $Id: psmile_loc_trans_real.F90 2325 2010-04-21 15:00:07Z valcke $
00072 ! $Author: valcke $
00073 !
00074    Character(len=len_cvs_string), save :: mycvs = 
00075        '$Id: psmile_loc_trans_real.F90 2325 2010-04-21 15:00:07Z valcke $'
00076 !
00077 !----------------------------------------------------------------------
00078 
00079          select case ( task )
00080 
00081          case ( PSMILe_scat )
00082             
00083             if ( Fields(field_id)%mask_id == PRISM_UNDEFINED ) then
00084                data_out = data_in
00085             else
00086                do i = 1, nbr_fields
00087                   data_out(:,i) = unpack ( data_in(:,i), &
00088                        Masks(Fields(field_id)%mask_id)%mask_array, &
00089                        data_out(:,i) )
00090                enddo
00091             endif
00092 
00093          case ( PSMILe_gath )
00094 
00095             if ( Fields(field_id)%mask_id == PRISM_UNDEFINED ) then
00096                data_out = data_in
00097             else
00098                data_out(:,i) = pack ( data_in(:,i), Masks(Fields(field_id)%mask_id)%mask_array )
00099             endif
00100 
00101          case default
00102 
00103            print *, task, ' is not a valid number, no action performed '
00104 
00105          end select
00106 
00107       end subroutine PSMILe_Loc_Trans_real

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1