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