psmile_free_field_handle.F90

Go to the documentation of this file.
00001 !
00002 !-----------------------------------------------------------------------
00003 ! Copyright 2006-2010, NEC Europe Ltd., London, UK.
00004 ! All rights reserved. Use is subject to OASIS4 license terms.
00005 !-----------------------------------------------------------------------
00006 !BOP
00007 !
00008 ! !ROUTINE: PSMILe_Free_field_handle
00009 !
00010 ! !INTERFACE:
00011 
00012       subroutine psmile_free_field_handle (field_id, ierror)
00013 !
00014 ! !USES:
00015 !
00016       use PRISM_constants
00017 !
00018       use PSMILe, dummy_interface => PSMILe_Free_field_handle
00019 
00020       implicit none
00021 !
00022 ! !INPUT PARAMETERS:
00023 !
00024       integer,Intent(In)  :: field_id
00025 
00026 !     Handle to the grid function information to be released.
00027 !
00028 ! !OUTPUT PARAMETERS:
00029 !
00030 !
00031       integer, Intent (Out)               :: ierror
00032 
00033 !     Returns the error code of psmile_free_field_handle;
00034 !             ierror = 0 : No error
00035 !             ierror > 0 : Severe error
00036 !
00037 ! !LOCAL VARIABLES
00038 !
00039       integer, parameter  :: nerrp = 2
00040       integer             :: ierrp (nerrp)
00041 !
00042 ! !DESCRIPTION:
00043 !
00044 ! Subroutine "PSMILe_Free_field_handle" releases a grid function handle.
00045 !
00046 ! !REVISION HISTORY:
00047 !
00048 !   Date      Programmer    Description
00049 ! ----------  -----------   -----------
00050 ! 01.12.03    H. Ritzdorf   created
00051 !
00052 !EOP
00053 !----------------------------------------------------------------------
00054 !
00055 ! $Id: psmile_free_field_handle.F90 2325 2010-04-21 15:00:07Z valcke $
00056 ! $Author: valcke $
00057 !
00058    Character(len=len_cvs_string), save :: mycvs = 
00059        '$Id: psmile_free_field_handle.F90 2325 2010-04-21 15:00:07Z valcke $'
00060 !
00061 !----------------------------------------------------------------------
00062 
00063 #ifdef VERBOSE
00064       print *, trim(ch_id), ': PSMILe_Free_field_handle: start handle =', field_id
00065 
00066       call psmile_flushstd
00067 #endif /* VERBOSE */
00068 
00069 !
00070 !   Initialization
00071 !
00072       ierror = 0
00073 !
00074       if (field_id > Number_of_Fields_allocated .or. &
00075           field_id < 1) then
00076 
00077          ierrp (1) = field_id
00078          ierrp (2) = Number_of_Fields_allocated
00079 
00080          ierror = PRISM_Error_Internal
00081          call psmile_error (ierror, "invalid field handle", &
00082                             ierrp, nerrp, __FILE__, __LINE__)
00083          return
00084       endif
00085 !
00086 !   Free Index
00087 !
00088       Fields(field_id)%status = PSMILe_status_free
00089 
00090 #ifdef VERBOSE
00091       print *, trim(ch_id), ': PSMILe_Free_field_handle: eof ierror =', ierror
00092 
00093       call psmile_flushstd
00094 #endif /* VERBOSE */
00095 !
00096       end subroutine PSMILe_Free_field_handle

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1