Changeset 4559 for palm/trunk/SOURCE/close_file.f90
- Timestamp:
- Jun 11, 2020 8:51:48 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/close_file.f90
r4360 r4559 1 1 !> @file close_file.f90 2 !------------------------------------------------------------------------------ !2 !--------------------------------------------------------------------------------------------------! 3 3 ! This file is part of the PALM model system. 4 4 ! 5 ! PALM is free software: you can redistribute it and/or modify it under the 6 ! terms of the GNU General Public License as published by the Free Software 7 ! Foundation, either version 3 of the License, or (at your option) any later 8 ! version. 9 ! 10 ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY 11 ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 ! 14 ! You should have received a copy of the GNU General Public License along with 15 ! PALM. If not, see <http://www.gnu.org/licenses/>. 5 ! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General 6 ! Public License as published by the Free Software Foundation, either version 3 of the License, or 7 ! (at your option) any later version. 8 ! 9 ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 10 ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 11 ! Public License for more details. 12 ! 13 ! You should have received a copy of the GNU General Public License along with PALM. If not, see 14 ! <http://www.gnu.org/licenses/>. 16 15 ! 17 16 ! Copyright 1997-2020 Leibniz Universitaet Hannover 18 !------------------------------------------------------------------------------ !17 !--------------------------------------------------------------------------------------------------! 19 18 ! 20 19 ! Current revisions: … … 25 24 ! ----------------- 26 25 ! $Id$ 26 ! file re-formatted to follow the PALM coding standard 27 ! 28 ! 4360 2020-01-07 11:25:50Z suehring 27 29 ! Corrected "Former revisions" section 28 ! 30 ! 29 31 ! 4069 2019-07-01 14:05:51Z Giersch 30 ! Masked output running index mid has been introduced as a local variable to 32 ! Masked output running index mid has been introduced as a local variable to 31 33 ! avoid runtime error (Loop variable has been modified) in time_integration 32 ! 34 ! 33 35 ! 3655 2019-01-07 16:51:22Z knoop 34 36 ! unused variables and format statements removed … … 40 42 ! Description: 41 43 ! ------------ 42 !> Close specified file or all open files, if "0" has been given as the 43 !> calling argument. In that case, execute last actions for certain unit 44 !> numbers, if required. 45 !------------------------------------------------------------------------------! 44 !> Close specified file or all open files, if "0" has been given as the calling argument. In that 45 !> case, execute last actions for certain unit numbers, if required. 46 !--------------------------------------------------------------------------------------------------! 46 47 SUBROUTINE close_file( file_id ) 47 48 49 USE control_parameters, &48 49 50 USE control_parameters, & 50 51 ONLY: max_masks, openfile 51 52 52 53 USE kinds 53 54 54 55 #if defined( __netcdf ) 55 56 USE NETCDF … … 57 58 58 59 USE netcdf_interface, & 59 ONLY: id_set_mask, id_set_pr, id_set_pts, id_set_sp, & 60 id_set_ts, id_set_xy, id_set_xz, id_set_yz, id_set_3d, & 61 id_set_fl, nc_stat, netcdf_data_format, netcdf_handle_error 62 63 USE pegrid 60 ONLY: id_set_mask, id_set_pr, id_set_pts, id_set_sp, id_set_ts, id_set_xy, id_set_xz, & 61 id_set_yz, id_set_3d, id_set_fl, nc_stat, netcdf_data_format, netcdf_handle_error 62 63 USE pegrid 64 64 65 65 IMPLICIT NONE 66 66 67 CHARACTER (LEN=10) :: datform = 'lit_endian' !< 68 CHARACTER (LEN=80) :: title !< 69 70 INTEGER(iwp) :: av !< 71 INTEGER(iwp) :: dimx !< 72 INTEGER(iwp) :: dimy !< 73 INTEGER(iwp) :: fid !< 74 INTEGER(iwp) :: file_id !< 75 INTEGER(iwp) :: mid !< masked output running index 76 INTEGER(iwp) :: planz !< 77 78 LOGICAL :: checkuf = .TRUE. !< 79 LOGICAL :: datleg = .TRUE. !< 80 LOGICAL :: dbp = .FALSE. !< 81 82 NAMELIST /GLOBAL/ checkuf, datform, dimx, dimy, dbp, planz, & 83 title 67 CHARACTER (LEN=10) :: datform = 'lit_endian' !< 68 CHARACTER (LEN=80) :: title !< 69 70 INTEGER(iwp) :: av !< 71 INTEGER(iwp) :: dimx !< 72 INTEGER(iwp) :: dimy !< 73 INTEGER(iwp) :: fid !< 74 INTEGER(iwp) :: file_id !< 75 INTEGER(iwp) :: mid !< masked output running index 76 INTEGER(iwp) :: planz !< 77 78 LOGICAL :: checkuf = .TRUE. !< 79 LOGICAL :: datleg = .TRUE. !< 80 LOGICAL :: dbp = .FALSE. !< 81 82 NAMELIST /GLOBAL/ checkuf, datform, dbp, dimx, dimy, planz, title 84 83 NAMELIST /RAHMEN/ datleg 85 84 86 85 ! 87 !-- Close specified unit number (if opened) and set a flag that it has 88 !-- been opened one time at least 86 !-- Close specified unit number (if opened) and set a flag that it has been opened one time at least 89 87 IF ( file_id /= 0 ) THEN 90 88 IF ( openfile(file_id)%opened ) THEN … … 162 160 ! CALL netcdf_handle_error( 'close_file', 51 ) 163 161 164 CASE ( 109 ) 162 CASE ( 109 ) 165 163 166 164 nc_stat = NF90_CLOSE( id_set_pts ) … … 206 204 IF ( myid == 0 .OR. netcdf_data_format > 4 ) THEN 207 205 ! 208 !-- decompose fid into mid and av206 !-- Decompose fid into mid and av 209 207 IF ( fid <= 200+max_masks ) THEN 210 208 mid = fid - 200
Note: See TracChangeset
for help on using the changeset viewer.