Changeset 1682 for palm/trunk/SOURCE/netcdf.f90
- Timestamp:
- Oct 7, 2015 11:56:08 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/netcdf.f90
r1597 r1682 1 #if defined( __ibmy_special ) 2 @PROCESS NOOPTimize 3 #endif 4 SUBROUTINE define_netcdf_header( callmode, extend, av ) 5 1 !> @file netcdf.f90 6 2 !--------------------------------------------------------------------------------! 7 3 ! This file is part of PALM. … … 23 19 ! Current revisions: 24 20 ! ------------------ 25 ! 21 ! Code annotations made doxygen readable 26 22 ! 27 23 ! Former revisions: … … 97 93 ! Description: 98 94 ! ------------ 99 ! In case of extend = .FALSE.:100 ! Define all necessary dimensions, axes and variables for the different101 ! netCDF datasets. This subroutine is called from check_open after a new102 ! dataset is created. It leaves the open netCDF files ready to write.103 ! 104 ! In case of extend = .TRUE.:105 ! Find out if dimensions and variables of an existing file match the values106 ! of the actual run. If so, get all necessary information (ids, etc.) from107 ! this file.108 ! 109 ! Parameter av can assume values 0 (non-averaged data) and 1 (time averaged110 ! data)95 !> In case of extend = .FALSE.: 96 !> Define all necessary dimensions, axes and variables for the different 97 !> netCDF datasets. This subroutine is called from check_open after a new 98 !> dataset is created. It leaves the open netCDF files ready to write. 99 !> 100 !> In case of extend = .TRUE.: 101 !> Find out if dimensions and variables of an existing file match the values 102 !> of the actual run. If so, get all necessary information (ids, etc.) from 103 !> this file. 104 !> 105 !> Parameter av can assume values 0 (non-averaged data) and 1 (time averaged 106 !> data) 111 107 !------------------------------------------------------------------------------! 108 #if defined( __ibmy_special ) 109 @PROCESS NOOPTimize 110 #endif 111 SUBROUTINE define_netcdf_header( callmode, extend, av ) 112 112 113 #if defined( __netcdf ) 113 114 … … 164 165 IMPLICIT NONE 165 166 166 CHARACTER (LEN=2) :: suffix ! :167 CHARACTER (LEN=2), INTENT (IN) :: callmode ! :168 CHARACTER (LEN=3) :: suffix1 ! :169 CHARACTER (LEN=4) :: grid_x ! :170 CHARACTER (LEN=4) :: grid_y ! :171 CHARACTER (LEN=4) :: grid_z ! :172 CHARACTER (LEN=6) :: mode ! :173 CHARACTER (LEN=10) :: netcdf_var_name ! :174 CHARACTER (LEN=10) :: precision ! :175 CHARACTER (LEN=10) :: var ! :176 CHARACTER (LEN=80) :: time_average_text ! :177 CHARACTER (LEN=2000) :: char_cross_profiles ! :178 CHARACTER (LEN=2000) :: var_list ! :179 CHARACTER (LEN=2000) :: var_list_old ! :180 181 CHARACTER (LEN=100), DIMENSION(1:crmax) :: cross_profiles_adj ! :182 CHARACTER (LEN=100), DIMENSION(1:crmax) :: cross_profiles_char ! :183 184 INTEGER(iwp) :: av ! :185 INTEGER(iwp) :: cross_profiles_count ! :186 INTEGER(iwp) :: cross_profiles_maxi ! :187 INTEGER(iwp) :: delim ! :188 INTEGER(iwp) :: delim_old ! :189 INTEGER(iwp) :: file_id ! :190 INTEGER(iwp) :: i ! :191 INTEGER(iwp) :: id_last ! :192 INTEGER(iwp) :: id_x ! :193 INTEGER(iwp) :: id_y ! :194 INTEGER(iwp) :: id_z ! :195 INTEGER(iwp) :: j ! :196 INTEGER(iwp) :: k ! :197 INTEGER(iwp) :: kk ! :198 INTEGER(iwp) :: ns ! :199 INTEGER(iwp) :: ns_do ! :actual value of ns for soil model data200 INTEGER(iwp) :: ns_old ! :201 INTEGER(iwp) :: ntime_count ! :202 INTEGER(iwp) :: nz_old ! :203 204 INTEGER(iwp), SAVE :: oldmode ! :205 206 INTEGER(iwp), DIMENSION(1) :: id_dim_time_old ! :207 INTEGER(iwp), DIMENSION(1) :: id_dim_x_yz_old ! :208 INTEGER(iwp), DIMENSION(1) :: id_dim_y_xz_old ! :209 INTEGER(iwp), DIMENSION(1) :: id_dim_zu_sp_old ! :210 INTEGER(iwp), DIMENSION(1) :: id_dim_zu_xy_old ! :211 INTEGER(iwp), DIMENSION(1) :: id_dim_zu_3d_old ! :212 INTEGER(iwp), DIMENSION(1) :: id_dim_zu_mask_old ! :213 214 215 INTEGER(iwp), DIMENSION(1:crmax) :: cross_profiles_numb ! :216 217 LOGICAL :: found ! :218 219 LOGICAL, INTENT (INOUT) :: extend ! :220 221 LOGICAL, SAVE :: init_netcdf = .FALSE. ! :222 223 REAL(wp), DIMENSION(1) :: last_time_coordinate ! :224 225 REAL(wp), DIMENSION(:), ALLOCATABLE :: netcdf_data ! :226 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: netcdf_data_2d ! :167 CHARACTER (LEN=2) :: suffix !< 168 CHARACTER (LEN=2), INTENT (IN) :: callmode !< 169 CHARACTER (LEN=3) :: suffix1 !< 170 CHARACTER (LEN=4) :: grid_x !< 171 CHARACTER (LEN=4) :: grid_y !< 172 CHARACTER (LEN=4) :: grid_z !< 173 CHARACTER (LEN=6) :: mode !< 174 CHARACTER (LEN=10) :: netcdf_var_name !< 175 CHARACTER (LEN=10) :: precision !< 176 CHARACTER (LEN=10) :: var !< 177 CHARACTER (LEN=80) :: time_average_text !< 178 CHARACTER (LEN=2000) :: char_cross_profiles !< 179 CHARACTER (LEN=2000) :: var_list !< 180 CHARACTER (LEN=2000) :: var_list_old !< 181 182 CHARACTER (LEN=100), DIMENSION(1:crmax) :: cross_profiles_adj !< 183 CHARACTER (LEN=100), DIMENSION(1:crmax) :: cross_profiles_char !< 184 185 INTEGER(iwp) :: av !< 186 INTEGER(iwp) :: cross_profiles_count !< 187 INTEGER(iwp) :: cross_profiles_maxi !< 188 INTEGER(iwp) :: delim !< 189 INTEGER(iwp) :: delim_old !< 190 INTEGER(iwp) :: file_id !< 191 INTEGER(iwp) :: i !< 192 INTEGER(iwp) :: id_last !< 193 INTEGER(iwp) :: id_x !< 194 INTEGER(iwp) :: id_y !< 195 INTEGER(iwp) :: id_z !< 196 INTEGER(iwp) :: j !< 197 INTEGER(iwp) :: k !< 198 INTEGER(iwp) :: kk !< 199 INTEGER(iwp) :: ns !< 200 INTEGER(iwp) :: ns_do !< actual value of ns for soil model data 201 INTEGER(iwp) :: ns_old !< 202 INTEGER(iwp) :: ntime_count !< 203 INTEGER(iwp) :: nz_old !< 204 205 INTEGER(iwp), SAVE :: oldmode !< 206 207 INTEGER(iwp), DIMENSION(1) :: id_dim_time_old !< 208 INTEGER(iwp), DIMENSION(1) :: id_dim_x_yz_old !< 209 INTEGER(iwp), DIMENSION(1) :: id_dim_y_xz_old !< 210 INTEGER(iwp), DIMENSION(1) :: id_dim_zu_sp_old !< 211 INTEGER(iwp), DIMENSION(1) :: id_dim_zu_xy_old !< 212 INTEGER(iwp), DIMENSION(1) :: id_dim_zu_3d_old !< 213 INTEGER(iwp), DIMENSION(1) :: id_dim_zu_mask_old !< 214 215 216 INTEGER(iwp), DIMENSION(1:crmax) :: cross_profiles_numb !< 217 218 LOGICAL :: found !< 219 220 LOGICAL, INTENT (INOUT) :: extend !< 221 222 LOGICAL, SAVE :: init_netcdf = .FALSE. !< 223 224 REAL(wp), DIMENSION(1) :: last_time_coordinate !< 225 226 REAL(wp), DIMENSION(:), ALLOCATABLE :: netcdf_data !< 227 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: netcdf_data_2d !< 227 228 228 229 ! … … 5055 5056 5056 5057 5057 SUBROUTINE create_netcdf_file( filename , id, parallel, errno )5058 #if defined( __netcdf )5059 5060 5058 !------------------------------------------------------------------------------! 5061 5059 ! Description: 5062 5060 ! ------------ 5063 ! Creates a netCDF file and give back the id. The parallel flag has to be TRUE5064 ! for parallel netCDF output support.5061 !> Creates a netCDF file and give back the id. The parallel flag has to be TRUE 5062 !> for parallel netCDF output support. 5065 5063 !------------------------------------------------------------------------------! 5064 5065 SUBROUTINE create_netcdf_file( filename , id, parallel, errno ) 5066 #if defined( __netcdf ) 5067 5066 5068 5067 5069 USE control_parameters … … 5133 5135 5134 5136 5135 SUBROUTINE open_write_netcdf_file( filename, id, parallel, errno )5136 #if defined( __netcdf )5137 5138 5137 !------------------------------------------------------------------------------! 5139 5138 ! Description: 5140 5139 ! ------------ 5141 ! Opens an existing netCDF file for writing and gives back the id.5142 ! The parallel flag has to be TRUE for parallel netCDF output support.5140 !> Opens an existing netCDF file for writing and gives back the id. 5141 !> The parallel flag has to be TRUE for parallel netCDF output support. 5143 5142 !------------------------------------------------------------------------------! 5143 5144 SUBROUTINE open_write_netcdf_file( filename, id, parallel, errno ) 5145 #if defined( __netcdf ) 5146 5144 5147 5145 5148 USE control_parameters, & … … 5176 5179 5177 5180 5178 SUBROUTINE handle_netcdf_error( routine_name, errno )5179 #if defined( __netcdf )5180 5181 5181 !------------------------------------------------------------------------------! 5182 5182 ! Description: 5183 5183 ! ------------ 5184 ! Prints out a text message corresponding to the current status.5184 !> Prints out a text message corresponding to the current status. 5185 5185 !------------------------------------------------------------------------------! 5186 5187 SUBROUTINE handle_netcdf_error( routine_name, errno ) 5188 #if defined( __netcdf ) 5189 5186 5190 5187 5191 USE control_parameters, &
Note: See TracChangeset
for help on using the changeset viewer.