Changeset 4466 for palm/trunk/SOURCE/time_integration.f90
- Timestamp:
- Mar 20, 2020 4:14:41 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/time_integration.f90
r4457 r4466 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Add advection fluxes to ACC copyin 28 ! 29 ! 4457 2020-03-11 14:20:43Z raasch 27 30 ! use statement for exchange horiz added 28 ! 31 ! 29 32 ! 4444 2020-03-05 15:59:50Z raasch 30 33 ! bugfix: cpp-directives for serial mode added 31 ! 34 ! 32 35 ! 4420 2020-02-24 14:13:56Z maronga 33 36 ! Added output control for wind turbine model 34 ! 37 ! 35 38 ! 4403 2020-02-12 13:08:46Z banzhafs 36 39 ! Allowing both existing and on-demand emission read modes … … 38 41 ! 4360 2020-01-07 11:25:50Z suehring 39 42 ! Bugfix, hour_call_emis uninitialized at first call of time_integration 40 ! 43 ! 41 44 ! 4346 2019-12-18 11:55:56Z motisi 42 45 ! Introduction of wall_flags_total_0, which currently sets bits based on static 43 46 ! topography information used in wall_flags_static_0 44 ! 47 ! 45 48 ! 4329 2019-12-10 15:46:36Z motisi 46 49 ! Renamed wall_flags_0 to wall_flags_static_0 47 ! 50 ! 48 51 ! 4281 2019-10-29 15:15:39Z schwenkel 49 52 ! Moved boundary conditions to module interface 50 ! 53 ! 51 54 ! 4276 2019-10-28 16:03:29Z schwenkel 52 55 ! Further modularization of lpm code components 53 ! 56 ! 54 57 ! 4275 2019-10-28 15:34:55Z schwenkel 55 58 ! Move call oft lpm to the end of intermediate timestep loop … … 60 63 ! 4227 2019-09-10 18:04:34Z gronemeier 61 64 ! implement new palm_date_time_mod 62 ! 65 ! 63 66 ! 4226 2019-09-10 17:03:24Z suehring 64 67 ! Changes in interface for the offline nesting 65 ! 68 ! 66 69 ! 4182 2019-08-22 15:20:23Z scharf 67 70 ! Corrected "Former revisions" section 68 ! 71 ! 69 72 ! 4170 2019-08-19 17:12:31Z gronemeier 70 73 ! copy diss, diss_p, tdiss_m to GPU 71 ! 74 ! 72 75 ! 4144 2019-08-06 09:11:47Z raasch 73 76 ! relational operators .EQ., .NE., etc. replaced by ==, /=, etc. 74 ! 77 ! 75 78 ! 4126 2019-07-30 11:09:11Z gronemeier 76 79 ! renamed routine to calculate uv exposure 77 ! 80 ! 78 81 ! 4111 2019-07-22 18:16:57Z suehring 79 82 ! advc_flags_1 / advc_flags_2 renamed to advc_flags_m / advc_flags_s 80 ! 83 ! 81 84 ! 4069 2019-07-01 14:05:51Z Giersch 82 ! Masked output running index mid has been introduced as a local variable to 85 ! Masked output running index mid has been introduced as a local variable to 83 86 ! avoid runtime error (Loop variable has been modified) in time_integration 84 ! 87 ! 85 88 ! 4064 2019-07-01 05:33:33Z gronemeier 86 89 ! Moved call to radiation module out of intermediate time loop 87 ! 90 ! 88 91 ! 4048 2019-06-21 21:00:21Z knoop 89 92 ! Moved production_e_init call into turbulence_closure_mod 90 ! 93 ! 91 94 ! 4047 2019-06-21 18:58:09Z knoop 92 95 ! Added remainings of swap_timelevel upon its dissolution 93 ! 96 ! 94 97 ! 4043 2019-06-18 16:59:00Z schwenkel 95 98 ! Further LPM modularization … … 97 100 ! 4039 2019-06-18 10:32:41Z suehring 98 101 ! Rename subroutines in module for diagnostic quantities 99 ! 102 ! 100 103 ! 4029 2019-06-14 14:04:35Z raasch 101 104 ! exchange of ghost points and boundary conditions separated for chemical species and SALSA module, 102 105 ! bugfix: decycling of chemistry species after nesting data transfer 103 ! 106 ! 104 107 ! 4022 2019-06-12 11:52:39Z suehring 105 108 ! Call synthetic turbulence generator at last RK3 substep right after boundary 106 ! conditions are updated in offline nesting in order to assure that 107 ! perturbations are always imposed 108 ! 109 ! conditions are updated in offline nesting in order to assure that 110 ! perturbations are always imposed 111 ! 109 112 ! 4017 2019-06-06 12:16:46Z schwenkel 110 113 ! Mass (volume) flux correction included to ensure global mass conservation for child domains. 111 ! 114 ! 112 115 ! 3994 2019-05-22 18:08:09Z suehring 113 116 ! output of turbulence intensity added 114 ! 117 ! 115 118 ! 3988 2019-05-22 11:32:37Z kanani 116 119 ! Implement steerable output interval for virtual measurements 117 ! 120 ! 118 121 ! 3968 2019-05-13 11:04:01Z suehring 119 122 ! replace nspec_out with n_matched_vars 120 ! 123 ! 121 124 ! 3929 2019-04-24 12:52:08Z banzhafs 122 125 ! Reverse changes back from revision 3878: use chem_boundary_conds instead of 123 126 ! chem_boundary_conds_decycle 124 ! 125 ! 127 ! 128 ! 126 129 ! 3885 2019-04-11 11:29:34Z kanani 127 ! Changes related to global restructuring of location messages and introduction 130 ! Changes related to global restructuring of location messages and introduction 128 131 ! of additional debug messages 129 132 ! 130 133 ! 3879 2019-04-08 20:25:23Z knoop 131 134 ! Moved wtm_forces to module_interface_actions 132 ! 135 ! 133 136 ! 3872 2019-04-08 15:03:06Z knoop 134 137 ! Modifications made for salsa: … … 136 139 ! salsa_emission_update (i.e. skip_time_do_salsa >= time_since_reference_point 137 140 ! and next_aero_emission_update <= time_since_reference_point ). 138 ! - Renamed nbins --> nbins_aerosol, ncc_tot --> ncomponents_mass and 141 ! - Renamed nbins --> nbins_aerosol, ncc_tot --> ncomponents_mass and 139 142 ! ngast --> ngases_salsa and loop indices b, c and sg to ib, ic and ig 140 143 ! - Apply nesting for salsa variables 141 144 ! - Removed cpu_log calls speciffic for salsa. 142 ! 145 ! 143 146 ! 3833 2019-03-28 15:04:04Z forkel 144 147 ! added USE chem_gasphase_mod, replaced nspec by nspec since fixed compounds are not integrated 145 ! 148 ! 146 149 ! 3820 2019-03-27 11:53:41Z forkel 147 150 ! renamed do_emiss to emissions_anthropogenic (ecc) 148 ! 149 ! 151 ! 152 ! 150 153 ! 3774 2019-03-04 10:52:49Z moh.hefny 151 154 ! rephrase if statement to avoid unallocated array in case of … … 155 158 ! module section re-formatted and openacc required variables moved to separate section, 156 159 ! re-formatting to 100 char line width 157 ! 160 ! 158 161 ! 3745 2019-02-15 18:57:56Z suehring 159 162 ! Call indoor model after first timestep 160 ! 163 ! 161 164 ! 3744 2019-02-15 18:38:58Z suehring 162 165 ! - Moved call of bio_calculate_thermal_index_maps from biometeorology module to 163 166 ! time_integration to make sure averaged input is updated before calculating. 164 ! 167 ! 165 168 ! 3739 2019-02-13 08:05:17Z dom_dwd_user 166 169 ! Removed everything related to "time_bio_results" as this is never used. 167 ! 170 ! 168 171 ! 3724 2019-02-06 16:28:23Z kanani 169 ! Correct double-used log_point_s unit 170 ! 172 ! Correct double-used log_point_s unit 173 ! 171 174 ! 3719 2019-02-06 13:10:18Z kanani 172 175 ! - removed wind_turbine cpu measurement, since same time is measured inside … … 176 179 ! moved radiation_interactions cpulog to special measures 177 180 ! - moved some cpu_log calls to this routine for better overview 178 ! 181 ! 179 182 ! 3705 2019-01-29 19:56:39Z suehring 180 183 ! Data output for virtual measurements added 181 ! 184 ! 182 185 ! 3704 2019-01-29 19:51:41Z suehring 183 186 ! Rename subroutines for surface-data output 184 ! 187 ! 185 188 ! 3647 2019-01-02 14:10:44Z kanani 186 189 ! Bugfix: add time_since_reference_point to IF clause for data_output calls … … 198 201 !------------------------------------------------------------------------------! 199 202 SUBROUTINE time_integration 200 203 201 204 202 205 USE advec_ws, & … … 400 403 vm_time_start 401 404 402 405 403 406 USE wind_turbine_model_mod, & 404 407 ONLY: dt_data_output_wtm, time_wtm, wind_turbine, wtm_data_output … … 406 409 #if defined( _OPENACC ) 407 410 USE arrays_3d, & 408 ONLY: d, dd2zu, ddzu, ddzw, drho_air, drho_air_zw, dzw, e, heatflux_output_conversion, & 411 ONLY: d, dd2zu, ddzu, ddzw, & 412 diss_l_u, & 413 diss_l_v, & 414 diss_l_w, & 415 diss_s_u, & 416 diss_s_v, & 417 diss_s_w, & 418 drho_air, drho_air_zw, dzw, e, & 419 flux_l_u, & 420 flux_l_v, & 421 flux_l_w, & 422 flux_s_u, & 423 flux_s_v, & 424 flux_s_w, & 425 heatflux_output_conversion, & 409 426 kh, km, momentumflux_output_conversion, nc, nr, p, ptdf_x, ptdf_y, qc, qr, rdf, & 410 427 rdf_sc, rho_air, rho_air_zw, s, tdiss_m, te_m, tpt_m, tu_m, tv_m, tw_m, ug, u_init, & … … 453 470 ! 454 471 !-- Copy data from arrays_3d 455 !$ACC DATA & 472 !$ACC DATA & 456 473 !$ACC COPY(d(nzb+1:nzt,nys:nyn,nxl:nxr)) & 457 474 !$ACC COPY(diss(nzb:nzt+1,nysg:nyng,nxlg:nxrg)) & … … 466 483 467 484 !$ACC DATA & 485 !$ACC COPYIN(diss_l_u(0:nz+1,nys:nyn,0), flux_l_u(0:nz+1,nys:nyn,0)) & 486 !$ACC COPYIN(diss_l_v(0:nz+1,nys:nyn,0), flux_l_v(0:nz+1,nys:nyn,0)) & 487 !$ACC COPYIN(diss_l_w(0:nz+1,nys:nyn,0), flux_l_w(0:nz+1,nys:nyn,0)) & 488 !$ACC COPYIN(diss_s_u(0:nz+1,0), flux_s_u(0:nz+1,0)) & 489 !$ACC COPYIN(diss_s_v(0:nz+1,0), flux_s_v(0:nz+1,0)) & 490 !$ACC COPYIN(diss_s_w(0:nz+1,0), flux_s_w(0:nz+1,0)) & 468 491 !$ACC COPY(diss_p(nzb:nzt+1,nysg:nyng,nxlg:nxrg)) & 469 492 !$ACC COPY(e_p(nzb:nzt+1,nysg:nyng,nxlg:nxrg)) & … … 569 592 CALL run_control 570 593 ! 571 !-- Data exchange between coupled models in case that a call has been omitted 594 !-- Data exchange between coupled models in case that a call has been omitted 572 595 !-- at the end of the previous run of a job chain. 573 596 IF ( coupling_mode /= 'uncoupled' .AND. run_coupled .AND. .NOT. vnested ) THEN 574 597 ! 575 !-- In case of model termination initiated by the local model the coupler 576 !-- must not be called because this would again cause an MPI hang. 598 !-- In case of model termination initiated by the local model the coupler 599 !-- must not be called because this would again cause an MPI hang. 577 600 DO WHILE ( time_coupling >= dt_coupling .AND. terminate_coupled == 0 ) 578 601 CALL surface_coupler … … 606 629 607 630 ! 608 !-- Determine ug, vg and w_subs in dependence on data from external file 631 !-- Determine ug, vg and w_subs in dependence on data from external file 609 632 !-- LSF_DATA 610 633 IF ( large_scale_forcing .AND. lsf_vert ) THEN … … 614 637 615 638 ! 616 !-- Set pt_init and q_init to the current profiles taken from 617 !-- NUDGING_DATA 639 !-- Set pt_init and q_init to the current profiles taken from 640 !-- NUDGING_DATA 618 641 IF ( nudging ) THEN 619 642 CALL nudge_ref ( simulated_time ) … … 649 672 ENDIF 650 673 ! 651 !-- Input of boundary data. 674 !-- Input of boundary data. 652 675 IF ( nesting_offline ) CALL nesting_offl_input 653 676 ! 654 677 !-- Execute all other module actions routines 655 678 CALL module_interface_actions( 'before_timestep' ) 656 679 657 680 !-- Start of intermediate step loop 658 681 intermediate_timestep_count = 0 … … 689 712 ! 690 713 !-- Assure that ref_state does not become zero at any level 691 !-- ( might be the case if a vertical level is completely occupied 714 !-- ( might be the case if a vertical level is completely occupied 692 715 !-- with topography ). 693 716 ref_state = MERGE( MAXVAL(ref_state), ref_state, ref_state == 0.0_wp ) … … 856 879 ENDIF 857 880 858 IF ( passive_scalar ) CALL exchange_horiz( s, nbgp ) 881 IF ( passive_scalar ) CALL exchange_horiz( s, nbgp ) 859 882 860 883 IF ( .NOT. constant_diffusion ) CALL exchange_horiz( e, nbgp ) … … 866 889 IF ( air_chemistry ) THEN 867 890 DO n = 1, nvar 868 CALL exchange_horiz( chem_species(n)%conc, nbgp ) 891 CALL exchange_horiz( chem_species(n)%conc, nbgp ) 869 892 ENDDO 870 893 ENDIF … … 973 996 974 997 ! 975 !-- Map forcing data derived from larger scale model onto domain 998 !-- Map forcing data derived from larger scale model onto domain 976 999 !-- boundaries. Further, update geostrophic wind components. 977 1000 IF ( nesting_offline .AND. intermediate_timestep_count == & 978 1001 intermediate_timestep_count_max ) THEN 979 !-- Determine interpolation factor before boundary conditions and geostrophic wind 1002 !-- Determine interpolation factor before boundary conditions and geostrophic wind 980 1003 !-- is updated. 981 1004 CALL nesting_offl_interpolation_factor … … 994 1017 !-- Ensure mass conservation. This need to be done after imposing 995 1018 !-- synthetic turbulence and top boundary condition for pressure is set to 996 !-- Neumann conditions. 1019 !-- Neumann conditions. 997 1020 !-- Is this also required in case of Dirichlet? 998 1021 IF ( nesting_offline ) CALL nesting_offl_mass_conservation … … 1013 1036 CALL vnest_boundary_conds 1014 1037 CALL cpu_log( log_point_s(30), 'vnest_bc', 'stop' ) 1015 1038 1016 1039 IF ( coupling_mode == 'vnested_fine' ) CALL pres 1017 1040 … … 1058 1081 ENDIF 1059 1082 ! 1060 !-- If required, compute virtual potential temperature 1061 IF ( humidity ) THEN 1062 CALL compute_vpt 1063 ENDIF 1083 !-- If required, compute virtual potential temperature 1084 IF ( humidity ) THEN 1085 CALL compute_vpt 1086 ENDIF 1064 1087 1065 1088 ! … … 1068 1091 1069 1092 ! 1070 !-- Determine surface fluxes shf and qsws and surface values 1071 !-- pt_surface and q_surface in dependence on data from external 1093 !-- Determine surface fluxes shf and qsws and surface values 1094 !-- pt_surface and q_surface in dependence on data from external 1072 1095 !-- file LSF_DATA respectively 1073 1096 IF ( ( large_scale_forcing .AND. lsf_surf ) .AND. & … … 1078 1101 1079 1102 ! 1080 !-- First the vertical (and horizontal) fluxes in the surface 1103 !-- First the vertical (and horizontal) fluxes in the surface 1081 1104 !-- (constant flux) layer are computed 1082 1105 IF ( constant_flux_layer ) THEN … … 1086 1109 ENDIF 1087 1110 ! 1088 !-- If required, solve the energy balance for the surface and run soil 1111 !-- If required, solve the energy balance for the surface and run soil 1089 1112 !-- model. Call for horizontal as well as vertical surfaces 1090 1113 IF ( land_surface .AND. time_since_reference_point >= skip_time_do_lsm) THEN … … 1114 1137 ! 1115 1138 !-- At the end, set boundary conditons for potential temperature 1116 !-- and humidity after running the land-surface model. This 1139 !-- and humidity after running the land-surface model. This 1117 1140 !-- might be important for the nesting, where arrays are transfered. 1118 1141 CALL lsm_boundary_condition … … 1122 1145 ENDIF 1123 1146 ! 1124 !-- If required, solve the energy balance for urban surfaces and run 1147 !-- If required, solve the energy balance for urban surfaces and run 1125 1148 !-- the material heat model 1126 1149 IF (urban_surface) THEN … … 1135 1158 ! 1136 1159 !-- At the end, set boundary conditons for potential temperature 1137 !-- and humidity after running the urban-surface model. This 1160 !-- and humidity after running the urban-surface model. This 1138 1161 !-- might be important for the nesting, where arrays are transfered. 1139 1162 CALL usm_boundary_condition … … 1200 1223 ! 1201 1224 !-- Adjust the current time to the time step of the radiation model. 1202 !-- Needed since radiation is pre-calculated and stored only on apparent 1225 !-- Needed since radiation is pre-calculated and stored only on apparent 1203 1226 !-- solar positions 1204 1227 time_since_reference_point_save = time_since_reference_point … … 1213 1236 CALL cpu_log( log_point_s(46), 'radiation_interaction', 'stop' ) 1214 1237 ENDIF 1215 1238 1216 1239 ! 1217 1240 !-- Return the current time to its original value … … 1223 1246 ENDIF 1224 1247 1225 1248 1226 1249 ! 1227 1250 !-- 20200203 (ECC) … … 1271 1294 !-- dt_indoor steers the frequency of the indoor model calculations. 1272 1295 !-- Note, at first timestep indoor model is called, in order to provide 1273 !-- a waste heat flux. 1296 !-- a waste heat flux. 1274 1297 IF ( indoor_model ) THEN 1275 1298 … … 1342 1365 time_virtual_measurement = time_virtual_measurement + dt_3d 1343 1366 ENDIF 1344 1367 1345 1368 ! 1346 1369 !-- Increment time-counter for wind turbine data output … … 1348 1371 time_wtm = time_wtm + dt_3d 1349 1372 ENDIF 1350 1373 1351 1374 ! 1352 1375 !-- In case of synthetic turbulence generation and parametrized turbulence 1353 !-- information, update the time counter and if required, adjust the 1376 !-- information, update the time counter and if required, adjust the 1354 1377 !-- STG to new atmospheric conditions. 1355 1378 IF ( use_syn_turb_gen ) THEN … … 1371 1394 1372 1395 ! 1373 !-- In case of model termination initiated by the local model 1374 !-- (terminate_coupled > 0), the coupler must be skipped because it would 1396 !-- In case of model termination initiated by the local model 1397 !-- (terminate_coupled > 0), the coupler must be skipped because it would 1375 1398 !-- cause an MPI intercomminucation hang. 1376 !-- If necessary, the coupler will be called at the beginning of the 1399 !-- If necessary, the coupler will be called at the beginning of the 1377 1400 !-- next restart run. 1378 1401 DO WHILE ( time_coupling >= dt_coupling .AND. terminate_coupled == 0 ) … … 1469 1492 .AND. ( dt_dosurf_av - time_dosurf_av ) <= averaging_interval_surf & 1470 1493 .AND. time_since_reference_point >= skip_time_dosurf_av ) THEN 1471 IF ( time_dosurf_av >= dt_averaging_input ) THEN 1494 IF ( time_dosurf_av >= dt_averaging_input ) THEN 1472 1495 CALL surface_data_output_averaging 1473 1496 average_count_surf = average_count_surf + 1 … … 1502 1525 MAX( dt_virtual_measurement, dt_3d ) ) 1503 1526 ENDIF 1504 1527 1505 1528 ! 1506 1529 !-- Output wind turbine data … … 1509 1532 time_wtm = MOD( time_wtm, MAX( dt_data_output_wtm, dt_3d ) ) 1510 1533 ENDIF 1511 1534 1512 1535 ! 1513 1536 !-- Profile output (ASCII) on file … … 1707 1730 #if defined( __parallel ) 1708 1731 ! 1709 !-- Vertical nesting: Deallocate variables initialized for vertical nesting 1732 !-- Vertical nesting: Deallocate variables initialized for vertical nesting 1710 1733 IF ( vnest_init ) CALL vnest_deallocate 1711 1734 #endif
Note: See TracChangeset
for help on using the changeset viewer.