Changeset 564 for palm/trunk
- Timestamp:
- Sep 30, 2010 1:18:59 PM (14 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/check_open.f90
r520 r564 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! start number of mask output files changed to 201, netcdf message identifiers 7 ! of masked output changed 7 8 ! 8 9 ! Former revisions: … … 139 140 ENDIF 140 141 141 CASE ( 101:103, 106, 111:113, 116, 121:160)142 CASE ( 101:103, 106, 111:113, 116, 201:200+2*max_masks ) 142 143 143 144 IF ( netcdf_data_format < 3 ) THEN … … 1366 1367 ENDIF 1367 1368 1368 CASE ( 121:160)1369 CASE ( 201:200+2*max_masks ) 1369 1370 ! 1370 1371 !-- Set filename depending on unit number 1371 IF ( file_id <= 140) THEN1372 mid = file_id - 1201372 IF ( file_id <= 200+max_masks ) THEN 1373 mid = file_id - 200 1373 1374 WRITE ( mask_char,'(I2.2)') mid 1374 1375 filename = 'DATA_MASK_' // mask_char // '_NETCDF' // coupling_char 1375 1376 av = 0 1376 1377 ELSE 1377 mid = file_id - 1401378 mid = file_id - (200+max_masks) 1378 1379 WRITE ( mask_char,'(I2.2)') mid 1379 1380 filename = 'DATA_MASK_' // mask_char // '_AV_NETCDF' // & … … 1396 1397 nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_mask(mid,av) ) 1397 1398 #endif 1398 CALL handle_netcdf_error( 'check_open', 9998)1399 CALL handle_netcdf_error( 'check_open', 456 ) 1399 1400 ! 1400 1401 !-- Read header information and set all ids. If there is a mismatch … … 1407 1408 IF ( .NOT. netcdf_extend ) THEN 1408 1409 nc_stat = NF90_CLOSE( id_set_mask(mid,av) ) 1409 CALL handle_netcdf_error( 'check_open', 9998)1410 CALL handle_netcdf_error( 'check_open', 457 ) 1410 1411 CALL local_system('rm ' // TRIM( filename ) ) 1411 1412 ENDIF … … 1450 1451 ENDIF 1451 1452 1452 CALL handle_netcdf_error( 'check_open', 9998 )1453 CALL handle_netcdf_error( 'check_open', 458 ) 1453 1454 ! 1454 1455 !-- Define the header … … 1460 1461 #else 1461 1462 1462 CASE ( 101:109, 111:113, 116, 121:160)1463 CASE ( 101:109, 111:113, 116, 201:200+2*max_masks ) 1463 1464 1464 1465 ! -
palm/trunk/SOURCE/check_parameters.f90
r554 r564 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! palm message identifiers of masked output changed, 20 replaced by max_masks 7 7 ! 8 8 ! Former revisions: … … 1505 1505 IF ( dt_do3d == 9999999.9 ) dt_do3d = dt_data_output 1506 1506 IF ( dt_data_output_av == 9999999.9 ) dt_data_output_av = dt_data_output 1507 DO mid = 1, 201507 DO mid = 1, max_masks 1508 1508 IF ( dt_domask(mid) == 9999999.9 ) dt_domask(mid) = dt_data_output 1509 1509 ENDDO … … 1526 1526 IF ( skip_time_data_output_av == 9999999.9 ) & 1527 1527 skip_time_data_output_av = skip_time_data_output 1528 DO mid = 1, 201528 DO mid = 1, max_masks 1529 1529 IF ( skip_time_domask(mid) == 9999999.9 ) & 1530 1530 skip_time_domask(mid) = skip_time_data_output … … 2692 2692 WRITE( message_string, * ) 'illegal value: masks must be >= 0 and ', & 2693 2693 '<= ', max_masks, ' (=max_masks)' 2694 CALL message( 'check_parameters', 'PA 9998', 1, 2, 0, 6, 0 )2694 CALL message( 'check_parameters', 'PA0325', 1, 2, 0, 6, 0 ) 2695 2695 ENDIF 2696 2696 IF ( masks > 0 ) THEN … … 2702 2702 'illegal value: mask_scale_x, mask_scale_y and mask_scale_z', & 2703 2703 'must be > 0.0' 2704 CALL message( 'check_parameters', 'PA 9998', 1, 2, 0, 6, 0 )2704 CALL message( 'check_parameters', 'PA0326', 1, 2, 0, 6, 0 ) 2705 2705 ENDIF 2706 2706 ! -
palm/trunk/SOURCE/close_file.f90
r494 r564 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! start number of mask output files changed to 201, netcdf message identifiers 7 ! of masked output changed 7 8 ! 8 9 ! Former revisions: … … 100 101 ! 101 102 !-- Close all open unit numbers 102 DO fid = 1, 160103 DO fid = 1, 200+2*max_masks 103 104 104 105 IF ( openfile(fid)%opened .OR. openfile(fid)%opened_before ) THEN … … 509 510 ENDIF 510 511 511 CASE ( 121:160)512 CASE ( 201:200+2*max_masks ) 512 513 513 514 IF ( netcdf_output .AND. & … … 515 516 ! 516 517 !-- decompose fid into mid and av 517 IF ( fid <= 140) THEN518 mid = fid - 120518 IF ( fid <= 200+max_masks ) THEN 519 mid = fid - 200 519 520 av = 0 520 521 ELSE 521 mid = fid - 140522 mid = fid - (200+max_masks) 522 523 av = 1 523 524 ENDIF 524 525 nc_stat = NF90_CLOSE( id_set_mask(mid,av) ) 525 CALL handle_netcdf_error( 'close_file', 9998)526 CALL handle_netcdf_error( 'close_file', 459 ) 526 527 527 528 ENDIF -
palm/trunk/SOURCE/data_output_mask.f90
r494 r564 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! start number of mask output files changed to 201, netcdf message identifiers 7 ! of masked output changed, palm message identifiers of masked output changed 7 8 ! 8 9 ! Former revisions: … … 60 61 IF ( netcdf_output .AND. ( myid == 0 .OR. netcdf_data_format > 2 ) ) & 61 62 THEN 62 CALL check_open( 120+mid+av*max_masks )63 CALL check_open( 200+mid+av*max_masks ) 63 64 ENDIF 64 65 … … 82 83 start = (/ domask_time_count(mid,av) /), & 83 84 count = (/ 1 /) ) 84 CALL handle_netcdf_error( 'data_output_mask', 9998)85 CALL handle_netcdf_error( 'data_output_mask', 460 ) 85 86 ENDIF 86 87 … … 300 301 WRITE ( message_string, * ) 'no output available for: ', & 301 302 TRIM( domask(mid,av,if) ) 302 CALL message( 'data_output_mask', 'PA 9998', 0, 0, 0, 6, 0 )303 CALL message( 'data_output_mask', 'PA0327', 0, 0, 0, 6, 0 ) 303 304 ENDIF 304 305 … … 339 340 count = (/ mask_size_l(mid,1), mask_size_l(mid,2), & 340 341 mask_size_l(mid,3), 1 /) ) 341 CALL handle_netcdf_error( 'data_output_mask', 9998)342 CALL handle_netcdf_error( 'data_output_mask', 461 ) 342 343 ELSE 343 344 #endif … … 386 387 count = (/ mask_size(mid,1), mask_size(mid,2), & 387 388 mask_size(mid,3), 1 /) ) 388 CALL handle_netcdf_error( 'data_output_mask', 9998)389 CALL handle_netcdf_error( 'data_output_mask', 462 ) 389 390 390 391 ELSE … … 431 432 count = (/ mask_size_l(mid,1), mask_size_l(mid,2), & 432 433 mask_size_l(mid,3), 1 /) ) 433 CALL handle_netcdf_error( 'data_output_mask', 9998)434 CALL handle_netcdf_error( 'data_output_mask', 463 ) 434 435 #endif 435 436 -
palm/trunk/SOURCE/init_masks.f90
r558 r564 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! assignment of mask_xyz_loop added, palm message identifiers of masked output 7 ! changed 7 8 ! 8 9 ! Former revisions: … … 64 65 '3 (NetCDF 4) and 4 (NetCDF 4 Classic model)'// & 65 66 '&are currently not supported (not yet tested).' 66 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )67 CALL message( 'init_masks', 'PA0328', 1, 2, 0, 6, 0 ) 67 68 ENDIF 68 69 … … 70 71 !-- Store data output parameters for masked data output in few shared arrays 71 72 DO mid = 1, masks 73 72 74 do_mask (mid,:) = data_output_masks(mid,:) 73 75 do_mask_user(mid,:) = data_output_masks_user(mid,:) … … 75 77 mask (mid,2,:) = mask_y(mid,:) 76 78 mask (mid,3,:) = mask_z(mid,:) 77 mask_loop (mid,1,:) = mask_x_loop(mid,:) 78 mask_loop (mid,2,:) = mask_y_loop(mid,:) 79 mask_loop (mid,3,:) = mask_z_loop(mid,:) 79 80 IF ( mask_x_loop(mid,1) == -1.0 .AND. mask_x_loop(mid,2) == -1.0 & 81 .AND. mask_x_loop(mid,3) == -1.0 ) THEN 82 mask_loop(mid,1,1:2) = -1.0 83 mask_loop(mid,1,3) = 0.0 84 ELSE 85 mask_loop(mid,1,:) = mask_x_loop(mid,:) 86 ENDIF 87 IF ( mask_y_loop(mid,1) == -1.0 .AND. mask_y_loop(mid,2) == -1.0 & 88 .AND. mask_y_loop(mid,3) == -1.0 ) THEN 89 mask_loop(mid,2,1:2) = -1.0 90 mask_loop(mid,2,3) = 0.0 91 ELSE 92 mask_loop(mid,2,:) = mask_y_loop(mid,:) 93 ENDIF 94 IF ( mask_z_loop(mid,1) == -1.0 .AND. mask_z_loop(mid,2) == -1.0 & 95 .AND. mask_z_loop(mid,3) == -1.0 ) THEN 96 mask_loop(mid,3,1:2) = -1.0 97 mask_loop(mid,3,3) = 0.0 98 ELSE 99 mask_loop(mid,3,:) = mask_z_loop(mid,:) 100 ENDIF 101 80 102 ENDDO 81 103 … … 107 129 'given by data_output_mask and data_output_mask_user ', & 108 130 'exceeds the limit of 100' 109 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )131 CALL message( 'init_masks', 'PA0329', 1, 2, 0, 6, 0 ) 110 132 ENDIF 111 133 do_mask(mid,i) = do_mask_user(mid,j) … … 138 160 WRITE ( message_string, * ) 'output of "', TRIM( var ), & 139 161 '" requires constant_diffusion = .FALSE.' 140 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )162 CALL message( 'init_masks', 'PA0103', 1, 2, 0, 6, 0 ) 141 163 ENDIF 142 164 unit = 'm2/s2' … … 147 169 '" requires a "particles_par"-NAMELIST in the ', & 148 170 'parameter file (PARIN)' 149 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )171 CALL message( 'init_masks', 'PA0104', 1, 2, 0, 6, 0 ) 150 172 ENDIF 151 173 IF ( TRIM( var ) == 'pc' ) unit = 'number' … … 156 178 WRITE ( message_string, * ) 'output of "', TRIM( var ), & 157 179 '" requires humidity = .TRUE.' 158 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )180 CALL message( 'init_masks', 'PA0105', 1, 2, 0, 6, 0 ) 159 181 ENDIF 160 182 IF ( TRIM( var ) == 'q' ) unit = 'kg/kg' … … 166 188 '" requires cloud_physics = .TRUE. or cloud_droplets', & 167 189 ' = .TRUE.' 168 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )190 CALL message( 'init_masks', 'PA0108', 1, 2, 0, 6, 0 ) 169 191 ENDIF 170 192 unit = 'kg/kg' … … 174 196 WRITE ( message_string, * ) 'output of "', TRIM( var ), & 175 197 '" requires cloud_droplets = .TRUE.' 176 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )198 CALL message( 'init_masks', 'PA0107', 1, 2, 0, 6, 0 ) 177 199 ENDIF 178 200 IF ( TRIM( var ) == 'ql_c' ) unit = 'kg/kg' … … 184 206 WRITE ( message_string, * ) 'output of "', TRIM( var ), & 185 207 '" requires cloud_physics = .TRUE.' 186 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )208 CALL message( 'init_masks', 'PA0108', 1, 2, 0, 6, 0 ) 187 209 ENDIF 188 210 unit = 'kg/kg' … … 192 214 WRITE ( message_string, * ) 'output of "', TRIM( var ), & 193 215 '" requires ocean = .TRUE.' 194 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )216 CALL message( 'init_masks', 'PA0109', 1, 2, 0, 6, 0 ) 195 217 ENDIF 196 218 unit = 'kg/m3' … … 200 222 WRITE ( message_string, * ) 'output of "', TRIM( var ), & 201 223 '" requires passive_scalar = .TRUE.' 202 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )224 CALL message( 'init_masks', 'PA0110', 1, 2, 0, 6, 0 ) 203 225 ENDIF 204 226 unit = 'conc' … … 208 230 WRITE ( message_string, * ) 'output of "', TRIM( var ), & 209 231 '" requires ocean = .TRUE.' 210 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )232 CALL message( 'init_masks', 'PA0109', 1, 2, 0, 6, 0 ) 211 233 ENDIF 212 234 unit = 'psu' … … 216 238 'output: "', TRIM( var ), '" is only allowed', & 217 239 'for horizontal cross section' 218 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )240 CALL message( 'init_masks', 'PA0111', 1, 2, 0, 6, 0 ) 219 241 ! IF ( TRIM( var ) == 'lwp*' .AND. .NOT. cloud_physics ) THEN 220 242 ! WRITE ( message_string, * ) 'output of "', TRIM( var ), & 221 243 ! '" requires cloud_physics = .TRUE.' 222 ! CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )244 ! CALL message( 'init_masks', 'PA0108', 1, 2, 0, 6, 0 ) 223 245 ! ENDIF 224 246 ! IF ( TRIM( var ) == 'pra*' .AND. .NOT. precipitation ) THEN 225 247 ! WRITE ( message_string, * ) 'output of "', TRIM( var ), & 226 248 ! '" requires precipitation = .TRUE.' 227 ! CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )249 ! CALL message( 'init_masks', 'PA0112', 1, 2, 0, 6, 0 ) 228 250 ! ENDIF 229 251 ! IF ( TRIM( var ) == 'pra*' .AND. j == 1 ) THEN … … 231 253 ! ' precipitation amount "', TRIM( var ), & 232 254 ! '" not possible' 233 ! CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )255 ! CALL message( 'init_masks', 'PA0113', 1, 2, 0, 6, 0 ) 234 256 ! ENDIF 235 257 ! IF ( TRIM( var ) == 'prr*' .AND. .NOT. precipitation ) THEN 236 258 ! WRITE ( message_string, * ) 'output of "', TRIM( var ), & 237 259 ! '" requires precipitation = .TRUE.' 238 ! CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )260 ! CALL message( 'init_masks', 'PA0112', 1, 2, 0, 6, 0 ) 239 261 ! ENDIF 240 262 ! … … 262 284 'output or data_output_user: "', & 263 285 TRIM( do_mask(mid,i) ), '"' 264 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )286 CALL message( 'init_masks', 'PA0114', 1, 2, 0, 6, 0 ) 265 287 ELSE 266 288 WRITE ( message_string, * ) 'illegal value for data_',& 267 289 'output: "', TRIM( do_mask(mid,i) ), '"' 268 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )290 CALL message( 'init_masks', 'PA0330', 1, 2, 0, 6, 0 ) 269 291 ENDIF 270 292 ENDIF … … 451 473 m,' in mask ',mid,' along dimension ',dim, & 452 474 ' exceeds ',nxyz_string,' = ',nxyz 453 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )475 CALL message( 'init_masks', 'PA0331', 1, 2, 0, 6, 0 ) 454 476 ENDIF 455 477 IF ( m >= lb .AND. m <= ub ) THEN … … 490 512 nxyz_string,'*',dxyz_string,'/mask_scale(',dim,')=', & 491 513 nxyz*dxyz/mask_scale(dim) 492 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )514 CALL message( 'init_masks', 'PA0332', 1, 2, 0, 6, 0 ) 493 515 ENDIF 494 516 loop_begin = NINT( mask_loop(mid,dim,1) * mask_scale(dim) * ddxyz ) … … 507 529 mask_loop(mid,dim,2),'&exceed zw(nz)/mask_scale(',dim, & 508 530 ')=',zw(nz)/mask_scale(dim) 509 CALL message( 'init_masks', 'PA 9998', 1, 2, 0, 6, 0 )531 CALL message( 'init_masks', 'PA0333', 1, 2, 0, 6, 0 ) 510 532 ENDIF 511 533 ind_array = & … … 530 552 'match the desired heights&within the stretching ', & 531 553 'region. Recommendation: use mask instead of mask_loop.' 532 CALL message( 'init_masks', 'PA 9998', 0, 1, 0, 6, 0 )554 CALL message( 'init_masks', 'PA0334', 0, 1, 0, 6, 0 ) 533 555 ENDIF 534 556 -
palm/trunk/SOURCE/modules.f90
r559 r564 5 5 ! Current revisions: 6 6 ! ----------------- 7 ! 7 ! nc_precision and netcdf_precision dimension changed to 11, all default 8 ! values of mask_xyz_loop changed to -1.0, dimension of openfile changed to 9 ! 200+2*max_masks, max_masks changed to 50 8 10 ! 9 11 ! Former revisions: … … 303 305 LOGICAL :: opened, opened_before 304 306 END TYPE file_status 305 306 TYPE(file_status), DIMENSION(200) :: openfile = file_status(.FALSE.,.FALSE.)307 308 309 INTEGER, PARAMETER :: mask_xyz_dimension = 100, max_masks = 20307 308 INTEGER, PARAMETER :: mask_xyz_dimension = 100, max_masks = 50 309 310 TYPE(file_status), DIMENSION(200+2*max_masks) :: & 311 openfile = file_status(.FALSE.,.FALSE.) 310 312 311 313 CHARACTER (LEN=1) :: cycle_mg = 'w', timestep_reason = ' ' … … 354 356 CHARACTER (LEN=10), DIMENSION(300) :: data_output_pr = ' ' 355 357 CHARACTER (LEN=10), DIMENSION(200) :: data_output_pr_user = ' ' 356 CHARACTER (LEN=20), DIMENSION( 50) :: netcdf_precision = ' '358 CHARACTER (LEN=20), DIMENSION(11) :: netcdf_precision = ' ' 357 359 358 360 CHARACTER (LEN=10), DIMENSION(max_masks,0:1,100) :: domask = ' ' … … 549 551 REAL, DIMENSION(:), ALLOCATABLE :: dp_smooth_factor 550 552 551 REAL, DIMENSION(max_masks,mask_xyz_dimension) :: 553 REAL, DIMENSION(max_masks,mask_xyz_dimension) :: & 552 554 mask_x = -1.0, mask_y = -1.0, mask_z = -1.0 553 REAL, DIMENSION(max_masks,3) :: & 554 mask_x_loop = (/ -1.0, -1.0, -1.0, -1.0, -1.0, & 555 -1.0, -1.0, -1.0, -1.0, -1.0, & 556 -1.0, -1.0, -1.0, -1.0, -1.0, & 557 -1.0, -1.0, -1.0, -1.0, -1.0, & 558 -1.0, -1.0, -1.0, -1.0, -1.0, & 559 -1.0, -1.0, -1.0, -1.0, -1.0, & 560 -1.0, -1.0, -1.0, -1.0, -1.0, & 561 -1.0, -1.0, -1.0, -1.0, -1.0, & 562 0.0, 0.0, 0.0, 0.0, 0.0, & 563 0.0, 0.0, 0.0, 0.0, 0.0, & 564 0.0, 0.0, 0.0, 0.0, 0.0, & 565 0.0, 0.0, 0.0, 0.0, 0.0 /), & 566 567 mask_y_loop = (/ -1.0, -1.0, -1.0, -1.0, -1.0, & 568 -1.0, -1.0, -1.0, -1.0, -1.0, & 569 -1.0, -1.0, -1.0, -1.0, -1.0, & 570 -1.0, -1.0, -1.0, -1.0, -1.0, & 571 -1.0, -1.0, -1.0, -1.0, -1.0, & 572 -1.0, -1.0, -1.0, -1.0, -1.0, & 573 -1.0, -1.0, -1.0, -1.0, -1.0, & 574 -1.0, -1.0, -1.0, -1.0, -1.0, & 575 0.0, 0.0, 0.0, 0.0, 0.0, & 576 0.0, 0.0, 0.0, 0.0, 0.0, & 577 0.0, 0.0, 0.0, 0.0, 0.0, & 578 0.0, 0.0, 0.0, 0.0, 0.0 /), & 579 580 mask_z_loop = (/ -1.0, -1.0, -1.0, -1.0, -1.0, & 581 -1.0, -1.0, -1.0, -1.0, -1.0, & 582 -1.0, -1.0, -1.0, -1.0, -1.0, & 583 -1.0, -1.0, -1.0, -1.0, -1.0, & 584 -1.0, -1.0, -1.0, -1.0, -1.0, & 585 -1.0, -1.0, -1.0, -1.0, -1.0, & 586 -1.0, -1.0, -1.0, -1.0, -1.0, & 587 -1.0, -1.0, -1.0, -1.0, -1.0, & 588 0.0, 0.0, 0.0, 0.0, 0.0, & 589 0.0, 0.0, 0.0, 0.0, 0.0, & 590 0.0, 0.0, 0.0, 0.0, 0.0, & 591 0.0, 0.0, 0.0, 0.0, 0.0 /) 555 REAL, DIMENSION(max_masks,3) :: & 556 mask_x_loop = -1.0, mask_y_loop = -1.0, mask_z_loop = -1.0 592 557 593 558 ! … … 1026 991 INTEGER, DIMENSION(10) :: id_var_dospx, id_var_dospy 1027 992 INTEGER, DIMENSION(20) :: id_var_prt 1028 INTEGER, DIMENSION( 50) :: nc_precision993 INTEGER, DIMENSION(11) :: nc_precision 1029 994 INTEGER, DIMENSION(dopr_norm_num) :: id_var_norm_dopr 1030 995 -
palm/trunk/SOURCE/netcdf.f90
r520 r564 7 7 ! Current revisions: 8 8 ! ------------------ 9 ! 9 ! nc_precision changed from 40 masks to 1 mask, start number of mask output 10 ! files changed to 201, netcdf message identifiers of masked output changed 10 11 ! 11 12 ! Former revisions: … … 176 177 nc_precision(8) = j 177 178 CASE ( 'masks' ) 178 nc_precision(11:50) = j179 CASE ( 'mask01' )180 179 nc_precision(11) = j 181 CASE ( 'mask02' )182 nc_precision(12) = j183 CASE ( 'mask03' )184 nc_precision(13) = j185 CASE ( 'mask04' )186 nc_precision(14) = j187 CASE ( 'mask05' )188 nc_precision(15) = j189 CASE ( 'mask06' )190 nc_precision(16) = j191 CASE ( 'mask07' )192 nc_precision(17) = j193 CASE ( 'mask08' )194 nc_precision(18) = j195 CASE ( 'mask09' )196 nc_precision(19) = j197 CASE ( 'mask10' )198 nc_precision(20) = j199 CASE ( 'mask11' )200 nc_precision(21) = j201 CASE ( 'mask12' )202 nc_precision(22) = j203 CASE ( 'mask13' )204 nc_precision(23) = j205 CASE ( 'mask14' )206 nc_precision(24) = j207 CASE ( 'mask15' )208 nc_precision(25) = j209 CASE ( 'mask16' )210 nc_precision(26) = j211 CASE ( 'mask17' )212 nc_precision(27) = j213 CASE ( 'mask18' )214 nc_precision(28) = j215 CASE ( 'mask19' )216 nc_precision(29) = j217 CASE ( 'mask20' )218 nc_precision(30) = j219 CASE ( 'maskav01' )220 nc_precision(31) = j221 CASE ( 'maskav02' )222 nc_precision(32) = j223 CASE ( 'maskav03' )224 nc_precision(33) = j225 CASE ( 'maskav04' )226 nc_precision(34) = j227 CASE ( 'maskav05' )228 nc_precision(35) = j229 CASE ( 'maskav06' )230 nc_precision(36) = j231 CASE ( 'maskav07' )232 nc_precision(37) = j233 CASE ( 'maskav08' )234 nc_precision(38) = j235 CASE ( 'maskav09' )236 nc_precision(39) = j237 CASE ( 'maskav10' )238 nc_precision(40) = j239 CASE ( 'maskav11' )240 nc_precision(41) = j241 CASE ( 'maskav12' )242 nc_precision(42) = j243 CASE ( 'maskav13' )244 nc_precision(43) = j245 CASE ( 'maskav14' )246 nc_precision(44) = j247 CASE ( 'maskav15' )248 nc_precision(45) = j249 CASE ( 'maskav16' )250 nc_precision(46) = j251 CASE ( 'maskav17' )252 nc_precision(47) = j253 CASE ( 'maskav18' )254 nc_precision(48) = j255 CASE ( 'maskav19' )256 nc_precision(49) = j257 CASE ( 'maskav20' )258 nc_precision(50) = j259 180 CASE ( 'all' ) 260 181 nc_precision = j … … 297 218 !-- mid and av 298 219 file_id = av 299 IF ( file_id <= 140) THEN300 mid = file_id - 120220 IF ( file_id <= 200+max_masks ) THEN 221 mid = file_id - 200 301 222 av = 0 302 223 ELSE 303 mid = file_id - 140224 mid = file_id - (200+max_masks) 304 225 av = 1 305 226 ENDIF … … 309 230 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, & 310 231 'Conventions', 'COARDS' ) 311 CALL handle_netcdf_error( 'netcdf', 9998)232 CALL handle_netcdf_error( 'netcdf', 464 ) 312 233 313 234 IF ( av == 0 ) THEN … … 320 241 TRIM( run_description_header ) // & 321 242 TRIM( time_average_text ) ) 322 CALL handle_netcdf_error( 'netcdf', 9998)243 CALL handle_netcdf_error( 'netcdf', 465 ) 323 244 IF ( av == 1 ) THEN 324 245 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval 325 246 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, & 326 247 'time_avg', TRIM( time_average_text ) ) 327 CALL handle_netcdf_error( 'netcdf', 9998)248 CALL handle_netcdf_error( 'netcdf', 466 ) 328 249 ENDIF 329 250 … … 332 253 nc_stat = NF90_DEF_DIM( id_set_mask(mid,av), 'time', NF90_UNLIMITED, & 333 254 id_dim_time_mask(mid,av) ) 334 CALL handle_netcdf_error( 'netcdf', 9998)255 CALL handle_netcdf_error( 'netcdf', 467 ) 335 256 336 257 nc_stat = NF90_DEF_VAR( id_set_mask(mid,av), 'time', NF90_DOUBLE, & 337 258 id_dim_time_mask(mid,av), & 338 259 id_var_time_mask(mid,av) ) 339 CALL handle_netcdf_error( 'netcdf', 9998 )260 CALL handle_netcdf_error( 'netcdf', 468 ) 340 261 341 262 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), & 342 263 id_var_time_mask(mid,av), 'units', & 343 264 'seconds') 344 CALL handle_netcdf_error( 'netcdf', 9998)265 CALL handle_netcdf_error( 'netcdf', 469 ) 345 266 346 267 ! … … 349 270 nc_stat = NF90_DEF_DIM( id_set_mask(mid,av), 'zu_3d', & 350 271 mask_size(mid,3), id_dim_zu_mask(mid,av) ) 351 CALL handle_netcdf_error( 'netcdf', 9998)272 CALL handle_netcdf_error( 'netcdf', 470 ) 352 273 353 274 nc_stat = NF90_DEF_VAR( id_set_mask(mid,av), 'zu_3d', NF90_DOUBLE, & 354 275 id_dim_zu_mask(mid,av), & 355 276 id_var_zu_mask(mid,av) ) 356 CALL handle_netcdf_error( 'netcdf', 9998)277 CALL handle_netcdf_error( 'netcdf', 471 ) 357 278 358 279 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), id_var_zu_mask(mid,av), & 359 280 'units', 'meters' ) 360 CALL handle_netcdf_error( 'netcdf', 9998)281 CALL handle_netcdf_error( 'netcdf', 472 ) 361 282 362 283 ! … … 364 285 nc_stat = NF90_DEF_DIM( id_set_mask(mid,av), 'zw_3d', & 365 286 mask_size(mid,3), id_dim_zw_mask(mid,av) ) 366 CALL handle_netcdf_error( 'netcdf', 9998)287 CALL handle_netcdf_error( 'netcdf', 473 ) 367 288 368 289 nc_stat = NF90_DEF_VAR( id_set_mask(mid,av), 'zw_3d', NF90_DOUBLE, & 369 290 id_dim_zw_mask(mid,av), & 370 291 id_var_zw_mask(mid,av) ) 371 CALL handle_netcdf_error( 'netcdf', 9998)292 CALL handle_netcdf_error( 'netcdf', 474 ) 372 293 373 294 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), id_var_zw_mask(mid,av), & 374 295 'units', 'meters' ) 375 CALL handle_netcdf_error( 'netcdf', 9998)296 CALL handle_netcdf_error( 'netcdf', 475 ) 376 297 377 298 ! … … 379 300 nc_stat = NF90_DEF_DIM( id_set_mask(mid,av), 'x', & 380 301 mask_size(mid,1), id_dim_x_mask(mid,av) ) 381 CALL handle_netcdf_error( 'netcdf', 9998)302 CALL handle_netcdf_error( 'netcdf', 476 ) 382 303 383 304 nc_stat = NF90_DEF_VAR( id_set_mask(mid,av), 'x', NF90_DOUBLE, & 384 305 id_dim_x_mask(mid,av), id_var_x_mask(mid,av) ) 385 CALL handle_netcdf_error( 'netcdf', 9998)306 CALL handle_netcdf_error( 'netcdf', 477 ) 386 307 387 308 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), id_var_x_mask(mid,av), & 388 309 'units', 'meters' ) 389 CALL handle_netcdf_error( 'netcdf', 9998 )310 CALL handle_netcdf_error( 'netcdf', 478 ) 390 311 391 312 ! … … 393 314 nc_stat = NF90_DEF_DIM( id_set_mask(mid,av), 'xu', & 394 315 mask_size(mid,1), id_dim_xu_mask(mid,av) ) 395 CALL handle_netcdf_error( 'netcdf', 9998)316 CALL handle_netcdf_error( 'netcdf', 479 ) 396 317 397 318 nc_stat = NF90_DEF_VAR( id_set_mask(mid,av), 'xu', NF90_DOUBLE, & 398 319 id_dim_xu_mask(mid,av), & 399 320 id_var_xu_mask(mid,av) ) 400 CALL handle_netcdf_error( 'netcdf', 9998)321 CALL handle_netcdf_error( 'netcdf', 480 ) 401 322 402 323 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), id_var_xu_mask(mid,av), & 403 324 'units', 'meters' ) 404 CALL handle_netcdf_error( 'netcdf', 9998)325 CALL handle_netcdf_error( 'netcdf', 481 ) 405 326 406 327 ! … … 408 329 nc_stat = NF90_DEF_DIM( id_set_mask(mid,av), 'y', & 409 330 mask_size(mid,2), id_dim_y_mask(mid,av) ) 410 CALL handle_netcdf_error( 'netcdf', 9998)331 CALL handle_netcdf_error( 'netcdf', 482 ) 411 332 412 333 nc_stat = NF90_DEF_VAR( id_set_mask(mid,av), 'y', NF90_DOUBLE, & 413 334 id_dim_y_mask(mid,av), id_var_y_mask(mid,av) ) 414 CALL handle_netcdf_error( 'netcdf', 9998)335 CALL handle_netcdf_error( 'netcdf', 483 ) 415 336 416 337 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), id_var_y_mask(mid,av), & 417 338 'units', 'meters' ) 418 CALL handle_netcdf_error( 'netcdf', 9998)339 CALL handle_netcdf_error( 'netcdf', 484 ) 419 340 420 341 ! … … 422 343 nc_stat = NF90_DEF_DIM( id_set_mask(mid,av), 'yv', & 423 344 mask_size(mid,2), id_dim_yv_mask(mid,av) ) 424 CALL handle_netcdf_error( 'netcdf', 9998)345 CALL handle_netcdf_error( 'netcdf', 485 ) 425 346 426 347 nc_stat = NF90_DEF_VAR( id_set_mask(mid,av), 'yv', NF90_DOUBLE, & 427 348 id_dim_yv_mask(mid,av), & 428 349 id_var_yv_mask(mid,av) ) 429 CALL handle_netcdf_error( 'netcdf', 9998)350 CALL handle_netcdf_error( 'netcdf', 486 ) 430 351 431 352 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), id_var_yv_mask(mid,av), & 432 353 'units', 'meters' ) 433 CALL handle_netcdf_error( 'netcdf', 9998)354 CALL handle_netcdf_error( 'netcdf', 487 ) 434 355 435 356 ! … … 443 364 id_dim_y_mask(mid,av) /), & 444 365 id_var_zusi_mask(mid,av) ) 445 CALL handle_netcdf_error( 'netcdf', 9998 )366 CALL handle_netcdf_error( 'netcdf', 488 ) 446 367 447 368 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), & 448 369 id_var_zusi_mask(mid,av), & 449 370 'units', 'meters' ) 450 CALL handle_netcdf_error( 'netcdf', 9998)371 CALL handle_netcdf_error( 'netcdf', 489 ) 451 372 452 373 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), & 453 374 id_var_zusi_mask(mid,av), & 454 375 'long_name', 'zu(nzb_s_inner)' ) 455 CALL handle_netcdf_error( 'netcdf', 9998)376 CALL handle_netcdf_error( 'netcdf', 490 ) 456 377 457 378 ! … … 461 382 id_dim_y_mask(mid,av) /), & 462 383 id_var_zwwi_mask(mid,av) ) 463 CALL handle_netcdf_error( 'netcdf', 9998)384 CALL handle_netcdf_error( 'netcdf', 491 ) 464 385 465 386 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), & 466 387 id_var_zwwi_mask(mid,av), & 467 388 'units', 'meters' ) 468 CALL handle_netcdf_error( 'netcdf', 9998)389 CALL handle_netcdf_error( 'netcdf', 492 ) 469 390 470 391 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), & 471 392 id_var_zwwi_mask(mid,av), & 472 393 'long_name', 'zw(nzb_w_inner)' ) 473 CALL handle_netcdf_error( 'netcdf', 9998)394 CALL handle_netcdf_error( 'netcdf', 493 ) 474 395 475 396 ENDIF … … 548 469 !-- Define the grid 549 470 nc_stat = NF90_DEF_VAR( id_set_mask(mid,av), domask(mid,av,i), & 550 nc_precision(1 0+mid+av*20), &471 nc_precision(11), & 551 472 (/ id_x, id_y, id_z, & 552 473 id_dim_time_mask(mid,av) /), & … … 556 477 WRITE ( message_string, * ) 'no grid defined for', & 557 478 ' variable ', TRIM( domask(mid,av,i) ) 558 CALL message( 'define_netcdf_header', 'PA 9998', 0, 1, 0, 6, 0 )479 CALL message( 'define_netcdf_header', 'PA0244', 0, 1, 0, 6, 0 ) 559 480 ENDIF 560 481 561 482 var_list = TRIM( var_list ) // TRIM( domask(mid,av,i) ) // ';' 562 483 563 CALL handle_netcdf_error( 'netcdf', 9998)484 CALL handle_netcdf_error( 'netcdf', 494 ) 564 485 ! 565 486 !-- Store the 'real' name of the variable (with *, for example) … … 569 490 id_var_domask(mid,av,i), & 570 491 'long_name', domask(mid,av,i) ) 571 CALL handle_netcdf_error( 'netcdf', 9998)492 CALL handle_netcdf_error( 'netcdf', 495 ) 572 493 ! 573 494 !-- Define the variable's unit … … 575 496 id_var_domask(mid,av,i), & 576 497 'units', TRIM( domask_unit(mid,av,i) ) ) 577 CALL handle_netcdf_error( 'netcdf', 9998)498 CALL handle_netcdf_error( 'netcdf', 496 ) 578 499 579 500 i = i + 1 … … 590 511 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, & 591 512 'VAR_LIST', var_list ) 592 CALL handle_netcdf_error( 'netcdf', 9998)513 CALL handle_netcdf_error( 'netcdf', 497 ) 593 514 594 515 ! 595 516 !-- Leave NetCDF define mode 596 517 nc_stat = NF90_ENDDEF( id_set_mask(mid,av) ) 597 CALL handle_netcdf_error( 'netcdf', 9998 )518 CALL handle_netcdf_error( 'netcdf', 498 ) 598 519 599 520 ! … … 606 527 netcdf_data, start = (/ 1 /), & 607 528 count = (/ mask_size(mid,1) /) ) 608 CALL handle_netcdf_error( 'netcdf', 9998)529 CALL handle_netcdf_error( 'netcdf', 499 ) 609 530 610 531 netcdf_data = mask_i_global(mid,:mask_size(mid,1)) * dx … … 613 534 netcdf_data, start = (/ 1 /), & 614 535 count = (/ mask_size(mid,1) /) ) 615 CALL handle_netcdf_error( 'netcdf', 9998)536 CALL handle_netcdf_error( 'netcdf', 500 ) 616 537 617 538 DEALLOCATE( netcdf_data ) … … 626 547 netcdf_data, start = (/ 1 /), & 627 548 count = (/ mask_size(mid,2) /)) 628 CALL handle_netcdf_error( 'netcdf', 9998)549 CALL handle_netcdf_error( 'netcdf', 501 ) 629 550 630 551 netcdf_data = mask_j_global(mid,:mask_size(mid,2)) * dy … … 633 554 netcdf_data, start = (/ 1 /), & 634 555 count = (/ mask_size(mid,2) /)) 635 CALL handle_netcdf_error( 'netcdf', 9998)556 CALL handle_netcdf_error( 'netcdf', 502 ) 636 557 637 558 DEALLOCATE( netcdf_data ) … … 646 567 netcdf_data, start = (/ 1 /), & 647 568 count = (/ mask_size(mid,3) /) ) 648 CALL handle_netcdf_error( 'netcdf', 9998)569 CALL handle_netcdf_error( 'netcdf', 503 ) 649 570 650 571 netcdf_data = zw( mask_k_global(mid,:mask_size(mid,3)) ) … … 653 574 netcdf_data, start = (/ 1 /), & 654 575 count = (/ mask_size(mid,3) /) ) 655 CALL handle_netcdf_error( 'netcdf', 9998)576 CALL handle_netcdf_error( 'netcdf', 504 ) 656 577 657 578 DEALLOCATE( netcdf_data ) … … 671 592 count = (/ mask_size(mid,1), & 672 593 mask_size(mid,2) /) ) 673 CALL handle_netcdf_error( 'netcdf', 9998)594 CALL handle_netcdf_error( 'netcdf', 505 ) 674 595 675 596 netcdf_data_2d = zw_w_inner( mask_i_global(mid,:mask_size(mid,1)),& … … 682 603 count = (/ mask_size(mid,1), & 683 604 mask_size(mid,2) /) ) 684 CALL handle_netcdf_error( 'netcdf', 9998)605 CALL handle_netcdf_error( 'netcdf', 506 ) 685 606 686 607 DEALLOCATE( netcdf_data_2d ) … … 698 619 !-- mid and av 699 620 file_id = av 700 IF ( file_id <= 140) THEN701 mid = file_id - 120621 IF ( file_id <= 200+max_masks ) THEN 622 mid = file_id - 200 702 623 av = 0 703 624 ELSE 704 mid = file_id - 140625 mid = file_id - (200+max_masks) 705 626 av = 1 706 627 ENDIF … … 713 634 nc_stat = NF90_GET_ATT( id_set_mask(mid,av), NF90_GLOBAL, 'VAR_LIST',& 714 635 var_list_old ) 715 CALL handle_netcdf_error( 'netcdf', 9998)636 CALL handle_netcdf_error( 'netcdf', 507 ) 716 637 717 638 var_list = ';' … … 733 654 '&but this file cannot be extended due to variable ', & 734 655 'mismatch.&New file is created instead.' 735 CALL message( 'define_netcdf_header', 'PA 9998', 0, 1, 0, 6, 0 )656 CALL message( 'define_netcdf_header', 'PA0335', 0, 1, 0, 6, 0 ) 736 657 extend = .FALSE. 737 658 RETURN … … 742 663 nc_stat = NF90_INQ_VARID( id_set_mask(mid,av), 'zu', & 743 664 id_var_zu_mask(mid,av) ) 744 CALL handle_netcdf_error( 'netcdf', 9998 )665 CALL handle_netcdf_error( 'netcdf', 508 ) 745 666 746 667 nc_stat = NF90_INQUIRE_VARIABLE( id_set_mask(mid,av), & 747 668 id_var_zu_mask(mid,av), & 748 669 dimids = id_dim_zu_mask_old ) 749 CALL handle_netcdf_error( 'netcdf', 9998)670 CALL handle_netcdf_error( 'netcdf', 509 ) 750 671 id_dim_zu_mask(mid,av) = id_dim_zu_mask_old(1) 751 672 … … 753 674 id_dim_zu_mask(mid,av), & 754 675 len = nz_old ) 755 CALL handle_netcdf_error( 'netcdf', 9998)676 CALL handle_netcdf_error( 'netcdf', 510 ) 756 677 757 678 IF ( mask_size(mid,3) /= nz_old ) THEN … … 761 682 ' number of&vertical grid points.', & 762 683 '&New file is created instead.' 763 CALL message( 'define_netcdf_header', 'PA 9998', 0, 1, 0, 6, 0 )684 CALL message( 'define_netcdf_header', 'PA0336', 0, 1, 0, 6, 0 ) 764 685 extend = .FALSE. 765 686 RETURN … … 773 694 nc_stat = NF90_INQ_VARID( id_set_mask(mid,av), 'time', & 774 695 id_var_time_mask(mid,av) ) 775 CALL handle_netcdf_error( 'netcdf', 9998)696 CALL handle_netcdf_error( 'netcdf', 511 ) 776 697 777 698 nc_stat = NF90_INQUIRE_VARIABLE( id_set_mask(mid,av), & 778 699 id_var_time_mask(mid,av), & 779 700 dimids = id_dim_time_old ) 780 CALL handle_netcdf_error( 'netcdf', 9998)701 CALL handle_netcdf_error( 'netcdf', 512 ) 781 702 id_dim_time_mask(mid,av) = id_dim_time_old(1) 782 703 … … 784 705 id_dim_time_mask(mid,av), & 785 706 len = domask_time_count(mid,av) ) 786 CALL handle_netcdf_error( 'netcdf', 9998)707 CALL handle_netcdf_error( 'netcdf', 513 ) 787 708 788 709 nc_stat = NF90_GET_VAR( id_set_mask(mid,av), & … … 791 712 start = (/ domask_time_count(mid,av) /), & 792 713 count = (/ 1 /) ) 793 CALL handle_netcdf_error( 'netcdf', 9998)714 CALL handle_netcdf_error( 'netcdf', 514 ) 794 715 795 716 IF ( last_time_coordinate(1) >= simulated_time ) THEN … … 799 720 'output time&is less or equal than the last output time ', & 800 721 'on this file.&New file is created instead.' 801 CALL message( 'define_netcdf_header', 'PA 9998', 0, 1, 0, 6, 0 )722 CALL message( 'define_netcdf_header', 'PA0337', 0, 1, 0, 6, 0 ) 802 723 domask_time_count(mid,av) = 0 803 724 extend = .FALSE. … … 813 734 TRIM( domask(mid,av,i) ), & 814 735 id_var_domask(mid,av,i) ) 815 CALL handle_netcdf_error( 'netcdf', 9998)736 CALL handle_netcdf_error( 'netcdf', 515 ) 816 737 i = i + 1 817 738 ENDDO … … 831 752 ENDIF 832 753 nc_stat = NF90_REDEF( id_set_mask(mid,av) ) 833 CALL handle_netcdf_error( 'netcdf', 9998)754 CALL handle_netcdf_error( 'netcdf', 516 ) 834 755 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, 'title', & 835 756 TRIM( run_description_header ) // & 836 757 TRIM( time_average_text ) ) 837 CALL handle_netcdf_error( 'netcdf', 9998)758 CALL handle_netcdf_error( 'netcdf', 517 ) 838 759 nc_stat = NF90_ENDDEF( id_set_mask(mid,av) ) 839 CALL handle_netcdf_error( 'netcdf', 9998 )760 CALL handle_netcdf_error( 'netcdf', 518 ) 840 761 WRITE ( message_string, * ) 'NetCDF file for ', TRIM( var ), & 841 762 ' data for mask', mid, ' from previous run found.', & 842 763 '&This file will be extended.' 843 CALL message( 'define_netcdf_header', 'PA 9998', 0, 0, 0, 6, 0 )764 CALL message( 'define_netcdf_header', 'PA0338', 0, 0, 0, 6, 0 ) 844 765 ! 845 766 !-- restore original parameter file_id (=formal parameter av) into av
Note: See TracChangeset
for help on using the changeset viewer.