source: palm/trunk/SOURCE/check_for_restart.f90 @ 529

Last change on this file since 529 was 392, checked in by raasch, 15 years ago

New:
---

Adapted for machine lck
(mrun, mbuild, subjob)

bc_lr/bc_ns in most subroutines replaced by LOGICAL variables bc_lr_cyc,
bc_ns_cyc for speed optimization
(check_parameters, diffusion_u, diffusion_v, diffusion_w, modules)

Additional timestep criterion in case of simulations with plant canopy (timestep)

Check for illegal entries in section_xy|xz|yz that exceed nz+1|ny+1|nx+1
(check_parameters)

Clipping of dvrp output implemented. Default colourtable for particles
implemented, particle attributes (color, dvrp_size) can be set with new
parameters particle_color, particle_dvrpsize, color_interval,
dvrpsize_interval (init_dvrp, data_output_dvrp, modules, user_data_output_dvrp).
Slicer attributes (dvrp) are set with new routine set_slicer_attributes_dvrp
and are controlled with existing parameters slicer_range_limits.
(set_slicer_attributes_dvrp)

Ocean atmosphere coupling allows to use independent precursor runs in order
to account for different spin-up times. The time when coupling has to be
started is given by new inipar parameter coupling_start_time. The precursor
ocean run has to be started using new mrun option "-y" in order to add
appendix "_O" to all output files.
(check_for_restart, check_parameters, data_output_2d, data_output_3d,
data_output_profiles, data_output_ptseries, data_output_spectra,
data_output_tseries, header, init_coupling, modules, mrun,
parin, read_var_list, surface_coupler, time_integration, write_var_list)

Polygon reduction for topography and ground plate isosurface. Reduction level
for buildings can be chosen with parameter cluster_size. (init_dvrp)

External pressure gradient (check_parameters, header, init_3d_model, modules,
parin, prognostic_equations, read_var_list, write_var_list)

New topography case 'single_street_canyon' (header, init_grid, modules, parin,
read_var_list, user_check_parameters, user_header, user_init_grid, write_var_list)

Option to predefine a target bulk velocity for conserve_volume_flow
(check_parameters, header, init_3d_model, modules, parin, read_var_list,
write_var_list)

Option for user defined 2D data output in xy cross sections at z=nzb+1
(data_output_2d, user_data_output_2d)

xy cross section output of surface heatfluxes (latent, sensible)
(average_3d_data, check_parameters, data_output_2d, modules, read_3d_binary,
sum_up_3d_data, write_3d_binary)

average_3d_data, check_for_restart, check_parameters, data_output_2d, data_output_3d, data_output_dvrp, data_output_profiles, data_output_ptseries, data_output_spectra, data_output_tseries, init_coupling, init_dvrp, init_grid, init_3d_model, header, mbuild, modules, mrun, package_parin, parin, prognostic_equations, read_3d_binary, read_var_list, subjob, surface_coupler, timestep, time_integration, user_check_parameters, user_data_output_2d, user_data_output_dvrp, user_header, user_init_grid, write_3d_binary, write_var_list

New: set_particle_attributes, set_slicer_attributes_dvrp

Changed:


lcmuk changed to lc to avoid problems with Intel compiler on sgi-ice
(poisfft)

For extended NetCDF files, the updated title attribute includes an update of
time_average_text where appropriate. (netcdf)

In case of restart runs without extension, initial profiles are not written
to NetCDF-file anymore. (data_output_profiles, modules, read_var_list, write_var_list)

Small change in formatting of the message handling routine concering the output in the
job protocoll. (message)

initializing_actions='read_data_for_recycling' renamed to 'cyclic_fill', now
independent of turbulent_inflow (check_parameters, header, init_3d_model)

2 NetCDF error numbers changed. (data_output_3d)

A Link to the website appendix_a.html is printed for further information
about the possible errors. (message)

Temperature gradient criterion for estimating the boundary layer height
replaced by the gradient criterion of Sullivan et al. (1998). (flow_statistics)

NetCDF unit attribute in timeseries output in case of statistic regions added
(netcdf)

Output of NetCDF messages with aid of message handling routine.
(check_open, close_file, data_output_2d, data_output_3d,
data_output_profiles, data_output_ptseries, data_output_spectra,
data_output_tseries, netcdf, output_particles_netcdf)

Output of messages replaced by message handling routine.
(advec_particles, advec_s_bc, buoyancy, calc_spectra, check_for_restart,
check_open, coriolis, cpu_log, data_output_2d, data_output_3d, data_output_dvrp,
data_output_profiles, data_output_spectra, fft_xy, flow_statistics, header,
init_1d_model, init_3d_model, init_dvrp, init_grid, init_particles, init_pegrid,
netcdf, parin, plant_canopy_model, poisfft_hybrid, poismg, read_3d_binary,
read_var_list, surface_coupler, temperton_fft, timestep, user_actions,
user_data_output_dvrp, user_dvrp_coltab, user_init_grid, user_init_plant_canopy,
user_parin, user_read_restart_data, user_spectra )

Maximum number of tails is calculated from maximum number of particles and
skip_particles_for_tail (init_particles)

Value of vertical_particle_advection may differ for each particle group
(advec_particles, header, modules)

First constant in array den also defined as type double. (eqn_state_seawater)

Parameter dvrp_psize moved from particles_par to dvrp_graphics_par. (package_parin)

topography_grid_convention moved from userpar to inipar (check_parameters,
header, parin, read_var_list, user_check_parameters, user_header,
user_init_grid, user_parin, write_var_list)

Default value of grid_matching changed to strict.

Adjustments for runs on lcxt4 (necessary due to an software update on CRAY) and
for coupled runs on ibmy (mrun, subjob)

advec_particles, advec_s_bc, buoyancy, calc_spectra, check_for_restart, check_open, check_parameters, close_file, coriolis, cpu_log, data_output_2d, data_output_3d, data_output_dvrp, data_output_profiles, data_output_ptseries, data_output_spectra, data_output_tseries, eqn_state_seawater, fft_xy, flow_statistics, header, init_1d_model, init_3d_model, init_dvrp, init_grid, init_particles, init_pegrid, message, mrun, netcdf, output_particles_netcdf, package_parin, parin, plant_canopy_model, poisfft, poisfft_hybrid, poismg, read_3d_binary, read_var_list, sort_particles, subjob, user_check_parameters, user_header, user_init_grid, user_parin, surface_coupler, temperton_fft, timestep, user_actions, user_data_output_dvrp, user_dvrp_coltab, user_init_grid, user_init_plant_canopy, user_parin, user_read_restart_data, user_spectra, write_var_list

Errors:


Bugfix: Initial hydrostatic pressure profile in case of ocean runs is now
calculated in 5 iteration steps. (init_ocean)

Bugfix: wrong sign in buoyancy production of ocean part in case of not using
the reference density (only in 3D routine production_e) (production_e)

Bugfix: output of averaged 2d/3d quantities requires that an avaraging
interval has been set, respective error message is included (check_parameters)

Bugfix: Output on unit 14 only if requested by write_binary.
(user_last_actions)

Bugfix to avoid zero division by km_neutral (production_e)

Bugfix for extended NetCDF files: In order to avoid 'data mode' errors if
updated attributes are larger than their original size, NF90_PUT_ATT is called
in 'define mode' enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a
possible performance loss; an alternative strategy would be to ensure equal
attribute size in a job chain. (netcdf)

Bugfix: correction of initial volume flow for non-flat topography (init_3d_model)
Bugfix: zero initialization of arrays within buildings for 'cyclic_fill' (init_3d_model)

Bugfix: to_be_resorted => s_av for time-averaged scalars (data_output_2d, data_output_3d)

Bugfix: error in formatting the output (message)

Bugfix: avoid that ngp_2dh_s_inner becomes zero (init_3_model)

Typographical error: unit of wpt in dots_unit (modules)

Bugfix: error in check, if particles moved further than one subdomain length.
This check must not be applied for newly released particles. (advec_particles)

Bugfix: several tail counters are initialized, particle_tail_coordinates is
only written to file if its third index is > 0, arrays for tails are allocated
with a minimum size of 10 tails if there is no tail initially (init_particles,
advec_particles)

Bugfix: pressure included for profile output (check_parameters)

Bugfix: Type of count and count_rate changed to default INTEGER on NEC machines
(cpu_log)

Bugfix: output if particle time series only if particle advection is switched
on. (time_integration)

Bugfix: qsws was calculated in case of constant heatflux = .FALSE. (prandtl_fluxes)

Bugfix: averaging along z is not allowed for 2d quantities (e.g. u* and z0) (data_output_2d)

Typographical errors (netcdf)

If the inversion height calculated by the prerun is zero, inflow_damping_height
must be explicitly specified (init_3d_model)

Small bugfix concerning 3d 64bit netcdf output format (header)

Bugfix: dt_fixed removed from the restart file, because otherwise, no change
from a fixed to a variable timestep would be possible in restart runs.
(read_var_list, write_var_list)

Bugfix: initial setting of time_coupling in coupled restart runs (time_integration)

advec_particles, check_parameters, cpu_log, data_output_2d, data_output_3d, header, init_3d_model, init_particles, init_ocean, modules, netcdf, prandtl_fluxes, production_e, read_var_list, time_integration, user_last_actions, write_var_list

  • Property svn:keywords set to Id
File size: 5.4 KB
RevLine 
[1]1 SUBROUTINE check_for_restart
2
3!------------------------------------------------------------------------------!
[247]4! Current revisions:
[1]5! -----------------
[392]6!
[1]7!
8! Former revisions:
9! -----------------
[3]10! $Id: check_for_restart.f90 392 2009-09-24 10:39:14Z heinze $
[110]11!
[392]12! 291 2009-04-16 12:07:26Z raasch
13! Coupling with independent precursor runs.
14! Output of messages replaced by message handling routine
15!
[226]16! 222 2009-01-12 16:04:16Z letzel
17! Implementation of an MPI-1 coupling: replaced myid with target_id
18! Bugfix for nonparallel execution
19!
[110]20! 108 2007-08-24 15:10:38Z letzel
21! modifications to terminate coupled runs
22!
[3]23! RCS Log replace by Id keyword, revision history cleaned up
24!
[1]25! Revision 1.11  2007/02/11 12:55:13  raasch
26! Informative output to the job protocol
27!
28! Revision 1.1  1998/03/18 20:06:51  raasch
29! Initial revision
30!
31!
32! Description:
33! ------------
34! Set stop flag, if restart is neccessary because of expiring cpu-time or
35! if it is forced by user
36!------------------------------------------------------------------------------!
37
38    USE pegrid
39    USE control_parameters
40
41    IMPLICIT NONE
42
43
44    LOGICAL :: terminate_run_l
45    REAL ::  remaining_time
46
47
48!
49!-- Check remaining CPU-time
50    CALL local_tremain( remaining_time )
51
52!
53!-- If necessary set a flag to stop the model run
54    terminate_run_l = .FALSE.
55    IF ( remaining_time <= termination_time_needed  .AND. &
56         write_binary(1:4) == 'true' )  THEN
57
58       terminate_run_l = .TRUE.
59    ENDIF
60
61#if defined( __parallel )
62!
63!-- Make a logical OR for all processes. Stop the model run if at least
64!-- one processor has reached the time limit.
65    CALL MPI_ALLREDUCE( terminate_run_l, terminate_run, 1, MPI_LOGICAL, &
66                        MPI_LOR, comm2d, ierr )
67#else
68    terminate_run = terminate_run_l
69#endif
70
71!
72!-- Output that job will be terminated
73    IF ( terminate_run  .AND.  myid == 0 )  THEN
[274]74       WRITE( message_string, * ) 'run will be terminated because it is ', &
75                       'running out of job cpu limit & ',                  &
76                       'remaining time:         ', remaining_time, ' s',   &
77                       'termination time needed:', termination_time_needed, ' s'
[247]78       CALL message( 'check_for_restart', 'PA0163', 0, 1, 0, 6, 0 )
[1]79    ENDIF
80
81!
[108]82!-- In case of coupled runs inform the remote model of the termination
83!-- and its reason, provided the remote model has not already been
84!-- informed of another termination reason (terminate_coupled > 0) before,
85!-- or vice versa (terminate_coupled_remote > 0).
[110]86    IF ( terminate_run .AND. TRIM( coupling_mode ) /= 'uncoupled'  .AND. &
87         terminate_coupled == 0  .AND.  terminate_coupled_remote == 0 )  THEN
88
[108]89       terminate_coupled = 3
[222]90#if defined( __parallel )
[206]91       CALL MPI_SENDRECV( terminate_coupled,        1, MPI_INTEGER,          &
92                          target_id, 0,                                      &
93                          terminate_coupled_remote, 1, MPI_INTEGER,          &
94                          target_id, 0,                                      &
[110]95                          comm_inter, status, ierr )
[222]96#endif
[108]97    ENDIF
98
99!
[1]100!-- Set the stop flag also, if restart is forced by user
[291]101    IF ( time_restart /= 9999999.9  .AND.  &
102         time_restart < time_since_reference_point )  THEN
103
[1]104!
105!--    Restart is not neccessary, if the end time of the run (given by
106!--    the user) has been reached
107       IF ( simulated_time < end_time )  THEN
108          terminate_run = .TRUE.
109!
110!--       Increment restart time, if forced by user, otherwise set restart
111!--       time to default (no user restart)
112          IF ( dt_restart /= 9999999.9 )  THEN
113             time_restart = time_restart + dt_restart
114          ELSE
115             time_restart = 9999999.9
116          ENDIF
117
[247]118          WRITE( message_string, * ) 'run will be terminated due to user ', &
[274]119                                  'settings of',                            &
120                                  '&restart_time / dt_restart',             &
121                                  '&new restart time is: ', time_restart, ' s' 
122          CALL message( 'check_for_restart', 'PA0164', 0, 0, 0, 6, 0 )
[247]123 
[108]124!
125!--       In case of coupled runs inform the remote model of the termination
126!--       and its reason, provided the remote model has not already been
127!--       informed of another termination reason (terminate_coupled > 0) before,
128!--       or vice versa (terminate_coupled_remote > 0).
[206]129          IF ( coupling_mode /= 'uncoupled' .AND. terminate_coupled == 0  &
130               .AND.  terminate_coupled_remote == 0 )  THEN
[110]131
[108]132             IF ( dt_restart /= 9999999.9 )  THEN
133                terminate_coupled = 4
134             ELSE
135                terminate_coupled = 5
136             ENDIF
[222]137#if defined( __parallel )
[206]138             CALL MPI_SENDRECV( terminate_coupled,        1, MPI_INTEGER,    &
139                                target_id,  0,                               &
140                                terminate_coupled_remote, 1, MPI_INTEGER,    &
141                                target_id,  0,                               &
142                                comm_inter, status, ierr )
[222]143#endif
[108]144          ENDIF
145       ELSE
[1]146          time_restart = 9999999.9
147       ENDIF
148    ENDIF
149
150!
151!-- If the run is stopped, set a flag file which is necessary to initiate
152!-- the start of a continuation run
153    IF ( terminate_run  .AND.  myid == 0 )  THEN
154
155       OPEN ( 90, FILE='CONTINUE_RUN', FORM='FORMATTED' )
156       WRITE ( 90, '(A)' )  TRIM( run_description_header )
157       CLOSE ( 90 )
158
159    ENDIF
160
161
162 END SUBROUTINE check_for_restart
Note: See TracBrowser for help on using the repository browser.