source: palm/trunk/SOURCE/surface_coupler.f90 @ 430

Last change on this file since 430 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: 7.0 KB
RevLine 
[102]1 SUBROUTINE surface_coupler
2
3!------------------------------------------------------------------------------!
[258]4! Current revisions:
[102]5! -----------------
[392]6!
[102]7!
8! Former revisions:
9! ------------------
10! $Id: surface_coupler.f90 392 2009-09-24 10:39:14Z raasch $
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! 206 2008-10-13 14:59:11Z raasch
17! Implementation of a MPI-1 Coupling: replaced myid with target_id,
18! deleted __mpi2 directives
19!
[110]20! 109 2007-08-28 15:26:47Z letzel
[102]21! Initial revision
22!
23! Description:
24! ------------
25! Data exchange at the interface between coupled models
26!------------------------------------------------------------------------------!
27
28    USE arrays_3d
29    USE control_parameters
30    USE cpulog
31    USE grid_variables
32    USE indices
33    USE interfaces
34    USE pegrid
35
36    IMPLICIT NONE
37
[108]38    INTEGER ::  i, j, k
[102]39
[291]40    REAL    ::  time_since_reference_point_rem
[102]41
[206]42#if defined( __parallel )
[102]43
[206]44       CALL cpu_log( log_point(39), 'surface_coupler', 'start' )
[102]45
46!
[108]47!-- In case of model termination initiated by the remote model
48!-- (terminate_coupled_remote > 0), initiate termination of the local model.
49!-- The rest of the coupler must then be skipped because it would cause an MPI
50!-- intercomminucation hang.
51!-- If necessary, the coupler will be called at the beginning of the next
52!-- restart run.
[206]53    CALL MPI_SENDRECV( terminate_coupled,        1, MPI_INTEGER, target_id,  &
54                       0, &
55                       terminate_coupled_remote, 1, MPI_INTEGER, target_id,  &
56                       0, comm_inter, status, ierr )
[108]57    IF ( terminate_coupled_remote > 0 )  THEN
[274]58       WRITE( message_string, * ) 'remote model "',                         &
59                                  TRIM( coupling_mode_remote ),             &
60                                  '" terminated',                           &
61                                  '&with terminate_coupled_remote = ',      &
62                                  terminate_coupled_remote,                 &
63                                  '&local model  "', TRIM( coupling_mode ), &
64                                  '" has',                                  &
65                                  '&terminate_coupled = ',                  &
[258]66                                  terminate_coupled
67       CALL message( 'surface_coupler', 'PA0310', 1, 2, 0, 6, 0 )
[108]68       RETURN
69    ENDIF
[291]70
[108]71!
72!-- Exchange the current simulated time between the models,
[102]73!-- currently just for testing
[291]74    CALL MPI_SEND( time_since_reference_point, 1, MPI_REAL, target_id, 11, &
[206]75                   comm_inter, ierr )
[291]76    CALL MPI_RECV( time_since_reference_point_rem, 1, MPI_REAL, target_id, 11, &
[102]77                   comm_inter, status, ierr )
[291]78    WRITE ( 9, * ) 'simulated time: ', simulated_time
79    WRITE ( 9, * ) 'time since start of coupling: ', &
80                   time_since_reference_point, ' remote: ', &
81                   time_since_reference_point_rem
[102]82    CALL local_flush( 9 )
83
84!
85!-- Exchange the interface data
86    IF ( coupling_mode == 'atmosphere_to_ocean' )  THEN
87
88!
89!--    Send heat flux at bottom surface to the ocean model
90       WRITE ( 9, * )  '*** send shf to ocean'
91       CALL local_flush( 9 )
[206]92       CALL MPI_SEND( shf(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 12, &
[102]93                      comm_inter, ierr )
94
95!
[108]96!--    Send humidity flux at bottom surface to the ocean model
97       IF ( humidity )  THEN
98          WRITE ( 9, * )  '*** send qsws to ocean'
99          CALL local_flush( 9 )
[206]100          CALL MPI_SEND( qsws(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 13, &
[108]101               comm_inter, ierr )
102       ENDIF
103
104!
[102]105!--    Receive temperature at the bottom surface from the ocean model
106       WRITE ( 9, * )  '*** receive pt from ocean'
107       CALL local_flush( 9 )
[206]108       CALL MPI_RECV( pt(0,nys-1,nxl-1), 1, type_xy, target_id, 14, &
109                      comm_inter, status, ierr )
[102]110
111!
112!--    Send the momentum flux (u) at bottom surface to the ocean model
113       WRITE ( 9, * )  '*** send usws to ocean'
114       CALL local_flush( 9 )
[206]115       CALL MPI_SEND( usws(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 15, &
[102]116                      comm_inter, ierr )
117
118!
119!--    Send the momentum flux (v) at bottom surface to the ocean model
120       WRITE ( 9, * )  '*** send vsws to ocean'
121       CALL local_flush( 9 )
[206]122       CALL MPI_SEND( vsws(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 16, &
[102]123                      comm_inter, ierr )
124
125    ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
126
127!
128!--    Receive heat flux at the sea surface (top) from the atmosphere model
129       WRITE ( 9, * )  '*** receive tswst from atmosphere'
130       CALL local_flush( 9 )
[206]131       CALL MPI_RECV( tswst(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 12, &
[102]132                      comm_inter, status, ierr )
133
134!
[108]135!--    Receive humidity flux from the atmosphere model (bottom)
136!--    and add it to the heat flux at the sea surface (top)...
137       IF ( humidity_remote )  THEN
138          WRITE ( 9, * )  '*** receive qswst_remote from atmosphere'
139          CALL local_flush( 9 )
[206]140          CALL MPI_RECV( qswst_remote(nys-1,nxl-1), ngp_xy, MPI_REAL, &
141                         target_id, 13, comm_inter, status, ierr )
[108]142
[109]143          !here tswst is still the sum of atmospheric bottom heat fluxes
144          tswst = tswst + qswst_remote * 2.2626108e6 / 1005.0
145          !*latent heat of vaporization in m2/s2, or 540 cal/g, or 40.65 kJ/mol
146          !/(rho_atm(=1.0)*c_p)
[108]147!
148!--    ...and convert it to a salinity flux at the sea surface (top)
149!--       following Steinhorn (1991), JPO 21, pp. 1681-1683:
150!--       S'w' = -S * evaporation / ( rho_water * ( 1 - S ) )
151          saswst = -1.0 * sa(nzt,:,:) * qswst_remote /  &
152               ( rho(nzt,:,:) * ( 1.0 - sa(nzt,:,:) ) )
153       ENDIF
154
155!
[102]156!--    Adjust the kinematic heat flux with respect to ocean density
157!--    (constants are the specific heat capacities for air and water)
[109]158       !now tswst is the ocean top heat flux
[108]159       tswst = tswst / rho(nzt,:,:) * 1005.0 / 4218.0
[102]160
161!
162!--    Send sea surface temperature to the atmosphere model
163       WRITE ( 9, * )  '*** send pt to atmosphere'
164       CALL local_flush( 9 )
[206]165       CALL MPI_SEND( pt(nzt,nys-1,nxl-1), 1, type_xy, target_id, 14, &
166                      comm_inter, ierr )
[102]167
168!
169!--    Receive momentum flux (u) at the sea surface (top) from the atmosphere
170!--    model
171       WRITE ( 9, * )  '*** receive uswst from atmosphere'
172       CALL local_flush( 9 )
[206]173       CALL MPI_RECV( uswst(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 15, &
[102]174                      comm_inter, status, ierr )
175
176!
177!--    Receive momentum flux (v) at the sea surface (top) from the atmosphere
178!--    model
179       WRITE ( 9, * )  '*** receive vswst from atmosphere'
180       CALL local_flush( 9 )
[206]181       CALL MPI_RECV( vswst(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 16, &
[102]182                      comm_inter, status, ierr )
183
184!
185!--    Adjust the momentum fluxes with respect to ocean density
[108]186       uswst = uswst / rho(nzt,:,:)
187       vswst = vswst / rho(nzt,:,:)
[102]188
189    ENDIF
190
191    CALL cpu_log( log_point(39), 'surface_coupler', 'stop' )
192
193#endif
194
195 END SUBROUTINE surface_coupler
Note: See TracBrowser for help on using the repository browser.