Changeset 3294
- Timestamp:
- Oct 1, 2018 2:37:10 AM (6 years ago)
- Location:
- palm/trunk
- Files:
-
- 2 added
- 2 deleted
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/INSTALL/test_oceanml_p3d
r3275 r3294 19 19 initializing_actions = 'set_constant_profiles', ! initial conditions 20 20 21 ocean = .TRUE., ! enable ocean modeling22 21 latitude = 55.6, 23 22 … … 37 36 bc_s_b = 'initial_gradient', 38 37 bc_s_t = 'neumann', 39 bc_sa_t = 'neumann',40 38 41 39 use_top_fluxes = .T., … … 47 45 48 46 top_heatflux = 0.0, 49 top_salinityflux = 0.0,50 47 ! 51 48 !-- numerics … … 75 72 !-- data output 76 73 !------------------------------------------------------------------------------- 77 netcdf_data_format = 5, ! use NetCDF378 79 74 dt_run_control = 0.0, ! output interval for run control 80 75 … … 83 78 / ! end of runtime parameter namelist 84 79 80 !------------------------------------------------------------------------------- 81 !-- OCEAN PARAMETER NAMELIST 82 ! Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/oceanpar 83 !------------------------------------------------------------------------------- 84 &ocean_parameters 85 ! 86 !-- top boundary condition for salinity 87 bc_sa_t = 'neumann', 85 88 89 ! zero salinityflux at ocean surface 90 top_salinityflux = 0.0, 91 92 / ! end of ocean parameters -
palm/trunk/INSTALL/test_oceanml_rc
r2508 r3294 1 1 2 2 ****************************** -------------------------------------------- 3 * PALM 4.0 Rev: 2507M * ocean - run without 1D - prerun3 * PALM 5.0 Rev: 3291M * ocean - run without 1D - prerun 4 4 ****************************** -------------------------------------------- 5 5 6 Date: 0 2-10-17 Run: test_oceanml7 Time: 10:50:00Run-No.: 008 Run on host: lcmuk6 Date: 01-10-18 Run: test_oceanml 7 Time: 04:15:16 Run-No.: 00 8 Run on host: imuk 9 9 Number of PEs: 4 Processor grid (x,y): ( 2, 2) calculated 10 10 ------------------------------------------------------------------------------ … … 13 13 ----------------- 14 14 15 --> Use the Moeng_Wyngaard turbulence closure (LES mode). 15 16 --> Use the boussinesq approximation for the model equations. 16 17 --> Solve perturbation pressure via FFT using temperton-algorithm routines … … 34 35 ---------------------------------- 35 36 36 Grid length: dx = 1.250 m dy = 1.250 m dz = 1.250 m 37 Grid length: dx = 1.250 m dy = 1.250 m 38 dz(1) = 1.250 m 39 37 40 Domain size: x = 80.000 m y = 80.000 m z(u) = -80.000 m 41 42 38 43 39 44 Number of gridpoints (x,y,z): (0: 63, 0: 63, 0: 65) … … 114 119 115 120 1D-Profiles: 116 Output every ********s121 Output every 9999999.90 s 117 122 118 123 … … 141 146 ------------------- 142 147 143 Geograph. latitude : phi = 55.6 degr 148 Geograph. latitude : latitude = 55.6 degr 149 Geograph. longitude : longitude = 0.0 degr 144 150 Angular velocity : omega = 0.729E-04 rad/s 145 151 Coriolis parameter : f = 0.000120 1/s 146 152 f* = 0.000082 1/s 153 154 Day of the year at model start : day_init = 172 155 UTC time at model start : time_utc_init = 43200.0 s 147 156 148 157 Gravity : g = 9.8 m/s**2 -
palm/trunk/SCRIPTS/palmrun
r3236 r3294 27 27 # ----------------- 28 28 # $Id$ 29 # more detailed error message for outdated fileconnection file 30 # 31 # 3236 2018-09-10 09:07:06Z raasch 29 32 # warning issued in case of file connection file version mismatch, 30 33 # host_configuration renamed configuration_identifier, … … 409 412 printf "\n working directory, but its revision does not match" 410 413 printf "\n the revision of the default (trunk) version." 411 printf "\n You may need to update your connection file!" 414 printf "\n You may need to update your connection file" 415 printf "\n \"${working_directory}/.palm.iofiles\" !" 412 416 fi 413 417 fi -
palm/trunk/SOURCE/Makefile
r3274 r3294 25 25 # ----------------- 26 26 # $Id$ 27 # changes related to modularization of the ocean mode, 28 # bugfix: dependency to advec_ws was missed in chemistry_model_mod 29 # 30 # 3274 2018-09-24 15:42:55Z knoop 27 31 # Added palm dependency of multi_agent_system_mod, because of mas_last_actions 28 32 # call at the end of palm run … … 494 498 disturb_field.f90 \ 495 499 disturb_heatflux.f90 \ 496 eqn_state_seawater.f90 \497 500 exchange_horiz_2d.f90 \ 498 501 exchange_horiz.f90 \ … … 509 512 init_grid.f90 \ 510 513 init_masks.f90 \ 511 init_ocean.f90 \512 514 init_pegrid.f90 \ 513 515 init_pt_anomaly.f90 \ 514 516 init_rankine.f90 \ 515 517 init_slope.f90 \ 518 init_vertical_profiles.f90 \ 516 519 interaction_droplets_ptq.f90 \ 517 520 land_surface_model_mod.f90 \ … … 548 551 netcdf_data_input_mod.f90 \ 549 552 netcdf_interface_mod.f90 \ 553 ocean_mod.f90 \ 550 554 outflow_turbulence.f90 \ 551 555 package_parin.f90 \ … … 707 711 mod_kinds.o \ 708 712 modules.o \ 713 ocean_mod.o \ 709 714 radiation_model_mod.o \ 710 715 turbulence_closure_mod.o \ … … 753 758 chemistry_model_mod.o \ 754 759 gust_mod.o \ 760 init_vertical_profiles.o \ 755 761 land_surface_model_mod.o \ 756 762 large_scale_forcing_nudging_mod.o \ … … 760 766 netcdf_data_input_mod.o \ 761 767 netcdf_interface_mod.o \ 768 ocean_mod.o \ 762 769 plant_canopy_model_mod.o \ 763 770 pmc_interface_mod.o \ … … 772 779 wind_turbine_model_mod.o 773 780 chemistry_model_mod.o: \ 781 advec_ws.o \ 774 782 chem_gasphase_mod.o \ 775 783 chem_modules.o \ … … 867 875 modules.o \ 868 876 netcdf_interface_mod.o \ 877 ocean_mod.o \ 869 878 radiation_model_mod.o \ 870 879 surface_mod.o \ … … 882 891 modules.o \ 883 892 netcdf_interface_mod.o \ 893 ocean_mod.o \ 884 894 turbulence_closure_mod.o \ 885 895 urban_surface_mod.o … … 914 924 modules.o \ 915 925 random_generator_parallel_mod.o \ 916 surface_mod.o917 eqn_state_seawater.o: \918 mod_kinds.o \919 modules.o \920 926 surface_mod.o 921 927 exchange_horiz.o: \ … … 963 969 modules.o \ 964 970 netcdf_interface_mod.o \ 971 ocean_mod.o \ 965 972 plant_canopy_model_mod.o \ 966 973 pmc_handle_communicator_mod.o \ … … 993 1000 netcdf_data_input_mod.o \ 994 1001 netcdf_interface_mod.o \ 1002 ocean_mod.o \ 995 1003 plant_canopy_model_mod.o \ 996 1004 pmc_interface_mod.o \ … … 1030 1038 modules.o \ 1031 1039 netcdf_interface_mod.o 1032 init_ocean.o: \1033 basic_constants_and_equations_mod.o \1034 eqn_state_seawater.o \1035 mod_kinds.o \1036 modules.o1037 1040 init_pegrid.o: \ 1038 1041 mod_kinds.o \ … … 1052 1055 mod_kinds.o \ 1053 1056 modules.o 1057 init_vertical_profiles.o: \ 1058 modules.o \ 1059 mod_kinds.o 1054 1060 interaction_droplets_ptq.o: \ 1055 1061 basic_constants_and_equations_mod.o \ … … 1238 1244 mod_kinds.o \ 1239 1245 modules.o \ 1246 ocean_mod.o \ 1240 1247 radiation_model_mod.o \ 1241 1248 spectra_mod.o \ … … 1243 1250 urban_surface_mod.o \ 1244 1251 uv_exposure_model_mod.o 1252 ocean_mod.o: \ 1253 advec_s_pw.o \ 1254 advec_s_up.o \ 1255 advec_ws.o \ 1256 basic_constants_and_equations_mod.o \ 1257 diffusion_s.o \ 1258 init_vertical_profiles.o \ 1259 mod_kinds.o \ 1260 modules.o \ 1261 pmc_interface_mod.o \ 1262 user_actions.o 1245 1263 outflow_turbulence.o: \ 1246 1264 cpulog_mod.o \ … … 1278 1296 multi_agent_system_mod.o \ 1279 1297 netcdf_interface_mod.o \ 1298 ocean_mod.o \ 1280 1299 plant_canopy_model_mod.o \ 1281 1300 pmc_interface_mod.o \ … … 1387 1406 diffusion_v.o \ 1388 1407 diffusion_w.o \ 1389 eqn_state_seawater.o \1390 1408 large_scale_forcing_nudging_mod.o \ 1391 1409 mod_kinds.o \ … … 1393 1411 modules.o \ 1394 1412 modules.o \ 1413 ocean_mod.o \ 1395 1414 plant_canopy_model_mod.o \ 1396 1415 radiation_model_mod.o \ … … 1508 1527 mod_kinds.o \ 1509 1528 modules.o \ 1529 ocean_mod.o \ 1510 1530 pmc_interface_mod.o \ 1511 1531 turbulence_closure_mod.o \ … … 1538 1558 modules.o \ 1539 1559 multi_agent_system_mod.o \ 1560 ocean_mod.o \ 1540 1561 pmc_interface_mod.o \ 1541 1562 prognostic_equations.o \ … … 1595 1616 mod_particle_attributes.o \ 1596 1617 modules.o \ 1618 ocean_mod.o \ 1597 1619 plant_canopy_model_mod.o \ 1598 1620 pmc_interface_mod.o \ … … 1785 1807 modules.o \ 1786 1808 netcdf_interface_mod.o \ 1809 ocean_mod.o \ 1787 1810 radiation_model_mod.o \ 1788 1811 random_function_mod.o \ -
palm/trunk/SOURCE/advec_ws.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! ocean renamed ocean_mode 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 293 296 294 297 USE control_parameters, & 295 ONLY: humidity, loop_optimization, passive_scalar, ocean ,&298 ONLY: humidity, loop_optimization, passive_scalar, ocean_mode, & 296 299 rans_tke_e, ws_scheme_mom, ws_scheme_sca 297 300 … … 369 372 ENDIF 370 373 371 IF ( ocean ) THEN374 IF ( ocean_mode ) THEN 372 375 ALLOCATE( sums_wssas_ws_l(nzb:nzt+1,0:threads_per_task-1) ) 373 376 sums_wssas_ws_l = 0.0_wp … … 454 457 ENDIF 455 458 456 IF ( ocean ) THEN459 IF ( ocean_mode ) THEN 457 460 ALLOCATE( flux_s_sa(nzb+1:nzt,0:threads_per_task-1), & 458 461 diss_s_sa(nzb+1:nzt,0:threads_per_task-1) ) … … 1084 1087 1085 1088 USE control_parameters, & 1086 ONLY: humidity, passive_scalar, ocean, ws_scheme_mom, ws_scheme_sca 1089 ONLY: humidity, passive_scalar, ocean_mode, ws_scheme_mom, & 1090 ws_scheme_sca 1087 1091 1088 1092 USE kinds … … 1123 1127 sums_wsnrs_ws_l = 0.0_wp 1124 1128 ENDIF 1125 IF ( ocean ) sums_wssas_ws_l = 0.0_wp1129 IF ( ocean_mode ) sums_wssas_ws_l = 0.0_wp 1126 1130 1127 1131 ENDIF -
palm/trunk/SOURCE/average_3d_data.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 149 152 USE control_parameters, & 150 153 ONLY: air_chemistry, average_count_3d, doav, doav_n, land_surface, & 151 urban_surface, varnamelength154 ocean_mode, urban_surface, varnamelength 152 155 153 156 USE cpulog, & … … 165 168 ONLY: lsm_3d_data_averaging 166 169 170 USE ocean_mod, & 171 ONLY: ocean_3d_data_averaging 172 167 173 USE radiation_model_mod, & 168 174 ONLY: radiation, radiation_3d_data_averaging … … 179 185 IMPLICIT NONE 180 186 181 INTEGER(iwp) :: i !< runningindex182 INTEGER(iwp) :: ii !< runningindex183 INTEGER(iwp) :: j !< runningindex184 INTEGER(iwp) :: k !< runningindex187 INTEGER(iwp) :: i !< loop index 188 INTEGER(iwp) :: ii !< loop index 189 INTEGER(iwp) :: j !< loop index 190 INTEGER(iwp) :: k !< loop index 185 191 186 192 CHARACTER (LEN=varnamelength) :: trimvar !< TRIM of output-variable string … … 392 398 ENDIF 393 399 394 CASE ( 'rho_ocean' )395 IF ( ALLOCATED( rho_ocean_av ) ) THEN396 DO i = nxlg, nxrg397 DO j = nysg, nyng398 DO k = nzb, nzt+1399 rho_ocean_av(k,j,i) = rho_ocean_av(k,j,i) / REAL( average_count_3d, KIND=wp )400 ENDDO401 ENDDO402 ENDDO403 ENDIF404 405 400 CASE ( 's' ) 406 401 IF ( ALLOCATED( s_av ) ) THEN … … 414 409 ENDIF 415 410 416 CASE ( 'sa' )417 IF ( ALLOCATED( sa_av ) ) THEN418 DO i = nxlg, nxrg419 DO j = nysg, nyng420 DO k = nzb, nzt+1421 sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d, KIND=wp )422 ENDDO423 ENDDO424 ENDDO425 ENDIF426 427 411 CASE ( 'shf*' ) 428 412 IF ( ALLOCATED( shf_av ) ) THEN … … 549 533 ENDIF 550 534 535 CASE ( 'usm_output' ) 551 536 ! 552 !-- Block of urban surface model outputs 553 CASE ( 'usm_output' ) 537 !-- Block of urban surface model outputs 554 538 CALL usm_average_3d_data( 'average', doav(ii) ) 555 539 556 540 CASE DEFAULT 557 541 ! 558 !-- Turbulence closure module 559 CALL tcm_3d_data_averaging( 'average', doav(ii) ) 560 ! 561 !-- microphysics module quantities 542 !-- Averaging of data from other modules 543 IF ( air_chemistry ) THEN 544 CALL chem_3d_data_averaging( 'average', doav(ii) ) 545 ENDIF 546 562 547 IF ( bulk_cloud_model ) THEN 563 548 CALL bcm_3d_data_averaging( 'average', doav(ii) ) 564 549 ENDIF 565 ! 566 !-- Land surface quantity 550 551 IF ( gust_module_enabled ) THEN 552 CALL gust_3d_data_averaging( 'average', doav(ii) ) 553 ENDIF 554 567 555 IF ( land_surface ) THEN 568 556 CALL lsm_3d_data_averaging( 'average', doav(ii) ) 569 557 ENDIF 570 ! 571 !-- Radiation quantity 558 559 IF ( ocean_mode ) THEN 560 CALL ocean_3d_data_averaging( 'average', doav(ii) ) 561 ENDIF 562 572 563 IF ( radiation ) THEN 573 564 CALL radiation_3d_data_averaging( 'average', doav(ii) ) 574 565 ENDIF 575 ! 576 !-- Gust module quantities 577 IF ( gust_module_enabled ) THEN 578 CALL gust_3d_data_averaging( 'average', doav(ii) ) 579 ENDIF 580 ! 581 !-- Chemistry quantity 582 IF ( air_chemistry ) THEN 583 CALL chem_3d_data_averaging( 'average', doav(ii) ) 584 ENDIF 585 ! 586 !-- User-defined quantity 566 567 CALL tcm_3d_data_averaging( 'average', doav(ii) ) 568 ! 569 !-- User-defined quantities 587 570 CALL user_3d_data_averaging( 'average', doav(ii) ) 588 571 -
palm/trunk/SOURCE/boundary_conds.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 203 206 ONLY: kappa 204 207 208 USE bulk_cloud_model_mod, & 209 ONLY: bulk_cloud_model, microphysics_morrison, microphysics_seifert 210 205 211 USE chemistry_model_mod, & 206 212 ONLY: chem_boundary_conds … … 212 218 child_domain, constant_diffusion, coupling_mode, & 213 219 dt_3d, humidity, ibc_pt_b, ibc_pt_t, ibc_q_b, ibc_q_t, ibc_s_b, & 214 ibc_s_t,ibc_sa_t, ibc_uv_b, ibc_uv_t, & 215 intermediate_timestep_count, & 216 nesting_offline, nudging, & 217 ocean, passive_scalar, rans_mode, rans_tke_e, tsc, use_cmax 220 ibc_s_t, ibc_uv_b, ibc_uv_t, & 221 intermediate_timestep_count, nesting_offline, nudging, & 222 ocean_mode, passive_scalar, rans_mode, rans_tke_e, tsc, use_cmax 218 223 219 224 USE grid_variables, & … … 221 226 222 227 USE indices, & 223 ONLY: nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, & 224 nzb, nzt 228 ONLY: nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, nzb, nzt 225 229 226 230 USE kinds 227 231 228 USE bulk_cloud_model_mod,&229 ONLY: bulk_cloud_model, microphysics_morrison, microphysics_seifert232 USE ocean_mod, & 233 ONLY: ibc_sa_t 230 234 231 235 USE pegrid … … 529 533 ! 530 534 !-- Boundary conditions for salinity 531 IF ( ocean ) THEN535 IF ( ocean_mode ) THEN 532 536 ! 533 537 !-- Bottom boundary: Neumann condition because salinity flux is always -
palm/trunk/SOURCE/buoyancy.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! module use statements moved to global declaration section 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 53 56 ! 1850 2016-04-08 13:29:27Z maronga 54 57 ! Module renamed 55 !56 58 ! 57 59 ! 1682 2015-10-07 23:56:08Z knoop … … 121 123 ONLY: g 122 124 125 USE arrays_3d, & 126 ONLY: pt, pt_slope_ref, ref_state, tend 127 128 USE control_parameters, & 129 ONLY: atmos_ocean_sign, cos_alpha_surface, message_string, pt_surface,& 130 sin_alpha_surface, sloping_surface 131 132 USE kinds 133 123 134 PRIVATE 124 135 PUBLIC buoyancy … … 139 150 SUBROUTINE buoyancy( var, wind_component ) 140 151 141 USE arrays_3d, &142 ONLY: pt, pt_slope_ref, ref_state, tend143 144 USE control_parameters, &145 ONLY: atmos_ocean_sign, cos_alpha_surface, message_string, &146 pt_surface, sin_alpha_surface, sloping_surface147 148 152 USE indices, & 149 153 ONLY: nxl, nxlg, nxlu, nxr, nxrg, nyn, nyng, nys, nysg, nzb, & 150 154 nzt, wall_flags_0 151 152 USE kinds153 154 USE pegrid155 155 156 156 … … 245 245 SUBROUTINE buoyancy_ij( i, j, var, wind_component ) 246 246 247 USE arrays_3d, &248 ONLY: pt, pt_slope_ref, ref_state, tend249 250 USE control_parameters, &251 ONLY: atmos_ocean_sign, cos_alpha_surface, message_string, &252 pt_surface, sin_alpha_surface, sloping_surface253 247 254 248 USE indices, & 255 249 ONLY: nxlg, nxrg, nyng, nysg, nzb, nzt, wall_flags_0 256 257 USE kinds258 259 USE pegrid260 261 250 262 251 IMPLICIT NONE -
palm/trunk/SOURCE/check_parameters.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id: check_parameters.f90 2520 2017-10-05 13:50:26Z gronemeier & 27 ! changes concerning modularization of ocean option, 28 ! init_vertical_profiles moved to separate file to avoid circular dependency 29 ! 30 ! 2520 2017-10-05 13:50:26Z gronemeier 27 31 ! Modularization of all bulk cloud physics code components 28 32 ! … … 669 673 USE arrays_3d 670 674 675 USE basic_constants_and_equations_mod 676 671 677 USE bulk_cloud_model_mod, & 672 678 ONLY: bulk_cloud_model, bcm_check_parameters, bcm_check_data_output, & … … 676 682 ONLY: chem_boundary_conds, chem_check_data_output, & 677 683 chem_check_data_output_pr, chem_species 684 678 685 USE chem_modules 679 USE basic_constants_and_equations_mod 686 680 687 USE control_parameters 688 681 689 USE dvrp_variables 690 682 691 USE grid_variables 692 683 693 USE gust_mod, & 684 694 ONLY: gust_check_data_output, gust_check_data_output_pr, & 685 695 gust_check_parameters, gust_module_enabled 696 697 USE kinds 698 686 699 USE indices 700 687 701 USE land_surface_model_mod, & 688 702 ONLY: lsm_check_data_output, lsm_check_data_output_pr, & … … 691 705 USE lsf_nudging_mod, & 692 706 ONLY: lsf_nudging_check_parameters, lsf_nudging_check_data_output_pr 693 694 USE kinds695 707 696 708 USE model_1d_mod, & … … 706 718 waterflux_output_unit, momentumflux_output_unit 707 719 720 USE ocean_mod, & 721 ONLY: ocean_check_data_output, ocean_check_data_output_pr, & 722 ocean_check_parameters 723 708 724 USE particle_attributes 725 709 726 USE pegrid 727 710 728 USE plant_canopy_model_mod, & 711 729 ONLY: pcm_check_data_output, pcm_check_parameters … … 715 733 716 734 USE profil_parameter 735 717 736 USE radiation_model_mod, & 718 737 ONLY: radiation, radiation_check_data_output, & 719 738 radiation_check_data_output_pr, radiation_check_parameters 739 720 740 USE spectra_mod, & 721 741 ONLY: calculate_spectra, spectra_check_parameters 742 722 743 USE statistics 744 723 745 USE subsidence_mod 746 724 747 USE statistics 748 725 749 USE synthetic_turbulence_generator_mod, & 726 750 ONLY: stg_check_parameters 751 727 752 USE transpose_indices 753 728 754 USE turbulence_closure_mod, & 729 755 ONLY: tcm_check_data_output, tcm_check_parameters 756 730 757 USE urban_surface_mod, & 731 758 ONLY: usm_check_data_output, usm_check_parameters 759 732 760 USE uv_exposure_model_mod, & 733 761 ONLY: uvem_check_data_output 762 734 763 USE wind_turbine_model_mod, & 735 764 ONLY: wtm_check_parameters 765 736 766 USE vertical_nesting_mod, & 737 767 ONLY: vnested, vnest_check_parameters … … 1083 1113 1084 1114 ! 1085 !-- Check turbulence closure setup1086 CALL tcm_check_parameters1087 1088 !1089 1115 !-- Check approximation 1090 1116 IF ( TRIM( approximation ) /= 'boussinesq' .AND. & … … 1127 1153 CALL message( 'check_parameters', 'PA0450', 1, 2, 0, 6, 0 ) 1128 1154 ENDIF 1155 ! 1129 1156 !-- Set flux input mode according to approximation if applicable 1130 1157 IF ( TRIM( flux_input_mode ) == 'approximation-specific' ) THEN … … 1145 1172 CALL message( 'check_parameters', 'PA0451', 1, 2, 0, 6, 0 ) 1146 1173 ENDIF 1174 ! 1147 1175 !-- Set flux output mode according to approximation if applicable 1148 1176 IF ( TRIM( flux_output_mode ) == 'approximation-specific' ) THEN … … 1163 1191 1164 1192 ! 1165 !-- set the flux output units according to flux_output_mode1193 !-- Set the flux output units according to flux_output_mode 1166 1194 IF ( TRIM( flux_output_mode ) == 'kinematic' ) THEN 1167 1195 heatflux_output_unit = 'K m/s' … … 1174 1202 ENDIF 1175 1203 1204 ! 1176 1205 !-- set time series output units for fluxes 1177 1206 dots_unit(14:16) = heatflux_output_unit 1178 1207 dots_unit(21) = waterflux_output_unit 1179 1208 dots_unit(19:20) = momentumflux_output_unit 1180 1181 !1182 !-- Check ocean setting1183 IF ( TRIM( coupling_mode ) == 'uncoupled' .AND. &1184 TRIM( coupling_char ) == '_O' .AND. &1185 .NOT. ocean ) THEN1186 1187 !1188 !-- Check whether an (uncoupled) atmospheric run has been declared as an1189 !-- ocean run (this setting is done via palmrun-option -y)1190 message_string = 'ocean = .F. does not allow coupling_char = "' // &1191 TRIM( coupling_char ) // '" set by palmrun-option "-y"'1192 CALL message( 'check_parameters', 'PA0317', 1, 2, 0, 6, 0 )1193 1194 ENDIF1195 1209 1196 1210 ! … … 1430 1444 1431 1445 ! 1432 !-- Check for synthetic turbulence generator settings 1446 !-- Check the module settings 1447 IF ( ocean_mode ) CALL ocean_check_parameters 1448 CALL tcm_check_parameters 1433 1449 CALL stg_check_parameters 1434 ! 1435 !-- When plant canopy model is used, peform addtional checks 1436 IF ( plant_canopy ) CALL pcm_check_parameters 1437 1438 ! 1439 !-- Additional checks for spectra 1440 IF ( calculate_spectra ) CALL spectra_check_parameters 1441 ! 1442 !-- When land surface model is used, perform additional checks 1443 IF ( land_surface ) CALL lsm_check_parameters 1444 ! 1445 !-- When microphysics module is used, perform additional checks 1446 IF ( bulk_cloud_model ) CALL bcm_check_parameters 1447 1448 ! 1449 !-- When urban surface model is used, perform additional checks 1450 IF ( urban_surface ) CALL usm_check_parameters 1451 1452 ! 1453 !-- If wind turbine model is used, perform additional checks 1454 IF ( wind_turbine ) CALL wtm_check_parameters 1455 ! 1456 !-- When radiation model is used, peform addtional checks 1457 IF ( radiation ) CALL radiation_check_parameters 1458 ! 1459 !-- When gust module is used, perform additional checks 1450 IF ( plant_canopy ) CALL pcm_check_parameters 1451 IF ( calculate_spectra ) CALL spectra_check_parameters 1452 IF ( land_surface ) CALL lsm_check_parameters 1453 IF ( bulk_cloud_model ) CALL bcm_check_parameters 1454 IF ( urban_surface ) CALL usm_check_parameters 1455 IF ( wind_turbine ) CALL wtm_check_parameters 1456 IF ( radiation ) CALL radiation_check_parameters 1460 1457 IF ( gust_module_enabled ) CALL gust_check_parameters 1461 !1462 !-- When large-scale forcing or nudging is used, peform addtional checks1463 1458 IF ( large_scale_forcing .OR. nudging ) CALL lsf_nudging_check_parameters 1464 1459 1465 1460 ! 1466 !-- In case of no model continuation run, check initialising parameters and1467 !-- deducefurther quantities1461 !-- In case of no restart run, check initialising parameters and calculate 1462 !-- further quantities 1468 1463 IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN 1469 1464 … … 1472 1467 pt_init = pt_surface 1473 1468 IF ( humidity ) q_init = q_surface 1474 IF ( ocean ) sa_init = sa_surface1475 1469 IF ( passive_scalar ) s_init = s_surface 1476 1470 IF ( air_chemistry ) THEN … … 1486 1480 gradient = 0.0_wp 1487 1481 1488 IF ( .NOT. ocean) THEN1482 IF ( .NOT. ocean_mode ) THEN 1489 1483 1490 1484 ug_vertical_gradient_level_ind(1) = 0 … … 1550 1544 gradient = 0.0_wp 1551 1545 1552 IF ( .NOT. ocean) THEN1546 IF ( .NOT. ocean_mode ) THEN 1553 1547 1554 1548 vg_vertical_gradient_level_ind(1) = 0 … … 1691 1685 !-- Compute initial chemistry profile using the given chemical species gradients 1692 1686 IF ( air_chemistry ) THEN 1693 DO lsp = 1, nvar 1694 CALL init_vertical_profiles( cs_vertical_gradient_level_ind(lsp,:), & 1695 cs_vertical_gradient_level(lsp,:), & 1696 cs_vertical_gradient(lsp,:), & 1697 chem_species(lsp)%conc_pr_init, & 1698 cs_surface(lsp), bc_cs_t_val(lsp) ) 1699 ENDDO 1700 ENDIF 1701 ! 1702 ! 1703 !-- If required, compute initial salinity profile using the given salinity 1704 !-- gradients 1705 IF ( ocean ) THEN 1706 CALL init_vertical_profiles( sa_vertical_gradient_level_ind, & 1707 sa_vertical_gradient_level, & 1708 sa_vertical_gradient, sa_init, & 1709 sa_surface, dum ) 1710 ENDIF 1711 1687 DO lsp = 1, nvar 1688 CALL init_vertical_profiles( cs_vertical_gradient_level_ind(lsp,:),& 1689 cs_vertical_gradient_level(lsp,:), & 1690 cs_vertical_gradient(lsp,:), & 1691 chem_species(lsp)%conc_pr_init, & 1692 cs_surface(lsp), bc_cs_t_val(lsp) ) 1693 ENDDO 1694 ENDIF 1712 1695 1713 1696 ENDIF … … 1777 1760 TRIM( reference_state ) // '"' 1778 1761 CALL message( 'check_parameters', 'PA0056', 1, 2, 0, 6, 0 ) 1779 ENDIF1780 1781 !1782 !-- Sign of buoyancy/stability terms1783 IF ( ocean ) atmos_ocean_sign = -1.0_wp1784 1785 !1786 !-- Ocean version must use flux boundary conditions at the top1787 IF ( ocean .AND. .NOT. use_top_fluxes ) THEN1788 message_string = 'use_top_fluxes must be .TRUE. in ocean mode'1789 CALL message( 'check_parameters', 'PA0042', 1, 2, 0, 6, 0 )1790 1762 ENDIF 1791 1763 … … 2067 2039 2068 2040 ! 2069 !-- Boundary conditions for salinity2070 IF ( ocean ) THEN2071 IF ( bc_sa_t == 'dirichlet' ) THEN2072 ibc_sa_t = 02073 ELSEIF ( bc_sa_t == 'neumann' ) THEN2074 ibc_sa_t = 12075 ELSE2076 message_string = 'unknown boundary condition: bc_sa_t = "' // &2077 TRIM( bc_sa_t ) // '"'2078 CALL message( 'check_parameters', 'PA0068', 1, 2, 0, 6, 0 )2079 ENDIF2080 2081 IF ( top_salinityflux == 9999999.9_wp ) constant_top_salinityflux = .FALSE.2082 IF ( ibc_sa_t == 1 .AND. top_salinityflux == 9999999.9_wp ) THEN2083 message_string = 'boundary condition: bc_sa_t = "' // &2084 TRIM( bc_sa_t ) // '" requires to set ' // &2085 'top_salinityflux'2086 CALL message( 'check_parameters', 'PA0069', 1, 2, 0, 6, 0 )2087 ENDIF2088 2089 !2090 !-- A fixed salinity at the top implies Dirichlet boundary condition for2091 !-- salinity. In this case specification of a constant salinity flux is2092 !-- forbidden.2093 IF ( ibc_sa_t == 0 .AND. constant_top_salinityflux .AND. &2094 top_salinityflux /= 0.0_wp ) THEN2095 message_string = 'boundary condition: bc_sa_t = "' // &2096 TRIM( bc_sa_t ) // '" is not allowed with ' // &2097 'top_salinityflux /= 0.0'2098 CALL message( 'check_parameters', 'PA0070', 1, 2, 0, 6, 0 )2099 ENDIF2100 2101 ENDIF2102 2103 !2104 2041 !-- Set boundary conditions for total water content 2105 2042 IF ( humidity ) THEN … … 2158 2095 .AND. top_scalarflux /= 0.0_wp ) THEN 2159 2096 message_string = 'boundary condition: bc_s_t = "' // & 2160 TRIM( bc_s a_t ) // '" is not allowed with ' //&2097 TRIM( bc_s_t ) // '" is not allowed with ' // & 2161 2098 'top_scalarflux /= 0.0' 2162 2099 CALL message( 'check_parameters', 'PA0441', 1, 2, 0, 6, 0 ) … … 2230 2167 2231 2168 IF ( rayleigh_damping_height == -1.0_wp ) THEN 2232 IF ( .NOT. ocean ) THEN2169 IF ( .NOT. ocean_mode ) THEN 2233 2170 rayleigh_damping_height = 0.66666666666_wp * zu(nzt) 2234 2171 ELSE … … 2236 2173 ENDIF 2237 2174 ELSE 2238 IF ( .NOT. ocean ) THEN2175 IF ( .NOT. ocean_mode ) THEN 2239 2176 IF ( rayleigh_damping_height < 0.0_wp .OR. & 2240 2177 rayleigh_damping_height > zu(nzt) ) THEN … … 2519 2456 hom(:,2,22,:) = SPREAD( zw, 2, statistic_regions+1 ) 2520 2457 2521 CASE ( 'sa', '#sa' )2522 IF ( .NOT. ocean ) THEN2523 message_string = 'data_output_pr = ' // &2524 TRIM( data_output_pr(i) ) // ' is not imp' // &2525 'lemented for ocean = .FALSE.'2526 CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 )2527 ELSE2528 dopr_index(i) = 232529 dopr_unit(i) = 'psu'2530 hom(:,2,23,:) = SPREAD( zu, 2, statistic_regions+1 )2531 IF ( data_output_pr(i)(1:1) == '#' ) THEN2532 dopr_initial_index(i) = 262533 hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 )2534 hom(nzb,2,26,:) = 0.0_wp ! because zu(nzb) is negative2535 data_output_pr(i) = data_output_pr(i)(2:)2536 ENDIF2537 ENDIF2538 2539 2458 CASE ( 'u*2' ) 2540 2459 dopr_index(i) = 30 … … 2846 2765 hom(:,2,57,:) = SPREAD( zu, 2, statistic_regions+1 ) 2847 2766 2848 2849 2767 CASE ( 'u"pt"' ) 2850 2768 dopr_index(i) = 58 … … 2876 2794 dopr_unit(i) = TRIM ( heatflux_output_unit ) 2877 2795 hom(:,2,63,:) = SPREAD( zu, 2, statistic_regions+1 ) 2878 2879 CASE ( 'rho_ocean' )2880 IF ( .NOT. ocean ) THEN2881 message_string = 'data_output_pr = ' // &2882 TRIM( data_output_pr(i) ) // ' is not imp' // &2883 'lemented for ocean = .FALSE.'2884 CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 )2885 ELSE2886 dopr_index(i) = 642887 dopr_unit(i) = 'kg/m3'2888 hom(:,2,64,:) = SPREAD( zu, 2, statistic_regions+1 )2889 IF ( data_output_pr(i)(1:1) == '#' ) THEN2890 dopr_initial_index(i) = 772891 hom(:,2,77,:) = SPREAD( zu, 2, statistic_regions+1 )2892 hom(nzb,2,77,:) = 0.0_wp ! because zu(nzb) is negative2893 data_output_pr(i) = data_output_pr(i)(2:)2894 ENDIF2895 ENDIF2896 2897 CASE ( 'w"sa"' )2898 IF ( .NOT. ocean ) THEN2899 message_string = 'data_output_pr = ' // &2900 TRIM( data_output_pr(i) ) // ' is not imp' // &2901 'lemented for ocean = .FALSE.'2902 CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 )2903 ELSE2904 dopr_index(i) = 652905 dopr_unit(i) = 'psu m/s'2906 hom(:,2,65,:) = SPREAD( zw, 2, statistic_regions+1 )2907 ENDIF2908 2909 CASE ( 'w*sa*' )2910 IF ( .NOT. ocean ) THEN2911 message_string = 'data_output_pr = ' // &2912 TRIM( data_output_pr(i) ) // ' is not imp' // &2913 'lemented for ocean = .FALSE.'2914 CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 )2915 ELSE2916 dopr_index(i) = 662917 dopr_unit(i) = 'psu m/s'2918 hom(:,2,66,:) = SPREAD( zw, 2, statistic_regions+1 )2919 ENDIF2920 2921 CASE ( 'wsa' )2922 IF ( .NOT. ocean ) THEN2923 message_string = 'data_output_pr = ' // &2924 TRIM( data_output_pr(i) ) // ' is not imp' // &2925 'lemented for ocean = .FALSE.'2926 CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 )2927 ELSE2928 dopr_index(i) = 672929 dopr_unit(i) = 'psu m/s'2930 hom(:,2,67,:) = SPREAD( zw, 2, statistic_regions+1 )2931 ENDIF2932 2796 2933 2797 CASE ( 'w*p*' ) … … 2953 2817 ENDIF 2954 2818 2955 CASE ( 'prho' )2956 IF ( .NOT. ocean ) THEN2957 message_string = 'data_output_pr = ' // &2958 TRIM( data_output_pr(i) ) // ' is not imp' // &2959 'lemented for ocean = .FALSE.'2960 CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 )2961 ELSE2962 dopr_index(i) = 712963 dopr_unit(i) = 'kg/m3'2964 hom(:,2,71,:) = SPREAD( zu, 2, statistic_regions+1 )2965 ENDIF2966 2967 2819 CASE ( 'hyp' ) 2968 2820 dopr_index(i) = 72 … … 3014 2866 ENDIF 3015 2867 3016 3017 3018 2868 CASE DEFAULT 2869 2870 ! 2871 !-- Check for other modules 2872 IF ( unit == 'illegal' .AND. bulk_cloud_model ) THEN 2873 CALL bcm_check_data_output_pr( data_output_pr(i), i, unit, & 2874 dopr_unit(i) ) 2875 ENDIF 2876 2877 IF ( unit == 'illegal' ) THEN 2878 CALL chem_check_data_output_pr( data_output_pr(i), i, unit, & 2879 dopr_unit(i) ) 2880 ENDIF 2881 2882 IF ( unit == 'illegal' .AND. gust_module_enabled ) THEN 2883 CALL gust_check_data_output_pr( data_output_pr(i), i, unit, & 2884 dopr_unit(i) ) 2885 ENDIF 2886 2887 IF ( unit == 'illegal' ) THEN 2888 CALL lsf_nudging_check_data_output_pr( data_output_pr(i), i, & 2889 unit, dopr_unit(i) ) 2890 ENDIF 3019 2891 3020 2892 CALL lsm_check_data_output_pr( data_output_pr(i), i, unit, & 3021 2893 dopr_unit(i) ) 3022 ! 3023 !-- Block of microphysics module profile outputs 3024 IF ( unit == 'illegal' .AND. bulk_cloud_model ) THEN 3025 CALL bcm_check_data_output_pr(data_output_pr(i), i, unit, & 2894 2895 IF ( unit == 'illegal' ) THEN 2896 CALL ocean_check_data_output_pr( data_output_pr(i), i, unit, & 3026 2897 dopr_unit(i) ) 3027 ENDIF3028 3029 IF ( unit == 'illegal' ) THEN3030 CALL lsf_nudging_check_data_output_pr( data_output_pr(i), i, &3031 unit, dopr_unit(i) )3032 2898 ENDIF 3033 2899 … … 3036 2902 unit, dopr_unit(i) ) 3037 2903 ENDIF 3038 ! 3039 !-- Block of gust module profile outputs 3040 IF ( unit == 'illegal' .AND. gust_module_enabled ) THEN 3041 CALL gust_check_data_output_pr( data_output_pr(i), i, unit, & 3042 dopr_unit(i) ) 3043 ENDIF 3044 3045 IF ( unit == 'illegal' ) THEN 3046 CALL chem_check_data_output_pr( data_output_pr(i), i, & 3047 unit, dopr_unit(i) ) 3048 ENDIF 3049 2904 2905 ! 2906 !-- Finally, check for user defined quantities 3050 2907 IF ( unit == 'illegal' ) THEN 3051 2908 unit = '' … … 3053 2910 ENDIF 3054 2911 2912 ! 2913 !-- No valid quantity found 3055 2914 IF ( unit == 'illegal' ) THEN 3056 2915 IF ( data_output_pr_user(1) /= ' ' ) THEN … … 3184 3043 unit = 'kg/kg' 3185 3044 3186 CASE ( 'rho_ocean' )3187 IF ( .NOT. ocean ) THEN3188 message_string = 'output of "' // TRIM( var ) // '" requi' // &3189 'res ocean = .TRUE.'3190 CALL message( 'check_parameters', 'PA0109', 1, 2, 0, 6, 0 )3191 ENDIF3192 unit = 'kg/m3'3193 3194 3045 CASE ( 's' ) 3195 3046 IF ( .NOT. passive_scalar ) THEN … … 3199 3050 ENDIF 3200 3051 unit = 'kg/m3' 3201 3202 CASE ( 'sa' )3203 IF ( .NOT. ocean ) THEN3204 message_string = 'output of "' // TRIM( var ) // '" requi' // &3205 'res ocean = .TRUE.'3206 CALL message( 'check_parameters', 'PA0109', 1, 2, 0, 6, 0 )3207 ENDIF3208 unit = 'psu'3209 3052 3210 3053 CASE ( 'p', 'pt', 'u', 'v', 'w' ) … … 3279 3122 CASE DEFAULT 3280 3123 3281 CALL tcm_check_data_output 3282 3283 ! 3284 !-- Block of microphysics module outputs3124 CALL tcm_check_data_output( var, unit ) 3125 3126 ! 3127 !-- Check for other modules 3285 3128 IF ( unit == 'illegal' .AND. bulk_cloud_model ) THEN 3286 CALL bcm_check_data_output ( var, unit ) 3287 ENDIF 3288 3289 IF ( unit == 'illegal' ) THEN 3290 CALL lsm_check_data_output ( var, unit, i, ilen, k ) 3291 ENDIF 3292 3293 IF ( unit == 'illegal' ) THEN 3294 CALL radiation_check_data_output( var, unit, i, ilen, k ) 3295 ENDIF 3296 3297 ! 3298 !-- Block of gust module outputs 3299 IF ( unit == 'illegal' .AND. gust_module_enabled ) THEN 3300 CALL gust_check_data_output ( var, unit ) 3301 ENDIF 3302 3303 ! 3304 !-- Block of chemistry model outputs 3129 CALL bcm_check_data_output( var, unit ) 3130 ENDIF 3131 3305 3132 IF ( unit == 'illegal' .AND. air_chemistry & 3306 3133 .AND. var(1:3) == 'kc_' ) THEN … … 3308 3135 ENDIF 3309 3136 3310 ! 3311 !-- Block of urban surface model outputs 3312 IF ( unit == 'illegal' .AND. urban_surface .AND. var(1:4) == 'usm_' ) THEN 3137 IF ( unit == 'illegal' ) THEN 3138 CALL lsm_check_data_output ( var, unit, i, ilen, k ) 3139 ENDIF 3140 3141 IF ( unit == 'illegal' .AND. gust_module_enabled ) THEN 3142 CALL gust_check_data_output ( var, unit ) 3143 ENDIF 3144 3145 IF ( unit == 'illegal' .AND. ocean_mode ) THEN 3146 CALL ocean_check_data_output( var, unit ) 3147 ENDIF 3148 3149 IF ( unit == 'illegal' .AND. plant_canopy & 3150 .AND. var(1:4) == 'pcm_' ) THEN 3151 CALL pcm_check_data_output( var, unit ) 3152 ENDIF 3153 3154 IF ( unit == 'illegal' ) THEN 3155 CALL radiation_check_data_output( var, unit, i, ilen, k ) 3156 ENDIF 3157 3158 IF ( unit == 'illegal' .AND. urban_surface & 3159 .AND. var(1:4) == 'usm_' ) THEN 3313 3160 CALL usm_check_data_output( var, unit ) 3314 3161 ENDIF 3315 3162 3316 ! 3317 !-- Block of plant canopy model outputs 3318 IF ( unit == 'illegal' .AND. plant_canopy .AND. var(1:4) == 'pcm_' ) THEN 3319 CALL pcm_check_data_output( var, unit ) 3320 ENDIF 3321 3322 ! 3323 !-- Block of uv exposure model outputs 3324 IF ( unit == 'illegal' .AND. uv_exposure .AND. var(1:5) == 'uvem_' ) THEN 3163 IF ( unit == 'illegal' .AND. uv_exposure & 3164 .AND. var(1:5) == 'uvem_' ) THEN 3325 3165 CALL uvem_check_data_output( var, unit, i, ilen, k ) 3326 3166 ENDIF 3327 3167 3168 ! 3169 !-- Finally, check for user-defined quantities 3328 3170 IF ( unit == 'illegal' ) THEN 3329 3171 unit = '' … … 3628 3470 !-- Determine upper and lower hight level indices for random perturbations 3629 3471 IF ( disturbance_level_b == -9999999.9_wp ) THEN 3630 IF ( ocean ) THEN3472 IF ( ocean_mode ) THEN 3631 3473 disturbance_level_b = zu((nzt*2)/3) 3632 3474 disturbance_level_ind_b = ( nzt * 2 ) / 3 … … 3653 3495 3654 3496 IF ( disturbance_level_t == -9999999.9_wp ) THEN 3655 IF ( ocean ) THEN3497 IF ( ocean_mode ) THEN 3656 3498 disturbance_level_t = zu(nzt-3) 3657 3499 disturbance_level_ind_t = nzt - 3 … … 4074 3916 4075 3917 4076 4077 !------------------------------------------------------------------------------!4078 ! Description:4079 ! ------------4080 !> Inititalizes the vertical profiles of scalar quantities.4081 !------------------------------------------------------------------------------!4082 4083 SUBROUTINE init_vertical_profiles( vertical_gradient_level_ind, &4084 vertical_gradient_level, &4085 vertical_gradient, &4086 pr_init, surface_value, bc_t_val )4087 4088 4089 IMPLICIT NONE4090 4091 INTEGER(iwp) :: i !< counter4092 INTEGER(iwp), DIMENSION(1:10) :: vertical_gradient_level_ind !< vertical grid indices for gradient levels4093 4094 REAL(wp) :: bc_t_val !< model top gradient4095 REAL(wp) :: gradient !< vertica gradient of the respective quantity4096 REAL(wp) :: surface_value !< surface value of the respecitve quantity4097 4098 4099 REAL(wp), DIMENSION(0:nz+1) :: pr_init !< initialisation profile4100 REAL(wp), DIMENSION(1:10) :: vertical_gradient !< given vertical gradient4101 REAL(wp), DIMENSION(1:10) :: vertical_gradient_level !< given vertical gradient level4102 4103 i = 14104 gradient = 0.0_wp4105 4106 IF ( .NOT. ocean ) THEN4107 4108 vertical_gradient_level_ind(1) = 04109 DO k = 1, nzt+14110 IF ( i < 11 ) THEN4111 IF ( vertical_gradient_level(i) < zu(k) .AND. &4112 vertical_gradient_level(i) >= 0.0_wp ) THEN4113 gradient = vertical_gradient(i) / 100.0_wp4114 vertical_gradient_level_ind(i) = k - 14115 i = i + 14116 ENDIF4117 ENDIF4118 IF ( gradient /= 0.0_wp ) THEN4119 IF ( k /= 1 ) THEN4120 pr_init(k) = pr_init(k-1) + dzu(k) * gradient4121 ELSE4122 pr_init(k) = pr_init(k-1) + dzu(k) * gradient4123 ENDIF4124 ELSE4125 pr_init(k) = pr_init(k-1)4126 ENDIF4127 !4128 !-- Avoid negative values4129 IF ( pr_init(k) < 0.0_wp ) THEN4130 pr_init(k) = 0.0_wp4131 ENDIF4132 ENDDO4133 4134 ELSE4135 4136 vertical_gradient_level_ind(1) = nzt+14137 DO k = nzt, 0, -14138 IF ( i < 11 ) THEN4139 IF ( vertical_gradient_level(i) > zu(k) .AND. &4140 vertical_gradient_level(i) <= 0.0_wp ) THEN4141 gradient = vertical_gradient(i) / 100.0_wp4142 vertical_gradient_level_ind(i) = k + 14143 i = i + 14144 ENDIF4145 ENDIF4146 IF ( gradient /= 0.0_wp ) THEN4147 IF ( k /= nzt ) THEN4148 pr_init(k) = pr_init(k+1) - dzu(k+1) * gradient4149 ELSE4150 pr_init(k) = surface_value - 0.5_wp * dzu(k+1) * gradient4151 pr_init(k+1) = surface_value + 0.5_wp * dzu(k+1) * gradient4152 ENDIF4153 ELSE4154 pr_init(k) = pr_init(k+1)4155 ENDIF4156 !4157 !-- Avoid negative humidities4158 IF ( pr_init(k) < 0.0_wp ) THEN4159 pr_init(k) = 0.0_wp4160 ENDIF4161 ENDDO4162 4163 ENDIF4164 4165 !4166 !-- In case of no given gradients, choose zero gradient conditions4167 IF ( vertical_gradient_level(1) == -999999.9_wp ) THEN4168 vertical_gradient_level(1) = 0.0_wp4169 ENDIF4170 !4171 !-- Store gradient at the top boundary for possible Neumann boundary condition4172 bc_t_val = ( pr_init(nzt+1) - pr_init(nzt) ) / dzu(nzt+1)4173 4174 END SUBROUTINE init_vertical_profiles4175 4176 4177 4178 3918 !------------------------------------------------------------------------------! 4179 3919 ! Description: -
palm/trunk/SOURCE/data_output_2d.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 238 241 USE arrays_3d, & 239 242 ONLY: dzw, e, heatflux_output_conversion, nc, nr, p, pt, & 240 precipitation_amount, prr, q, qc, ql, ql_c, ql_v, qr, & 241 rho_ocean, s, sa, tend, u, v, vpt, w, zu, zw, & 242 waterflux_output_conversion, hyrho, d_exner 243 precipitation_amount, prr, q, qc, ql, ql_c, ql_v, qr, s, tend, & 244 u, v, vpt, w, zu, zw, waterflux_output_conversion, hyrho, d_exner 243 245 244 246 USE averaging … … 258 260 ibc_uv_b, io_blocks, io_group, land_surface, message_string, & 259 261 ntdim_2d_xy, ntdim_2d_xz, ntdim_2d_yz, & 260 psolver, section, simulated_time,&262 ocean_mode, psolver, section, simulated_time, & 261 263 time_since_reference_point, uv_exposure 262 264 … … 284 286 id_var_time_xy, id_var_time_xz, id_var_time_yz, nc_stat, & 285 287 netcdf_data_format, netcdf_handle_error 288 289 USE ocean_mod, & 290 ONLY: ocean_data_output_2d 286 291 287 292 USE particle_attributes, & … … 940 945 level_z(nzb+1) = zu(nzb+1) 941 946 942 CASE ( 'rho_ocean_xy', 'rho_ocean_xz', 'rho_ocean_yz' )943 IF ( av == 0 ) THEN944 to_be_resorted => rho_ocean945 ELSE946 IF ( .NOT. ALLOCATED( rho_ocean_av ) ) THEN947 ALLOCATE( rho_ocean_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )948 rho_ocean_av = REAL( fill_value, KIND = wp )949 ENDIF950 to_be_resorted => rho_ocean_av951 ENDIF952 953 947 CASE ( 's_xy', 's_xz', 's_yz' ) 954 948 IF ( av == 0 ) THEN … … 960 954 ENDIF 961 955 to_be_resorted => s_av 962 ENDIF963 964 CASE ( 'sa_xy', 'sa_xz', 'sa_yz' )965 IF ( av == 0 ) THEN966 to_be_resorted => sa967 ELSE968 IF ( .NOT. ALLOCATED( sa_av ) ) THEN969 ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )970 sa_av = REAL( fill_value, KIND = wp )971 ENDIF972 to_be_resorted => sa_av973 956 ENDIF 974 957 … … 1306 1289 1307 1290 ! 1308 !-- Turbulence closure variables 1309 IF ( .NOT. found ) THEN 1310 CALL tcm_data_output_2d( av, do2d(av,if), found, grid, mode,& 1311 local_pf, nzb_do, nzt_do ) 1312 ENDIF 1313 1314 ! 1315 !-- Microphysics module quantities 1291 !-- Quantities of other modules 1316 1292 IF ( .NOT. found .AND. bulk_cloud_model ) THEN 1317 1293 CALL bcm_data_output_2d( av, do2d(av,if), found, grid, mode,& … … 1319 1295 ENDIF 1320 1296 1321 ! 1322 !-- Land surface model quantity 1297 IF ( .NOT. found .AND. gust_module_enabled ) THEN 1298 CALL gust_data_output_2d( av, do2d(av,if), found, grid, & 1299 local_pf, two_d, nzb_do, nzt_do ) 1300 ENDIF 1301 1323 1302 IF ( .NOT. found .AND. land_surface ) THEN 1324 1303 CALL lsm_data_output_2d( av, do2d(av,if), found, grid, mode,& … … 1326 1305 ENDIF 1327 1306 1328 ! 1329 !-- Radiation quantity 1307 IF ( .NOT. found .AND. ocean_mode ) THEN 1308 CALL ocean_data_output_2d( av, do2d(av,if), found, grid, & 1309 mode, local_pf, nzb_do, nzt_do ) 1310 ENDIF 1311 1330 1312 IF ( .NOT. found .AND. radiation ) THEN 1331 1313 CALL radiation_data_output_2d( av, do2d(av,if), found, grid,& … … 1334 1316 ENDIF 1335 1317 1336 ! 1337 !-- Gust module quantities 1338 IF ( .NOT. found .AND. gust_module_enabled ) THEN 1339 CALL gust_data_output_2d( av, do2d(av,if), found, grid, & 1340 local_pf, two_d, nzb_do, nzt_do ) 1341 ENDIF 1342 1343 ! 1344 !-- UV exposure model quantity 1318 IF ( .NOT. found ) THEN 1319 CALL tcm_data_output_2d( av, do2d(av,if), found, grid, mode,& 1320 local_pf, nzb_do, nzt_do ) 1321 ENDIF 1322 1345 1323 IF ( .NOT. found .AND. uv_exposure ) THEN 1346 1324 CALL uvem_data_output_2d( av, do2d(av,if), found, grid, & … … 1349 1327 1350 1328 ! 1351 !-- User defined quantit y1329 !-- User defined quantities 1352 1330 IF ( .NOT. found ) THEN 1353 1331 CALL user_data_output_2d( av, do2d(av,if), found, grid, & -
palm/trunk/SOURCE/data_output_3d.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 208 211 209 212 USE arrays_3d, & 210 ONLY: e, nc, nr, p, pt, prr, q, qc, ql, ql_c, ql_v, qr, rho_ocean, s,&211 sa, tend, u, v, vpt, w, d_exner213 ONLY: d_exner, e, nc, nr, p, pt, prr, q, qc, ql, ql_c, ql_v, qr, s, & 214 tend, u, v, vpt, w 212 215 213 216 USE averaging … … 225 228 ONLY: air_chemistry, do3d, do3d_no, do3d_time_count, & 226 229 io_blocks, io_group, land_surface, message_string, & 227 ntdim_3d, nz_do3d, plant_canopy,&230 ntdim_3d, nz_do3d, ocean_mode, plant_canopy, & 228 231 psolver, simulated_time, time_since_reference_point, & 229 232 urban_surface, varnamelength … … 252 255 netcdf_data_format, netcdf_handle_error 253 256 257 USE ocean_mod, & 258 ONLY: ocean_data_output_3d 259 254 260 USE particle_attributes, & 255 261 ONLY: grid_particles, number_of_particles, particles, & … … 614 620 ENDIF 615 621 616 CASE ( 'rho_ocean' )617 IF ( av == 0 ) THEN618 to_be_resorted => rho_ocean619 ELSE620 IF ( .NOT. ALLOCATED( rho_ocean_av ) ) THEN621 ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )622 u_av = REAL( fill_value, KIND = wp )623 ENDIF624 to_be_resorted => rho_ocean_av625 ENDIF626 627 622 CASE ( 's' ) 628 623 IF ( av == 0 ) THEN … … 634 629 ENDIF 635 630 to_be_resorted => s_av 636 ENDIF637 638 CASE ( 'sa' )639 IF ( av == 0 ) THEN640 to_be_resorted => sa641 ELSE642 IF ( .NOT. ALLOCATED( sa_av ) ) THEN643 ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )644 sa_av = REAL( fill_value, KIND = wp )645 ENDIF646 to_be_resorted => sa_av647 631 ENDIF 648 632 … … 701 685 CASE DEFAULT 702 686 703 IF ( .NOT. found ) THEN 704 CALL tcm_data_output_3d( av, do3d(av,if), found, local_pf, & 705 nzb_do, nzt_do ) 706 resorted = .TRUE. 707 ENDIF 708 709 ! 710 !-- Microphysic module quantities 687 ! 688 !-- Quantities of other modules 711 689 IF ( .NOT. found .AND. bulk_cloud_model ) THEN 712 690 CALL bcm_data_output_3d( av, do3d(av,if), found, local_pf, & … … 715 693 ENDIF 716 694 717 ! 718 !-- Land surface quantity 695 IF ( .NOT. found .AND. air_chemistry ) THEN 696 CALL chem_data_output_3d( av, do3d(av,if), found, & 697 local_pf, fill_value, nzb_do, nzt_do ) 698 resorted = .TRUE. 699 ENDIF 700 701 IF ( .NOT. found .AND. gust_module_enabled ) THEN 702 CALL gust_data_output_3d( av, do3d(av,if), found, local_pf, & 703 nzb_do, nzt_do ) 704 resorted = .TRUE. 705 ENDIF 706 719 707 IF ( .NOT. found .AND. land_surface ) THEN 720 708 ! … … 742 730 ENDIF 743 731 744 ! 745 !-- Radiation quantity 732 IF ( .NOT. found .AND. ocean_mode ) THEN 733 CALL ocean_data_output_3d( av, do3d(av,if), found, local_pf, & 734 nzb_do, nzt_do ) 735 resorted = .TRUE. 736 ENDIF 737 738 IF ( .NOT. found .AND. plant_canopy ) THEN 739 CALL pcm_data_output_3d( av, do3d(av,if), found, local_pf, & 740 fill_value, nzb_do, nzt_do ) 741 resorted = .TRUE. 742 ENDIF 743 746 744 IF ( .NOT. found .AND. radiation ) THEN 747 745 CALL radiation_data_output_3d( av, do3d(av,if), found, & … … 750 748 ENDIF 751 749 752 ! 753 !-- Gust module quantities 754 IF ( .NOT. found .AND. gust_module_enabled ) THEN 755 CALL gust_data_output_3d( av, do3d(av,if), found, local_pf, & 756 nzb_do, nzt_do ) 757 resorted = .TRUE. 758 ENDIF 759 760 ! 761 !-- Chemistry model output 762 IF ( .NOT. found .AND. air_chemistry ) THEN 763 CALL chem_data_output_3d( av, do3d(av,if), found, & 764 local_pf, fill_value, nzb_do, nzt_do ) 765 resorted = .TRUE. 766 ENDIF 767 768 ! 769 !-- Plant canopy model output 770 IF ( .NOT. found .AND. plant_canopy ) THEN 771 CALL pcm_data_output_3d( av, do3d(av,if), found, local_pf, & 772 fill_value, nzb_do, nzt_do ) 773 resorted = .TRUE. 774 ENDIF 775 776 ! 777 !-- User defined quantity 750 IF ( .NOT. found ) THEN 751 CALL tcm_data_output_3d( av, do3d(av,if), found, local_pf, & 752 nzb_do, nzt_do ) 753 resorted = .TRUE. 754 ENDIF 755 756 ! 757 !-- User defined quantities 778 758 IF ( .NOT. found ) THEN 779 759 CALL user_data_output_3d( av, do3d(av,if), found, local_pf, & -
palm/trunk/SOURCE/flow_statistics.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! ocean renamed ocean_mode 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 296 299 dt_3d, humidity, initializing_actions, land_surface, & 297 300 large_scale_forcing, large_scale_subsidence, max_pr_user, & 298 message_string, neutral, ocean , passive_scalar, simulated_time,&299 simulated_time _at_begin, use_subsidence_tendencies,&300 use_su rface_fluxes, use_top_fluxes, ws_scheme_mom,&301 ws_scheme_ sca301 message_string, neutral, ocean_mode, passive_scalar, & 302 simulated_time, simulated_time_at_begin, & 303 use_subsidence_tendencies, use_surface_fluxes, use_top_fluxes, & 304 ws_scheme_mom, ws_scheme_sca 302 305 303 306 USE cpulog, & … … 432 435 !-- According to the Neumann bc for the horizontal velocity components, 433 436 !-- the corresponding fluxes has to satisfiy the same bc. 434 IF ( ocean ) THEN437 IF ( ocean_mode ) THEN 435 438 sums_us2_ws_l(nzt+1,:) = sums_us2_ws_l(nzt,:) 436 439 sums_vs2_ws_l(nzt+1,:) = sums_vs2_ws_l(nzt,:) … … 459 462 sums_l(:,17,i) = sums_wspts_ws_l(:,i) & 460 463 * heatflux_output_conversion ! w*pt* 461 IF ( ocean 464 IF ( ocean_mode ) sums_l(:,66,i) = sums_wssas_ws_l(:,i) ! w*sa* 462 465 IF ( humidity ) sums_l(:,49,i) = sums_wsqs_ws_l(:,i) & 463 466 * waterflux_output_conversion ! w*q* … … 490 493 ! 491 494 !-- Horizontally averaged profile of salinity 492 IF ( ocean ) THEN495 IF ( ocean_mode ) THEN 493 496 !$OMP DO 494 497 DO i = nxl, nxr … … 563 566 sums_l(:,2,0) = sums_l(:,2,0) + sums_l(:,2,i) 564 567 sums_l(:,4,0) = sums_l(:,4,0) + sums_l(:,4,i) 565 IF ( ocean ) THEN568 IF ( ocean_mode ) THEN 566 569 sums_l(:,23,0) = sums_l(:,23,0) + sums_l(:,23,i) 567 570 ENDIF … … 592 595 CALL MPI_ALLREDUCE( sums_l(nzb,4,0), sums(nzb,4), nzt+2-nzb, MPI_REAL, & 593 596 MPI_SUM, comm2d, ierr ) 594 IF ( ocean ) THEN597 IF ( ocean_mode ) THEN 595 598 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 596 599 CALL MPI_ALLREDUCE( sums_l(nzb,23,0), sums(nzb,23), nzt+2-nzb, & … … 623 626 sums(:,2) = sums_l(:,2,0) 624 627 sums(:,4) = sums_l(:,4,0) 625 IF ( ocean ) sums(:,23) = sums_l(:,23,0)628 IF ( ocean_mode ) sums(:,23) = sums_l(:,23,0) 626 629 IF ( humidity ) THEN 627 630 sums(:,44) = sums_l(:,44,0) … … 648 651 ! 649 652 !-- Salinity 650 IF ( ocean ) THEN653 IF ( ocean_mode ) THEN 651 654 sums(:,23) = sums(:,23) / ngp_2dh_s_inner(:,sr) 652 655 hom(:,1,23,sr) = sums(:,23) ! sa … … 930 933 ! 931 934 !-- Salinity flux w"sa" 932 IF ( ocean ) THEN935 IF ( ocean_mode ) THEN 933 936 sums_l(k,65,tn) = sums_l(k,65,tn) & 934 937 - 0.5_wp * ( kh(k,j,i) + kh(k+1,j,i) )& … … 1000 1003 sums_l(k+ki,61,tn) = sums_l(k+ki,61,tn) + & 1001 1004 0.0_wp * rmask(j,i,sr) ! v"pt" 1002 IF ( ocean ) THEN1005 IF ( ocean_mode ) THEN 1003 1006 sums_l(k+ki,65,tn) = sums_l(k+ki,65,tn) + & 1004 1007 surf_def_h(l)%sasws(m) * rmask(j,i,sr) ! w"sa" … … 1053 1056 sums_l(nzb,61,tn) = sums_l(nzb,61,tn) + & 1054 1057 0.0_wp * rmask(j,i,sr) ! v"pt" 1055 IF ( ocean ) THEN1058 IF ( ocean_mode ) THEN 1056 1059 sums_l(nzb,65,tn) = sums_l(nzb,65,tn) + & 1057 1060 surf_lsm_h%sasws(m) * rmask(j,i,sr) ! w"sa" … … 1104 1107 sums_l(nzb,61,tn) = sums_l(nzb,61,tn) + & 1105 1108 0.0_wp * rmask(j,i,sr) ! v"pt" 1106 IF ( ocean ) THEN1109 IF ( ocean_mode ) THEN 1107 1110 sums_l(nzb,65,tn) = sums_l(nzb,65,tn) + & 1108 1111 surf_usm_h%sasws(m) * rmask(j,i,sr) ! w"sa" … … 1276 1279 0.0_wp * rmask(j,i,sr) ! v"pt" 1277 1280 1278 IF ( ocean ) THEN1281 IF ( ocean_mode ) THEN 1279 1282 sums_l(nzt,65,tn) = sums_l(nzt,65,tn) + & 1280 1283 surf_def_h(2)%sasws(m) * rmask(j,i,sr) ! w"sa" … … 1336 1339 !-- Salinity flux and density (density does not belong to here, 1337 1340 !-- but so far there is no other suitable place to calculate) 1338 IF ( ocean ) THEN1341 IF ( ocean_mode ) THEN 1339 1342 IF( .NOT. ws_scheme_sca .OR. sr /= 0 ) THEN 1340 1343 pts = 0.5_wp * ( sa(k,j,i) - hom(k,1,23,sr) + & … … 1562 1565 ! 1563 1566 !-- Density at top follows Neumann condition 1564 IF ( ocean ) THEN1567 IF ( ocean_mode ) THEN 1565 1568 sums_l(nzt+1,64,tn) = sums_l(nzt,64,tn) 1566 1569 sums_l(nzt+1,71,tn) = sums_l(nzt,71,tn) … … 2032 2035 first = .TRUE. 2033 2036 2034 IF ( ocean ) THEN2037 IF ( ocean_mode ) THEN 2035 2038 DO k = nzt, nzb+1, -1 2036 2039 IF ( first .AND. hom(k,1,18,sr) < -1.0E-8_wp ) THEN … … 2080 2083 dptdz_threshold = 0.2_wp / 100.0_wp 2081 2084 2082 IF ( ocean ) THEN2085 IF ( ocean_mode ) THEN 2083 2086 DO k = nzt+1, nzb+5, -1 2084 2087 IF ( dptdz(k) > dptdz_threshold .AND. & -
palm/trunk/SOURCE/header.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 425 428 USE netcdf_interface, & 426 429 ONLY: netcdf_data_format, netcdf_data_format_string, netcdf_deflate 430 431 USE ocean_mod, & 432 ONLY: ibc_sa_t, prho_reference, sa_surface, sa_vertical_gradient, & 433 sa_vertical_gradient_level, sa_vertical_gradient_level_ind 427 434 428 435 USE particle_attributes, & … … 578 585 ENDIF 579 586 IF ( nested_run ) run_classification = 'nested ' // run_classification(1:63) 580 IF ( ocean ) THEN587 IF ( ocean_mode ) THEN 581 588 run_classification = 'ocean - ' // run_classification(1:61) 582 589 ELSE … … 733 740 IF ( use_upstream_for_tke ) WRITE ( io, 143 ) 734 741 IF ( rayleigh_damping_factor /= 0.0_wp ) THEN 735 IF ( .NOT. ocean ) THEN742 IF ( .NOT. ocean_mode ) THEN 736 743 WRITE ( io, 123 ) 'above', rayleigh_damping_height, & 737 744 rayleigh_damping_factor … … 815 822 ! 816 823 !-- Computational grid 817 IF ( .NOT. ocean ) THEN824 IF ( .NOT. ocean_mode ) THEN 818 825 WRITE ( io, 250 ) dx, dy 819 826 … … 1176 1183 ENDIF 1177 1184 1178 IF ( ocean ) THEN1185 IF ( ocean_mode ) THEN 1179 1186 r_lower = 'sa(0) = sa(1)' 1180 1187 IF ( ibc_sa_t == 0 ) THEN … … 1253 1260 WRITE ( io, 316 ) 1254 1261 ENDIF 1255 IF ( ocean .AND. constant_top_salinityflux ) &1262 IF ( ocean_mode .AND. constant_top_salinityflux ) & 1256 1263 WRITE ( io, 309 ) top_salinityflux 1257 1264 IF ( humidity ) WRITE ( io, 315 ) … … 1412 1419 !-- Initial salinity profile 1413 1420 !-- Building output strings, starting with surface salinity 1414 IF ( ocean ) THEN1421 IF ( ocean_mode ) THEN 1415 1422 WRITE ( temperatures, '(F6.2)' ) sa_surface 1416 1423 gradients = '------' … … 1895 1902 WRITE ( io, 412 ) TRIM( reference_state ) 1896 1903 IF ( use_single_reference_value ) THEN 1897 IF ( ocean ) THEN1904 IF ( ocean_mode ) THEN 1898 1905 WRITE ( io, 413 ) prho_reference 1899 1906 ELSE -
palm/trunk/SOURCE/init_3d_model.f90
r3289 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3289 2018-09-28 10:23:58Z suehring 27 30 ! Introduce module parameter for number of inflow profiles 28 31 ! … … 549 552 USE netcdf_data_input_mod, & 550 553 ONLY: init_3d, netcdf_data_input_init_3d 554 555 USE ocean_mod, & 556 ONLY: ocean_init, ocean_init_arrays 551 557 552 558 USE particle_attributes, & … … 772 778 s_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 773 779 s_3(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 774 #endif775 ENDIF776 777 IF ( ocean ) THEN778 #if defined( __nopointer )779 ALLOCATE( prho(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &780 rho_ocean(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &781 sa(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &782 sa_p(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &783 tsa_m(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )784 #else785 ALLOCATE( prho_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &786 rho_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &787 sa_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &788 sa_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &789 sa_3(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )790 prho => prho_1791 rho_ocean => rho_1 ! routines calc_mean_profile and diffusion_e require792 ! density to be apointer793 780 #endif 794 781 ENDIF … … 1010 997 s => s_1; s_p => s_2; ts_m => s_3 1011 998 ENDIF 1012 1013 IF ( ocean ) THEN1014 sa => sa_1; sa_p => sa_2; tsa_m => sa_31015 ENDIF1016 999 #endif 1000 1017 1001 ! 1018 1002 !-- Initialize arrays for turbulence closure … … 1022 1006 CALL init_surface_arrays 1023 1007 ! 1024 !-- Allocate microphysics module arrays 1025 IF ( bulk_cloud_model ) THEN 1026 CALL bcm_init_arrays 1027 ENDIF 1028 ! 1029 !-- Allocate land surface model arrays 1030 IF ( land_surface ) THEN 1031 CALL lsm_init_arrays 1032 ENDIF 1033 1034 ! 1035 !-- Allocate wind turbine model arrays 1036 IF ( wind_turbine ) THEN 1037 CALL wtm_init_arrays 1038 ENDIF 1039 ! 1040 !-- Allocate gust module arrays 1041 IF ( gust_module_enabled ) THEN 1042 CALL gust_init_arrays 1043 ENDIF 1008 !-- Allocate arrays for other modules 1009 IF ( bulk_cloud_model ) CALL bcm_init_arrays 1010 IF ( gust_module_enabled ) CALL gust_init_arrays 1011 IF ( land_surface ) CALL lsm_init_arrays 1012 IF ( ocean_mode ) CALL ocean_init_arrays 1013 IF ( wind_turbine ) CALL wtm_init_arrays 1014 IF ( uv_exposure ) CALL uvem_init_arrays 1044 1015 1045 1016 ! … … 1053 1024 IF ( uv_exposure ) THEN 1054 1025 CALL uvem_init 1055 ENDIF1056 !1057 !-- Allocate uv exposure arrays1058 IF ( uv_exposure ) THEN1059 CALL uvem_init_arrays1060 1026 ENDIF 1061 1027 … … 1230 1196 ENDIF 1231 1197 1232 IF ( ocean ) THEN1233 DO i = nxlg, nxrg1234 DO j = nysg, nyng1235 sa(:,j,i) = sa_init1236 ENDDO1237 ENDDO1238 ENDIF1239 1198 ! 1240 1199 !-- Set velocity components at non-atmospheric / oceanic grid points to … … 1380 1339 ENDIF 1381 1340 1382 IF ( ocean ) THEN1383 DO i = nxlg, nxrg1384 DO j = nysg, nyng1385 sa(:,j,i) = sa_init1386 ENDDO1387 ENDDO1388 ENDIF1389 1341 ! 1390 1342 !-- Compute initial temperature field and other constants used in case … … 1449 1401 hom(:,1,7,:) = SPREAD( pt(:,nys,nxl), 2, statistic_regions+1 ) 1450 1402 1451 1452 !1453 !-- Store initial salinity profile1454 IF ( ocean ) THEN1455 hom(:,1,26,:) = SPREAD( sa(:,nys,nxl), 2, statistic_regions+1 )1456 ENDIF1457 1458 1403 IF ( humidity ) THEN 1459 1404 ! … … 1557 1502 ENDIF 1558 1503 1559 IF ( ocean ) THEN1560 tsa_m = 0.0_wp1561 sa_p = sa1562 ENDIF1563 1564 1504 CALL location_message( 'finished', .TRUE. ) 1565 1505 … … 1810 1750 ENDIF 1811 1751 IF ( passive_scalar ) s_p = s 1812 IF ( ocean ) sa_p = sa1813 1814 1752 ! 1815 1753 !-- Allthough tendency arrays are set in prognostic_equations, they have … … 1821 1759 ENDIF 1822 1760 IF ( passive_scalar ) ts_m = 0.0_wp 1823 IF ( ocean ) tsa_m = 0.0_wp1824 1761 ! 1825 1762 !-- Initialize synthetic turbulence generator in case of restart. … … 2241 2178 IF ( dt_dvrp /= 9999999.9_wp ) CALL init_dvrp 2242 2179 2243 IF ( ocean ) THEN 2244 ! 2245 !-- Initialize quantities needed for the ocean model 2246 CALL init_ocean 2247 2248 ENDIF 2249 ! 2250 !-- Initialize quantities for handling cloud physics 2251 !-- This routine must be called before lpm_init, because 2252 !-- otherwise, array d_exner, needed in data_output_dvrp (called by 2253 !-- lpm_init) is not defined. 2254 IF ( .NOT. ocean ) THEN 2180 ! 2181 !-- Initialize quantities needed for the ocean model 2182 IF ( ocean_mode ) CALL ocean_init 2183 2184 ! 2185 !-- Initialize quantities for handling cloud physics. 2186 !-- This routine must be called before lpm_init, becaus otherwise, 2187 !-- array d_exner, needed in data_output_dvrp (called by lpm_init) is not defined. 2188 IF ( .NOT. ocean_mode ) THEN 2255 2189 2256 2190 ALLOCATE( hyp(nzb:nzt+1) ) … … 2454 2388 rdf_sc = 0.0_wp 2455 2389 IF ( rayleigh_damping_factor /= 0.0_wp ) THEN 2456 IF ( .NOT. ocean ) THEN 2390 2391 IF ( .NOT. ocean_mode ) THEN 2457 2392 DO k = nzb+1, nzt 2458 2393 IF ( zu(k) >= rayleigh_damping_height ) THEN … … 2464 2399 ENDDO 2465 2400 ELSE 2401 ! 2402 !-- In ocean mode, rayleigh damping is applied in the lower part of the 2403 !-- model domain 2466 2404 DO k = nzt, nzb+1, -1 2467 2405 IF ( zu(k) <= rayleigh_damping_height ) THEN … … 2473 2411 ENDDO 2474 2412 ENDIF 2413 2475 2414 ENDIF 2476 2415 IF ( scalar_rayleigh_damping ) rdf_sc = rdf -
palm/trunk/SOURCE/init_grid.f90
r3241 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! ocean renamed ocean_mode 28 ! 29 ! 3241 2018-09-12 15:02:00Z raasch 27 30 ! unused variables removed 28 31 ! … … 359 362 dz_stretch_level_start, ibc_uv_b, message_string, & 360 363 momentum_advec, number_stretch_level_end, & 361 number_stretch_level_start, ocean, psolver, scalar_advec,&364 number_stretch_level_start, ocean_mode, psolver, scalar_advec, & 362 365 topography, use_surface_fluxes 363 366 … … 509 512 ! 510 513 !-- Define the vertical grid levels 511 IF ( .NOT. ocean ) THEN514 IF ( .NOT. ocean_mode ) THEN 512 515 513 516 ! … … 1293 1296 1294 1297 USE control_parameters, & 1295 ONLY: bc_lr_cyc, bc_ns_cyc, message_string, ocean 1298 ONLY: bc_lr_cyc, bc_ns_cyc, message_string, ocean_mode 1296 1299 1297 1300 USE indices, & … … 1386 1389 !-- In order to map topography on PALM grid also in case of ocean simulations, 1387 1390 !-- pre-calculate an offset value. 1388 ocean_offset = MERGE( zw(0), 0.0_wp, ocean )1391 ocean_offset = MERGE( zw(0), 0.0_wp, ocean_mode ) 1389 1392 ! 1390 1393 !-- Reference buildings on top of orography. This is not necessary … … 1638 1641 !-- Topography input via ASCII format. 1639 1642 ELSE 1640 ocean_offset = MERGE( zw(0), 0.0_wp, ocean )1643 ocean_offset = MERGE( zw(0), 0.0_wp, ocean_mode ) 1641 1644 topo_3d = IBSET( topo_3d, 0 ) 1642 1645 topo_3d(nzb,:,:) = IBCLR( topo_3d(nzb,:,:), 0 ) -
palm/trunk/SOURCE/init_masks.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! ocean renamed ocean_mode 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 145 148 mask_x_loop, mask_xyz_dimension, mask_y, mask_y_loop, mask_z, & 146 149 mask_z_loop, max_masks, message_string, mid, & 147 passive_scalar, ocean , varnamelength150 passive_scalar, ocean_mode, varnamelength 148 151 149 152 … … 412 415 413 416 CASE ( 'rho_ocean' ) 414 IF ( .NOT. ocean ) THEN415 WRITE ( message_string, * ) 'output of "', TRIM( var ), & 416 '" requires ocean = .TRUE.'417 IF ( .NOT. ocean_mode ) THEN 418 WRITE ( message_string, * ) 'output of "', TRIM( var ), & 419 '" requires ocean mode' 417 420 CALL message( 'init_masks', 'PA0109', 1, 2, 0, 6, 0 ) 418 421 ENDIF … … 428 431 429 432 CASE ( 'sa' ) 430 IF ( .NOT. ocean ) THEN431 WRITE ( message_string, * ) 'output of "', TRIM( var ), & 432 '" requires ocean = .TRUE.'433 IF ( .NOT. ocean_mode ) THEN 434 WRITE ( message_string, * ) 'output of "', TRIM( var ), & 435 '" requires ocean mode' 433 436 CALL message( 'init_masks', 'PA0109', 1, 2, 0, 6, 0 ) 434 437 ENDIF -
palm/trunk/SOURCE/large_scale_forcing_nudging_mod.f90
r3241 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! ocean renamed ocean_mode 28 ! 29 ! 3241 2018-09-12 15:02:00Z raasch 27 30 ! unused variables removed 28 31 ! … … 92 95 large_scale_forcing, large_scale_subsidence, lsf_surf, lsf_vert,& 93 96 lsf_exception, message_string, nesting_offline, neutral, & 94 nudging, passive_scalar, pt_surface, ocean , q_surface,&97 nudging, passive_scalar, pt_surface, ocean_mode, q_surface, & 95 98 surface_heatflux, surface_pressure, surface_waterflux, & 96 99 topography, use_subsidence_tendencies … … 696 699 ENDIF 697 700 698 IF ( large_scale_forcing .AND. ocean ) THEN701 IF ( large_scale_forcing .AND. ocean_mode ) THEN 699 702 message_string = 'The usage of large scale forcing from external &'//& 700 'file LSF_DATA is not implemented for ocean runs'703 'file LSF_DATA is not implemented for ocean mode' 701 704 CALL message( 'check_parameters', 'PA0378', 1, 2, 0, 6, 0 ) 702 705 ENDIF -
palm/trunk/SOURCE/lpm_init.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! ocean renamed ocean_mode 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 231 234 USE control_parameters, & 232 235 ONLY: cloud_droplets, constant_flux_layer, current_timestep_number, & 233 dt_3d, dz, initializing_actions, message_string, ocean ,&236 dt_3d, dz, initializing_actions, message_string, ocean_mode, & 234 237 simulated_time 235 238 … … 328 331 !-- In case of oceans runs, the vertical index calculations need an offset, 329 332 !-- because otherwise the k indices will become negative 330 IF ( ocean ) THEN333 IF ( ocean_mode ) THEN 331 334 offset_ocean_nzt = nzt 332 335 offset_ocean_nzt_m1 = nzt - 1 -
palm/trunk/SOURCE/modules.f90
r3289 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! ocean renamed ocean_mode 28 ! 29 ! 3289 2018-09-28 10:23:58Z suehring 27 30 ! +num_mean_inflow_profiles 28 31 ! … … 1109 1112 CHARACTER (LEN=20) :: bc_s_b = 'dirichlet' !< namelist parameter 1110 1113 CHARACTER (LEN=20) :: bc_s_t = 'initial_gradient' !< namelist parameter 1111 CHARACTER (LEN=20) :: bc_sa_t = 'neumann' !< namelist parameter1112 1114 CHARACTER (LEN=20) :: bc_uv_b = 'dirichlet' !< namelist parameter 1113 1115 CHARACTER (LEN=20) :: bc_uv_t = 'dirichlet' !< namelist parameter … … 1180 1182 INTEGER(iwp) :: ibc_s_b !< integer flag for bc_s_b 1181 1183 INTEGER(iwp) :: ibc_s_t !< integer flag for bc_s_t 1182 INTEGER(iwp) :: ibc_sa_t !< integer flag for bc_sa_t1183 1184 INTEGER(iwp) :: ibc_uv_b !< integer flag for bc_uv_b 1184 1185 INTEGER(iwp) :: ibc_uv_t !< integer flag for bc_uv_t … … 1242 1243 INTEGER(iwp) :: q_vertical_gradient_level_ind(10) = -9999 !< grid index values of q_vertical_gradient_level(s) 1243 1244 INTEGER(iwp) :: s_vertical_gradient_level_ind(10) = -9999 !< grid index values of s_vertical_gradient_level(s) 1244 INTEGER(iwp) :: sa_vertical_gradient_level_ind(10) = -9999 !< grid index values of sa_vertical_gradient_level(s)1245 1245 INTEGER(iwp) :: section(100,3) !< collective array for section_xy/xz/yz 1246 1246 INTEGER(iwp) :: section_xy(100) = -9999 !< namelist parameter … … 1293 1293 LOGICAL :: constant_top_heatflux = .TRUE. !< heat flux at domain top constant? 1294 1294 LOGICAL :: constant_top_momentumflux = .FALSE. !< momentum flux at domain topconstant? 1295 LOGICAL :: constant_top_salinityflux = .TRUE. !< salinity flux at ocean domain top?1295 LOGICAL :: constant_top_salinityflux = .TRUE. !< constant salinity flux at ocean surface 1296 1296 LOGICAL :: constant_top_scalarflux = .TRUE. !< passive-scalar flux at domain top constant? 1297 1297 LOGICAL :: constant_scalarflux = .TRUE. !< passive-scalar flux at surfaces constant? … … 1328 1328 LOGICAL :: neutral = .FALSE. !< namelist parameter 1329 1329 LOGICAL :: nudging = .FALSE. !< namelist parameter 1330 LOGICAL :: ocean = .FALSE.!< namelist parameter1330 LOGICAL :: ocean_mode = .FALSE. !< namelist parameter 1331 1331 LOGICAL :: passive_scalar = .FALSE. !< namelist parameter 1332 1332 LOGICAL :: plant_canopy = .FALSE. !< switch for use of plant canopy model … … 1380 1380 !< (galilei transformation) 1381 1381 REAL(wp) :: alpha_surface = 0.0_wp !< namelist parameter 1382 REAL(wp) :: atmos_ocean_sign = 1.0_wp !< vertical-grid conversion factor 1382 REAL(wp) :: atmos_ocean_sign = 1.0_wp !< vertical-grid conversion factor 1383 1383 !< (=1.0 in atmosphere, =-1.0 in ocean) 1384 1384 REAL(wp) :: averaging_interval = 0.0_wp !< namelist parameter … … 1454 1454 REAL(wp) :: particle_maximum_age = 9999999.9_wp !< namelist parameter 1455 1455 REAL(wp) :: prandtl_number = 1.0_wp !< namelist parameter 1456 REAL(wp) :: prho_reference !< reference state of potential density1457 1456 REAL(wp) :: pt_damping_factor = 0.0_wp !< namelist parameter 1458 1457 REAL(wp) :: pt_damping_width = 0.0_wp !< namelist parameter … … 1472 1471 REAL(wp) :: rho_surface !< surface value of density 1473 1472 REAL(wp) :: roughness_length = 0.1_wp !< namelist parameter 1474 REAL(wp) :: sa_surface = 35.0_wp !< namelist parameter1475 1473 REAL(wp) :: simulated_time = 0.0_wp !< elapsed simulated time 1476 1474 REAL(wp) :: simulated_time_at_begin !< elapsed simulated time of previous run (job chain) … … 1550 1548 REAL(wp) :: s_vertical_gradient(10) = 0.0_wp !< namelist parameter 1551 1549 REAL(wp) :: s_vertical_gradient_level(10) = -999999.9_wp !< namelist parameter 1552 REAL(wp) :: sa_vertical_gradient(10) = 0.0_wp !< namelist parameter1553 REAL(wp) :: sa_vertical_gradient_level(10) = -999999.9_wp !< namelist parameter1554 1550 REAL(wp) :: skip_time_domask(max_masks) = 9999999.9_wp !< namelist parameter 1555 1551 REAL(wp) :: threshold(20) = 0.0_wp !< namelist parameter -
palm/trunk/SOURCE/netcdf_interface_mod.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 568 571 do3d_time_count, domask_time_count, end_time, land_surface, & 569 572 mask_size_l, mask_i, mask_i_global, mask_j, mask_j_global, & 570 mask_k_global, message_string, mid, ntdim_2d_xy, 571 ntdim_2d_ xz, ntdim_2d_yz, ntdim_3d, nz_do3d, plant_canopy,&573 mask_k_global, message_string, mid, ntdim_2d_xy, ntdim_2d_xz, & 574 ntdim_2d_yz, ntdim_3d, nz_do3d, ocean_mode, plant_canopy, & 572 575 run_description_header, section, simulated_time, & 573 576 simulated_time_at_begin, skip_time_data_output_av, & … … 589 592 USE land_surface_model_mod, & 590 593 ONLY: lsm_define_netcdf_grid, nzb_soil, nzt_soil, nzs, zs 594 595 USE ocean_mod, & 596 ONLY: ocean_define_netcdf_grid 591 597 592 598 USE pegrid … … 943 949 CASE ( 'e', 'lpt', 'nc', 'nr', 'p', 'pc', 'pr', 'prr', 'pt', & 944 950 'q', 'qc', 'ql', 'ql_c', 'ql_v', 'ql_vp', 'qr', 'qv', & 945 ' rho_ocean', 's', 'sa', 'vpt' )951 's', 'vpt' ) 946 952 947 953 grid_x = 'x' … … 971 977 972 978 ! 973 !-- Block of urban surface model outputs979 !-- Block of urban surface model outputs 974 980 CASE ( 'usm_output' ) 975 981 976 CALL usm_define_netcdf_grid( domask( mid,av,i), found,&982 CALL usm_define_netcdf_grid( domask( mid,av,i), found, & 977 983 grid_x, grid_y, grid_z ) 978 984 979 985 CASE DEFAULT 980 981 CALL tcm_define_netcdf_grid( domask(mid,av,i), found, & 982 grid_x, grid_y, grid_z ) 983 984 ! 985 !-- Check for land surface quantities 986 ! 987 !-- Check for quantities defined in other modules 988 IF ( .NOT. found .AND. air_chemistry ) THEN 989 CALL chem_define_netcdf_grid( domask(mid,av,i), found, & 990 grid_x, grid_y, grid_z ) 991 ENDIF 992 993 IF ( .NOT. found .AND. gust_module_enabled ) THEN 994 CALL gust_define_netcdf_grid( domask(mid,av,i), found, & 995 grid_x, grid_y, grid_z ) 996 ENDIF 997 986 998 IF ( land_surface ) THEN 987 999 CALL lsm_define_netcdf_grid( domask(mid,av,i), found, & 988 1000 grid_x, grid_y, grid_z ) 989 1001 ENDIF 990 ! 991 !-- Check for plant canopy quantities 1002 1003 IF ( .NOT. found .AND. ocean_mode ) THEN 1004 CALL ocean_define_netcdf_grid( domask(mid,av,i), found, & 1005 grid_x, grid_y, grid_z ) 1006 ENDIF 1007 992 1008 IF ( .NOT. found .AND. plant_canopy ) THEN 993 1009 CALL pcm_define_netcdf_grid( domask(mid,av,i), found, & … … 995 1011 ENDIF 996 1012 997 !998 !-- Check for radiation quantities999 1013 IF ( .NOT. found .AND. radiation ) THEN 1000 1014 CALL radiation_define_netcdf_grid( domask(mid,av,i), & … … 1003 1017 ENDIF 1004 1018 1005 ! 1006 !-- Check for gust module quantities 1007 IF ( .NOT. found .AND. gust_module_enabled ) THEN 1008 CALL gust_define_netcdf_grid( domask(mid,av,i), found, & 1009 grid_x, grid_y, grid_z ) 1010 ENDIF 1011 1012 ! 1013 !-- Check for chemistry quantities 1014 IF ( .NOT. found .AND. air_chemistry ) THEN 1015 CALL chem_define_netcdf_grid( domask(mid,av,i), & 1016 found, grid_x, grid_y, & 1017 grid_z ) 1018 ENDIF 1019 1020 ! 1021 !-- Check for user-defined quantities 1019 CALL tcm_define_netcdf_grid( domask( mid,av,i), found, & 1020 grid_x, grid_y, grid_z ) 1021 1022 ! 1023 !-- Now check for user-defined quantities 1022 1024 IF ( .NOT. found ) THEN 1023 1025 CALL user_define_netcdf_grid( domask(mid,av,i), found, & … … 4806 4808 ! 4807 4809 !-- Define y-axis 4808 CALL netcdf_create_dim( id_set_sp, 'k_y', ny/2, id_dim_y_sp, 282 )4810 CALL netcdf_create_dim( id_set_sp, 'k_y', ny/2, id_dim_y_sp, 282 ) 4809 4811 CALL netcdf_create_var( id_set_sp, (/ id_dim_y_sp /), 'k_y', & 4810 4812 NF90_DOUBLE, id_var_y_sp, 'm-1', '', 283, & -
palm/trunk/SOURCE/parin.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 471 474 ONLY: netcdf_data_format, netcdf_deflate, netcdf_precision 472 475 476 USE ocean_mod, & 477 ONLY: ocean_parin 478 473 479 USE pegrid 474 480 … … 527 533 NAMELIST /inipar/ alpha_surface, approximation, bc_e_b, & 528 534 bc_lr, bc_ns, bc_p_b, bc_p_t, bc_pt_b, bc_pt_t, bc_q_b, & 529 bc_q_t,bc_s_b, bc_s_t, bc_ sa_t, bc_uv_b, bc_uv_t, &530 b ottom_salinityflux, building_height, building_length_x, &535 bc_q_t,bc_s_b, bc_s_t, bc_uv_b, bc_uv_t, & 536 building_height, building_length_x, & 531 537 building_length_y, building_wall_left, building_wall_south, & 532 538 calc_soil_moisture_during_spinup, & … … 559 565 most_method, nesting_offline, & 560 566 netcdf_precision, neutral, ngsrb, & 561 nsor, nsor_ini, nudging, nx, ny, nz, ocean , omega, omega_sor,&562 o utflow_source_plane, passive_scalar,&567 nsor, nsor_ini, nudging, nx, ny, nz, ocean_mode, omega, & 568 omega_sor, outflow_source_plane, passive_scalar, & 563 569 prandtl_number, psolver, pt_damping_factor, & 564 570 pt_damping_width, pt_reference, pt_surface, & … … 571 577 recycling_width, recycling_yshift, & 572 578 reference_state, residual_limit, & 573 roughness_length, sa_surface,&574 s a_vertical_gradient, sa_vertical_gradient_level, scalar_advec, &579 roughness_length, & 580 scalar_advec, & 575 581 scalar_rayleigh_damping, & 576 582 spinup_time, spinup_pt_amplitude, spinup_pt_mean, & … … 581 587 s_vertical_gradient_level, time_utc_init, timestep_scheme, & 582 588 topography, topography_grid_convention, top_heatflux, & 583 top_momentumflux_u, top_momentumflux_v, top_salinityflux,&589 top_momentumflux_u, top_momentumflux_v, & 584 590 top_scalarflux, transpose_compute_overlap, & 585 591 tunnel_height, tunnel_length, tunnel_width_x, tunnel_width_y, & … … 593 599 vg_vertical_gradient_level, v_bulk, v_profile,& 594 600 wall_adjustment, wall_heatflux, wall_humidityflux, & 595 wall_s alinityflux, wall_scalarflux, y_shift, zeta_max, zeta_min, &601 wall_scalarflux, y_shift, zeta_max, zeta_min, & 596 602 z0h_factor 597 603 598 NAMELIST /initialization_parameters/ alpha_surface, &604 NAMELIST /initialization_parameters/ alpha_surface, & 599 605 approximation, bc_e_b, & 600 606 bc_lr, bc_ns, bc_p_b, bc_p_t, bc_pt_b, bc_pt_t, bc_q_b, & 601 bc_q_t,bc_s_b, bc_s_t, bc_ sa_t, bc_uv_b, bc_uv_t,&602 b ottom_salinityflux, building_height, building_length_x,&607 bc_q_t,bc_s_b, bc_s_t, bc_uv_b, bc_uv_t, & 608 building_height, building_length_x, & 603 609 building_length_y, building_wall_left, building_wall_south, & 604 610 calc_soil_moisture_during_spinup, & 605 call_psolver_at_all_substeps, &611 call_psolver_at_all_substeps, & 606 612 canyon_height, & 607 613 canyon_width_x, canyon_width_y, canyon_wall_left, & 608 canyon_wall_south, cfl_factor, cloud_droplets, &609 cloud_top_radiation, &610 collective_wait, complex_terrain, &614 canyon_wall_south, cfl_factor, cloud_droplets, & 615 cloud_top_radiation, & 616 collective_wait, complex_terrain, & 611 617 conserve_volume_flow, & 612 618 conserve_volume_flow_mode, constant_flux_layer, & 613 coupling_start_time, &619 coupling_start_time, & 614 620 cycle_mg, damp_level_1d, & 615 621 data_output_during_spinup, & 616 622 day_of_year_init, & 617 623 dissipation_1d, & 618 dp_external, dp_level_b, dp_smooth, dpdxy, &624 dp_external, dp_level_b, dp_smooth, dpdxy, & 619 625 dt, dt_pr_1d, dt_run_control_1d, dt_spinup, dx, dy, dz, dz_max, & 620 626 dz_stretch_factor, dz_stretch_level, dz_stretch_level_start, & … … 626 632 initializing_actions, km_constant, & 627 633 large_scale_forcing, large_scale_subsidence, latitude, & 628 longitude, &634 longitude, & 629 635 loop_optimization, lsf_exception, masking_method, mg_cycles, & 630 636 mg_switch_to_pe0_level, mixing_length_1d, momentum_advec, & 631 most_method, nesting_offline, &637 most_method, nesting_offline, & 632 638 netcdf_precision, neutral, ngsrb, & 633 nsor, nsor_ini, nudging, nx, ny, nz, ocean , omega, omega_sor,&634 o utflow_source_plane, passive_scalar,&635 prandtl_number, psolver, pt_damping_factor, &639 nsor, nsor_ini, nudging, nx, ny, nz, ocean_mode, omega, & 640 omega_sor, outflow_source_plane, passive_scalar, & 641 prandtl_number, psolver, pt_damping_factor, & 636 642 pt_damping_width, pt_reference, pt_surface, & 637 643 pt_surface_initial_change, pt_vertical_gradient, & … … 643 649 recycling_width, recycling_yshift, & 644 650 reference_state, residual_limit, & 645 roughness_length, sa_surface, & 646 sa_vertical_gradient, sa_vertical_gradient_level, scalar_advec, & 647 scalar_rayleigh_damping, & 651 roughness_length, scalar_advec, & 652 scalar_rayleigh_damping, & 648 653 spinup_time, spinup_pt_amplitude, spinup_pt_mean, & 649 654 statistic_regions, subs_vertical_gradient, & … … 653 658 s_vertical_gradient_level, time_utc_init, timestep_scheme, & 654 659 topography, topography_grid_convention, top_heatflux, & 655 top_momentumflux_u, top_momentumflux_v, top_salinityflux,&660 top_momentumflux_u, top_momentumflux_v, & 656 661 top_scalarflux, transpose_compute_overlap, & 657 662 tunnel_height, tunnel_length, tunnel_width_x, tunnel_width_y, & … … 663 668 use_free_convection_scaling, & 664 669 uv_heights, u_bulk, u_profile, vg_surface, vg_vertical_gradient, & 665 vg_vertical_gradient_level, v_bulk, v_profile, &670 vg_vertical_gradient_level, v_bulk, v_profile, & 666 671 wall_adjustment, wall_heatflux, wall_humidityflux, & 667 wall_salinityflux, wall_scalarflux, y_shift, zeta_max, zeta_min, & 668 z0h_factor 672 wall_scalarflux, y_shift, zeta_max, zeta_min, z0h_factor 669 673 670 674 NAMELIST /d3par/ averaging_interval, averaging_interval_pr, & … … 858 862 859 863 ! 860 !-- Check if land surface model is used and read &lsm_par if required864 !-- Check for module namelists and read them 861 865 CALL lsm_parin 862 863 !864 !-- Check if gust module is used and read &gust_par if required865 866 CALL bcm_parin 866 867 !868 !-- Check if urban surface model is used and read &urban_surface_par if required869 867 CALL usm_parin 870 871 !872 !-- Check if spectra shall be calculated and read spectra_par if required873 868 CALL spectra_parin 874 875 !876 !-- Check if radiation model is used and read &radiation_par if required877 869 CALL radiation_parin 878 879 !880 !-- Check if gust module is used and read &gust_par if required881 870 CALL gust_parin 882 883 !884 !-- Check if multi agent system is used and read &agents_par if required885 871 CALL mas_parin 886 887 ! 888 !-- Check if plant canopy model is used and read &canopy_par if required 872 CALL ocean_parin 889 873 CALL pcm_parin 890 891 !892 !-- Read control parameters for optionally used model software packages893 874 CALL package_parin 894 895 !896 !-- Check if wind turbine model is used and read &wind_turbine_par if897 !-- required898 875 CALL wtm_parin 899 !900 !-- Check if virtual flights should be carried out and read &flight_par901 !-- if required902 876 CALL flight_parin 903 !904 !-- Check if synthetic turbulence generator is used and read stg_par if905 !-- required906 877 CALL stg_parin 907 !908 !-- Read chemistry variables909 878 CALL chem_parin 910 !911 !-- Check if uv exposure model is used and read &uvexposure_par912 879 CALL uvem_parin 913 880 ! -
palm/trunk/SOURCE/plant_canopy_model_mod.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! ocean renamed ocean_mode 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 685 688 686 689 USE control_parameters, & 687 ONLY: humidity, message_string, ocean , urban_surface690 ONLY: humidity, message_string, ocean_mode, urban_surface 688 691 689 692 USE netcdf_data_input_mod, & … … 732 735 gradient = 0.0_wp 733 736 734 IF ( .NOT. ocean ) THEN737 IF ( .NOT. ocean_mode ) THEN 735 738 736 739 lad(0) = lad_surface -
palm/trunk/SOURCE/prognostic_equations.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 277 280 278 281 282 USE advec_s_bc_mod, & 283 ONLY: advec_s_bc 284 285 USE advec_s_pw_mod, & 286 ONLY: advec_s_pw 287 288 USE advec_s_up_mod, & 289 ONLY: advec_s_up 290 291 USE advec_u_pw_mod, & 292 ONLY: advec_u_pw 293 294 USE advec_u_up_mod, & 295 ONLY: advec_u_up 296 297 USE advec_v_pw_mod, & 298 ONLY: advec_v_pw 299 300 USE advec_v_up_mod, & 301 ONLY: advec_v_up 302 303 USE advec_w_pw_mod, & 304 ONLY: advec_w_pw 305 306 USE advec_w_up_mod, & 307 ONLY: advec_w_up 308 309 USE advec_ws, & 310 ONLY: advec_s_ws, advec_u_ws, advec_v_ws, advec_w_ws 279 311 280 312 USE arrays_3d, & … … 287 319 flux_l_sa, nc, nc_p, nr, nr_p, pt, ptdf_x, ptdf_y, pt_init, & 288 320 pt_p, prho, q, q_init, q_p, qc, qc_p, qr, qr_p, rdf, rdf_sc, & 289 ref_state, rho_ocean, s, s_init, s_p, sa, sa_init, sa_p, tend, & 290 te_m, tnc_m, tnr_m, tpt_m, tq_m, tqc_m, tqr_m, ts_m, tsa_m, & 291 tu_m, tv_m, tw_m, u, ug, u_init, u_p, v, vg, vpt, v_init, v_p, & 292 w, w_p 321 ref_state, rho_ocean, s, s_init, s_p, tend, te_m, tnc_m, & 322 tnr_m, tpt_m, tq_m, tqc_m, tqr_m, ts_m, tu_m, tv_m, tw_m, u, & 323 ug, u_init, u_p, v, vg, vpt, v_init, v_p, w, w_p 293 324 294 325 USE bulk_cloud_model_mod, & … … 297 328 microphysics_morrison, microphysics_seifert 298 329 330 USE buoyancy_mod, & 331 ONLY: buoyancy 332 333 USE calc_radiation_mod, & 334 ONLY: calc_radiation 335 299 336 USE chemistry_model_mod, & 300 337 ONLY: chem_integrate, chem_prognostic_equations, & 301 338 chem_species, nspec, nvar, spc_names 302 339 340 USE chem_modules, & 341 ONLY: call_chem_at_all_substeps, chem_gasphase_on 342 303 343 USE chem_photolysis_mod, & 304 344 ONLY: photolysis_control 305 306 USE chem_modules, &307 ONLY: call_chem_at_all_substeps, chem_gasphase_on308 345 309 346 USE control_parameters, & … … 315 352 large_scale_subsidence, & 316 353 neutral, nudging, & 317 ocean, passive_scalar, plant_canopy, & 318 prho_reference, prho_reference, & 319 prho_reference, pt_reference, pt_reference, pt_reference, & 354 ocean_mode, passive_scalar, plant_canopy, pt_reference, & 320 355 scalar_advec, scalar_advec, simulated_time, sloping_surface, & 321 356 timestep_scheme, tsc, use_subsidence_tendencies, & … … 323 358 ws_scheme_sca, urban_surface, land_surface 324 359 360 USE coriolis_mod, & 361 ONLY: coriolis 362 325 363 USE cpulog, & 326 364 ONLY: cpu_log, log_point, log_point_s 327 365 328 329 USE eqn_state_seawater_mod, & 330 ONLY: eqn_state_seawater 366 USE diffusion_s_mod, & 367 ONLY: diffusion_s 368 369 USE diffusion_u_mod, & 370 ONLY: diffusion_u 371 372 USE diffusion_v_mod, & 373 ONLY: diffusion_v 374 375 USE diffusion_w_mod, & 376 ONLY: diffusion_w 331 377 332 378 USE indices, & … … 334 380 nzb, nzt, wall_flags_0 335 381 336 USE advec_ws, &337 ONLY: advec_s_ws, advec_u_ws, advec_v_ws, advec_w_ws338 339 USE advec_s_bc_mod, &340 ONLY: advec_s_bc341 342 USE advec_s_pw_mod, &343 ONLY: advec_s_pw344 345 USE advec_s_up_mod, &346 ONLY: advec_s_up347 348 USE advec_u_pw_mod, &349 ONLY: advec_u_pw350 351 USE advec_u_up_mod, &352 ONLY: advec_u_up353 354 USE advec_v_pw_mod, &355 ONLY: advec_v_pw356 357 USE advec_v_up_mod, &358 ONLY: advec_v_up359 360 USE advec_w_pw_mod, &361 ONLY: advec_w_pw362 363 USE advec_w_up_mod, &364 ONLY: advec_w_up365 366 USE buoyancy_mod, &367 ONLY: buoyancy368 369 USE calc_radiation_mod, &370 ONLY: calc_radiation371 372 USE coriolis_mod, &373 ONLY: coriolis374 375 USE diffusion_s_mod, &376 ONLY: diffusion_s377 378 USE diffusion_u_mod, &379 ONLY: diffusion_u380 381 USE diffusion_v_mod, &382 ONLY: diffusion_v383 384 USE diffusion_w_mod, &385 ONLY: diffusion_w386 387 382 USE kinds 388 383 389 384 USE lsf_nudging_mod, & 390 385 ONLY: ls_advec, nudge 386 387 USE ocean_mod, & 388 ONLY: eqn_state_seawater, ocean_prognostic_equations 391 389 392 390 USE plant_canopy_model_mod, & … … 403 401 ONLY: subsidence 404 402 403 USE surface_mod, & 404 ONLY : surf_def_h, surf_def_v, surf_lsm_h, surf_lsm_v, surf_usm_h, & 405 surf_usm_v 406 405 407 USE turbulence_closure_mod, & 406 408 ONLY: tcm_prognostic … … 408 410 USE user_actions_mod, & 409 411 ONLY: user_actions 410 411 USE surface_mod, &412 ONLY : surf_def_h, surf_def_v, surf_lsm_h, surf_lsm_v, surf_usm_h, &413 surf_usm_v414 412 415 413 USE wind_turbine_model_mod, & … … 699 697 700 698 IF ( .NOT. neutral ) THEN 701 IF ( ocean ) THEN699 IF ( ocean_mode ) THEN 702 700 CALL buoyancy( i, j, rho_ocean, 3 ) 703 701 ELSE … … 844 842 ENDIF 845 843 ENDIF 846 847 ENDIF848 849 !850 !-- If required, compute prognostic equation for salinity851 IF ( ocean ) THEN852 853 !854 !-- Tendency-terms for salinity855 tend(:,j,i) = 0.0_wp856 IF ( timestep_scheme(1:5) == 'runge' ) &857 THEN858 IF ( ws_scheme_sca ) THEN859 CALL advec_s_ws( i, j, sa, 'sa', flux_s_sa, &860 diss_s_sa, flux_l_sa, diss_l_sa, i_omp_start, tn )861 ELSE862 CALL advec_s_pw( i, j, sa )863 ENDIF864 ELSE865 CALL advec_s_up( i, j, sa )866 ENDIF867 CALL diffusion_s( i, j, sa, &868 surf_def_h(0)%sasws, surf_def_h(1)%sasws, &869 surf_def_h(2)%sasws, &870 surf_lsm_h%sasws, surf_usm_h%sasws, &871 surf_def_v(0)%sasws, surf_def_v(1)%sasws, &872 surf_def_v(2)%sasws, surf_def_v(3)%sasws, &873 surf_lsm_v(0)%sasws, surf_lsm_v(1)%sasws, &874 surf_lsm_v(2)%sasws, surf_lsm_v(3)%sasws, &875 surf_usm_v(0)%sasws, surf_usm_v(1)%sasws, &876 surf_usm_v(2)%sasws, surf_usm_v(3)%sasws )877 878 CALL user_actions( i, j, 'sa-tendency' )879 880 !881 !-- Prognostic equation for salinity882 DO k = nzb+1, nzt883 sa_p(k,j,i) = sa(k,j,i) + ( dt_3d * &884 ( tsc(2) * tend(k,j,i) + &885 tsc(3) * tsa_m(k,j,i) ) &886 - tsc(5) * rdf_sc(k) &887 * ( sa(k,j,i) - sa_init(k) )&888 ) * MERGE( 1.0_wp, 0.0_wp, &889 BTEST( wall_flags_0(k,j,i), 0 )&890 )891 IF ( sa_p(k,j,i) < 0.0_wp ) sa_p(k,j,i) = 0.1_wp * sa(k,j,i)892 ENDDO893 894 !895 !-- Calculate tendencies for the next Runge-Kutta step896 IF ( timestep_scheme(1:5) == 'runge' ) THEN897 IF ( intermediate_timestep_count == 1 ) THEN898 DO k = nzb+1, nzt899 tsa_m(k,j,i) = tend(k,j,i)900 ENDDO901 ELSEIF ( intermediate_timestep_count < &902 intermediate_timestep_count_max ) THEN903 DO k = nzb+1, nzt904 tsa_m(k,j,i) = -9.5625_wp * tend(k,j,i) + &905 5.3125_wp * tsa_m(k,j,i)906 ENDDO907 ENDIF908 ENDIF909 910 !911 !-- Calculate density by the equation of state for seawater912 CALL eqn_state_seawater( i, j )913 844 914 845 ENDIF … … 1324 1255 1325 1256 ! 1326 !-- If required, compute prognostic equation for chemical quantites1257 !-- Calculate prognostic equation for chemical quantites 1327 1258 IF ( air_chemistry ) THEN 1259 !> TODO: remove time measurement since it slows down performance because it will be called extremely often 1328 1260 CALL cpu_log( log_point(83), '(chem advec+diff+prog)', 'start' ) 1329 1261 ! 1330 1262 !-- Loop over chemical species 1331 1263 DO lsp = 1, nvar 1332 CALL chem_prognostic_equations ( chem_species(lsp)%conc_p,&1264 CALL chem_prognostic_equations( chem_species(lsp)%conc_p, & 1333 1265 chem_species(lsp)%conc, & 1334 1266 chem_species(lsp)%tconc_m, & … … 1342 1274 1343 1275 CALL cpu_log( log_point(83), '(chem advec+diff+prog)', 'stop' ) 1344 ENDIF ! Chemicals equations 1345 1346 ENDDO 1347 ENDDO 1276 ENDIF ! Chemical equations 1277 ! 1278 !-- Calculate prognostic equations for the ocean 1279 IF ( ocean_mode ) THEN 1280 CALL ocean_prognostic_equations( i, j, i_omp_start, tn ) 1281 ENDIF 1282 1283 ENDDO ! loop over j 1284 ENDDO ! loop over i 1348 1285 !$OMP END PARALLEL 1349 1286 … … 1576 1513 1577 1514 IF ( .NOT. neutral ) THEN 1578 IF ( ocean ) THEN1515 IF ( ocean_mode ) THEN 1579 1516 CALL buoyancy( rho_ocean, 3 ) 1580 1517 ELSE … … 1770 1707 1771 1708 ! 1772 !-- If required, compute prognostic equation for salinity1773 IF ( ocean ) THEN1774 1775 CALL cpu_log( log_point(37), 'sa-equation', 'start' )1776 1777 !1778 !-- sa-tendency terms with communication1779 sbt = tsc(2)1780 IF ( scalar_advec == 'bc-scheme' ) THEN1781 1782 IF ( timestep_scheme(1:5) /= 'runge' ) THEN1783 !1784 !-- Bott-Chlond scheme always uses Euler time step. Thus:1785 sbt = 1.0_wp1786 ENDIF1787 tend = 0.0_wp1788 CALL advec_s_bc( sa, 'sa' )1789 1790 ENDIF1791 1792 !1793 !-- sa-tendency terms with no communication1794 IF ( scalar_advec /= 'bc-scheme' ) THEN1795 tend = 0.0_wp1796 IF ( timestep_scheme(1:5) == 'runge' ) THEN1797 IF ( ws_scheme_sca ) THEN1798 CALL advec_s_ws( sa, 'sa' )1799 ELSE1800 CALL advec_s_pw( sa )1801 ENDIF1802 ELSE1803 CALL advec_s_up( sa )1804 ENDIF1805 ENDIF1806 1807 CALL diffusion_s( sa, &1808 surf_def_h(0)%sasws, surf_def_h(1)%sasws, &1809 surf_def_h(2)%sasws, &1810 surf_lsm_h%sasws, surf_usm_h%sasws, &1811 surf_def_v(0)%sasws, surf_def_v(1)%sasws, &1812 surf_def_v(2)%sasws, surf_def_v(3)%sasws, &1813 surf_lsm_v(0)%sasws, surf_lsm_v(1)%sasws, &1814 surf_lsm_v(2)%sasws, surf_lsm_v(3)%sasws, &1815 surf_usm_v(0)%sasws, surf_usm_v(1)%sasws, &1816 surf_usm_v(2)%sasws, surf_usm_v(3)%sasws )1817 1818 CALL user_actions( 'sa-tendency' )1819 1820 !1821 !-- Prognostic equation for salinity1822 DO i = nxl, nxr1823 DO j = nys, nyn1824 DO k = nzb+1, nzt1825 sa_p(k,j,i) = sa(k,j,i) + ( dt_3d * ( sbt * tend(k,j,i) + &1826 tsc(3) * tsa_m(k,j,i) ) &1827 - tsc(5) * rdf_sc(k) * &1828 ( sa(k,j,i) - sa_init(k) ) &1829 ) &1830 * MERGE( 1.0_wp, 0.0_wp, &1831 BTEST( wall_flags_0(k,j,i), 0 ) &1832 )1833 IF ( sa_p(k,j,i) < 0.0_wp ) sa_p(k,j,i) = 0.1_wp * sa(k,j,i)1834 ENDDO1835 ENDDO1836 ENDDO1837 1838 !1839 !-- Calculate tendencies for the next Runge-Kutta step1840 IF ( timestep_scheme(1:5) == 'runge' ) THEN1841 IF ( intermediate_timestep_count == 1 ) THEN1842 DO i = nxl, nxr1843 DO j = nys, nyn1844 DO k = nzb+1, nzt1845 tsa_m(k,j,i) = tend(k,j,i)1846 ENDDO1847 ENDDO1848 ENDDO1849 ELSEIF ( intermediate_timestep_count < &1850 intermediate_timestep_count_max ) THEN1851 DO i = nxl, nxr1852 DO j = nys, nyn1853 DO k = nzb+1, nzt1854 tsa_m(k,j,i) = -9.5625_wp * tend(k,j,i) + &1855 5.3125_wp * tsa_m(k,j,i)1856 ENDDO1857 ENDDO1858 ENDDO1859 ENDIF1860 ENDIF1861 1862 CALL cpu_log( log_point(37), 'sa-equation', 'stop' )1863 1864 !1865 !-- Calculate density by the equation of state for seawater1866 CALL cpu_log( log_point(38), 'eqns-seawater', 'start' )1867 CALL eqn_state_seawater1868 CALL cpu_log( log_point(38), 'eqns-seawater', 'stop' )1869 1870 ENDIF1871 1872 !1873 1709 !-- If required, compute prognostic equation for total water content 1874 1710 IF ( humidity ) THEN … … 2074 1910 2075 1911 CALL cpu_log( log_point(67), 'qc-equation', 'stop' ) 1912 2076 1913 CALL cpu_log( log_point(68), 'nc-equation', 'start' ) 2077 2078 1914 ! 2079 1915 !-- Calculate prognostic equation for cloud drop concentration … … 2461 2297 ENDIF 2462 2298 2299 ! 2300 !-- Calculate prognostic equations for turbulence closure 2463 2301 CALL tcm_prognostic() 2464 2302 2465 2303 ! 2466 !-- If required, compute prognostic equation for chemical quantites2304 !-- Calculate prognostic equation for chemical quantites 2467 2305 IF ( air_chemistry ) THEN 2468 2306 CALL cpu_log( log_point(83), '(chem advec+diff+prog)', 'start' ) … … 2470 2308 !-- Loop over chemical species 2471 2309 DO lsp = 1, nvar 2472 CALL chem_prognostic_equations ( chem_species(lsp)%conc_p,&2473 chem_species(lsp)%conc,&2474 chem_species(lsp)%tconc_m,&2475 chem_species(lsp)%conc_pr_init,&2476 lsp )2310 CALL chem_prognostic_equations( chem_species(lsp)%conc_p, & 2311 chem_species(lsp)%conc, & 2312 chem_species(lsp)%tconc_m, & 2313 chem_species(lsp)%conc_pr_init, & 2314 lsp ) 2477 2315 ENDDO 2478 2316 … … 2480 2318 ENDIF ! Chemicals equations 2481 2319 2320 ! 2321 !-- Calculate prognostic equations for the ocean 2322 IF ( ocean_mode ) CALL ocean_prognostic_equations() 2482 2323 2483 2324 END SUBROUTINE prognostic_equations_vector -
palm/trunk/SOURCE/read_restart_data_mod.f90
r3289 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3289 2018-09-28 10:23:58Z suehring 27 30 ! Introduce module parameter for number of inflow profiles 28 31 ! … … 77 80 78 81 USE control_parameters 79 80 82 81 83 IMPLICIT NONE … … 99 101 100 102 101 PUBLIC rrd_global, rrd_read_parts_of_global, rrd_local, & 102 rrd_skip_global 103 PUBLIC rrd_global, rrd_read_parts_of_global, rrd_local, rrd_skip_global 103 104 104 105 105 106 CONTAINS 106 107 108 !------------------------------------------------------------------------------! 107 109 ! Description: 108 110 ! ------------ … … 115 117 USE arrays_3d, & 116 118 ONLY: inflow_damping_factor, mean_inflow_profiles, pt_init, & 117 q_init, ref_state, s _init, sa_init, u_init, ug, v_init, vg119 q_init, ref_state, sa_init, s_init, u_init, ug, v_init, vg 118 120 119 121 USE bulk_cloud_model_mod, & … … 140 142 USE netcdf_interface, & 141 143 ONLY: netcdf_precision, output_for_t0 144 145 USE ocean_mod, & 146 ONLY: ocean_rrd_global 142 147 143 148 USE particle_attributes, & … … 177 182 178 183 CALL check_open( 13 ) 179 180 ! 181 !-- Make version number check first 184 ! 185 !-- Make version number check first 182 186 READ ( 13 ) length 183 187 READ ( 13 ) restart_string(1:length) … … 196 200 197 201 ! 198 !-- Read number of PEs and horizontal index bounds of all PEs used in previous199 !-- run202 !-- Read number of PEs and horizontal index bounds of all PEs used in the 203 !-- previous run 200 204 READ ( 13 ) length 201 205 READ ( 13 ) restart_string(1:length) … … 223 227 224 228 ! 225 !-- Read vertical number of gridpoints and number of different areas used226 !-- for computing statistics. Allocate arrays depending on these values,227 !-- which are needed for the following read instructions.229 !-- Read vertical number of gridpoints and number of different areas used 230 !-- for computing statistics. Allocate arrays depending on these values, 231 !-- which are needed for the following read instructions. 228 232 READ ( 13 ) length 229 233 READ ( 13 ) restart_string(1:length) … … 257 261 ENDIF 258 262 READ ( 13 ) statistic_regions 263 259 264 IF ( .NOT. ALLOCATED( ug ) ) THEN 260 265 ALLOCATE( ug(0:nz+1), u_init(0:nz+1), vg(0:nz+1), & … … 266 271 267 272 ! 268 !-- Now read all control parameters:269 !-- Caution: When the following read instructions have been changed, the270 !-- ------- version number stored in the variable binary_version_global has to271 !-- be increased. The same changes must also be done in272 !-- wrd_write_global.273 !-- Now read all control parameters: 274 !-- Caution: When the following read instructions have been changed, the 275 !-- ------- version number stored in the variable binary_version_global has 276 !-- to be increased. The same changes must also be done in 277 !-- wrd_write_global. 273 278 READ ( 13 ) length 274 279 READ ( 13 ) restart_string(1:length) … … 318 323 CASE ( 'bc_s_t' ) 319 324 READ ( 13 ) bc_s_t 320 CASE ( 'bc_sa_t' )321 READ ( 13 ) bc_sa_t322 325 CASE ( 'bc_uv_b' ) 323 326 READ ( 13 ) bc_uv_b 324 327 CASE ( 'bc_uv_t' ) 325 328 READ ( 13 ) bc_uv_t 326 CASE ( 'bottom_salinityflux' )327 READ ( 13 ) bottom_salinityflux328 329 CASE ( 'building_height' ) 329 330 READ ( 13 ) building_height … … 496 497 READ ( 13 ) ny 497 498 ny_on_file = ny 498 CASE ( 'ocean ' )499 READ ( 13 ) ocean 499 CASE ( 'ocean_mode' ) 500 READ ( 13 ) ocean_mode 500 501 CASE ( 'old_dt' ) 501 502 READ ( 13 ) old_dt … … 580 581 CASE ( 's_vertical_gradient_level_ind' ) 581 582 READ ( 13 ) s_vertical_gradient_level_ind 582 CASE ( 'sa_init' )583 READ ( 13 ) sa_init584 CASE ( 'sa_surface' )585 READ ( 13 ) sa_surface586 CASE ( 'sa_vertical_gradient' )587 READ ( 13 ) sa_vertical_gradient588 CASE ( 'sa_vertical_gradient_level' )589 READ ( 13 ) sa_vertical_gradient_level590 583 CASE ( 'scalar_advec' ) 591 584 READ ( 13 ) scalar_advec … … 662 655 CASE ( 'top_momentumflux_v' ) 663 656 READ ( 13 ) top_momentumflux_v 664 CASE ( 'top_salinityflux' )665 READ ( 13 ) top_salinityflux666 657 CASE ( 'top_scalarflux' ) 667 658 READ ( 13 ) top_scalarflux … … 754 745 CASE ( 'wall_humidityflux' ) 755 746 READ ( 13 ) wall_humidityflux 756 CASE ( 'wall_salinityflux' )757 READ ( 13 ) wall_salinityflux758 747 CASE ( 'wall_scalarflux' ) 759 748 READ ( 13 ) wall_scalarflux … … 769 758 READ ( 13 ) z_i 770 759 771 772 760 CASE DEFAULT 773 774 IF ( .NOT. found ) CALL bcm_rrd_global( found ) 775 776 IF ( .NOT. found ) CALL wtm_rrd_global( found ) 777 778 IF ( .NOT. found ) CALL flight_rrd_global( found ) 779 780 IF ( .NOT. found ) CALL stg_rrd_global ( found ) 781 782 IF ( .NOT. found ) CALL gust_rrd_global( found ) 783 784 IF ( .NOT. found ) CALL user_rrd_global( found ) 761 ! 762 !-- Read global variables from of other modules 763 IF ( .NOT. found ) CALL bcm_rrd_global( found ) 764 IF ( .NOT. found ) CALL flight_rrd_global( found ) 765 IF ( .NOT. found ) CALL gust_rrd_global( found ) 766 IF ( .NOT. found ) CALL ocean_rrd_global( found ) 767 IF ( .NOT. found ) CALL stg_rrd_global ( found ) 768 IF ( .NOT. found ) CALL wtm_rrd_global( found ) 769 ! 770 !-- Read user-defined global variables 771 IF ( .NOT. found ) CALL user_rrd_global( found ) 785 772 786 773 IF ( .NOT. found ) THEN … … 1049 1036 1050 1037 USE arrays_3d, & 1051 ONLY: e, kh, km, p, pt, q, ql, & 1052 s, sa, u, u_m_l, u_m_n, u_m_r, u_m_s, v, v_m_l, v_m_n, & 1053 v_m_r, v_m_s, vpt, w, w_m_l, w_m_n, w_m_r, w_m_s 1038 ONLY: e, kh, km, p, pt, q, ql, s, u, u_m_l, u_m_n, u_m_r, u_m_s, & 1039 v, v_m_l, v_m_n, v_m_r, v_m_s, vpt, w, w_m_l, w_m_n, w_m_r, w_m_s 1040 1041 USE bulk_cloud_model_mod, & 1042 ONLY : bcm_rrd_local 1054 1043 1055 1044 USE averaging … … 1073 1062 ONLY: lsm_rrd_local 1074 1063 1075 USE bulk_cloud_model_mod,&1076 ONLY : bcm_rrd_local1064 USE ocean_mod, & 1065 ONLY: ocean_rrd_local 1077 1066 1078 1067 USE particle_attributes, & … … 1599 1588 DEALLOCATE( tmp_2d_id_random, tmp_2d_seq_random ) 1600 1589 1601 CASE ( 'rho_ocean_av' )1602 IF ( .NOT. ALLOCATED( rho_ocean_av ) ) THEN1603 ALLOCATE( rho_ocean_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )1604 ENDIF1605 IF ( k == 1 ) READ ( 13 ) tmp_3d1606 rho_ocean_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &1607 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)1608 1609 1590 CASE ( 's' ) 1610 1591 IF ( k == 1 ) READ ( 13 ) tmp_3d … … 1618 1599 IF ( k == 1 ) READ ( 13 ) tmp_3d 1619 1600 s_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1620 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)1621 1622 CASE ( 'sa' )1623 IF ( k == 1 ) READ ( 13 ) tmp_3d1624 sa(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &1625 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)1626 1627 CASE ( 'sa_av' )1628 IF ( .NOT. ALLOCATED( sa_av ) ) THEN1629 ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )1630 ENDIF1631 IF ( k == 1 ) READ ( 13 ) tmp_3d1632 sa_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &1633 1601 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1634 1602 … … 1884 1852 1885 1853 ! 1886 !-- Read microphysics module restart data1854 !-- Read restart data of other modules 1887 1855 IF ( .NOT. found ) CALL bcm_rrd_local( i, k, nxlf, & 1888 1856 nxlc, nxl_on_file, nxrf, nxrc, & … … 1891 1859 nys_on_file, tmp_2d, tmp_3d, found ) 1892 1860 1893 ! 1894 !-- Read surface related variables 1895 IF ( .NOT. found ) CALL surface_rrd_local( i, k, nxlf, & 1896 nxlc, nxl_on_file, nxrf, nxrc, & 1861 IF ( .NOT. found ) CALL chem_rrd_local( i, k, nxlf, & 1862 nxlc, nxl_on_file, nxrf, nxrc, & 1897 1863 nxr_on_file, nynf, nync, & 1898 1864 nyn_on_file, nysf, nysc, & 1899 nys_on_file, found ) 1900 1901 ! 1902 !-- Read urban surface restart data 1903 IF ( .NOT. found ) CALL usm_rrd_local( i, k, nxlf, & 1865 nys_on_file, tmp_3d, found ) 1866 1867 IF ( .NOT. found ) CALL gust_rrd_local( i, k, nxlf, & 1904 1868 nxlc, nxl_on_file, nxrf, nxrc, & 1905 1869 nxr_on_file, nynf, nync, & 1906 1870 nyn_on_file, nysf, nysc, & 1907 nys_on_file, found ) 1908 1909 ! 1910 !-- Read land surface restart data 1871 nys_on_file, tmp_2d, tmp_3d, found ) 1872 1911 1873 IF ( .NOT. found ) CALL lsm_rrd_local( i, k, nxlf, & 1912 1874 nxlc, nxl_on_file, nxrf, nxrc, & … … 1915 1877 nys_on_file, tmp_2d, found ) 1916 1878 1917 ! 1918 !-- Read radiation restart data 1879 IF ( .NOT. found ) CALL ocean_rrd_local( i, k, nxlf, & 1880 nxlc, nxl_on_file, nxrf, nxrc, & 1881 nxr_on_file, nynf, nync, & 1882 nyn_on_file, nysf, nysc, & 1883 nys_on_file, tmp_2d, tmp_3d, found ) 1884 1919 1885 IF ( .NOT. found ) CALL radiation_rrd_local( i, k, nxlf, & 1920 1886 nxlc, nxl_on_file, nxrf, nxrc, & … … 1923 1889 nys_on_file, tmp_2d, tmp_3d, found ) 1924 1890 1925 ! 1926 !-- Read chemistry restart data 1927 IF ( .NOT. found ) CALL chem_rrd_local( i, k, nxlf, & 1891 IF ( .NOT. found ) CALL surface_rrd_local( i, k, nxlf, & 1928 1892 nxlc, nxl_on_file, nxrf, nxrc, & 1929 1893 nxr_on_file, nynf, nync, & 1930 1894 nyn_on_file, nysf, nysc, & 1931 nys_on_file, tmp_3d, found ) 1932 1933 ! 1934 !-- Read gust module restart data 1935 IF ( .NOT. found ) CALL gust_rrd_local( i, k, nxlf, & 1895 nys_on_file, found ) 1896 1897 IF ( .NOT. found ) CALL usm_rrd_local( i, k, nxlf, & 1936 1898 nxlc, nxl_on_file, nxrf, nxrc, & 1937 1899 nxr_on_file, nynf, nync, & 1938 1900 nyn_on_file, nysf, nysc, & 1939 nys_on_file, tmp_2d, tmp_3d,found )1901 nys_on_file, found ) 1940 1902 1941 1903 ! -
palm/trunk/SOURCE/subsidence_mod.f90
r3045 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! ocean renamed ocean_mode 28 ! 29 ! 3045 2018-05-28 07:55:41Z Giersch 27 30 ! Error message revised 28 31 ! … … 126 129 127 130 USE control_parameters, & 128 ONLY: message_string, ocean , subs_vertical_gradient,&131 ONLY: message_string, ocean_mode, subs_vertical_gradient, & 129 132 subs_vertical_gradient_level, subs_vertical_gradient_level_i 130 133 … … 147 150 ENDIF 148 151 149 IF ( ocean ) THEN152 IF ( ocean_mode ) THEN 150 153 message_string = 'Applying large scale vertical motion is not ' // & 151 'allowed for ocean runs'154 'allowed for ocean mode' 152 155 CALL message( 'init_w_subsidence', 'PA0324', 2, 2, 0, 6, 0 ) 153 156 ENDIF -
palm/trunk/SOURCE/sum_up_3d_data.f90
r3291 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3291 2018-09-28 11:33:03Z scharf 27 30 ! corrected previous commit for 3D topography 28 31 ! … … 211 214 212 215 USE arrays_3d, & 213 ONLY: dzw, e, heatflux_output_conversion, nc, nr, p, prr, pt,&214 q, qc, ql, ql_c, ql_v, qr, rho_ocean, s, sa, u, v, vpt, w,&215 waterflux_output_conversion , d_exner216 ONLY: dzw, d_exner, e, heatflux_output_conversion, nc, nr, p, prr, & 217 pt, q, qc, ql, ql_c, ql_v, qr, s, u, v, vpt, w, & 218 waterflux_output_conversion 216 219 217 220 USE averaging, & 218 ONLY: e_av, ghf_av, lpt_av, lwp_av, & 219 ol_av, p_av, pc_av, pr_av, pt_av, q_av, ql_av, & 220 ql_c_av, ql_v_av, ql_vp_av, qsws_av, qv_av, r_a_av, & 221 rho_ocean_av, s_av, sa_av, shf_av, ssws_av, ts_av, tsurf_av, & 222 u_av, us_av, v_av, vpt_av, w_av, z0_av, z0h_av, z0q_av 221 ONLY: e_av, ghf_av, lpt_av, lwp_av, ol_av, p_av, pc_av, pr_av, pt_av, & 222 q_av, ql_av, ql_c_av, ql_v_av, ql_vp_av, qsws_av, qv_av, & 223 r_a_av, s_av, shf_av, ssws_av, ts_av, tsurf_av, u_av, us_av, & 224 v_av, vpt_av, w_av, z0_av, z0h_av, z0q_av 223 225 224 226 USE basic_constants_and_equations_mod, & … … 232 234 233 235 USE control_parameters, & 234 ONLY: air_chemistry, average_count_3d, doav, doav_n, 235 land_surface, rho_surface, urban_surface, uv_exposure,&236 ONLY: air_chemistry, average_count_3d, doav, doav_n, land_surface, & 237 ocean_mode, rho_surface, urban_surface, uv_exposure, & 236 238 varnamelength 237 239 … … 249 251 USE land_surface_model_mod, & 250 252 ONLY: lsm_3d_data_averaging 253 254 USE ocean_mod, & 255 ONLY: ocean_3d_data_averaging 251 256 252 257 USE particle_attributes, & … … 412 417 r_a_av = 0.0_wp 413 418 414 CASE ( 'rho_ocean' )415 IF ( .NOT. ALLOCATED( rho_ocean_av ) ) THEN416 ALLOCATE( rho_ocean_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )417 ENDIF418 rho_ocean_av = 0.0_wp419 420 419 CASE ( 's' ) 421 420 IF ( .NOT. ALLOCATED( s_av ) ) THEN … … 423 422 ENDIF 424 423 s_av = 0.0_wp 425 426 CASE ( 'sa' )427 IF ( .NOT. ALLOCATED( sa_av ) ) THEN428 ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )429 ENDIF430 sa_av = 0.0_wp431 424 432 425 CASE ( 'shf*' ) … … 501 494 ENDIF 502 495 z0q_av = 0.0_wp 496 497 CASE ( 'usm_output' ) 503 498 ! 504 !-- Block of urban surface model outputs 505 CASE ( 'usm_output' ) 506 499 !-- Block of urban surface model outputs 507 500 CALL usm_average_3d_data( 'allocate', doav(ii) ) 508 501 … … 511 504 512 505 ! 513 !-- Turbulence closure module 514 CALL tcm_3d_data_averaging( 'allocate', doav(ii) ) 515 516 ! 517 !-- Microphysics module quantities 506 !-- Allocating and initializing data arrays for other modules 518 507 IF ( bulk_cloud_model ) THEN 519 508 CALL bcm_3d_data_averaging( 'allocate', doav(ii) ) 520 509 ENDIF 521 510 522 ! 523 !-- Land surface quantity 511 IF ( air_chemistry .AND. trimvar(1:3) == 'kc_') THEN 512 CALL chem_3d_data_averaging( 'allocate', doav(ii) ) 513 ENDIF 514 515 IF ( gust_module_enabled ) THEN 516 CALL gust_3d_data_averaging( 'allocate', doav(ii) ) 517 ENDIF 518 524 519 IF ( land_surface ) THEN 525 520 CALL lsm_3d_data_averaging( 'allocate', doav(ii) ) 526 521 ENDIF 527 522 528 ! 529 !-- Radiation quantity 523 IF ( ocean_mode ) THEN 524 CALL ocean_3d_data_averaging( 'allocate', doav(ii) ) 525 ENDIF 526 530 527 IF ( radiation ) THEN 531 528 CALL radiation_3d_data_averaging( 'allocate', doav(ii) ) 532 529 ENDIF 533 530 534 !535 !-- Gust module quantities536 IF ( gust_module_enabled ) THEN537 CALL gust_3d_data_averaging( 'allocate', doav(ii) )538 ENDIF539 540 !541 !-- Chemical quantity542 IF ( air_chemistry .AND. trimvar(1:3) == 'kc_') THEN543 CALL chem_3d_data_averaging( 'allocate', doav(ii) )544 ENDIF545 546 !547 !-- UV exposure quantity548 531 IF ( uv_exposure .AND. trimvar(1:5) == 'uvem_') THEN 549 532 CALL uvem_3d_data_averaging( 'allocate', doav(ii) ) 550 533 ENDIF 551 534 552 ! 553 !-- User-defined quantity 535 CALL tcm_3d_data_averaging( 'allocate', doav(ii) ) 536 537 ! 538 !-- User-defined quantities 554 539 CALL user_3d_data_averaging( 'allocate', doav(ii) ) 555 540 … … 877 862 ENDIF 878 863 879 CASE ( 'rho_ocean' )880 IF ( ALLOCATED( rho_ocean_av ) ) THEN881 DO i = nxlg, nxrg882 DO j = nysg, nyng883 DO k = nzb, nzt+1884 rho_ocean_av(k,j,i) = rho_ocean_av(k,j,i) + rho_ocean(k,j,i)885 ENDDO886 ENDDO887 ENDDO888 ENDIF889 890 864 CASE ( 's' ) 891 865 IF ( ALLOCATED( s_av ) ) THEN … … 894 868 DO k = nzb, nzt+1 895 869 s_av(k,j,i) = s_av(k,j,i) + s(k,j,i) 896 ENDDO897 ENDDO898 ENDDO899 ENDIF900 901 CASE ( 'sa' )902 IF ( ALLOCATED( sa_av ) ) THEN903 DO i = nxlg, nxrg904 DO j = nysg, nyng905 DO k = nzb, nzt+1906 sa_av(k,j,i) = sa_av(k,j,i) + sa(k,j,i)907 870 ENDDO 908 871 ENDDO … … 1182 1145 ENDDO 1183 1146 ENDIF 1147 1148 CASE ( 'usm_output' ) 1184 1149 ! 1185 !-- Block of urban surface model outputs. 1186 !-- In case of urban surface variables it should be always checked 1187 !-- if respective arrays are allocated, at least in case of a restart 1188 !-- run, as averaged usm arrays are not read from file at the moment. 1189 CASE ( 'usm_output' ) 1150 !-- Block of urban surface model outputs. 1151 !-- In case of urban surface variables it should be always checked 1152 !-- if respective arrays are allocated, at least in case of a restart 1153 !-- run, as averaged usm arrays are not read from file at the moment. 1190 1154 CALL usm_average_3d_data( 'allocate', doav(ii) ) 1191 1155 CALL usm_average_3d_data( 'sum', doav(ii) ) … … 1193 1157 CASE DEFAULT 1194 1158 ! 1195 !-- Turbulence closure module 1196 CALL tcm_3d_data_averaging( 'sum', doav(ii) ) 1197 1198 ! 1199 !-- Microphysics module quantities 1159 !-- Summing up data from other modules 1200 1160 IF ( bulk_cloud_model ) THEN 1201 1161 CALL bcm_3d_data_averaging( 'sum', doav(ii) ) 1202 1162 ENDIF 1203 1163 1204 ! 1205 !-- Land surface quantity 1164 IF ( air_chemistry .AND. trimvar(1:3) == 'kc_') THEN 1165 CALL chem_3d_data_averaging( 'sum',doav(ii) ) 1166 ENDIF 1167 1168 IF ( gust_module_enabled ) THEN 1169 CALL gust_3d_data_averaging( 'sum', doav(ii) ) 1170 ENDIF 1171 1206 1172 IF ( land_surface ) THEN 1207 1173 CALL lsm_3d_data_averaging( 'sum', doav(ii) ) 1208 1174 ENDIF 1209 1175 1210 ! 1211 !-- Radiation quantity 1176 IF ( ocean_mode ) THEN 1177 CALL ocean_3d_data_averaging( 'sum', doav(ii) ) 1178 ENDIF 1179 1212 1180 IF ( radiation ) THEN 1213 1181 CALL radiation_3d_data_averaging( 'sum', doav(ii) ) 1214 1182 ENDIF 1215 1183 1216 ! 1217 !-- Gust module quantities 1218 IF ( gust_module_enabled ) THEN 1219 CALL gust_3d_data_averaging( 'sum', doav(ii) ) 1220 ENDIF 1221 1222 ! 1223 !-- Chemical quantity 1224 IF ( air_chemistry .AND. trimvar(1:3) == 'kc_') THEN 1225 CALL chem_3d_data_averaging( 'sum',doav(ii) ) 1226 ENDIF 1227 1228 ! 1229 !-- UV exposure quantity 1184 CALL tcm_3d_data_averaging( 'sum', doav(ii) ) 1185 1230 1186 IF ( uv_exposure ) THEN 1231 1187 CALL uvem_3d_data_averaging( 'sum', doav(ii) ) … … 1233 1189 1234 1190 ! 1235 !-- User-defined quantit y1191 !-- User-defined quantities 1236 1192 CALL user_3d_data_averaging( 'sum', doav(ii) ) 1237 1193 -
palm/trunk/SOURCE/surface_mod.f90
r3274 r3294 26 26 ! ----------------- 27 27 ! $Id$ 28 ! changes concerning modularization of ocean option 29 ! 30 ! 3274 2018-09-24 15:42:55Z knoop 28 31 ! Modularization of all bulk cloud physics code components 29 32 ! … … 1114 1117 ! 1115 1118 !-- Salinity surface flux 1116 IF ( ocean ) DEALLOCATE ( surfaces%sasws )1119 IF ( ocean_mode ) DEALLOCATE ( surfaces%sasws ) 1117 1120 1118 1121 END SUBROUTINE deallocate_surface_attributes_h … … 1241 1244 ! 1242 1245 !-- Salinity surface flux 1243 IF ( ocean ) ALLOCATE ( surfaces%sasws(1:surfaces%ns) )1246 IF ( ocean_mode ) ALLOCATE ( surfaces%sasws(1:surfaces%ns) ) 1244 1247 1245 1248 END SUBROUTINE allocate_surface_attributes_h … … 1306 1309 ! 1307 1310 !-- Salinity flux 1308 IF ( ocean ) DEALLOCATE ( surfaces%sasws )1311 IF ( ocean_mode ) DEALLOCATE ( surfaces%sasws ) 1309 1312 1310 1313 END SUBROUTINE deallocate_surface_attributes_h_top … … 1378 1381 ! 1379 1382 !-- Salinity flux 1380 IF ( ocean ) ALLOCATE ( surfaces%sasws(1:surfaces%ns) )1383 IF ( ocean_mode ) ALLOCATE ( surfaces%sasws(1:surfaces%ns) ) 1381 1384 1382 1385 END SUBROUTINE allocate_surface_attributes_h_top … … 1496 1499 ! 1497 1500 !-- Salinity surface flux 1498 IF ( ocean ) DEALLOCATE ( surfaces%sasws )1501 IF ( ocean_mode ) DEALLOCATE ( surfaces%sasws ) 1499 1502 1500 1503 END SUBROUTINE deallocate_surface_attributes_v … … 1621 1624 ! 1622 1625 !-- Salinity surface flux 1623 IF ( ocean ) ALLOCATE ( surfaces%sasws(1:surfaces%ns) )1626 IF ( ocean_mode ) ALLOCATE ( surfaces%sasws(1:surfaces%ns) ) 1624 1627 1625 1628 END SUBROUTINE allocate_surface_attributes_v … … 2268 2271 ENDIF 2269 2272 2270 IF ( ocean ) THEN2273 IF ( ocean_mode ) THEN 2271 2274 IF ( upward_facing ) THEN 2272 2275 surf%sasws(num_h) = bottom_salinityflux * rho_air_zw(k-1) … … 2344 2347 ! 2345 2348 !-- Prescribe top salinity flux 2346 IF ( ocean .AND. constant_top_salinityflux)&2349 IF ( ocean_mode .AND. constant_top_salinityflux) & 2347 2350 surf%sasws(num_h) = top_salinityflux * rho_air_zw(nzt+1) 2348 2351 ! … … 2488 2491 !-- So far, salinityflux at vertical surfaces is simply zero 2489 2492 !-- at the moment 2490 IF ( ocean ) surf%sasws(num_v) = wall_salinityflux(component)2493 IF ( ocean_mode ) surf%sasws(num_v) = wall_salinityflux(component) 2491 2494 ! 2492 2495 !-- Increment wall indices -
palm/trunk/SOURCE/swap_timelevel.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 147 150 ONLY: chem_swap_timelevel 148 151 149 USE land_surface_model_mod, &150 ONLY: lsm_swap_timelevel151 152 152 USE cpulog, & 153 153 ONLY: cpu_log, log_point 154 154 155 155 USE control_parameters, & 156 ONLY: air_chemistry, humidity, land_surface, 157 neutral, ocean,passive_scalar, timestep_count, urban_surface156 ONLY: air_chemistry, humidity, land_surface, neutral, ocean_mode, & 157 passive_scalar, timestep_count, urban_surface 158 158 159 159 USE gust_mod, & … … 164 164 ONLY: nxlg, nxrg, nyng, nysg, nzb, nzt 165 165 #endif 166 167 USE land_surface_model_mod, & 168 ONLY: lsm_swap_timelevel 169 170 USE ocean_mod, & 171 ONLY: ocean_swap_timelevel 166 172 167 173 USE pmc_interface, & … … 202 208 ENDDO 203 209 204 CALL tcm_swap_timelevel ( 0 )205 206 IF ( ocean ) THEN207 sa = sa_p208 ENDIF209 210 210 IF ( humidity ) THEN 211 211 q = q_p … … 214 214 IF ( passive_scalar ) s = s_p 215 215 216 IF ( humidity .AND. bulk_cloud_model ) THEN 217 CALL bcm_swap_timelevel ( 0 ) 218 ENDIF 219 220 IF ( land_surface ) THEN 221 CALL lsm_swap_timelevel ( 0 ) 222 ENDIF 223 224 IF ( urban_surface ) THEN 225 CALL usm_swap_timelevel ( 0 ) 226 ENDIF 227 228 IF ( gust_module_enabled ) THEN 229 CALL gust_swap_timelevel ( 0 ) 230 ENDIF 231 216 ! 217 !-- Swapping the timelevel of other modules 218 IF ( humidity .AND. bulk_cloud_model ) CALL bcm_swap_timelevel( 0 ) 219 IF ( gust_module_enabled ) CALL gust_swap_timelevel( 0 ) 220 IF ( land_surface ) CALL lsm_swap_timelevel( 0 ) 221 IF ( ocean_mode ) CALL ocean_swap_timelevl( 0 ) 222 CALL tcm_swap_timelevel( 0 ) 223 IF ( urban_surface ) CALL usm_swap_timelevel( 0 ) 232 224 233 225 CALL cpu_log( log_point(28), 'swap_timelevel (nop)', 'stop' ) … … 245 237 pt => pt_1; pt_p => pt_2 246 238 ENDIF 247 IF ( ocean ) THEN239 IF ( ocean_mode ) THEN 248 240 sa => sa_1; sa_p => sa_2 249 241 ENDIF … … 254 246 s => s_1; s_p => s_2 255 247 ENDIF 256 257 IF ( air_chemistry ) CALL chem_swap_timelevel(0)258 248 259 249 swap_level = 1 … … 267 257 pt => pt_2; pt_p => pt_1 268 258 ENDIF 269 IF ( ocean ) THEN259 IF ( ocean_mode ) THEN 270 260 sa => sa_2; sa_p => sa_1 271 261 ENDIF … … 277 267 ENDIF 278 268 279 IF ( air_chemistry ) CALL chem_swap_timelevel(1)280 281 269 swap_level = 2 282 270 283 271 END SELECT 272 273 IF ( air_chemistry ) CALL chem_swap_timelevel( MOD( timestep_count, 2) ) 284 274 285 275 CALL tcm_swap_timelevel ( MOD( timestep_count, 2) ) -
palm/trunk/SOURCE/time_integration.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 369 372 ref_state, rho_ocean, s, s_p, sa_p, tend, u, u_p, v, vpt, & 370 373 v_p, w, w_p 374 375 USE bulk_cloud_model_mod, & 376 ONLY: bulk_cloud_model, calc_liquid_water_content, & 377 collision_turbulence, microphysics_morrison, microphysics_seifert 371 378 372 379 USE calc_mean_profile_mod, & … … 399 406 multi_agent_system_end, multi_agent_system_start, & 400 407 nesting_offline, neutral, nr_timesteps_this_run, nudging, & 401 ocean , passive_scalar, prho_reference, pt_reference,&408 ocean_mode, passive_scalar, pt_reference, & 402 409 pt_slope_offset, random_heatflux, rans_mode, & 403 410 rans_tke_e, run_coupled, simulated_time, simulated_time_chr, & … … 443 450 lsf_nesting_offline, lsf_nesting_offline_mass_conservation 444 451 445 USE bulk_cloud_model_mod, &446 ONLY: bulk_cloud_model, calc_liquid_water_content, &447 collision_turbulence, microphysics_morrison, microphysics_seifert448 449 452 USE netcdf_data_input_mod, & 450 453 ONLY: nest_offl, netcdf_data_input_lsf … … 452 455 USE multi_agent_system_mod, & 453 456 ONLY: agents_active, multi_agent_system 457 458 USE ocean_mod, & 459 ONLY: prho_reference 454 460 455 461 USE particle_attributes, & … … 662 668 ref_state(:) = hom(:,1,4,0) ! this is used in the buoyancy term 663 669 ENDIF 664 IF ( ocean ) THEN670 IF ( ocean_mode ) THEN 665 671 CALL calc_mean_profile( rho_ocean, 64 ) 666 672 ref_state(:) = hom(:,1,64,0) … … 753 759 ENDIF 754 760 ENDIF 755 IF ( ocean ) THEN761 IF ( ocean_mode ) THEN 756 762 CALL exchange_horiz( sa_p, nbgp ) 757 763 CALL exchange_horiz( rho_ocean, nbgp ) … … 1053 1059 CALL cpu_log( log_point(17), 'diffusivities', 'start' ) 1054 1060 IF ( .NOT. humidity ) THEN 1055 IF ( ocean ) THEN1061 IF ( ocean_mode ) THEN 1056 1062 CALL tcm_diffusivities( prho, prho_reference ) 1057 1063 ELSE -
palm/trunk/SOURCE/turbulence_closure_mod.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 164 167 initializing_actions, intermediate_timestep_count, & 165 168 intermediate_timestep_count_max, km_constant, & 166 les_dynamic, les_mw, ocean , plant_canopy, prandtl_number,&167 p rho_reference, pt_reference, rans_mode, rans_tke_e, rans_tke_l,&169 les_dynamic, les_mw, ocean_mode, plant_canopy, prandtl_number, & 170 pt_reference, rans_mode, rans_tke_e, rans_tke_l, & 168 171 simulated_time,timestep_scheme, turbulence_closure, & 169 172 turbulent_inflow, use_upstream_for_tke, vpt_reference, & … … 190 193 191 194 USE kinds 195 196 USE ocean_mod, & 197 ONLY: prho_reference 192 198 193 199 USE pegrid … … 1116 1122 e = e_init 1117 1123 ELSE 1118 IF ( .NOT. ocean ) THEN1124 IF ( .NOT. ocean_mode ) THEN 1119 1125 kh = 0.01_wp ! there must exist an initial diffusion, because 1120 1126 km = 0.01_wp ! otherwise no TKE would be produced by the … … 1160 1166 e = e_init 1161 1167 ELSE 1162 IF ( .NOT. ocean ) THEN1168 IF ( .NOT. ocean_mode ) THEN 1163 1169 kh = 0.01_wp ! there must exist an initial diffusion, because 1164 1170 km = 0.01_wp ! otherwise no TKE would be produced by the … … 2155 2161 2156 2162 IF ( .NOT. humidity ) THEN 2157 IF ( ocean ) THEN2163 IF ( ocean_mode ) THEN 2158 2164 CALL diffusion_e( prho, prho_reference ) 2159 2165 ELSE … … 2423 2429 2424 2430 IF ( .NOT. humidity ) THEN 2425 IF ( ocean ) THEN2431 IF ( ocean_mode ) THEN 2426 2432 CALL diffusion_e( i, j, prho, prho_reference ) 2427 2433 ELSE … … 2934 2940 IF ( .NOT. humidity ) THEN 2935 2941 2936 IF ( ocean ) THEN2942 IF ( ocean_mode ) THEN 2937 2943 ! 2938 2944 !-- So far in the ocean no special treatment of density flux … … 3738 3744 IF ( .NOT. humidity ) THEN 3739 3745 3740 IF ( ocean ) THEN3746 IF ( ocean_mode ) THEN 3741 3747 ! 3742 3748 !-- So far in the ocean no special treatment of density flux in -
palm/trunk/SOURCE/write_restart_data_mod.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changes concerning modularization of ocean option 28 ! 29 ! 3274 2018-09-24 15:42:55Z knoop 27 30 ! Modularization of all bulk cloud physics code components 28 31 ! … … 95 98 USE arrays_3d, & 96 99 ONLY: inflow_damping_factor, mean_inflow_profiles, pt_init, & 97 q_init, ref_state, s_init, sa_init, u_init, ug, v_init, vg 100 q_init, ref_state, s_init, u_init, ug, v_init, vg 101 102 USE bulk_cloud_model_mod, & 103 ONLY: bulk_cloud_model, bcm_wrd_global 98 104 99 105 USE date_and_time_mod, & … … 112 118 ONLY: nx, ny, nz 113 119 114 USE bulk_cloud_model_mod, &115 ONLY: bulk_cloud_model, bcm_wrd_global116 117 120 USE model_1d_mod, & 118 121 ONLY: damp_level_1d, dt_pr_1d, dt_run_control_1d, end_time_1d … … 120 123 USE netcdf_interface, & 121 124 ONLY: netcdf_precision, output_for_t0 125 126 USE ocean_mod, & 127 ONLY: ocean_wrd_global 122 128 123 129 USE particle_attributes, & … … 238 244 WRITE ( 14 ) bc_s_t 239 245 240 CALL wrd_write_string( 'bc_sa_t' )241 WRITE ( 14 ) bc_sa_t242 243 246 CALL wrd_write_string( 'bc_uv_b' ) 244 247 WRITE ( 14 ) bc_uv_b … … 246 249 CALL wrd_write_string( 'bc_uv_t' ) 247 250 WRITE ( 14 ) bc_uv_t 248 249 CALL wrd_write_string( 'bottom_salinityflux' )250 WRITE ( 14 ) bottom_salinityflux251 251 252 252 CALL wrd_write_string( 'building_height' ) … … 497 497 WRITE ( 14 ) ny 498 498 499 CALL wrd_write_string( 'ocean ' )500 WRITE ( 14 ) ocean 499 CALL wrd_write_string( 'ocean_mode' ) 500 WRITE ( 14 ) ocean_mode 501 501 502 502 CALL wrd_write_string( 'old_dt' ) … … 622 622 CALL wrd_write_string( 's_vertical_gradient_level_ind' ) 623 623 WRITE ( 14 ) s_vertical_gradient_level_ind 624 625 CALL wrd_write_string( 'sa_init' )626 WRITE ( 14 ) sa_init627 628 CALL wrd_write_string( 'sa_surface' )629 WRITE ( 14 ) sa_surface630 631 CALL wrd_write_string( 'sa_vertical_gradient' )632 WRITE ( 14 ) sa_vertical_gradient633 634 CALL wrd_write_string( 'sa_vertical_gradient_level' )635 WRITE ( 14 ) sa_vertical_gradient_level636 624 637 625 CALL wrd_write_string( 'scalar_advec' ) … … 738 726 WRITE ( 14 ) top_momentumflux_v 739 727 740 CALL wrd_write_string( 'top_salinityflux' )741 WRITE ( 14 ) top_salinityflux742 743 728 CALL wrd_write_string( 'top_scalarflux' ) 744 729 WRITE ( 14 ) top_scalarflux … … 876 861 WRITE ( 14 ) wall_humidityflux 877 862 878 CALL wrd_write_string( 'wall_salinityflux' )879 WRITE ( 14 ) wall_salinityflux880 881 863 CALL wrd_write_string( 'wall_scalarflux' ) 882 864 WRITE ( 14 ) wall_scalarflux … … 897 879 WRITE ( 14 ) z_i 898 880 899 900 ! 901 !-- The order of the calls can be different as in read_restart_data_mod where 902 !-- the restart data will be read 903 904 ! 905 !-- If required, write restart data for gust module. 906 IF ( bulk_cloud_model ) CALL bcm_wrd_global 907 ! 908 !-- If required, write restart data for wind turbine model. 909 IF ( wind_turbine ) CALL wtm_wrd_global 910 911 ! 912 !-- If required, write restart data for virtual measurements. 913 IF ( virtual_flight ) CALL flight_wrd_global 914 915 ! 916 !-- If required, write restart data for turbulence generator. 917 IF ( syn_turb_gen ) CALL stg_wrd_global 918 919 ! 920 !-- If required, write restart data for gust module. 881 ! 882 !-- Write restart data of the other modules 883 !-- The order of the calls can be different as in read_restart_data_mod where 884 !-- the restart data will be read 885 IF ( bulk_cloud_model ) CALL bcm_wrd_global 886 IF ( virtual_flight ) CALL flight_wrd_global 921 887 IF ( gust_module_enabled ) CALL gust_wrd_global 922 923 ! 924 !-- Write restart data for user data. 888 IF ( ocean_mode ) CALL ocean_wrd_global 889 IF ( syn_turb_gen ) CALL stg_wrd_global 890 IF ( wind_turbine ) CALL wtm_wrd_global 891 ! 892 !-- Write restart data of the user-interface 925 893 CALL user_wrd_global 926 894 … … 940 908 941 909 USE arrays_3d, & 942 ONLY: e, kh, km, p, pt, q, ql, s, sa, u, u_m_l, u_m_n, u_m_r,&910 ONLY: e, kh, km, p, pt, q, ql, s, u, u_m_l, u_m_n, u_m_r, & 943 911 u_m_s, v, v_m_l, v_m_n, v_m_r, v_m_s, vpt, w, w_m_l, w_m_n, & 944 912 w_m_r, w_m_s … … 960 928 USE land_surface_model_mod, & 961 929 ONLY: lsm_wrd_local 930 931 USE ocean_mod, & 932 ONLY: ocean_wrd_local 962 933 963 934 USE particle_attributes, & … … 1112 1083 ENDIF 1113 1084 1114 IF ( ocean ) THEN1115 1116 IF ( ALLOCATED( rho_ocean_av ) ) THEN1117 CALL wrd_write_string( 'rho_ocean_av' )1118 WRITE ( 14 ) rho_ocean_av1119 ENDIF1120 1121 CALL wrd_write_string( 'sa' )1122 WRITE ( 14 ) sa1123 1124 IF ( ALLOCATED( sa_av ) ) THEN1125 CALL wrd_write_string( 'sa_av' )1126 WRITE ( 14 ) sa_av1127 ENDIF1128 1129 ENDIF1130 1131 1085 IF ( ALLOCATED( ql_c_av ) ) THEN 1132 1086 CALL wrd_write_string( 'ql_c_av' ) … … 1310 1264 1311 1265 ! 1312 !-- If required, write restart data for microphysics module. 1313 IF ( bulk_cloud_model ) THEN 1314 CALL bcm_wrd_local 1315 ENDIF 1316 1317 ! 1318 !-- Write surface-related restart data. 1266 !-- Write restart data of other modules 1267 IF ( bulk_cloud_model ) CALL bcm_wrd_local 1268 IF ( air_chemistry ) CALL chem_wrd_local 1269 IF ( gust_module_enabled ) CALL gust_wrd_local 1270 IF ( land_surface ) CALL lsm_wrd_local 1271 IF ( ocean_mode ) CALL ocean_wrd_local 1319 1272 CALL surface_wrd_local 1320 1321 ! 1322 !-- If required, write restart data for urban surface model. 1323 IF ( urban_surface ) THEN 1324 CALL usm_wrd_local 1325 ENDIF 1326 1327 ! 1328 !-- If required, write restart data for land surface model. 1329 IF ( land_surface ) THEN 1330 CALL lsm_wrd_local 1331 ENDIF 1332 1333 ! 1334 !-- If required, write restart data for radiation model. 1335 IF ( radiation ) THEN 1336 CALL radiation_wrd_local 1337 ENDIF 1338 1339 ! 1340 !-- If required, write restart data for chemistry model. 1341 IF ( air_chemistry ) THEN 1342 CALL chem_wrd_local 1343 ENDIF 1344 1345 ! 1346 !-- If required, write restart data for gust module. 1347 IF ( gust_module_enabled ) THEN 1348 CALL gust_wrd_local 1349 ENDIF 1350 1351 ! 1352 !-- Write user-related restart data. 1273 IF ( radiation ) CALL radiation_wrd_local 1274 IF ( urban_surface ) CALL usm_wrd_local 1275 1276 ! 1277 !-- Write user-defined restart data 1353 1278 CALL user_wrd_local 1354 1279 1355 !-- Write end label. 1280 ! 1281 !-- Write end label 1356 1282 CALL wrd_write_string( '*** end ***' ) 1357 1283
Note: See TracChangeset
for help on using the changeset viewer.