Changeset 4406 for palm/trunk/SOURCE


Ignore:
Timestamp:
Feb 13, 2020 8:06:29 PM (4 years ago)
Author:
knoop
Message:

Bugix: removed oro_rel wrong loop bounds and removed unnecessary restart method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/virtual_measurement_mod.f90

    r4400 r4406  
    2525! -----------------
    2626! $Id$
     27! Bugix: removed oro_rel wrong loop bounds and removed unnecessary restart method
     28!
     29! 4400 2020-02-10 20:32:41Z suehring
    2730! Revision of the module:
    2831! - revised input from NetCDF setup file
     
    142145    USE control_parameters,                                                    &
    143146        ONLY:  air_chemistry,                                                  &
    144                child_domain,                                                   &
    145147               coupling_char,                                                  &
    146148               dz,                                                             &
     
    153155               surface_pressure,                                               &
    154156               time_since_reference_point,                                     &
    155                virtual_measurement,                                            &
    156                write_binary
     157               virtual_measurement
    157158
    158159    USE cpulog,                                                                &
     
    346347    INTEGER(iwp) ::  maximum_name_length = 32 !< maximum name length of station names
    347348    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 file
    349349    INTEGER(iwp) ::  off_pr = 1               !< number neighboring grid points (in each direction) where virtual profile
    350350                                              !< measurements shall be taken, in addition to the given coordinates in the driver
     
    455455       CALL message( 'vm_check_parameters', 'PA0705', 1, 2, 0, 6, 0 )
    456456    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'
    465460       CALL message( 'check_parameters', 'PA0706', 1, 2, 0, 6, 0 )
    466461    ENDIF
     
    14501445!-- Determine the number of output timesteps. Set a maximum value of 80000
    14511446!-- timesteps.
    1452     ntimesteps = MIN( CEILING(                                                 &
     1447    ntimesteps = CEILING(                                                      &
    14531448                  ( end_time - MAX( vm_time_start, time_since_reference_point )&
    1454                   ) / MAX( 0.1_wp, dt_virtual_measurement ) ), ntimesteps_max )
     1449                  ) / dt_virtual_measurement )
    14551450!
    14561451!-- Create directory where output files will be stored.
     
    22692264    INTEGER(iwp)       ::  t_ind         !< time index
    22702265
    2271     LOGICAL            ::  proceed_run   !< flag to indicate that the maximum number of
    2272                                          !< timesteps in the file will be exceeded
    2273 
    22742266    REAL(wp), DIMENSION(:), ALLOCATABLE           ::  oro_rel                  !< relative altitude of model surface
    22752267    REAL(wp), DIMENSION(:), POINTER               ::  output_values_1d_pointer !< pointer for 1d output array
     
    23912383!--          and add this to z.
    23922384             ALLOCATE( oro_rel(1:vmea(l)%ns_soil) )
    2393              DO  n = 1, vmea(l)%ns
     2385             DO  n = 1, vmea(l)%ns_soil
    23942386                oro_rel(n) = zw(topo_top_ind(vmea(l)%j_soil(n),vmea(l)%i_soil(n),3))
    23952387             ENDDO
     
    24972489
    24982490    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
    25272492
    25282493  END SUBROUTINE vm_data_output
Note: See TracChangeset for help on using the changeset viewer.