Changeset 4406 for palm/trunk/SOURCE
- Timestamp:
- Feb 13, 2020 8:06:29 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/virtual_measurement_mod.f90
r4400 r4406 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Bugix: removed oro_rel wrong loop bounds and removed unnecessary restart method 28 ! 29 ! 4400 2020-02-10 20:32:41Z suehring 27 30 ! Revision of the module: 28 31 ! - revised input from NetCDF setup file … … 142 145 USE control_parameters, & 143 146 ONLY: air_chemistry, & 144 child_domain, &145 147 coupling_char, & 146 148 dz, & … … 153 155 surface_pressure, & 154 156 time_since_reference_point, & 155 virtual_measurement, & 156 write_binary 157 virtual_measurement 157 158 158 159 USE cpulog, & … … 346 347 INTEGER(iwp) :: maximum_name_length = 32 !< maximum name length of station names 347 348 INTEGER(iwp) :: ntimesteps !< number of timesteps defined in NetCDF output file 348 INTEGER(iwp) :: ntimesteps_max = 80000 !< number of maximum timesteps defined in NetCDF output file349 349 INTEGER(iwp) :: off_pr = 1 !< number neighboring grid points (in each direction) where virtual profile 350 350 !< measurements shall be taken, in addition to the given coordinates in the driver … … 455 455 CALL message( 'vm_check_parameters', 'PA0705', 1, 2, 0, 6, 0 ) 456 456 ENDIF 457 ! 458 !-- Check if restart activation string is set. Virtual measurements may exceed 459 !-- the maximum number of allowed timesteps in a NetCDF file. In order to handle 460 !-- this, the module will trigger a programm abortion with writing the restart 461 !-- data. 462 IF ( .NOT. write_binary ) THEN 463 message_string = 'virtual measurements require file activation ' // & 464 'string "restart"' 457 458 IF ( dt_virtual_measurement <= 0.0 ) THEN 459 message_string = 'dt_virtual_measurement must be > 0.0' 465 460 CALL message( 'check_parameters', 'PA0706', 1, 2, 0, 6, 0 ) 466 461 ENDIF … … 1450 1445 !-- Determine the number of output timesteps. Set a maximum value of 80000 1451 1446 !-- timesteps. 1452 ntimesteps = MIN( CEILING(&1447 ntimesteps = CEILING( & 1453 1448 ( end_time - MAX( vm_time_start, time_since_reference_point )& 1454 ) / MAX( 0.1_wp, dt_virtual_measurement ) ), ntimesteps_max)1449 ) / dt_virtual_measurement ) 1455 1450 ! 1456 1451 !-- Create directory where output files will be stored. … … 2269 2264 INTEGER(iwp) :: t_ind !< time index 2270 2265 2271 LOGICAL :: proceed_run !< flag to indicate that the maximum number of2272 !< timesteps in the file will be exceeded2273 2274 2266 REAL(wp), DIMENSION(:), ALLOCATABLE :: oro_rel !< relative altitude of model surface 2275 2267 REAL(wp), DIMENSION(:), POINTER :: output_values_1d_pointer !< pointer for 1d output array … … 2391 2383 !-- and add this to z. 2392 2384 ALLOCATE( oro_rel(1:vmea(l)%ns_soil) ) 2393 DO n = 1, vmea(l)%ns 2385 DO n = 1, vmea(l)%ns_soil 2394 2386 oro_rel(n) = zw(topo_top_ind(vmea(l)%j_soil(n),vmea(l)%i_soil(n),3)) 2395 2387 ENDDO … … 2497 2489 2498 2490 ENDDO ! loop over sites 2499 ! 2500 !-- Check if the time index exceeds its maximum values. This case, terminate the 2501 !-- run and force a restart. This is simply done by creating the file 2502 !-- DO_RESTART_NOW. 2503 proceed_run = .TRUE. 2504 IF ( ANY( vmea(:)%file_time_index >= ntimesteps - 1) ) proceed_run = .FALSE. 2505 2506 #if defined( __parallel ) 2507 CALL MPI_ALLREDUCE( MPI_IN_PLACE, & 2508 proceed_run, & 2509 1, & 2510 MPI_LOGICAL, & 2511 MPI_LAND, & 2512 MPI_COMM_WORLD, & 2513 ierr ) 2514 #endif 2515 ! 2516 !-- Create file DO_RESTART_NOW to force a restart. This file is only created 2517 !-- by rank 0 of the root domain. 2518 IF ( myid == 0 .AND. .NOT. child_domain .AND. .NOT. proceed_run ) THEN 2519 OPEN( 999, FILE='DO_RESTART_NOW' ) 2520 CLOSE( 999 ) 2521 2522 message_string = 'Run will be terminated because virtual ' // & 2523 'measurement times index exceeds its maximum value ' //& 2524 'in the output files. A restart run is forced.' 2525 CALL message( 'vm_data_output', 'PA0707', 0, 0, 0, 6, 0 ) 2526 ENDIF 2491 2527 2492 2528 2493 END SUBROUTINE vm_data_output
Note: See TracChangeset
for help on using the changeset viewer.