SICOPOLIS V3.0
 All Classes Files Functions Variables Macros
sico_end.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Subroutine : s i c o _ e n d
4 !
5 !> @file
6 !!
7 !! Ending of SICOPOLIS.
8 !!
9 !! @section Copyright
10 !!
11 !! Copyright 2009-2013 Ralf Greve
12 !!
13 !! @section License
14 !!
15 !! This file is part of SICOPOLIS.
16 !!
17 !! SICOPOLIS is free software: you can redistribute it and/or modify
18 !! it under the terms of the GNU General Public License as published by
19 !! the Free Software Foundation, either version 3 of the License, or
20 !! (at your option) any later version.
21 !!
22 !! SICOPOLIS is distributed in the hope that it will be useful,
23 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
24 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 !! GNU General Public License for more details.
26 !!
27 !! You should have received a copy of the GNU General Public License
28 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
29 !<
30 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31 
32 !-------------------------------------------------------------------------------
33 !> Ending of SICOPOLIS.
34 !<------------------------------------------------------------------------------
35 subroutine sico_end
36 
37 use sico_types
39 #if (NETCDF > 1)
40 use netcdf
41 #endif
42 
43 implicit none
44 
45 integer(i4b) :: ierr
46 
47 close(12, status='keep') ! Close time-series files
48 #if OUTSER==2
49 close(13, status='keep')
50 #endif
51 #if OUTSER==3
52 close(14, status='keep')
53 deallocate(lambda_core, phi_core, x_core, y_core)
54 #endif
55 #if OUTSER==4
56 close(41, status='keep')
57 close(42, status='keep')
58 close(43, status='keep')
59 close(44, status='keep')
60 close(45, status='keep')
61 close(46, status='keep')
62 close(47, status='keep')
63 close(48, status='keep')
64 close(49, status='keep')
65 close(50, status='keep')
66 deallocate(lambda_surf, phi_surf, x_surf, y_surf)
67 #endif
68 #if defined(HEINO)
69 close(15, status='keep')
70 #endif
71 
72 #if ( (TSURFACE==6) && (ACCSURFACE==6) )
73 call check( nf90_close(ncid_temp_precip) )
74  ! Closing of NetCDF file containing surface-temperature
75  ! and precipitation data as functions of time
76 #endif
77 
78 #if (CALCZS==4 || MARGIN==3)
79 call lis_finalize(ierr) ! Finalise execution environment of the
80  ! Library of Iterative Solvers Lis, if required
81 #endif
82 
83 write(6,'(a)') ' '
84 write(6,'(a)') ' '
85 write(6,'(a)') &
86 ' * * * sicopolis.F90 r e a d y * * *'
87 write(6,'(a)') ' '
88 write(6,'(a)') ' '
89 
90 end subroutine sico_end
91 !