Changeset 1972
- Timestamp:
- Jul 26, 2016 7:52:02 AM (8 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/Makefile
r1958 r1972 20 20 # Current revisions: 21 21 # ------------------ 22 # 22 # Removed some dependencies due to further modularization of land surface model 23 23 # 24 24 # Former revisions: … … 509 509 nudging_mod.o: modules.o cpulog_mod.o mod_kinds.o 510 510 package_parin.o: modules.o mod_kinds.o mod_particle_attributes.o 511 palm.o: modules.o cpulog_mod.o l s_forcing_mod.o mod_kinds.o nudging_mod.o\511 palm.o: modules.o cpulog_mod.o land_surface_model_mod.o ls_forcing_mod.o mod_kinds.o nudging_mod.o\ 512 512 pmc_interface_mod.o surface_layer_fluxes_mod.o 513 513 parin.o: modules.o cpulog_mod.o land_surface_model_mod.o mod_kinds.o netcdf_interface_mod.o \ … … 541 541 random_gauss.o: mod_kinds.o random_function_mod.o random_generator_parallel_mod.o 542 542 random_generator_parallel_mod.o: mod_kinds.o 543 read_3d_binary.o: modules.o cpulog_mod.o mod_kinds.o land_surface_model_mod.o\544 radiation_model_mod.o random_function_mod.o random_generator_parallel_mod.o \543 read_3d_binary.o: modules.o cpulog_mod.o mod_kinds.o \ 544 land_surface_model_mod.o radiation_model_mod.o random_function_mod.o random_generator_parallel_mod.o \ 545 545 spectra_mod.o 546 546 read_var_list.o: modules.o mod_kinds.o netcdf_interface_mod.o plant_canopy_model_mod.o \ … … 604 604 wall_fluxes.o: modules.o mod_kinds.o 605 605 wind_turbine_model_mod.o: modules.o cpulog_mod.o mod_kinds.o 606 write_3d_binary.o: modules.o cpulog_mod.o mod_kinds.o land_surface_model_mod.o\606 write_3d_binary.o: modules.o cpulog_mod.o mod_kinds.o \ 607 607 radiation_model_mod.o random_function_mod.o random_generator_parallel_mod.o \ 608 608 spectra_mod.o -
palm/trunk/SOURCE/average_3d_data.f90
r1961 r1972 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Output of land surface quantities is now done directly in the respective module 22 22 ! 23 23 ! Former revisions: … … 95 95 96 96 USE land_surface_model_mod, & 97 ONLY: c_liq_av, c_soil_av, c_veg_av, ghf_eb_av, lai_av, m_liq_eb_av, & 98 m_soil_av, nzb_soil, nzt_soil, qsws_eb_av, qsws_liq_eb_av, & 99 qsws_soil_eb_av, qsws_veg_eb_av, r_a, r_a_av, r_s, r_s_av, & 100 shf_eb_av, t_soil_av 97 ONLY: land_surface, lsm_3d_data_averaging 101 98 102 99 USE radiation_model_mod, & … … 130 127 SELECT CASE ( TRIM( doav(ii) ) ) 131 128 132 CASE ( 'c_liq*' )133 DO i = nxlg, nxrg134 DO j = nysg, nyng135 c_liq_av(j,i) = c_liq_av(j,i) / REAL( average_count_3d, KIND=wp )136 ENDDO137 ENDDO138 139 CASE ( 'c_soil*' )140 DO i = nxlg, nxrg141 DO j = nysg, nyng142 c_soil_av(j,i) = c_soil_av(j,i) / REAL( average_count_3d, KIND=wp )143 ENDDO144 ENDDO145 146 CASE ( 'c_veg*' )147 DO i = nxlg, nxrg148 DO j = nysg, nyng149 c_veg_av(j,i) = c_veg_av(j,i) / REAL( average_count_3d, KIND=wp )150 ENDDO151 ENDDO152 153 129 CASE ( 'e' ) 154 130 DO i = nxlg, nxrg … … 160 136 ENDDO 161 137 162 CASE ( 'ghf_eb*' )163 DO i = nxlg, nxrg164 DO j = nysg, nyng165 ghf_eb_av(j,i) = ghf_eb_av(j,i) / REAL( average_count_3d, KIND=wp )166 ENDDO167 ENDDO168 169 138 CASE ( 'qsws*' ) 170 139 DO i = nxlg, nxrg … … 174 143 ENDDO 175 144 176 CASE ( 'lai*' )177 DO i = nxlg, nxrg178 DO j = nysg, nyng179 lai_av(j,i) = lai_av(j,i) / REAL( average_count_3d, KIND=wp )180 ENDDO181 ENDDO182 183 145 CASE ( 'lpt' ) 184 146 DO i = nxlg, nxrg … … 194 156 DO j = nysg, nyng 195 157 lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d, KIND=wp ) 196 ENDDO197 ENDDO198 199 CASE ( 'm_liq_eb*' )200 DO i = nxlg, nxrg201 DO j = nysg, nyng202 m_liq_eb_av(j,i) = m_liq_eb_av(j,i) / REAL( average_count_3d, KIND=wp )203 ENDDO204 ENDDO205 206 CASE ( 'm_soil' )207 DO i = nxlg, nxrg208 DO j = nysg, nyng209 DO k = nzb_soil, nzt_soil210 m_soil_av(k,j,i) = m_soil_av(k,j,i) / REAL( average_count_3d, KIND=wp )211 ENDDO212 158 ENDDO 213 159 ENDDO … … 337 283 ENDDO 338 284 339 CASE ( 'qsws_eb*' )340 DO i = nxlg, nxrg341 DO j = nysg, nyng342 qsws_eb_av(j,i) = qsws_eb_av(j,i) / REAL( average_count_3d, KIND=wp )343 ENDDO344 ENDDO345 346 CASE ( 'qsws_liq_eb*' )347 DO i = nxlg, nxrg348 DO j = nysg, nyng349 qsws_liq_eb_av(j,i) = qsws_liq_eb_av(j,i) / REAL( average_count_3d, KIND=wp )350 ENDDO351 ENDDO352 353 CASE ( 'qsws_soil_eb*' )354 DO i = nxlg, nxrg355 DO j = nysg, nyng356 qsws_soil_eb_av(j,i) = qsws_soil_eb_av(j,i) / REAL( average_count_3d, KIND=wp )357 ENDDO358 ENDDO359 360 CASE ( 'qsws_veg_eb*' )361 DO i = nxlg, nxrg362 DO j = nysg, nyng363 qsws_veg_eb_av(j,i) = qsws_veg_eb_av(j,i) / REAL( average_count_3d, KIND=wp )364 ENDDO365 ENDDO366 367 285 CASE ( 'qv' ) 368 286 DO i = nxlg, nxrg … … 453 371 ENDDO 454 372 455 CASE ( 'r_a*' )456 DO i = nxlg, nxrg457 DO j = nysg, nyng458 r_a_av(j,i) = r_a_av(j,i) / REAL( average_count_3d, KIND=wp )459 ENDDO460 ENDDO461 462 CASE ( 'r_s*' )463 DO i = nxlg, nxrg464 DO j = nysg, nyng465 r_s_av(j,i) = r_s_av(j,i) / REAL( average_count_3d, KIND=wp )466 ENDDO467 ENDDO468 469 373 CASE ( 'rho' ) 470 374 DO i = nxlg, nxrg … … 515 419 ENDDO 516 420 517 CASE ( 't_soil' )518 DO i = nxlg, nxrg519 DO j = nysg, nyng520 DO k = nzb_soil, nzt_soil521 t_soil_av(k,j,i) = t_soil_av(k,j,i) / REAL( average_count_3d, KIND=wp )522 ENDDO523 ENDDO524 ENDDO525 526 421 CASE ( 'u' ) 527 422 DO i = nxlg, nxrg … … 582 477 583 478 CASE DEFAULT 479 ! 480 !-- Land surface quantity 481 IF ( land_surface ) THEN 482 CALL lsm_3d_data_averaging( 'average', doav(ii) ) 483 ENDIF 484 584 485 ! 585 486 !-- User-defined quantity -
palm/trunk/SOURCE/check_parameters.f90
r1971 r1972 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Removed check of lai* (done in land surface module) 22 22 ! 23 23 ! Former revisions: … … 2960 2960 CONTINUE 2961 2961 2962 CASE ( 'l ai*', 'lwp*', 'ol*', 'pra*', 'prr*', 'qsws*', 'shf*', 't*', &2962 CASE ( 'lwp*', 'ol*', 'pra*', 'prr*', 'qsws*', 'shf*', 't*', & 2963 2963 'u*', 'z0*', 'z0h*', 'z0q*' ) 2964 2964 IF ( k == 0 .OR. data_output(i)(ilen-2:ilen) /= '_xy' ) THEN -
palm/trunk/SOURCE/data_output_2d.f90
r1961 r1972 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Output of land surface quantities is now done directly in the respective module 22 22 ! 23 23 ! Former revisions: … … 174 174 175 175 USE land_surface_model_mod, & 176 ONLY: c_liq, c_liq_av, c_soil_av, c_veg, c_veg_av, ghf_eb, & 177 ghf_eb_av, lai, lai_av, m_liq_eb, m_liq_eb_av, m_soil, & 178 m_soil_av, nzb_soil, nzt_soil, qsws_eb, qsws_eb_av, & 179 qsws_liq_eb, qsws_liq_eb_av, qsws_soil_eb, qsws_soil_eb_av, & 180 qsws_veg_eb, qsws_veg_eb_av, r_a, r_a_av, r_s, r_s_av, shf_eb, & 181 shf_eb_av, t_soil, t_soil_av, zs 176 ONLY: land_surface, lsm_data_output_2d, zs 182 177 183 178 #if defined( __netcdf ) … … 290 285 CALL check_open( 101+av*10 ) 291 286 ENDIF 292 293 287 IF ( data_output_2d_on_each_pe ) THEN 294 288 CALL check_open( 21 ) … … 433 427 IF ( mode == 'xy' ) level_z = zu 434 428 435 CASE ( 'c_liq*_xy' ) ! 2d-array 436 IF ( av == 0 ) THEN 437 DO i = nxlg, nxrg 438 DO j = nysg, nyng 439 local_pf(i,j,nzb+1) = c_liq(j,i) * c_veg(j,i) 440 ENDDO 441 ENDDO 442 ELSE 443 DO i = nxlg, nxrg 444 DO j = nysg, nyng 445 local_pf(i,j,nzb+1) = c_liq_av(j,i) 429 CASE ( 'lpt_xy', 'lpt_xz', 'lpt_yz' ) 430 IF ( av == 0 ) THEN 431 to_be_resorted => pt 432 ELSE 433 to_be_resorted => lpt_av 434 ENDIF 435 IF ( mode == 'xy' ) level_z = zu 436 437 CASE ( 'lwp*_xy' ) ! 2d-array 438 IF ( av == 0 ) THEN 439 DO i = nxlg, nxrg 440 DO j = nysg, nyng 441 local_pf(i,j,nzb+1) = SUM( ql(nzb:nzt,j,i) * & 442 dzw(1:nzt+1) ) 443 ENDDO 444 ENDDO 445 ELSE 446 DO i = nxlg, nxrg 447 DO j = nysg, nyng 448 local_pf(i,j,nzb+1) = lwp_av(j,i) 446 449 ENDDO 447 450 ENDDO … … 450 453 two_d = .TRUE. 451 454 level_z(nzb+1) = zu(nzb+1) 452 453 CASE ( 'c_soil*_xy' ) ! 2d-array454 IF ( av == 0 ) THEN455 DO i = nxlg, nxrg456 DO j = nysg, nyng457 local_pf(i,j,nzb+1) = 1.0_wp - c_veg(j,i)458 ENDDO459 ENDDO460 ELSE461 DO i = nxlg, nxrg462 DO j = nysg, nyng463 local_pf(i,j,nzb+1) = c_soil_av(j,i)464 ENDDO465 ENDDO466 ENDIF467 resorted = .TRUE.468 two_d = .TRUE.469 level_z(nzb+1) = zu(nzb+1)470 471 CASE ( 'c_veg*_xy' ) ! 2d-array472 IF ( av == 0 ) THEN473 DO i = nxlg, nxrg474 DO j = nysg, nyng475 local_pf(i,j,nzb+1) = c_veg(j,i)476 ENDDO477 ENDDO478 ELSE479 DO i = nxlg, nxrg480 DO j = nysg, nyng481 local_pf(i,j,nzb+1) = c_veg_av(j,i)482 ENDDO483 ENDDO484 ENDIF485 resorted = .TRUE.486 two_d = .TRUE.487 level_z(nzb+1) = zu(nzb+1)488 489 CASE ( 'ghf_eb*_xy' ) ! 2d-array490 IF ( av == 0 ) THEN491 DO i = nxlg, nxrg492 DO j = nysg, nyng493 local_pf(i,j,nzb+1) = ghf_eb(j,i)494 ENDDO495 ENDDO496 ELSE497 DO i = nxlg, nxrg498 DO j = nysg, nyng499 local_pf(i,j,nzb+1) = ghf_eb_av(j,i)500 ENDDO501 ENDDO502 ENDIF503 resorted = .TRUE.504 two_d = .TRUE.505 level_z(nzb+1) = zu(nzb+1)506 507 CASE ( 'lai*_xy' ) ! 2d-array508 IF ( av == 0 ) THEN509 DO i = nxlg, nxrg510 DO j = nysg, nyng511 local_pf(i,j,nzb+1) = lai(j,i)512 ENDDO513 ENDDO514 ELSE515 DO i = nxlg, nxrg516 DO j = nysg, nyng517 local_pf(i,j,nzb+1) = lai_av(j,i)518 ENDDO519 ENDDO520 ENDIF521 resorted = .TRUE.522 two_d = .TRUE.523 level_z(nzb+1) = zu(nzb+1)524 525 CASE ( 'lpt_xy', 'lpt_xz', 'lpt_yz' )526 IF ( av == 0 ) THEN527 to_be_resorted => pt528 ELSE529 to_be_resorted => lpt_av530 ENDIF531 IF ( mode == 'xy' ) level_z = zu532 533 CASE ( 'lwp*_xy' ) ! 2d-array534 IF ( av == 0 ) THEN535 DO i = nxlg, nxrg536 DO j = nysg, nyng537 local_pf(i,j,nzb+1) = SUM( ql(nzb:nzt,j,i) * &538 dzw(1:nzt+1) )539 ENDDO540 ENDDO541 ELSE542 DO i = nxlg, nxrg543 DO j = nysg, nyng544 local_pf(i,j,nzb+1) = lwp_av(j,i)545 ENDDO546 ENDDO547 ENDIF548 resorted = .TRUE.549 two_d = .TRUE.550 level_z(nzb+1) = zu(nzb+1)551 552 CASE ( 'm_liq_eb*_xy' ) ! 2d-array553 IF ( av == 0 ) THEN554 DO i = nxlg, nxrg555 DO j = nysg, nyng556 local_pf(i,j,nzb+1) = m_liq_eb(j,i)557 ENDDO558 ENDDO559 ELSE560 DO i = nxlg, nxrg561 DO j = nysg, nyng562 local_pf(i,j,nzb+1) = m_liq_eb_av(j,i)563 ENDDO564 ENDDO565 ENDIF566 resorted = .TRUE.567 two_d = .TRUE.568 level_z(nzb+1) = zu(nzb+1)569 570 CASE ( 'm_soil_xy', 'm_soil_xz', 'm_soil_yz' )571 nzb_do = nzb_soil572 nzt_do = nzt_soil573 IF ( av == 0 ) THEN574 to_be_resorted => m_soil575 ELSE576 to_be_resorted => m_soil_av577 ENDIF578 IF ( mode == 'xy' ) level_z = zs579 455 580 456 CASE ( 'nr_xy', 'nr_xz', 'nr_yz' ) … … 859 735 level_z(nzb+1) = zu(nzb+1) 860 736 861 CASE ( 'qsws_eb*_xy' ) ! 2d-array 737 CASE ( 'qv_xy', 'qv_xz', 'qv_yz' ) 738 IF ( av == 0 ) THEN 739 DO i = nxlg, nxrg 740 DO j = nysg, nyng 741 DO k = nzb, nzt+1 742 local_pf(i,j,k) = q(k,j,i) - ql(k,j,i) 743 ENDDO 744 ENDDO 745 ENDDO 746 resorted = .TRUE. 747 ELSE 748 to_be_resorted => qv_av 749 ENDIF 750 IF ( mode == 'xy' ) level_z = zu 751 752 CASE ( 'rad_net*_xy' ) ! 2d-array 862 753 IF ( av == 0 ) THEN 863 754 DO i = nxlg, nxrg 864 755 DO j = nysg, nyng 865 local_pf(i,j,nzb+1) = qsws_eb(j,i)756 local_pf(i,j,nzb+1) = rad_net(j,i) 866 757 ENDDO 867 758 ENDDO … … 869 760 DO i = nxlg, nxrg 870 761 DO j = nysg, nyng 871 local_pf(i,j,nzb+1) = qsws_eb_av(j,i)762 local_pf(i,j,nzb+1) = rad_net_av(j,i) 872 763 ENDDO 873 764 ENDDO … … 877 768 level_z(nzb+1) = zu(nzb+1) 878 769 879 CASE ( 'qsws_liq_eb*_xy' ) ! 2d-array880 IF ( av == 0 ) THEN881 DO i = nxlg, nxrg882 DO j = nysg, nyng883 local_pf(i,j,nzb+1) = qsws_liq_eb(j,i)884 ENDDO885 ENDDO886 ELSE887 DO i = nxlg, nxrg888 DO j = nysg, nyng889 local_pf(i,j,nzb+1) = qsws_liq_eb_av(j,i)890 ENDDO891 ENDDO892 ENDIF893 resorted = .TRUE.894 two_d = .TRUE.895 level_z(nzb+1) = zu(nzb+1)896 897 CASE ( 'qsws_soil_eb*_xy' ) ! 2d-array898 IF ( av == 0 ) THEN899 DO i = nxlg, nxrg900 DO j = nysg, nyng901 local_pf(i,j,nzb+1) = qsws_soil_eb(j,i)902 ENDDO903 ENDDO904 ELSE905 DO i = nxlg, nxrg906 DO j = nysg, nyng907 local_pf(i,j,nzb+1) = qsws_soil_eb_av(j,i)908 ENDDO909 ENDDO910 ENDIF911 resorted = .TRUE.912 two_d = .TRUE.913 level_z(nzb+1) = zu(nzb+1)914 915 CASE ( 'qsws_veg_eb*_xy' ) ! 2d-array916 IF ( av == 0 ) THEN917 DO i = nxlg, nxrg918 DO j = nysg, nyng919 local_pf(i,j,nzb+1) = qsws_veg_eb(j,i)920 ENDDO921 ENDDO922 ELSE923 DO i = nxlg, nxrg924 DO j = nysg, nyng925 local_pf(i,j,nzb+1) = qsws_veg_eb_av(j,i)926 ENDDO927 ENDDO928 ENDIF929 resorted = .TRUE.930 two_d = .TRUE.931 level_z(nzb+1) = zu(nzb+1)932 933 CASE ( 'qv_xy', 'qv_xz', 'qv_yz' )934 IF ( av == 0 ) THEN935 DO i = nxlg, nxrg936 DO j = nysg, nyng937 DO k = nzb, nzt+1938 local_pf(i,j,k) = q(k,j,i) - ql(k,j,i)939 ENDDO940 ENDDO941 ENDDO942 resorted = .TRUE.943 ELSE944 to_be_resorted => qv_av945 ENDIF946 IF ( mode == 'xy' ) level_z = zu947 948 CASE ( 'rad_net*_xy' ) ! 2d-array949 IF ( av == 0 ) THEN950 DO i = nxlg, nxrg951 DO j = nysg, nyng952 local_pf(i,j,nzb+1) = rad_net(j,i)953 ENDDO954 ENDDO955 ELSE956 DO i = nxlg, nxrg957 DO j = nysg, nyng958 local_pf(i,j,nzb+1) = rad_net_av(j,i)959 ENDDO960 ENDDO961 ENDIF962 resorted = .TRUE.963 two_d = .TRUE.964 level_z(nzb+1) = zu(nzb+1)965 966 770 967 771 CASE ( 'rad_lw_in_xy', 'rad_lw_in_xz', 'rad_lw_in_yz' ) … … 1035 839 to_be_resorted => rho_av 1036 840 ENDIF 1037 1038 CASE ( 'r_a*_xy' ) ! 2d-array1039 IF ( av == 0 ) THEN1040 DO i = nxlg, nxrg1041 DO j = nysg, nyng1042 local_pf(i,j,nzb+1) = r_a(j,i)1043 ENDDO1044 ENDDO1045 ELSE1046 DO i = nxlg, nxrg1047 DO j = nysg, nyng1048 local_pf(i,j,nzb+1) = r_a_av(j,i)1049 ENDDO1050 ENDDO1051 ENDIF1052 resorted = .TRUE.1053 two_d = .TRUE.1054 level_z(nzb+1) = zu(nzb+1)1055 1056 CASE ( 'r_s*_xy' ) ! 2d-array1057 IF ( av == 0 ) THEN1058 DO i = nxlg, nxrg1059 DO j = nysg, nyng1060 local_pf(i,j,nzb+1) = r_s(j,i)1061 ENDDO1062 ENDDO1063 ELSE1064 DO i = nxlg, nxrg1065 DO j = nysg, nyng1066 local_pf(i,j,nzb+1) = r_s_av(j,i)1067 ENDDO1068 ENDDO1069 ENDIF1070 resorted = .TRUE.1071 two_d = .TRUE.1072 level_z(nzb+1) = zu(nzb+1)1073 841 1074 842 CASE ( 's_xy', 's_xz', 's_yz' ) … … 1097 865 DO j = nysg, nyng 1098 866 local_pf(i,j,nzb+1) = shf_av(j,i) 1099 ENDDO1100 ENDDO1101 ENDIF1102 resorted = .TRUE.1103 two_d = .TRUE.1104 level_z(nzb+1) = zu(nzb+1)1105 1106 CASE ( 'shf_eb*_xy' ) ! 2d-array1107 IF ( av == 0 ) THEN1108 DO i = nxlg, nxrg1109 DO j = nysg, nyng1110 local_pf(i,j,nzb+1) = shf_eb(j,i)1111 ENDDO1112 ENDDO1113 ELSE1114 DO i = nxlg, nxrg1115 DO j = nysg, nyng1116 local_pf(i,j,nzb+1) = shf_eb_av(j,i)1117 867 ENDDO 1118 868 ENDDO … … 1158 908 level_z(nzb+1) = zu(nzb+1) 1159 909 1160 CASE ( 't_soil_xy', 't_soil_xz', 't_soil_yz' )1161 nzb_do = nzb_soil1162 nzt_do = nzt_soil1163 IF ( av == 0 ) THEN1164 to_be_resorted => t_soil1165 ELSE1166 to_be_resorted => t_soil_av1167 ENDIF1168 IF ( mode == 'xy' ) level_z = zs1169 1170 910 CASE ( 'u_xy', 'u_xz', 'u_yz' ) 1171 911 IF ( av == 0 ) THEN … … 1285 1025 1286 1026 CASE DEFAULT 1027 1028 ! 1029 !-- Land surface model quantity 1030 IF ( land_surface ) THEN 1031 CALL lsm_data_output_2d( av, do2d(av,if), found, grid, mode,& 1032 local_pf, two_d, nzb_do, nzt_do ) 1033 ENDIF 1034 1287 1035 ! 1288 1036 !-- User defined quantity 1289 CALL user_data_output_2d( av, do2d(av,if), found, grid, & 1290 local_pf, two_d, nzb_do, nzt_do ) 1037 IF ( .NOT. found ) THEN 1038 CALL user_data_output_2d( av, do2d(av,if), found, grid, & 1039 local_pf, two_d, nzb_do, nzt_do ) 1040 ENDIF 1041 1291 1042 resorted = .TRUE. 1292 1043 -
palm/trunk/SOURCE/data_output_3d.f90
r1961 r1972 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Output of land surface quantities is now done directly in the respective module. 22 ! Unnecessary directive __parallel removed. 22 23 ! 23 24 ! Former revisions: … … 144 145 145 146 USE land_surface_model_mod, & 146 ONLY: m_soil, m_soil_av, nzb_soil, nzt_soil, t_soil, t_soil_av147 ONLY: land_surface, lsm_data_output_3d, nzb_soil, nzt_soil 147 148 148 149 #if defined( __netcdf ) … … 272 273 ELSE 273 274 to_be_resorted => lpt_av 274 ENDIF275 276 CASE ( 'm_soil' )277 nzb_do = nzb_soil278 nzt_do = nzt_soil279 !280 !-- For soil model quantities, it is required to re-allocate local_pf281 DEALLOCATE ( local_pf )282 ALLOCATE( local_pf(nxlg:nxrg,nysg:nyng,nzb_do:nzt_do) )283 284 IF ( av == 0 ) THEN285 to_be_resorted => m_soil286 ELSE287 to_be_resorted => m_soil_av288 275 ENDIF 289 276 … … 581 568 ENDIF 582 569 583 CASE ( 't_soil' )584 nzb_do = nzb_soil585 nzt_do = nzt_soil586 !587 !-- For soil model quantities, it is required to re-allocate local_pf588 DEALLOCATE ( local_pf )589 ALLOCATE( local_pf(nxlg:nxrg,nysg:nyng,nzb_do:nzt_do) )590 591 IF ( av == 0 ) THEN592 to_be_resorted => t_soil593 ELSE594 to_be_resorted => t_soil_av595 ENDIF596 597 570 CASE ( 'u' ) 598 571 IF ( av == 0 ) THEN … … 624 597 625 598 CASE DEFAULT 599 600 ! 601 !-- Land surface quantity 602 IF ( land_surface ) THEN 603 ! 604 !-- For soil model quantities, it is required to re-allocate local_pf 605 nzb_do = nzb_soil 606 nzt_do = nzt_soil 607 608 DEALLOCATE ( local_pf ) 609 ALLOCATE( local_pf(nxlg:nxrg,nysg:nyng,nzb_do:nzt_do) ) 610 611 CALL lsm_data_output_3d( av, do3d(av,if), found, local_pf ) 612 resorted = .TRUE. 613 ENDIF 614 626 615 ! 627 616 !-- User defined quantity 628 CALL user_data_output_3d( av, do3d(av,if), found, local_pf, & 629 nzb_do, nzt_do ) 630 resorted = .TRUE. 617 IF ( .NOT. found ) THEN 618 CALL user_data_output_3d( av, do3d(av,if), found, local_pf, & 619 nzb_do, nzt_do ) 620 resorted = .TRUE. 621 ENDIF 631 622 632 623 IF ( .NOT. found ) THEN … … 667 658 WRITE ( 30 ) local_pf(:,:,nzb_do:nzt_do) 668 659 ENDIF 669 #if defined( __parallel ) 660 670 661 CALL MPI_BARRIER( comm2d, ierr ) 671 #endif 662 672 663 ENDDO 673 664 -
palm/trunk/SOURCE/land_surface_model_mod.f90
r1967 r1972 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Further modularization: output of cross sections and 3D data is now done in this 22 ! module. Moreover, restart data is written and read directly within this module. 23 ! 22 24 ! 23 25 ! Former revisions: … … 549 551 !-- Public functions 550 552 PUBLIC lsm_check_data_output, lsm_check_data_output_pr, & 551 lsm_check_parameters, lsm_energy_balance, lsm_header, lsm_init, & 552 lsm_init_arrays, lsm_parin, lsm_soil_model, lsm_swap_timelevel 553 lsm_check_parameters, lsm_define_netcdf_grid, lsm_3d_data_averaging,& 554 lsm_data_output_2d, lsm_data_output_3d, lsm_energy_balance, & 555 lsm_header, lsm_init, lsm_init_arrays, lsm_parin, lsm_soil_model, & 556 lsm_swap_timelevel, lsm_read_restart_data, lsm_last_actions 553 557 ! 554 558 !-- Public parameters, constants and initial values … … 561 565 ! 562 566 !-- Public 2D output variables 563 PUBLIC c_liq, c_liq_av, c_soil_av, c_veg, c_veg_av, ghf_eb, ghf_eb_av, & 564 lai, lai_av, qsws_eb, qsws_eb_av, qsws_liq_eb, qsws_liq_eb_av, & 565 qsws_soil_eb, qsws_soil_eb_av, qsws_veg_eb, qsws_veg_eb_av, & 566 r_a, r_a_av, r_s, r_s_av, shf_eb, shf_eb_av 567 PUBLIC ghf_eb, qsws_eb, qsws_liq_eb, qsws_soil_eb,qsws_veg_eb, r_a, r_s, & 568 shf_eb 567 569 568 570 ! 569 571 !-- Public prognostic variables 570 PUBLIC m_ liq_eb, m_liq_eb_av, m_soil, m_soil_av, t_soil, t_soil_av572 PUBLIC m_soil, t_soil 571 573 572 574 … … 583 585 END INTERFACE lsm_check_parameters 584 586 587 INTERFACE lsm_3d_data_averaging 588 MODULE PROCEDURE lsm_3d_data_averaging 589 END INTERFACE lsm_3d_data_averaging 590 591 INTERFACE lsm_data_output_2d 592 MODULE PROCEDURE lsm_data_output_2d 593 END INTERFACE lsm_data_output_2d 594 595 INTERFACE lsm_data_output_3d 596 MODULE PROCEDURE lsm_data_output_3d 597 END INTERFACE lsm_data_output_3d 598 599 INTERFACE lsm_define_netcdf_grid 600 MODULE PROCEDURE lsm_define_netcdf_grid 601 END INTERFACE lsm_define_netcdf_grid 602 585 603 INTERFACE lsm_energy_balance 586 604 MODULE PROCEDURE lsm_energy_balance … … 611 629 END INTERFACE lsm_swap_timelevel 612 630 631 INTERFACE lsm_read_restart_data 632 MODULE PROCEDURE lsm_read_restart_data 633 END INTERFACE lsm_read_restart_data 634 635 636 INTERFACE lsm_last_actions 637 MODULE PROCEDURE lsm_last_actions 638 END INTERFACE lsm_last_actions 639 613 640 CONTAINS 614 641 … … 627 654 628 655 CHARACTER (LEN=*) :: unit !< 629 CHARACTER (LEN=*) :: var 656 CHARACTER (LEN=*) :: var !< 630 657 631 658 INTEGER(iwp) :: i … … 2415 2442 2416 2443 2444 2445 2446 !------------------------------------------------------------------------------! 2447 ! 2448 ! Description: 2449 ! ------------ 2450 !> Soubroutine for averaging 3D data 2451 !------------------------------------------------------------------------------! 2452 SUBROUTINE lsm_3d_data_averaging( mode, variable ) 2453 2454 2455 USE control_parameters 2456 2457 USE indices 2458 2459 USE kinds 2460 2461 IMPLICIT NONE 2462 2463 CHARACTER (LEN=*) :: mode !< 2464 CHARACTER (LEN=*) :: variable !< 2465 2466 INTEGER(iwp) :: i !< 2467 INTEGER(iwp) :: j !< 2468 INTEGER(iwp) :: k !< 2469 2470 IF ( mode == 'allocate' ) THEN 2471 2472 SELECT CASE ( TRIM( variable ) ) 2473 2474 CASE ( 'c_liq*' ) 2475 IF ( .NOT. ALLOCATED( c_liq_av ) ) THEN 2476 ALLOCATE( c_liq_av(nysg:nyng,nxlg:nxrg) ) 2477 ENDIF 2478 c_liq_av = 0.0_wp 2479 2480 CASE ( 'c_soil*' ) 2481 IF ( .NOT. ALLOCATED( c_soil_av ) ) THEN 2482 ALLOCATE( c_soil_av(nysg:nyng,nxlg:nxrg) ) 2483 ENDIF 2484 c_soil_av = 0.0_wp 2485 2486 CASE ( 'c_veg*' ) 2487 IF ( .NOT. ALLOCATED( c_veg_av ) ) THEN 2488 ALLOCATE( c_veg_av(nysg:nyng,nxlg:nxrg) ) 2489 ENDIF 2490 c_veg_av = 0.0_wp 2491 2492 CASE ( 'ghf_eb*' ) 2493 IF ( .NOT. ALLOCATED( ghf_eb_av ) ) THEN 2494 ALLOCATE( ghf_eb_av(nysg:nyng,nxlg:nxrg) ) 2495 ENDIF 2496 ghf_eb_av = 0.0_wp 2497 2498 CASE ( 'lai*' ) 2499 IF ( .NOT. ALLOCATED( lai_av ) ) THEN 2500 ALLOCATE( lai_av(nysg:nyng,nxlg:nxrg) ) 2501 ENDIF 2502 lai_av = 0.0_wp 2503 2504 CASE ( 'm_liq_eb*' ) 2505 IF ( .NOT. ALLOCATED( m_liq_eb_av ) ) THEN 2506 ALLOCATE( m_liq_eb_av(nysg:nyng,nxlg:nxrg) ) 2507 ENDIF 2508 m_liq_eb_av = 0.0_wp 2509 2510 CASE ( 'm_soil' ) 2511 IF ( .NOT. ALLOCATED( m_soil_av ) ) THEN 2512 ALLOCATE( m_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) 2513 ENDIF 2514 m_soil_av = 0.0_wp 2515 2516 CASE ( 'qsws_eb*' ) 2517 IF ( .NOT. ALLOCATED( qsws_eb_av ) ) THEN 2518 ALLOCATE( qsws_eb_av(nysg:nyng,nxlg:nxrg) ) 2519 ENDIF 2520 qsws_eb_av = 0.0_wp 2521 2522 CASE ( 'qsws_liq_eb*' ) 2523 IF ( .NOT. ALLOCATED( qsws_liq_eb_av ) ) THEN 2524 ALLOCATE( qsws_liq_eb_av(nysg:nyng,nxlg:nxrg) ) 2525 ENDIF 2526 qsws_liq_eb_av = 0.0_wp 2527 2528 CASE ( 'qsws_soil_eb*' ) 2529 IF ( .NOT. ALLOCATED( qsws_soil_eb_av ) ) THEN 2530 ALLOCATE( qsws_soil_eb_av(nysg:nyng,nxlg:nxrg) ) 2531 ENDIF 2532 qsws_soil_eb_av = 0.0_wp 2533 2534 CASE ( 'qsws_veg_eb*' ) 2535 IF ( .NOT. ALLOCATED( qsws_veg_eb_av ) ) THEN 2536 ALLOCATE( qsws_veg_eb_av(nysg:nyng,nxlg:nxrg) ) 2537 ENDIF 2538 qsws_veg_eb_av = 0.0_wp 2539 2540 CASE ( 'r_a*' ) 2541 IF ( .NOT. ALLOCATED( r_a_av ) ) THEN 2542 ALLOCATE( r_a_av(nysg:nyng,nxlg:nxrg) ) 2543 ENDIF 2544 r_a_av = 0.0_wp 2545 2546 CASE ( 'r_s*' ) 2547 IF ( .NOT. ALLOCATED( r_s_av ) ) THEN 2548 ALLOCATE( r_s_av(nysg:nyng,nxlg:nxrg) ) 2549 ENDIF 2550 r_s_av = 0.0_wp 2551 2552 CASE ( 'shf_eb*' ) 2553 IF ( .NOT. ALLOCATED( shf_eb_av ) ) THEN 2554 ALLOCATE( shf_eb_av(nysg:nyng,nxlg:nxrg) ) 2555 ENDIF 2556 shf_eb_av = 0.0_wp 2557 2558 CASE ( 't_soil' ) 2559 IF ( .NOT. ALLOCATED( t_soil_av ) ) THEN 2560 ALLOCATE( t_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) 2561 ENDIF 2562 t_soil_av = 0.0_wp 2563 2564 CASE DEFAULT 2565 CONTINUE 2566 2567 END SELECT 2568 2569 ELSEIF ( mode == 'sum' ) THEN 2570 2571 SELECT CASE ( TRIM( variable ) ) 2572 2573 CASE ( 'c_liq*' ) 2574 DO i = nxlg, nxrg 2575 DO j = nysg, nyng 2576 c_liq_av(j,i) = c_liq_av(j,i) + c_liq(j,i) 2577 ENDDO 2578 ENDDO 2579 2580 CASE ( 'c_soil*' ) 2581 DO i = nxlg, nxrg 2582 DO j = nysg, nyng 2583 c_soil_av(j,i) = c_soil_av(j,i) + (1.0 - c_veg(j,i)) 2584 ENDDO 2585 ENDDO 2586 2587 CASE ( 'c_veg*' ) 2588 DO i = nxlg, nxrg 2589 DO j = nysg, nyng 2590 c_veg_av(j,i) = c_veg_av(j,i) + c_veg(j,i) 2591 ENDDO 2592 ENDDO 2593 2594 CASE ( 'ghf_eb*' ) 2595 DO i = nxlg, nxrg 2596 DO j = nysg, nyng 2597 ghf_eb_av(j,i) = ghf_eb_av(j,i) + ghf_eb(j,i) 2598 ENDDO 2599 ENDDO 2600 2601 CASE ( 'lai*' ) 2602 DO i = nxlg, nxrg 2603 DO j = nysg, nyng 2604 lai_av(j,i) = lai_av(j,i) + lai(j,i) 2605 ENDDO 2606 ENDDO 2607 2608 CASE ( 'm_liq_eb*' ) 2609 DO i = nxlg, nxrg 2610 DO j = nysg, nyng 2611 m_liq_eb_av(j,i) = m_liq_eb_av(j,i) + m_liq_eb(j,i) 2612 ENDDO 2613 ENDDO 2614 2615 CASE ( 'm_soil' ) 2616 DO i = nxlg, nxrg 2617 DO j = nysg, nyng 2618 DO k = nzb_soil, nzt_soil 2619 m_soil_av(k,j,i) = m_soil_av(k,j,i) + m_soil(k,j,i) 2620 ENDDO 2621 ENDDO 2622 ENDDO 2623 2624 CASE ( 'qsws_eb*' ) 2625 DO i = nxlg, nxrg 2626 DO j = nysg, nyng 2627 qsws_eb_av(j,i) = qsws_eb_av(j,i) + qsws_eb(j,i) 2628 ENDDO 2629 ENDDO 2630 2631 CASE ( 'qsws_liq_eb*' ) 2632 DO i = nxlg, nxrg 2633 DO j = nysg, nyng 2634 qsws_liq_eb_av(j,i) = qsws_liq_eb_av(j,i) + qsws_liq_eb(j,i) 2635 ENDDO 2636 ENDDO 2637 2638 CASE ( 'qsws_soil_eb*' ) 2639 DO i = nxlg, nxrg 2640 DO j = nysg, nyng 2641 qsws_soil_eb_av(j,i) = qsws_soil_eb_av(j,i) + qsws_soil_eb(j,i) 2642 ENDDO 2643 ENDDO 2644 2645 CASE ( 'qsws_veg_eb*' ) 2646 DO i = nxlg, nxrg 2647 DO j = nysg, nyng 2648 qsws_veg_eb_av(j,i) = qsws_veg_eb_av(j,i) + qsws_veg_eb(j,i) 2649 ENDDO 2650 ENDDO 2651 2652 CASE ( 'r_a*' ) 2653 DO i = nxlg, nxrg 2654 DO j = nysg, nyng 2655 r_a_av(j,i) = r_a_av(j,i) + r_a(j,i) 2656 ENDDO 2657 ENDDO 2658 2659 CASE ( 'r_s*' ) 2660 DO i = nxlg, nxrg 2661 DO j = nysg, nyng 2662 r_s_av(j,i) = r_s_av(j,i) + r_s(j,i) 2663 ENDDO 2664 ENDDO 2665 2666 CASE ( 'shf_eb*' ) 2667 DO i = nxlg, nxrg 2668 DO j = nysg, nyng 2669 shf_eb_av(j,i) = shf_eb_av(j,i) + shf_eb(j,i) 2670 ENDDO 2671 ENDDO 2672 2673 CASE ( 't_soil' ) 2674 DO i = nxlg, nxrg 2675 DO j = nysg, nyng 2676 DO k = nzb_soil, nzt_soil 2677 t_soil_av(k,j,i) = t_soil_av(k,j,i) + t_soil(k,j,i) 2678 ENDDO 2679 ENDDO 2680 ENDDO 2681 2682 CASE DEFAULT 2683 CONTINUE 2684 2685 END SELECT 2686 2687 ELSEIF ( mode == 'average' ) THEN 2688 2689 SELECT CASE ( TRIM( variable ) ) 2690 2691 CASE ( 'c_liq*' ) 2692 DO i = nxlg, nxrg 2693 DO j = nysg, nyng 2694 c_liq_av(j,i) = c_liq_av(j,i) / REAL( average_count_3d, KIND=wp ) 2695 ENDDO 2696 ENDDO 2697 2698 CASE ( 'c_soil*' ) 2699 DO i = nxlg, nxrg 2700 DO j = nysg, nyng 2701 c_soil_av(j,i) = c_soil_av(j,i) / REAL( average_count_3d, KIND=wp ) 2702 ENDDO 2703 ENDDO 2704 2705 CASE ( 'c_veg*' ) 2706 DO i = nxlg, nxrg 2707 DO j = nysg, nyng 2708 c_veg_av(j,i) = c_veg_av(j,i) / REAL( average_count_3d, KIND=wp ) 2709 ENDDO 2710 ENDDO 2711 2712 CASE ( 'ghf_eb*' ) 2713 DO i = nxlg, nxrg 2714 DO j = nysg, nyng 2715 ghf_eb_av(j,i) = ghf_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) 2716 ENDDO 2717 ENDDO 2718 2719 CASE ( 'lai*' ) 2720 DO i = nxlg, nxrg 2721 DO j = nysg, nyng 2722 lai_av(j,i) = lai_av(j,i) / REAL( average_count_3d, KIND=wp ) 2723 ENDDO 2724 ENDDO 2725 2726 CASE ( 'm_liq_eb*' ) 2727 DO i = nxlg, nxrg 2728 DO j = nysg, nyng 2729 m_liq_eb_av(j,i) = m_liq_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) 2730 ENDDO 2731 ENDDO 2732 2733 CASE ( 'm_soil' ) 2734 DO i = nxlg, nxrg 2735 DO j = nysg, nyng 2736 DO k = nzb_soil, nzt_soil 2737 m_soil_av(k,j,i) = m_soil_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 2738 ENDDO 2739 ENDDO 2740 ENDDO 2741 2742 CASE ( 'qsws_eb*' ) 2743 DO i = nxlg, nxrg 2744 DO j = nysg, nyng 2745 qsws_eb_av(j,i) = qsws_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) 2746 ENDDO 2747 ENDDO 2748 2749 CASE ( 'qsws_liq_eb*' ) 2750 DO i = nxlg, nxrg 2751 DO j = nysg, nyng 2752 qsws_liq_eb_av(j,i) = qsws_liq_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) 2753 ENDDO 2754 ENDDO 2755 2756 CASE ( 'qsws_soil_eb*' ) 2757 DO i = nxlg, nxrg 2758 DO j = nysg, nyng 2759 qsws_soil_eb_av(j,i) = qsws_soil_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) 2760 ENDDO 2761 ENDDO 2762 2763 CASE ( 'qsws_veg_eb*' ) 2764 DO i = nxlg, nxrg 2765 DO j = nysg, nyng 2766 qsws_veg_eb_av(j,i) = qsws_veg_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) 2767 ENDDO 2768 ENDDO 2769 2770 CASE ( 'r_a*' ) 2771 DO i = nxlg, nxrg 2772 DO j = nysg, nyng 2773 r_a_av(j,i) = r_a_av(j,i) / REAL( average_count_3d, KIND=wp ) 2774 ENDDO 2775 ENDDO 2776 2777 CASE ( 'r_s*' ) 2778 DO i = nxlg, nxrg 2779 DO j = nysg, nyng 2780 r_s_av(j,i) = r_s_av(j,i) / REAL( average_count_3d, KIND=wp ) 2781 ENDDO 2782 ENDDO 2783 2784 CASE ( 't_soil' ) 2785 DO i = nxlg, nxrg 2786 DO j = nysg, nyng 2787 DO k = nzb_soil, nzt_soil 2788 t_soil_av(k,j,i) = t_soil_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 2789 ENDDO 2790 ENDDO 2791 ENDDO 2792 2793 END SELECT 2794 2795 ENDIF 2796 2797 END SUBROUTINE lsm_3d_data_averaging 2798 2799 2800 !------------------------------------------------------------------------------! 2801 ! 2802 ! Description: 2803 ! ------------ 2804 !> Soubroutine defines appropriate grid for netcdf variables. 2805 !> It is called out from subroutine netcdf. 2806 !------------------------------------------------------------------------------! 2807 SUBROUTINE lsm_define_netcdf_grid( var, found, grid_x, grid_y, grid_z ) 2808 2809 IMPLICIT NONE 2810 2811 CHARACTER (LEN=*), INTENT(IN) :: var !< 2812 LOGICAL, INTENT(OUT) :: found !< 2813 CHARACTER (LEN=*), INTENT(OUT) :: grid_x !< 2814 CHARACTER (LEN=*), INTENT(OUT) :: grid_y !< 2815 CHARACTER (LEN=*), INTENT(OUT) :: grid_z !< 2816 2817 2818 2819 ! 2820 !-- Check for the grid 2821 SELECT CASE ( TRIM( var ) ) 2822 2823 CASE ( 'm_soil', 't_soil' ) 2824 found = .TRUE. 2825 grid_x = 'x' 2826 grid_y = 'y' 2827 grid_z = 'zs' 2828 2829 CASE DEFAULT 2830 found = .FALSE. 2831 grid_x = 'none' 2832 grid_y = 'none' 2833 grid_z = 'none' 2834 END SELECT 2835 2836 END SUBROUTINE lsm_define_netcdf_grid 2837 2838 !------------------------------------------------------------------------------! 2839 ! 2840 ! Description: 2841 ! ------------ 2842 !> Soubroutine defines 3D output variables 2843 !------------------------------------------------------------------------------! 2844 SUBROUTINE lsm_data_output_2d( av, variable, found, grid, mode, local_pf, & 2845 two_d, nzb_do, nzt_do ) 2846 2847 2848 USE indices 2849 2850 USE kinds 2851 2852 USE user 2853 2854 IMPLICIT NONE 2855 2856 CHARACTER (LEN=*) :: grid !< 2857 CHARACTER (LEN=*) :: mode !< 2858 CHARACTER (LEN=*) :: variable !< 2859 2860 INTEGER(iwp) :: av !< 2861 INTEGER(iwp) :: i !< 2862 INTEGER(iwp) :: j !< 2863 INTEGER(iwp) :: k !< 2864 INTEGER(iwp) :: nzb_do !< 2865 INTEGER(iwp) :: nzt_do !< 2866 2867 LOGICAL :: found !< 2868 LOGICAL :: two_d !< flag parameter that indicates 2D variables (horizontal cross sections) 2869 2870 REAL(wp), DIMENSION(nxlg:nxrg,nysg:nyng,nzb:nzt+1) :: local_pf !< 2871 2872 found = .TRUE. 2873 2874 SELECT CASE ( TRIM( variable ) ) 2875 2876 2877 CASE ( 'c_liq*_xy' ) ! 2d-array 2878 IF ( av == 0 ) THEN 2879 DO i = nxlg, nxrg 2880 DO j = nysg, nyng 2881 local_pf(i,j,nzb+1) = c_liq(j,i) * c_veg(j,i) 2882 ENDDO 2883 ENDDO 2884 ELSE 2885 DO i = nxlg, nxrg 2886 DO j = nysg, nyng 2887 local_pf(i,j,nzb+1) = c_liq_av(j,i) 2888 ENDDO 2889 ENDDO 2890 ENDIF 2891 2892 two_d = .TRUE. 2893 grid = 'zu1' 2894 2895 CASE ( 'c_soil*_xy' ) ! 2d-array 2896 IF ( av == 0 ) THEN 2897 DO i = nxlg, nxrg 2898 DO j = nysg, nyng 2899 local_pf(i,j,nzb+1) = 1.0_wp - c_veg(j,i) 2900 ENDDO 2901 ENDDO 2902 ELSE 2903 DO i = nxlg, nxrg 2904 DO j = nysg, nyng 2905 local_pf(i,j,nzb+1) = c_soil_av(j,i) 2906 ENDDO 2907 ENDDO 2908 ENDIF 2909 2910 two_d = .TRUE. 2911 grid = 'zu1' 2912 2913 CASE ( 'c_veg*_xy' ) ! 2d-array 2914 IF ( av == 0 ) THEN 2915 DO i = nxlg, nxrg 2916 DO j = nysg, nyng 2917 local_pf(i,j,nzb+1) = c_veg(j,i) 2918 ENDDO 2919 ENDDO 2920 ELSE 2921 DO i = nxlg, nxrg 2922 DO j = nysg, nyng 2923 local_pf(i,j,nzb+1) = c_veg_av(j,i) 2924 ENDDO 2925 ENDDO 2926 ENDIF 2927 2928 two_d = .TRUE. 2929 grid = 'zu1' 2930 2931 CASE ( 'ghf_eb*_xy' ) ! 2d-array 2932 IF ( av == 0 ) THEN 2933 DO i = nxlg, nxrg 2934 DO j = nysg, nyng 2935 local_pf(i,j,nzb+1) = ghf_eb(j,i) 2936 ENDDO 2937 ENDDO 2938 ELSE 2939 DO i = nxlg, nxrg 2940 DO j = nysg, nyng 2941 local_pf(i,j,nzb+1) = ghf_eb_av(j,i) 2942 ENDDO 2943 ENDDO 2944 ENDIF 2945 2946 two_d = .TRUE. 2947 grid = 'zu1' 2948 2949 CASE ( 'lai*_xy' ) ! 2d-array 2950 IF ( av == 0 ) THEN 2951 DO i = nxlg, nxrg 2952 DO j = nysg, nyng 2953 local_pf(i,j,nzb+1) = lai(j,i) 2954 ENDDO 2955 ENDDO 2956 ELSE 2957 DO i = nxlg, nxrg 2958 DO j = nysg, nyng 2959 local_pf(i,j,nzb+1) = lai_av(j,i) 2960 ENDDO 2961 ENDDO 2962 ENDIF 2963 2964 two_d = .TRUE. 2965 grid = 'zu1' 2966 2967 CASE ( 'm_liq_eb*_xy' ) ! 2d-array 2968 IF ( av == 0 ) THEN 2969 DO i = nxlg, nxrg 2970 DO j = nysg, nyng 2971 local_pf(i,j,nzb+1) = m_liq_eb(j,i) 2972 ENDDO 2973 ENDDO 2974 ELSE 2975 DO i = nxlg, nxrg 2976 DO j = nysg, nyng 2977 local_pf(i,j,nzb+1) = m_liq_eb_av(j,i) 2978 ENDDO 2979 ENDDO 2980 ENDIF 2981 2982 two_d = .TRUE. 2983 grid = 'zu1' 2984 2985 CASE ( 'm_soil_xy', 'm_soil_xz', 'm_soil_yz' ) 2986 IF ( av == 0 ) THEN 2987 DO i = nxlg, nxrg 2988 DO j = nysg, nyng 2989 DO k = nzb_soil, nzt_soil 2990 local_pf(i,j,k) = m_soil(k,j,i) 2991 ENDDO 2992 ENDDO 2993 ENDDO 2994 ELSE 2995 DO i = nxlg, nxrg 2996 DO j = nysg, nyng 2997 DO k = nzb_soil, nzt_soil 2998 local_pf(i,j,k) = m_soil_av(k,j,i) 2999 ENDDO 3000 ENDDO 3001 ENDDO 3002 ENDIF 3003 3004 nzb_do = nzb_soil 3005 nzt_do = nzt_soil 3006 3007 IF ( mode == 'xy' ) grid = 'zs' 3008 3009 CASE ( 'qsws_eb*_xy' ) ! 2d-array 3010 IF ( av == 0 ) THEN 3011 DO i = nxlg, nxrg 3012 DO j = nysg, nyng 3013 local_pf(i,j,nzb+1) = qsws_eb(j,i) 3014 ENDDO 3015 ENDDO 3016 ELSE 3017 DO i = nxlg, nxrg 3018 DO j = nysg, nyng 3019 local_pf(i,j,nzb+1) = qsws_eb_av(j,i) 3020 ENDDO 3021 ENDDO 3022 ENDIF 3023 3024 two_d = .TRUE. 3025 grid = 'zu1' 3026 3027 CASE ( 'qsws_liq_eb*_xy' ) ! 2d-array 3028 IF ( av == 0 ) THEN 3029 DO i = nxlg, nxrg 3030 DO j = nysg, nyng 3031 local_pf(i,j,nzb+1) = qsws_liq_eb(j,i) 3032 ENDDO 3033 ENDDO 3034 ELSE 3035 DO i = nxlg, nxrg 3036 DO j = nysg, nyng 3037 local_pf(i,j,nzb+1) = qsws_liq_eb_av(j,i) 3038 ENDDO 3039 ENDDO 3040 ENDIF 3041 3042 two_d = .TRUE. 3043 grid = 'zu1' 3044 3045 CASE ( 'qsws_soil_eb*_xy' ) ! 2d-array 3046 IF ( av == 0 ) THEN 3047 DO i = nxlg, nxrg 3048 DO j = nysg, nyng 3049 local_pf(i,j,nzb+1) = qsws_soil_eb(j,i) 3050 ENDDO 3051 ENDDO 3052 ELSE 3053 DO i = nxlg, nxrg 3054 DO j = nysg, nyng 3055 local_pf(i,j,nzb+1) = qsws_soil_eb_av(j,i) 3056 ENDDO 3057 ENDDO 3058 ENDIF 3059 3060 two_d = .TRUE. 3061 grid = 'zu1' 3062 3063 CASE ( 'qsws_veg_eb*_xy' ) ! 2d-array 3064 IF ( av == 0 ) THEN 3065 DO i = nxlg, nxrg 3066 DO j = nysg, nyng 3067 local_pf(i,j,nzb+1) = qsws_veg_eb(j,i) 3068 ENDDO 3069 ENDDO 3070 ELSE 3071 DO i = nxlg, nxrg 3072 DO j = nysg, nyng 3073 local_pf(i,j,nzb+1) = qsws_veg_eb_av(j,i) 3074 ENDDO 3075 ENDDO 3076 ENDIF 3077 3078 two_d = .TRUE. 3079 grid = 'zu1' 3080 3081 3082 CASE ( 'r_a*_xy' ) ! 2d-array 3083 IF ( av == 0 ) THEN 3084 DO i = nxlg, nxrg 3085 DO j = nysg, nyng 3086 local_pf(i,j,nzb+1) = r_a(j,i) 3087 ENDDO 3088 ENDDO 3089 ELSE 3090 DO i = nxlg, nxrg 3091 DO j = nysg, nyng 3092 local_pf(i,j,nzb+1) = r_a_av(j,i) 3093 ENDDO 3094 ENDDO 3095 ENDIF 3096 3097 two_d = .TRUE. 3098 grid = 'zu1' 3099 3100 CASE ( 'r_s*_xy' ) ! 2d-array 3101 IF ( av == 0 ) THEN 3102 DO i = nxlg, nxrg 3103 DO j = nysg, nyng 3104 local_pf(i,j,nzb+1) = r_s(j,i) 3105 ENDDO 3106 ENDDO 3107 ELSE 3108 DO i = nxlg, nxrg 3109 DO j = nysg, nyng 3110 local_pf(i,j,nzb+1) = r_s_av(j,i) 3111 ENDDO 3112 ENDDO 3113 ENDIF 3114 3115 two_d = .TRUE. 3116 grid = 'zu1' 3117 3118 CASE ( 'shf_eb*_xy' ) ! 2d-array 3119 IF ( av == 0 ) THEN 3120 DO i = nxlg, nxrg 3121 DO j = nysg, nyng 3122 local_pf(i,j,nzb+1) = shf_eb(j,i) 3123 ENDDO 3124 ENDDO 3125 ELSE 3126 DO i = nxlg, nxrg 3127 DO j = nysg, nyng 3128 local_pf(i,j,nzb+1) = shf_eb_av(j,i) 3129 ENDDO 3130 ENDDO 3131 ENDIF 3132 3133 two_d = .TRUE. 3134 grid = 'zu1' 3135 3136 CASE ( 't_soil_xy', 't_soil_xz', 't_soil_yz' ) 3137 IF ( av == 0 ) THEN 3138 DO i = nxlg, nxrg 3139 DO j = nysg, nyng 3140 DO k = nzb_soil, nzt_soil 3141 local_pf(i,j,k) = t_soil(k,j,i) 3142 ENDDO 3143 ENDDO 3144 ENDDO 3145 ELSE 3146 DO i = nxlg, nxrg 3147 DO j = nysg, nyng 3148 DO k = nzb_soil, nzt_soil 3149 local_pf(i,j,k) = t_soil_av(k,j,i) 3150 ENDDO 3151 ENDDO 3152 ENDDO 3153 ENDIF 3154 3155 nzb_do = nzb_soil 3156 nzt_do = nzt_soil 3157 3158 IF ( mode == 'xy' ) grid = 'zs' 3159 3160 CASE DEFAULT 3161 found = .FALSE. 3162 grid = 'none' 3163 3164 END SELECT 3165 3166 END SUBROUTINE lsm_data_output_2d 3167 3168 3169 !------------------------------------------------------------------------------! 3170 ! 3171 ! Description: 3172 ! ------------ 3173 !> Soubroutine defines 3D output variables 3174 !------------------------------------------------------------------------------! 3175 SUBROUTINE lsm_data_output_3d( av, variable, found, local_pf ) 3176 3177 3178 USE indices 3179 3180 USE kinds 3181 3182 3183 IMPLICIT NONE 3184 3185 CHARACTER (LEN=*) :: variable !< 3186 3187 INTEGER(iwp) :: av !< 3188 INTEGER(iwp) :: i !< 3189 INTEGER(iwp) :: j !< 3190 INTEGER(iwp) :: k !< 3191 3192 LOGICAL :: found !< 3193 3194 REAL(sp), DIMENSION(nxlg:nxrg,nysg:nyng,nzb_soil:nzt_soil) :: local_pf !< 3195 3196 3197 found = .TRUE. 3198 3199 3200 SELECT CASE ( TRIM( variable ) ) 3201 3202 3203 CASE ( 'm_soil' ) 3204 3205 IF ( av == 0 ) THEN 3206 DO i = nxlg, nxrg 3207 DO j = nysg, nyng 3208 DO k = nzb_soil, nzt_soil 3209 local_pf(i,j,k) = m_soil(k,j,i) 3210 ENDDO 3211 ENDDO 3212 ENDDO 3213 ELSE 3214 DO i = nxlg, nxrg 3215 DO j = nysg, nyng 3216 DO k = nzb_soil, nzt_soil 3217 local_pf(i,j,k) = m_soil_av(k,j,i) 3218 ENDDO 3219 ENDDO 3220 ENDDO 3221 ENDIF 3222 3223 CASE ( 't_soil' ) 3224 3225 IF ( av == 0 ) THEN 3226 DO i = nxlg, nxrg 3227 DO j = nysg, nyng 3228 DO k = nzb_soil, nzt_soil 3229 local_pf(i,j,k) = t_soil(k,j,i) 3230 ENDDO 3231 ENDDO 3232 ENDDO 3233 ELSE 3234 DO i = nxlg, nxrg 3235 DO j = nysg, nyng 3236 DO k = nzb_soil, nzt_soil 3237 local_pf(i,j,k) = t_soil_av(k,j,i) 3238 ENDDO 3239 ENDDO 3240 ENDDO 3241 ENDIF 3242 3243 3244 CASE DEFAULT 3245 found = .FALSE. 3246 3247 END SELECT 3248 3249 3250 END SUBROUTINE lsm_data_output_3d 3251 3252 3253 !------------------------------------------------------------------------------! 3254 ! 3255 ! Description: 3256 ! ------------ 3257 !> Write restart data for land surface model 3258 !------------------------------------------------------------------------------! 3259 SUBROUTINE lsm_last_actions 3260 3261 3262 USE control_parameters 3263 3264 USE kinds 3265 3266 IMPLICIT NONE 3267 3268 IF ( write_binary(1:4) == 'true' ) THEN 3269 IF ( ALLOCATED( c_liq_av ) ) THEN 3270 WRITE ( 14 ) 'c_liq_av '; WRITE ( 14 ) c_liq_av 3271 ENDIF 3272 IF ( ALLOCATED( c_soil_av ) ) THEN 3273 WRITE ( 14 ) 'c_soil_av '; WRITE ( 14 ) c_soil_av 3274 ENDIF 3275 IF ( ALLOCATED( c_veg_av ) ) THEN 3276 WRITE ( 14 ) 'c_veg_av '; WRITE ( 14 ) c_veg_av 3277 ENDIF 3278 IF ( ALLOCATED( ghf_eb_av ) ) THEN 3279 WRITE ( 14 ) 'ghf_eb_av '; WRITE ( 14 ) ghf_eb_av 3280 ENDIF 3281 IF ( ALLOCATED( lai_av ) ) THEN 3282 WRITE ( 14 ) 'lai_av '; WRITE ( 14 ) lai_av 3283 ENDIF 3284 WRITE ( 14 ) 'm_liq_eb '; WRITE ( 14 ) m_liq_eb 3285 IF ( ALLOCATED( m_liq_eb_av ) ) THEN 3286 WRITE ( 14 ) 'm_liq_eb_av '; WRITE ( 14 ) m_liq_eb_av 3287 ENDIF 3288 WRITE ( 14 ) 'm_soil '; WRITE ( 14 ) m_soil 3289 IF ( ALLOCATED( m_soil_av ) ) THEN 3290 WRITE ( 14 ) 'm_soil_av '; WRITE ( 14 ) m_soil_av 3291 ENDIF 3292 IF ( ALLOCATED( qsws_eb_av ) ) THEN 3293 WRITE ( 14 ) 'qsws_eb_av '; WRITE ( 14 ) qsws_eb_av 3294 ENDIF 3295 IF ( ALLOCATED( qsws_liq_eb_av ) ) THEN 3296 WRITE ( 14 ) 'qsws_liq_eb_av '; WRITE ( 14 ) qsws_liq_eb_av 3297 ENDIF 3298 IF ( ALLOCATED( qsws_soil_eb_av ) ) THEN 3299 WRITE ( 14 ) 'qsws_soil_eb_av '; WRITE ( 14 ) qsws_soil_eb_av 3300 ENDIF 3301 IF ( ALLOCATED( qsws_veg_eb_av ) ) THEN 3302 WRITE ( 14 ) 'qsws_veg_eb_av '; WRITE ( 14 ) qsws_veg_eb_av 3303 ENDIF 3304 IF ( ALLOCATED( shf_eb_av ) ) THEN 3305 WRITE ( 14 ) 'shf_eb_av '; WRITE ( 14 ) shf_eb_av 3306 ENDIF 3307 WRITE ( 14 ) 't_soil '; WRITE ( 14 ) t_soil 3308 IF ( ALLOCATED( t_soil_av ) ) THEN 3309 WRITE ( 14 ) 't_soil_av '; WRITE ( 14 ) t_soil_av 3310 ENDIF 3311 3312 WRITE ( 14 ) '*** end lsm *** ' 3313 3314 ENDIF 3315 3316 END SUBROUTINE lsm_last_actions 3317 3318 3319 SUBROUTINE lsm_read_restart_data( i, nxlfa, nxl_on_file, nxrfa, nxr_on_file, & 3320 nynfa, nyn_on_file, nysfa, nys_on_file, & 3321 offset_xa, offset_ya, overlap_count, & 3322 tmp_2d ) 3323 3324 3325 USE control_parameters 3326 3327 USE indices 3328 3329 USE kinds 3330 3331 USE pegrid 3332 3333 IMPLICIT NONE 3334 3335 CHARACTER (LEN=20) :: field_char !< 3336 3337 INTEGER(iwp) :: i !< 3338 INTEGER(iwp) :: k !< 3339 INTEGER(iwp) :: nxlc !< 3340 INTEGER(iwp) :: nxlf !< 3341 INTEGER(iwp) :: nxl_on_file !< 3342 INTEGER(iwp) :: nxrc !< 3343 INTEGER(iwp) :: nxrf !< 3344 INTEGER(iwp) :: nxr_on_file !< 3345 INTEGER(iwp) :: nync !< 3346 INTEGER(iwp) :: nynf !< 3347 INTEGER(iwp) :: nyn_on_file !< 3348 INTEGER(iwp) :: nysc !< 3349 INTEGER(iwp) :: nysf !< 3350 INTEGER(iwp) :: nys_on_file !< 3351 INTEGER(iwp) :: overlap_count !< 3352 3353 INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nxlfa !< 3354 INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nxrfa !< 3355 INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nynfa !< 3356 INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nysfa !< 3357 INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: offset_xa !< 3358 INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: offset_ya !< 3359 3360 REAL(wp), & 3361 DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) ::& 3362 tmp_2d !< 3363 3364 REAL(wp), & 3365 DIMENSION(nzb_soil:nzt_soil+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) ::& 3366 tmp_3d !< 3367 3368 REAL(wp), & 3369 DIMENSION(nzb_soil:nzt_soil,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) ::& 3370 tmp_3d2 !< 3371 3372 3373 IF ( initializing_actions == 'read_restart_data' ) THEN 3374 READ ( 13 ) field_char 3375 3376 DO WHILE ( TRIM( field_char ) /= '*** end lsm ***' ) 3377 3378 DO k = 1, overlap_count 3379 3380 nxlf = nxlfa(i,k) 3381 nxlc = nxlfa(i,k) + offset_xa(i,k) 3382 nxrf = nxrfa(i,k) 3383 nxrc = nxrfa(i,k) + offset_xa(i,k) 3384 nysf = nysfa(i,k) 3385 nysc = nysfa(i,k) + offset_ya(i,k) 3386 nynf = nynfa(i,k) 3387 nync = nynfa(i,k) + offset_ya(i,k) 3388 3389 3390 SELECT CASE ( TRIM( field_char ) ) 3391 3392 CASE ( 'c_liq_av' ) 3393 IF ( .NOT. ALLOCATED( c_liq_av ) ) THEN 3394 ALLOCATE( c_liq_av(nysg:nyng,nxlg:nxrg) ) 3395 ENDIF 3396 IF ( k == 1 ) READ ( 13 ) tmp_2d 3397 c_liq_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3398 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3399 3400 CASE ( 'c_soil_av' ) 3401 IF ( .NOT. ALLOCATED( c_soil_av ) ) THEN 3402 ALLOCATE( c_soil_av(nysg:nyng,nxlg:nxrg) ) 3403 ENDIF 3404 IF ( k == 1 ) READ ( 13 ) tmp_2d 3405 c_soil_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3406 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3407 3408 CASE ( 'c_veg_av' ) 3409 IF ( .NOT. ALLOCATED( c_veg_av ) ) THEN 3410 ALLOCATE( c_veg_av(nysg:nyng,nxlg:nxrg) ) 3411 ENDIF 3412 IF ( k == 1 ) READ ( 13 ) tmp_2d 3413 c_veg_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3414 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3415 3416 CASE ( 'ghf_eb_av' ) 3417 IF ( .NOT. ALLOCATED( ghf_eb_av ) ) THEN 3418 ALLOCATE( ghf_eb_av(nysg:nyng,nxlg:nxrg) ) 3419 ENDIF 3420 IF ( k == 1 ) READ ( 13 ) tmp_2d 3421 ghf_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3422 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3423 3424 CASE ( 'm_liq_eb' ) 3425 IF ( k == 1 ) READ ( 13 ) tmp_2d 3426 m_liq_eb(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3427 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3428 3429 CASE ( 'lai_av' ) 3430 IF ( .NOT. ALLOCATED( lai_av ) ) THEN 3431 ALLOCATE( lai_av(nysg:nyng,nxlg:nxrg) ) 3432 ENDIF 3433 IF ( k == 1 ) READ ( 13 ) tmp_2d 3434 lai_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3435 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3436 3437 CASE ( 'm_liq_eb_av' ) 3438 IF ( .NOT. ALLOCATED( m_liq_eb_av ) ) THEN 3439 ALLOCATE( m_liq_eb_av(nysg:nyng,nxlg:nxrg) ) 3440 ENDIF 3441 IF ( k == 1 ) READ ( 13 ) tmp_2d 3442 m_liq_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3443 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3444 3445 CASE ( 'm_soil' ) 3446 IF ( k == 1 ) READ ( 13 ) tmp_3d2(:,:,:) 3447 m_soil(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3448 tmp_3d2(nzb_soil:nzt_soil,nysf-nbgp:nynf & 3449 +nbgp,nxlf-nbgp:nxrf+nbgp) 3450 3451 CASE ( 'm_soil_av' ) 3452 IF ( .NOT. ALLOCATED( m_soil_av ) ) THEN 3453 ALLOCATE( m_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) 3454 ENDIF 3455 IF ( k == 1 ) READ ( 13 ) tmp_3d2(:,:,:) 3456 m_soil_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3457 tmp_3d2(nzb_soil:nzt_soil,nysf & 3458 -nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3459 3460 CASE ( 'qsws_eb_av' ) 3461 IF ( .NOT. ALLOCATED( qsws_eb_av ) ) THEN 3462 ALLOCATE( qsws_eb_av(nysg:nyng,nxlg:nxrg) ) 3463 ENDIF 3464 IF ( k == 1 ) READ ( 13 ) tmp_2d 3465 qsws_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3466 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3467 3468 CASE ( 'qsws_liq_eb_av' ) 3469 IF ( .NOT. ALLOCATED( qsws_liq_eb_av ) ) THEN 3470 ALLOCATE( qsws_liq_eb_av(nysg:nyng,nxlg:nxrg) ) 3471 ENDIF 3472 IF ( k == 1 ) READ ( 13 ) tmp_2d 3473 qsws_liq_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3474 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3475 CASE ( 'qsws_soil_eb_av' ) 3476 IF ( .NOT. ALLOCATED( qsws_soil_eb_av ) ) THEN 3477 ALLOCATE( qsws_soil_eb_av(nysg:nyng,nxlg:nxrg) ) 3478 ENDIF 3479 IF ( k == 1 ) READ ( 13 ) tmp_2d 3480 qsws_soil_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3481 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3482 3483 CASE ( 'qsws_veg_eb_av' ) 3484 IF ( .NOT. ALLOCATED( qsws_veg_eb_av ) ) THEN 3485 ALLOCATE( qsws_veg_eb_av(nysg:nyng,nxlg:nxrg) ) 3486 ENDIF 3487 IF ( k == 1 ) READ ( 13 ) tmp_2d 3488 qsws_veg_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3489 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3490 3491 CASE ( 'shf_eb_av' ) 3492 IF ( .NOT. ALLOCATED( shf_eb_av ) ) THEN 3493 ALLOCATE( shf_eb_av(nysg:nyng,nxlg:nxrg) ) 3494 ENDIF 3495 IF ( k == 1 ) READ ( 13 ) tmp_2d 3496 shf_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3497 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 3498 3499 CASE ( 't_soil' ) 3500 IF ( k == 1 ) READ ( 13 ) tmp_3d 3501 t_soil(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3502 tmp_3d(:,nysf-nbgp:nynf+nbgp, & 3503 nxlf-nbgp:nxrf+nbgp) 3504 3505 CASE ( 't_soil_av' ) 3506 IF ( .NOT. ALLOCATED( t_soil_av ) ) THEN 3507 ALLOCATE( t_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) 3508 ENDIF 3509 IF ( k == 1 ) READ ( 13 ) tmp_3d2(:,:,:) 3510 t_soil_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 3511 tmp_3d(:,nysf-nbgp:nynf+nbgp, & 3512 nxlf-nbgp:nxrf+nbgp) 3513 3514 3515 CASE DEFAULT 3516 WRITE( message_string, * ) 'unknown variable named "', & 3517 TRIM( field_char ), '" found in', & 3518 '&data from prior run on PE ', myid 3519 CALL message( 'lsm_read_restart_data', 'PA0441', 1, 2, 0, 6, & 3520 0 ) 3521 3522 END SELECT 3523 3524 ENDDO 3525 3526 READ ( 13 ) field_char 3527 3528 ENDDO 3529 ENDIF 3530 3531 END SUBROUTINE lsm_read_restart_data 3532 2417 3533 !------------------------------------------------------------------------------! 2418 3534 ! Description: -
palm/trunk/SOURCE/netcdf_interface_mod.f90
r1961 r1972 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Bugfix: wrong units for lsm quantities. 22 ! Definition of grids for land surface quantities is now done directly in the 23 ! respective module. 22 24 ! 23 25 ! Former revisions: … … 208 210 'm2/s2 ', 'm2/s2 ', 'kg m/s ', & 209 211 'm ', 'kg/kg ', 'kg m/(kg s) ', & 210 'kg/kg ', ' ', '', &211 ' ', ' ', '', &212 'W/m2 ', 's/m ', ' 212 'kg/kg ', 'W/m2 ', 'W/m2 ', & 213 'W/m2 ', 'W/m2 ', 'W/m2 ', & 214 'W/m2 ', 's/m ', 's/m ', & 213 215 'W/m2 ', 'W/m2 ', 'W/m2 ', & 214 216 'W/m2 ', 'W/m2 ', ' ', & … … 400 402 401 403 USE land_surface_model_mod, & 402 ONLY: land_surface, nzb_soil, nzt_soil, nzs, zs404 ONLY: land_surface, lsm_define_netcdf_grid, nzb_soil, nzt_soil, nzs, zs 403 405 404 406 USE pegrid … … 758 760 grid_y = 'y' 759 761 grid_z = 'zw' 760 ! 761 !-- soil grid 762 CASE ( 'm_soil', 't_soil' ) 763 764 grid_x = 'x' 765 grid_y = 'y' 766 grid_z = 'zs' 762 767 763 768 764 CASE DEFAULT 765 766 ! 767 !-- Check for land surface quantities 768 IF ( land_surface ) THEN 769 CALL lsm_define_netcdf_grid( domask(mid,av,i), found, & 770 grid_x, grid_y, grid_z ) 771 ENDIF 772 769 773 ! 770 774 !-- Check for user-defined quantities 771 CALL user_define_netcdf_grid( domask(mid,av,i), found, & 772 grid_x, grid_y, grid_z ) 775 IF ( .NOT. found ) THEN 776 CALL user_define_netcdf_grid( domask(mid,av,i), found, & 777 grid_x, grid_y, grid_z ) 778 ENDIF 773 779 774 780 IF ( .NOT. found ) THEN … … 1258 1264 grid_y = 'y' 1259 1265 grid_z = 'zw' 1260 ! 1261 !-- soil grid 1262 CASE ( 'm_soil', 't_soil' ) 1263 1264 grid_x = 'x' 1265 grid_y = 'y' 1266 grid_z = 'zs' 1266 1267 1267 1268 1268 CASE DEFAULT 1269 ! 1269 1270 ! 1271 !-- Check for land surface quantities 1272 IF ( land_surface ) THEN 1273 CALL lsm_define_netcdf_grid( do3d(av,i), found, grid_x, & 1274 grid_y, grid_z ) 1275 ENDIF 1276 1270 1277 !-- Check for user-defined quantities 1271 CALL user_define_netcdf_grid( do3d(av,i), found, grid_x, & 1272 grid_y, grid_z ) 1278 IF ( .NOT. found ) THEN 1279 CALL user_define_netcdf_grid( do3d(av,i), found, grid_x, & 1280 grid_y, grid_z ) 1281 ENDIF 1273 1282 1274 1283 IF ( .NOT. found ) THEN … … 1992 2001 1993 2002 ! 1994 !-- 2003 !-- Write zs data 1995 2004 IF ( land_surface ) THEN 1996 2005 ns_do = 0 -
palm/trunk/SOURCE/palm.f90
r1961 r1972 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Added call to lsm_last_actions for binary output of land surface model data 22 22 ! 23 23 ! Former revisions: … … 161 161 162 162 USE kinds 163 164 USE land_surface_model_mod, & 165 ONLY: land_surface, lsm_last_actions 163 166 164 167 USE ls_forcing_mod, & … … 442 445 IF ( myid == 0 ) CALL header 443 446 ! 444 !-- If required, final user-defined actions, and447 !-- If required, final land surface and user-defined actions, and 445 448 !-- last actions on the open files and close files. Unit 14 was opened 446 449 !-- in write_3d_binary but it is closed here, to allow writing on this … … 449 452 DO i = 0, io_blocks-1 450 453 IF ( i == io_group ) THEN 454 IF ( land_surface ) THEN 455 CALL lsm_last_actions 456 ENDIF 451 457 CALL user_last_actions 452 458 IF ( write_binary(1:4) == 'true' ) CALL close_file( 14 ) -
palm/trunk/SOURCE/read_3d_binary.f90
r1960 r1972 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Land surface parts are now done in the respective module 22 22 ! 23 23 ! Former revisions: … … 127 127 128 128 USE land_surface_model_mod, & 129 ONLY: c_liq_av, c_soil_av, c_veg, c_veg_av, ghf_eb_av, lai_av, & 130 qsws_eb_av, qsws_liq_eb_av, qsws_soil_eb_av, qsws_veg_eb_av, & 131 land_surface, m_liq_eb, m_liq_eb_av, m_soil, m_soil_av, & 132 nzb_soil, nzt_soil, shf_eb_av, t_soil, t_soil_av 129 ONLY: land_surface, lsm_read_restart_data 133 130 134 131 USE particle_attributes, & … … 204 201 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: tmp_2d !< temporary array for storing 2D data 205 202 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3d !< temporary array for storing 3D data 206 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3d_soil1!< temporary array for storing 3D soil model data207 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3d_soil2!< temporary array for storing 3D soil model data208 203 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwul !< 209 204 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwun !< … … 330 325 !-- First compare the version numbers 331 326 READ ( 13 ) version_on_file 332 binary_version = '4. 3'327 binary_version = '4.4' 333 328 IF ( TRIM( version_on_file ) /= TRIM( binary_version ) ) THEN 334 329 WRITE( message_string, * ) 'version mismatch concerning data ', & … … 405 400 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 406 401 407 !408 !-- If the land surface model is used, allocate array for storing soil model409 !-- data410 IF ( land_surface ) THEN411 ALLOCATE( tmp_3d_soil1(nzb_soil:nzt_soil+1, &412 nys_on_file-nbgp:nyn_on_file+nbgp, &413 nxl_on_file-nbgp:nxr_on_file+nbgp) )414 ALLOCATE( tmp_3d_soil2(nzb_soil:nzt_soil, &415 nys_on_file-nbgp:nyn_on_file+nbgp, &416 nxl_on_file-nbgp:nxr_on_file+nbgp) )417 ENDIF418 402 ! 419 403 !-- Read arrays … … 444 428 SELECT CASE ( TRIM( field_chr ) ) 445 429 446 CASE ( 'c_liq_av' )447 IF ( .NOT. ALLOCATED( c_liq_av ) ) THEN448 ALLOCATE( c_liq_av(nysg:nyng,nxlg:nxrg) )449 ENDIF450 IF ( k == 1 ) READ ( 13 ) tmp_2d451 c_liq_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &452 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)453 454 CASE ( 'c_soil_av' )455 IF ( .NOT. ALLOCATED( c_soil_av ) ) THEN456 ALLOCATE( c_soil_av(nysg:nyng,nxlg:nxrg) )457 ENDIF458 IF ( k == 1 ) READ ( 13 ) tmp_2d459 c_soil_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &460 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)461 462 CASE ( 'c_veg_av' )463 IF ( .NOT. ALLOCATED( c_veg_av ) ) THEN464 ALLOCATE( c_veg_av(nysg:nyng,nxlg:nxrg) )465 ENDIF466 IF ( k == 1 ) READ ( 13 ) tmp_2d467 c_veg_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &468 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)469 470 430 CASE ( 'e' ) 471 431 IF ( k == 1 ) READ ( 13 ) tmp_3d … … 481 441 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 482 442 483 CASE ( 'ghf_eb_av' )484 IF ( .NOT. ALLOCATED( ghf_eb_av ) ) THEN485 ALLOCATE( ghf_eb_av(nysg:nyng,nxlg:nxrg) )486 ENDIF487 IF ( k == 1 ) READ ( 13 ) tmp_2d488 ghf_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &489 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)490 491 443 CASE ( 'iran' ) ! matching random numbers is still unresolved 492 444 ! issue 493 445 IF ( k == 1 ) READ ( 13 ) iran, iran_part 494 446 495 CASE ( 'lai_av' )496 IF ( .NOT. ALLOCATED( lai_av ) ) THEN497 ALLOCATE( lai_av(nysg:nyng,nxlg:nxrg) )498 ENDIF499 IF ( k == 1 ) READ ( 13 ) tmp_2d500 lai_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &501 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)502 503 447 CASE ( 'kh' ) 504 448 IF ( k == 1 ) READ ( 13 ) tmp_3d … … 526 470 lwp_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 527 471 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 528 529 CASE ( 'm_liq_eb' )530 IF ( k == 1 ) READ ( 13 ) tmp_2d531 m_liq_eb(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &532 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)533 CASE ( 'm_liq_eb_av' )534 IF ( .NOT. ALLOCATED( m_liq_eb_av ) ) THEN535 ALLOCATE( m_liq_eb_av(nysg:nyng,nxlg:nxrg) )536 ENDIF537 IF ( k == 1 ) READ ( 13 ) tmp_2d538 m_liq_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &539 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)540 541 CASE ( 'm_soil' )542 IF ( k == 1 ) READ ( 13 ) tmp_3d_soil2(:,:,:)543 m_soil(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &544 tmp_3d_soil2(nzb_soil:nzt_soil,nysf-nbgp:nynf &545 +nbgp,nxlf-nbgp:nxrf+nbgp)546 547 CASE ( 'm_soil_av' )548 IF ( .NOT. ALLOCATED( m_soil_av ) ) THEN549 ALLOCATE( m_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) )550 ENDIF551 IF ( k == 1 ) READ ( 13 ) tmp_3d_soil2(:,:,:)552 m_soil_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &553 tmp_3d_soil2(nzb_soil:nzt_soil,nysf &554 -nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)555 472 556 473 CASE ( 'nr' ) … … 769 686 IF ( k == 1 ) READ ( 13 ) tmp_2d 770 687 qswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 771 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)772 773 CASE ( 'qsws_eb_av' )774 IF ( .NOT. ALLOCATED( qsws_eb_av ) ) THEN775 ALLOCATE( qsws_eb_av(nysg:nyng,nxlg:nxrg) )776 ENDIF777 IF ( k == 1 ) READ ( 13 ) tmp_2d778 qsws_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &779 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)780 781 CASE ( 'qsws_liq_eb_av' )782 IF ( .NOT. ALLOCATED( qsws_liq_eb_av ) ) THEN783 ALLOCATE( qsws_liq_eb_av(nysg:nyng,nxlg:nxrg) )784 ENDIF785 IF ( k == 1 ) READ ( 13 ) tmp_2d786 qsws_liq_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &787 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)788 CASE ( 'qsws_soil_eb_av' )789 IF ( .NOT. ALLOCATED( qsws_soil_eb_av ) ) THEN790 ALLOCATE( qsws_soil_eb_av(nysg:nyng,nxlg:nxrg) )791 ENDIF792 IF ( k == 1 ) READ ( 13 ) tmp_2d793 qsws_soil_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &794 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)795 796 CASE ( 'qsws_veg_eb_av' )797 IF ( .NOT. ALLOCATED( qsws_veg_eb_av ) ) THEN798 ALLOCATE( qsws_veg_eb_av(nysg:nyng,nxlg:nxrg) )799 ENDIF800 IF ( k == 1 ) READ ( 13 ) tmp_2d801 qsws_veg_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &802 688 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 803 689 … … 1033 919 IF ( k == 1 ) READ ( 13 ) tmp_2d 1034 920 shf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1035 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)1036 1037 CASE ( 'shf_eb_av' )1038 IF ( .NOT. ALLOCATED( shf_eb_av ) ) THEN1039 ALLOCATE( shf_eb_av(nysg:nyng,nxlg:nxrg) )1040 ENDIF1041 IF ( k == 1 ) READ ( 13 ) tmp_2d1042 shf_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &1043 921 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1044 922 … … 1113 991 tswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1114 992 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1115 1116 CASE ( 't_soil' )1117 IF ( k == 1 ) READ ( 13 ) tmp_3d_soil11118 t_soil(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &1119 tmp_3d_soil1(:,nysf-nbgp:nynf+nbgp, &1120 nxlf-nbgp:nxrf+nbgp)1121 1122 CASE ( 't_soil_av' )1123 IF ( .NOT. ALLOCATED( t_soil_av ) ) THEN1124 ALLOCATE( t_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) )1125 ENDIF1126 IF ( k == 1 ) READ ( 13 ) tmp_3d_soil2(:,:,:)1127 t_soil_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &1128 tmp_3d_soil2(:,nysf-nbgp:nynf+nbgp, &1129 nxlf-nbgp:nxrf+nbgp)1130 993 1131 994 CASE ( 'u' ) … … 1407 1270 1408 1271 ! 1272 !-- Read land surface restart data 1273 CALL lsm_read_restart_data( i, nxlfa, nxl_on_file, nxrfa, nxr_on_file, & 1274 nynfa, nyn_on_file, nysfa, nys_on_file, & 1275 offset_xa, offset_ya, overlap_count(i), & 1276 tmp_2d ) 1277 1278 ! 1409 1279 !-- Read user-defined restart data 1410 1280 CALL user_read_restart_data( i, nxlfa, nxl_on_file, nxrfa, nxr_on_file, & … … 1418 1288 1419 1289 DEALLOCATE( tmp_2d, tmp_3d ) 1420 IF ( ALLOCATED( tmp_3d_soil1 ) ) DEALLOCATE( tmp_3d_soil1 )1421 IF ( ALLOCATED( tmp_3d_soil2 ) ) DEALLOCATE( tmp_3d_soil2 )1422 1290 1423 1291 ENDDO ! loop over restart files -
palm/trunk/SOURCE/sum_up_3d_data.f90
r1961 r1972 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Land surface actions are now done directly in the respective module 22 22 ! 23 23 ! Former revisions: … … 129 129 130 130 USE land_surface_model_mod, & 131 ONLY: c_liq, c_liq_av, c_soil_av, c_veg, c_veg_av, ghf_eb, & 132 ghf_eb_av, lai, lai_av, m_liq_eb, m_liq_eb_av, m_soil, & 133 m_soil_av, nzb_soil, nzt_soil, qsws_eb, qsws_eb_av, & 134 qsws_liq_eb, qsws_liq_eb_av, qsws_soil_eb, qsws_soil_eb_av, & 135 qsws_veg_eb, qsws_veg_eb_av, shf_eb, shf_eb_av, r_a, r_a_av, & 136 r_s, r_s_av, t_soil, t_soil_av 131 ONLY: land_surface, lsm_3d_data_averaging 137 132 138 133 USE particle_attributes, & … … 173 168 SELECT CASE ( TRIM( doav(ii) ) ) 174 169 175 CASE ( 'c_liq*' )176 IF ( .NOT. ALLOCATED( c_liq_av ) ) THEN177 ALLOCATE( c_liq_av(nysg:nyng,nxlg:nxrg) )178 ENDIF179 c_liq_av = 0.0_wp180 181 CASE ( 'c_soil*' )182 IF ( .NOT. ALLOCATED( c_soil_av ) ) THEN183 ALLOCATE( c_soil_av(nysg:nyng,nxlg:nxrg) )184 ENDIF185 c_soil_av = 0.0_wp186 187 CASE ( 'c_veg*' )188 IF ( .NOT. ALLOCATED( c_veg_av ) ) THEN189 ALLOCATE( c_veg_av(nysg:nyng,nxlg:nxrg) )190 ENDIF191 c_veg_av = 0.0_wp192 193 170 CASE ( 'e' ) 194 171 IF ( .NOT. ALLOCATED( e_av ) ) THEN … … 197 174 e_av = 0.0_wp 198 175 199 CASE ( 'ghf_eb*' )200 IF ( .NOT. ALLOCATED( ghf_eb_av ) ) THEN201 ALLOCATE( ghf_eb_av(nysg:nyng,nxlg:nxrg) )202 ENDIF203 ghf_eb_av = 0.0_wp204 205 CASE ( 'lai*' )206 IF ( .NOT. ALLOCATED( lai_av ) ) THEN207 ALLOCATE( lai_av(nysg:nyng,nxlg:nxrg) )208 ENDIF209 lai_av = 0.0_wp210 211 176 CASE ( 'lpt' ) 212 177 IF ( .NOT. ALLOCATED( lpt_av ) ) THEN … … 221 186 lwp_av = 0.0_wp 222 187 223 CASE ( 'm_liq_eb*' )224 IF ( .NOT. ALLOCATED( m_liq_eb_av ) ) THEN225 ALLOCATE( m_liq_eb_av(nysg:nyng,nxlg:nxrg) )226 ENDIF227 m_liq_eb_av = 0.0_wp228 229 CASE ( 'm_soil' )230 IF ( .NOT. ALLOCATED( m_soil_av ) ) THEN231 ALLOCATE( m_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) )232 ENDIF233 m_soil_av = 0.0_wp234 235 188 CASE ( 'nr' ) 236 189 IF ( .NOT. ALLOCATED( nr_av ) ) THEN … … 329 282 qsws_av = 0.0_wp 330 283 331 CASE ( 'qsws_eb*' )332 IF ( .NOT. ALLOCATED( qsws_eb_av ) ) THEN333 ALLOCATE( qsws_eb_av(nysg:nyng,nxlg:nxrg) )334 ENDIF335 qsws_eb_av = 0.0_wp336 337 CASE ( 'qsws_liq_eb*' )338 IF ( .NOT. ALLOCATED( qsws_liq_eb_av ) ) THEN339 ALLOCATE( qsws_liq_eb_av(nysg:nyng,nxlg:nxrg) )340 ENDIF341 qsws_liq_eb_av = 0.0_wp342 343 CASE ( 'qsws_soil_eb*' )344 IF ( .NOT. ALLOCATED( qsws_soil_eb_av ) ) THEN345 ALLOCATE( qsws_soil_eb_av(nysg:nyng,nxlg:nxrg) )346 ENDIF347 qsws_soil_eb_av = 0.0_wp348 349 CASE ( 'qsws_veg_eb*' )350 IF ( .NOT. ALLOCATED( qsws_veg_eb_av ) ) THEN351 ALLOCATE( qsws_veg_eb_av(nysg:nyng,nxlg:nxrg) )352 ENDIF353 qsws_veg_eb_av = 0.0_wp354 355 284 CASE ( 'qv' ) 356 285 IF ( .NOT. ALLOCATED( qv_av ) ) THEN … … 419 348 rho_av = 0.0_wp 420 349 421 CASE ( 'r_a*' )422 IF ( .NOT. ALLOCATED( r_a_av ) ) THEN423 ALLOCATE( r_a_av(nysg:nyng,nxlg:nxrg) )424 ENDIF425 r_a_av = 0.0_wp426 427 CASE ( 'r_s*' )428 IF ( .NOT. ALLOCATED( r_s_av ) ) THEN429 ALLOCATE( r_s_av(nysg:nyng,nxlg:nxrg) )430 ENDIF431 r_s_av = 0.0_wp432 433 350 CASE ( 's' ) 434 351 IF ( .NOT. ALLOCATED( s_av ) ) THEN … … 449 366 shf_av = 0.0_wp 450 367 451 CASE ( 'shf_eb*' )452 IF ( .NOT. ALLOCATED( shf_eb_av ) ) THEN453 ALLOCATE( shf_eb_av(nysg:nyng,nxlg:nxrg) )454 ENDIF455 shf_eb_av = 0.0_wp456 457 CASE ( 't_soil' )458 IF ( .NOT. ALLOCATED( t_soil_av ) ) THEN459 ALLOCATE( t_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) )460 ENDIF461 t_soil_av = 0.0_wp462 463 368 CASE ( 't*' ) 464 369 IF ( .NOT. ALLOCATED( ts_av ) ) THEN … … 516 421 517 422 CASE DEFAULT 423 424 ! 425 !-- Land surface quantity 426 IF ( land_surface ) THEN 427 CALL lsm_3d_data_averaging( 'allocate', doav(ii) ) 428 ENDIF 429 518 430 ! 519 431 !-- User-defined quantity … … 534 446 SELECT CASE ( TRIM( doav(ii) ) ) 535 447 536 CASE ( 'c_liq*' )537 DO i = nxlg, nxrg538 DO j = nysg, nyng539 c_liq_av(j,i) = c_liq_av(j,i) + c_liq(j,i)540 ENDDO541 ENDDO542 543 CASE ( 'c_soil*' )544 DO i = nxlg, nxrg545 DO j = nysg, nyng546 c_soil_av(j,i) = c_soil_av(j,i) + (1.0 - c_veg(j,i))547 ENDDO548 ENDDO549 550 CASE ( 'c_veg*' )551 DO i = nxlg, nxrg552 DO j = nysg, nyng553 c_veg_av(j,i) = c_veg_av(j,i) + c_veg(j,i)554 ENDDO555 ENDDO556 557 448 CASE ( 'e' ) 558 449 DO i = nxlg, nxrg … … 561 452 e_av(k,j,i) = e_av(k,j,i) + e(k,j,i) 562 453 ENDDO 563 ENDDO564 ENDDO565 566 CASE ( 'ghf_eb*' )567 DO i = nxlg, nxrg568 DO j = nysg, nyng569 ghf_eb_av(j,i) = ghf_eb_av(j,i) + ghf_eb(j,i)570 ENDDO571 ENDDO572 573 CASE ( 'lai*' )574 DO i = nxlg, nxrg575 DO j = nysg, nyng576 lai_av(j,i) = lai_av(j,i) + lai(j,i)577 454 ENDDO 578 455 ENDDO … … 592 469 lwp_av(j,i) = lwp_av(j,i) + SUM( ql(nzb:nzt,j,i) & 593 470 * dzw(1:nzt+1) ) * rho_surface 594 ENDDO595 ENDDO596 597 CASE ( 'm_liq_eb*' )598 DO i = nxlg, nxrg599 DO j = nysg, nyng600 m_liq_eb_av(j,i) = m_liq_eb_av(j,i) + m_liq_eb(j,i)601 ENDDO602 ENDDO603 604 CASE ( 'm_soil' )605 DO i = nxlg, nxrg606 DO j = nysg, nyng607 DO k = nzb_soil, nzt_soil608 m_soil_av(k,j,i) = m_soil_av(k,j,i) + m_soil(k,j,i)609 ENDDO610 471 ENDDO 611 472 ENDDO … … 782 643 ENDDO 783 644 784 CASE ( 'qsws_eb*' )785 DO i = nxlg, nxrg786 DO j = nysg, nyng787 qsws_eb_av(j,i) = qsws_eb_av(j,i) + qsws_eb(j,i)788 ENDDO789 ENDDO790 791 CASE ( 'qsws_liq_eb*' )792 DO i = nxlg, nxrg793 DO j = nysg, nyng794 qsws_liq_eb_av(j,i) = qsws_liq_eb_av(j,i) + qsws_liq_eb(j,i)795 ENDDO796 ENDDO797 798 CASE ( 'qsws_soil_eb*' )799 DO i = nxlg, nxrg800 DO j = nysg, nyng801 qsws_soil_eb_av(j,i) = qsws_soil_eb_av(j,i) + qsws_soil_eb(j,i)802 ENDDO803 ENDDO804 805 CASE ( 'qsws_veg_eb*' )806 DO i = nxlg, nxrg807 DO j = nysg, nyng808 qsws_veg_eb_av(j,i) = qsws_veg_eb_av(j,i) + qsws_veg_eb(j,i)809 ENDDO810 ENDDO811 812 645 CASE ( 'qv' ) 813 646 DO i = nxlg, nxrg … … 898 731 ENDDO 899 732 900 CASE ( 'r_a*' )901 DO i = nxlg, nxrg902 DO j = nysg, nyng903 r_a_av(j,i) = r_a_av(j,i) + r_a(j,i)904 ENDDO905 ENDDO906 907 CASE ( 'r_s*' )908 DO i = nxlg, nxrg909 DO j = nysg, nyng910 r_s_av(j,i) = r_s_av(j,i) + r_s(j,i)911 ENDDO912 ENDDO913 914 733 CASE ( 'rho' ) 915 734 DO i = nxlg, nxrg … … 946 765 ENDDO 947 766 948 CASE ( 'shf_eb*' )949 DO i = nxlg, nxrg950 DO j = nysg, nyng951 shf_eb_av(j,i) = shf_eb_av(j,i) + shf_eb(j,i)952 ENDDO953 ENDDO954 955 767 CASE ( 'ssws*' ) 956 768 DO i = nxlg, nxrg … … 967 779 ENDDO 968 780 969 CASE ( 't_soil' )970 DO i = nxlg, nxrg971 DO j = nysg, nyng972 DO k = nzb_soil, nzt_soil973 t_soil_av(k,j,i) = t_soil_av(k,j,i) + t_soil(k,j,i)974 ENDDO975 ENDDO976 ENDDO977 978 781 CASE ( 'u' ) 979 782 DO i = nxlg, nxrg … … 1041 844 1042 845 CASE DEFAULT 846 ! 847 !-- Land surface quantity 848 IF ( land_surface ) THEN 849 CALL lsm_3d_data_averaging( 'sum', doav(ii) ) 850 ENDIF 851 1043 852 ! 1044 853 !-- User-defined quantity -
palm/trunk/SOURCE/user_init_land_surface.f90
r1818 r1972 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Update of use statements 22 22 ! 23 23 ! Former revisions: … … 41 41 42 42 43 USE arrays_3d44 45 43 USE control_parameters 46 44 … … 48 46 49 47 USE kinds 48 49 USE land_surface_model_mod 50 50 51 USE land_surface_model_mod 51 USE netcdf_interface, & 52 ONLY: dots_label, dots_unit, dots_num 53 54 USE pegrid 52 55 53 56 USE user -
palm/trunk/SOURCE/write_3d_binary.f90
r1960 r1972 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Land surface actions are now done directly in the respective module 22 22 ! 23 23 ! Former revisions: … … 113 113 USE indices, & 114 114 ONLY: nxl, nxr, nys, nyn, nzb, nzt 115 116 USE land_surface_model_mod, &117 ONLY: c_liq_av, c_soil_av, c_veg_av, ghf_eb_av, lai_av, &118 qsws_eb_av, qsws_liq_eb_av, qsws_soil_eb_av, qsws_veg_eb_av, &119 land_surface, m_liq_eb, m_liq_eb_av, m_soil, m_soil_av, &120 nzb_soil, nzt_soil, shf_eb_av, t_soil, t_soil_av121 115 122 116 USE particle_attributes, & … … 152 146 ! 153 147 !-- Write arrays. 154 binary_version = '4. 3'148 binary_version = '4.4' 155 149 156 150 WRITE ( 14 ) binary_version … … 164 158 !-- adjusted accordingly. 165 159 166 167 IF ( land_surface ) THEN168 IF ( ALLOCATED( c_liq_av ) ) THEN169 WRITE ( 14 ) 'c_liq_av '; WRITE ( 14 ) c_liq_av170 ENDIF171 IF ( ALLOCATED( c_soil_av ) ) THEN172 WRITE ( 14 ) 'c_soil_av '; WRITE ( 14 ) c_soil_av173 ENDIF174 IF ( ALLOCATED( c_veg_av ) ) THEN175 WRITE ( 14 ) 'c_veg_av '; WRITE ( 14 ) c_veg_av176 ENDIF177 ENDIF178 160 WRITE ( 14 ) 'e '; WRITE ( 14 ) e 179 161 IF ( ALLOCATED( e_av ) ) THEN … … 181 163 ENDIF 182 164 WRITE ( 14 ) 'iran '; WRITE ( 14 ) iran, iran_part 183 IF ( land_surface ) THEN184 IF ( ALLOCATED( ghf_eb_av ) ) THEN185 WRITE ( 14 ) 'ghf_eb_av '; WRITE ( 14 ) ghf_eb_av186 ENDIF187 ENDIF188 165 WRITE ( 14 ) 'kh '; WRITE ( 14 ) kh 189 166 WRITE ( 14 ) 'km '; WRITE ( 14 ) km 190 IF ( land_surface ) THEN191 IF ( ALLOCATED( lai_av ) ) THEN192 WRITE ( 14 ) 'lai_av '; WRITE ( 14 ) lai_av193 ENDIF194 ENDIF195 167 IF ( ALLOCATED( lpt_av ) ) THEN 196 168 WRITE ( 14 ) 'lpt_av '; WRITE ( 14 ) lpt_av … … 198 170 IF ( ALLOCATED( lwp_av ) ) THEN 199 171 WRITE ( 14 ) 'lwp_av '; WRITE ( 14 ) lwp_av 200 ENDIF201 IF ( land_surface ) THEN202 WRITE ( 14 ) 'm_liq_eb '; WRITE ( 14 ) m_liq_eb203 IF ( ALLOCATED( m_liq_eb_av ) ) THEN204 WRITE ( 14 ) 'm_liq_eb_av '; WRITE ( 14 ) m_liq_eb_av205 ENDIF206 WRITE ( 14 ) 'm_soil '; WRITE ( 14 ) m_soil207 IF ( ALLOCATED( m_soil_av ) ) THEN208 WRITE ( 14 ) 'm_soil_av '; WRITE ( 14 ) m_soil_av209 ENDIF210 172 ENDIF 211 173 WRITE ( 14 ) 'ol '; WRITE ( 14 ) ol … … 289 251 WRITE ( 14 ) 'sswst '; WRITE ( 14 ) sswst 290 252 ENDIF 291 IF ( land_surface ) THEN292 IF ( ALLOCATED( qsws_eb_av ) ) THEN293 WRITE ( 14 ) 'qsws_eb_av '; WRITE ( 14 ) qsws_eb_av294 ENDIF295 IF ( ALLOCATED( qsws_liq_eb_av ) ) THEN296 WRITE ( 14 ) 'qsws_liq_eb_av '; WRITE ( 14 ) qsws_liq_eb_av297 ENDIF298 IF ( ALLOCATED( qsws_soil_eb_av ) ) THEN299 WRITE ( 14 ) 'qsws_soil_eb_av '; WRITE ( 14 ) qsws_soil_eb_av300 ENDIF301 IF ( ALLOCATED( qsws_veg_eb_av ) ) THEN302 WRITE ( 14 ) 'qsws_veg_eb_av '; WRITE ( 14 ) qsws_veg_eb_av303 ENDIF304 ENDIF305 253 IF ( ALLOCATED( rad_net ) ) THEN 306 254 WRITE ( 14 ) 'rad_net '; WRITE ( 14 ) rad_net … … 374 322 WRITE ( 14 ) 'saswst '; WRITE ( 14 ) saswst 375 323 ENDIF 376 IF ( land_surface ) THEN377 WRITE ( 14 ) 't_soil '; WRITE ( 14 ) t_soil378 IF ( ALLOCATED( t_soil_av ) ) THEN379 WRITE ( 14 ) 't_soil_av '; WRITE ( 14 ) t_soil_av380 ENDIF381 ENDIF382 324 IF ( ALLOCATED( ql_c_av ) ) THEN 383 325 WRITE ( 14 ) 'ql_c_av '; WRITE ( 14 ) ql_c_av … … 408 350 WRITE ( 14 ) 'shf_av '; WRITE ( 14 ) shf_av 409 351 ENDIF 410 IF ( land_surface ) THEN411 IF ( ALLOCATED( shf_eb_av ) ) THEN412 WRITE ( 14 ) 'shf_eb_av '; WRITE ( 14 ) shf_eb_av413 ENDIF414 ENDIF415 352 IF ( ALLOCATED( spectrum_x ) ) THEN 416 353 WRITE ( 14 ) 'spectrum_x '; WRITE ( 14 ) spectrum_x
Note: See TracChangeset
for help on using the changeset viewer.