psmile_free_method_handle.F90
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 subroutine psmile_free_method_handle ( method_id, ierror)
00013
00014
00015
00016 use PRISM_constants
00017
00018 use PSMILe, dummy_interface => PSMILe_Free_method_handle
00019
00020 implicit none
00021
00022
00023
00024 integer, Intent (In) :: method_id
00025
00026
00027
00028
00029
00030 integer, Intent (Out) :: ierror
00031
00032
00033
00034
00035
00036
00037 integer :: i
00038
00039 integer, parameter :: nerrp = 2
00040 integer :: ierrp (nerrp)
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 Character(len=len_cvs_string), save :: mycvs =
00059 '$Id: psmile_free_method_handle.F90 2325 2010-04-21 15:00:07Z valcke $'
00060
00061
00062
00063 #ifdef VERBOSE
00064 print *, trim(ch_id), ': PSMILe_Free_method_handle: start handle =', method_id
00065
00066 call psmile_flushstd
00067 #endif /* VERBOSE */
00068
00069
00070
00071
00072 ierror = 0
00073
00074 if (method_id > Number_of_Methods_allocated .or. &
00075 method_id < 1) then
00076
00077 ierrp (1) = method_id
00078 ierrp (2) = Number_of_Methods_allocated
00079
00080 ierror = PRISM_Error_Internal
00081 call psmile_error (ierror, "invalid method handle", &
00082 ierrp, nerrp, __FILE__, __LINE__)
00083 return
00084 endif
00085
00086
00087
00088 Methods(method_id)%status = PSMILe_status_free
00089
00090
00091
00092 if (Methods(method_id)%previous_method_in_grid /= PRISM_UNDEFINED) then
00093 i = Methods(method_id)%previous_method_in_grid
00094 Methods(i)%next_method_in_grid = Methods(method_id)%next_method_in_grid
00095 endif
00096
00097 if (Methods(method_id)%next_method_in_grid /= PRISM_UNDEFINED) then
00098 i = Methods(method_id)%next_method_in_grid
00099 Methods(i)%previous_method_in_grid = &
00100 Methods(method_id)%previous_method_in_grid
00101 endif
00102
00103
00104
00105 if (Associated (Methods(method_id)%send_infos_direct)) then
00106 Deallocate (Methods(method_id)%send_infos_direct)
00107 endif
00108
00109 if (Associated (Methods(method_id)%send_infos_coupler)) then
00110 Deallocate (Methods(method_id)%send_infos_coupler)
00111 endif
00112
00113 if (Associated (Methods(method_id)%recv_infos_direct)) then
00114 Deallocate (Methods(method_id)%recv_infos_direct)
00115 endif
00116
00117 if (Associated (Methods(method_id)%recv_infos_coupler)) then
00118 Deallocate (Methods(method_id)%recv_infos_coupler)
00119 endif
00120
00121 #ifdef VERBOSE
00122 print *, trim(ch_id), ': PSMILe_Free_method_handle: eof ierror =', ierror
00123
00124 call psmile_flushstd
00125 #endif /* VERBOSE */
00126
00127 end subroutine PSMILe_Free_method_handle