SICOPOLIS V3.1
 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 use nc_check
42 #endif
43 
44 implicit none
45 
46 integer(i4b) :: ierr
47 
48 character(len=64), parameter :: thisroutine = 'sico_end'
49 
50 close(unit=12, status='keep') ! Close time-series files
51 #if OUTSER==2
52 close(unit=13, status='keep')
53 #endif
54 #if OUTSER==3
55 close(unit=14, status='keep')
56 deallocate(lambda_core, phi_core, x_core, y_core)
57 #endif
58 #if OUTSER==4
59 close(unit=41, status='keep')
60 close(unit=42, status='keep')
61 close(unit=43, status='keep')
62 close(unit=44, status='keep')
63 close(unit=45, status='keep')
64 close(unit=46, status='keep')
65 close(unit=47, status='keep')
66 close(unit=48, status='keep')
67 close(unit=49, status='keep')
68 close(unit=50, status='keep')
69 deallocate(lambda_surf, phi_surf, x_surf, y_surf)
70 #endif
71 #if defined(HEINO)
72 close(unit=15, status='keep')
73 #endif
74 
75 #if ( (TSURFACE==6) && (ACCSURFACE==6) )
76 call check( nf90_close(ncid_temp_precip), thisroutine )
77  ! Closing of NetCDF file containing surface-temperature
78  ! and precipitation data as functions of time
79 #endif
80 
81 #if (CALCZS==4 || MARGIN==3)
82 call lis_finalize(ierr) ! Finalise execution environment of the
83  ! Library of Iterative Solvers Lis, if required
84 #endif
85 
86 write(unit=6, fmt='(a)') ' '
87 write(unit=6, fmt='(a)') ' '
88 write(unit=6, fmt='(a)') &
89 ' * * * sicopolis.F90 r e a d y * * *'
90 write(unit=6, fmt='(a)') ' '
91 write(unit=6, fmt='(a)') ' '
92 
93 end subroutine sico_end
94 !