prismdrv_finalize_smioc_struct.F90

Go to the documentation of this file.
00001 !------------------------------------------------------------------------
00002 ! Copyright 2006-2010, CERFACS, Toulouse, France.
00003 ! All rights reserved. Use is subject to OASIS4 license terms.
00004 !-----------------------------------------------------------------------
00005 !BOP
00006 !
00007 ! !ROUTINE: PRISMDrv_Finalize_smioc_struct
00008 !
00009 ! !INTERFACE
00010 subroutine prismdrv_finalize_smioc_struct(id_error)
00011 
00012 !
00013 ! !USES:
00014 !
00015   USE PSMILe_smioc
00016   USE PRISMDrv, dummy_interface => PRISMDrv_Finalize_smioc_struct
00017 !
00018   IMPLICIT NONE
00019 
00020 !
00021 ! !PARAMETERS:
00022 !
00023 
00024 !
00025 ! ! RETURN VALUE
00026 !
00027   INTEGER, INTENT (Out)               :: id_error   ! error value
00028 
00029 ! !DESCRIPTION
00030 ! Subroutine "PRISMDrv_finalize_smioc_struct" finalizeialize and set the driver
00031 ! smioc structures using the smioc api.
00032 !
00033 ! !REVISED HISTORY
00034 !   Date      Programmer   Description
00035 ! ----------  ----------   -----------
00036 ! 13/10/2003  S. Valcke     Creation
00037 ! 30/12/2003  D. Declat     Included in the driver
00038 !
00039 ! EOP
00040 !----------------------------------------------------------------------
00041 ! $Id: prismdrv_finalize_smioc_struct.F90 2399 2010-06-21 08:09:39Z coquart $
00042 ! $Author: coquart $
00043 !----------------------------------------------------------------------
00044 !
00045 ! 0. Local declarations
00046 !
00047   CHARACTER(LEN=80), SAVE  :: mycvs = 
00048      '$Id'
00049 !
00050   INTEGER, PARAMETER :: nerrp = 1
00051   INTEGER :: ierrp(nerrp)
00052   INTEGER :: id_err
00053   INTEGER :: ib_ntt
00054 !
00055 !----------------------------------------------------------------------
00056 !----------------------------------------------------------------------
00057 !
00058 !
00059 #ifdef VERBOSE
00060   PRINT *, '| | Enter PRISMDrv_finalize_smioc_struct'
00061   call psmile_flushstd
00062 #endif
00063   id_error = 0
00064   id_err   = 0
00065 !
00066 ! 1. Deallocation of global arrays
00067 !
00068   DEALLOCATE(iga_comp_id_doc_XML, stat = id_err)
00069   DEALLOCATE(iga_comp_nb_grids, stat = id_err)
00070   DEALLOCATE(iga_comp_nb_transi, stat = id_err)
00071   DEALLOCATE(iga_comp_nb_persis, stat = id_err)
00072   DEALLOCATE(iga_comp_nb_unitsets, stat = id_err)
00073   DEALLOCATE(iga_smioc_unitsets, stat = id_err)
00074   DEALLOCATE(sga_smioc_grids, stat = id_err)
00075   DEALLOCATE(sga_smioc_transi, stat = id_err)
00076   DEALLOCATE(sga_smioc_persis, stat = id_err)
00077   DEALLOCATE(iga_comp_nb_stand_name, stat = id_err)
00078   DEALLOCATE(iga_comp_nb_transi_in, stat = id_err)
00079   DEALLOCATE(iga_comp_nb_transi_out, stat = id_err)
00080 !
00081   DO ib_ntt = 1, ig_nb_tot_xml_transi
00082     DEALLOCATE (sga_xml_smioc_transi(ib_ntt)%sg_transi_in%sga_in_orig, stat=id_err)
00083     IF (id_err > 0) THEN
00084         ierrp (1) = id_err
00085         id_err = 14
00086         CALL Psmile_Error_Common ( id_err, 'sga_in_orig', &
00087            ierrp, 2, __FILE__, __LINE__ )
00088         RETURN
00089     ENDIF
00090     DEALLOCATE (sga_xml_smioc_transi(ib_ntt)%sga_transi_out, stat=id_err)
00091     IF (id_err > 0) THEN
00092         ierrp (1) = id_err
00093         id_err = 14
00094         CALL Psmile_Error_Common ( id_err, 'sga_transi_out', &
00095            ierrp, 2, __FILE__, __LINE__ )
00096         RETURN
00097     ENDIF
00098     DEALLOCATE (sga_xml_smioc_transi(ib_ntt)%cga_stand_name, stat=id_err)
00099     IF (id_err > 0) THEN
00100         ierrp (1) = id_err
00101         id_err = 14
00102         CALL Psmile_Error_Common ( id_err, 'cga_stand_name', &
00103            ierrp, 2, __FILE__, __LINE__ )
00104         RETURN
00105     ENDIF
00106   ENDDO
00107 !  9.2.   Deallocate global structure for transients, used for this first pass
00108   DEALLOCATE ( sga_xml_smioc_transi, stat=id_err)
00109     IF (id_err > 0) THEN
00110         ierrp (1) = id_err
00111         id_err = 14
00112         CALL Psmile_Error_Common ( id_err, 'sga_xml_smioc_transi', &
00113            ierrp, 2, __FILE__, __LINE__ )
00114         RETURN
00115     ENDIF
00116 !  9.3.   Deallocate counters (per component)
00117     DEALLOCATE ( iga_xml_comp_nb_transi, stat=id_err)
00118     IF (id_err > 0) THEN
00119         ierrp (1) = id_err
00120         id_err = 14
00121         CALL Psmile_Error_Common ( id_err, 'iga_xml_comp_nb_transi', &
00122            ierrp, 2, __FILE__, __LINE__ )
00123         RETURN
00124      ENDIF
00125 
00126   IF (id_err > 0) THEN
00127       ierrp (1) = id_err
00128 
00129       call psmile_error_common ( 14 , 'Global arrays', &
00130          ierrp, 1, __FILE__, __LINE__ )
00131   ENDIF
00132 
00133   id_error = id_err
00134 
00135 !
00136 #ifdef VERBOSE
00137   PRINT *, '| | Quit PRISMDrv_finalize_smioc_struct'
00138   PRINT *, '| |'
00139   call psmile_flushstd
00140 #endif
00141 end subroutine prismdrv_finalize_smioc_struct
00142 
00143 
00144 
00145 

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1