Changeset 4360 for palm/trunk/SOURCE/plant_canopy_model_mod.f90
- Timestamp:
- Jan 7, 2020 11:25:50 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/plant_canopy_model_mod.f90
r4356 r4360 15 15 ! PALM. If not, see <http://www.gnu.org/licenses/>. 16 16 ! 17 ! Copyright 1997-20 19Leibniz Universitaet Hannover17 ! Copyright 1997-2020 Leibniz Universitaet Hannover 18 18 ! Copyright 2017-2019 Institute of Computer Science of the 19 19 ! Czech Academy of Sciences, Prague … … 27 27 ! ----------------- 28 28 ! $Id$ 29 ! - Bugfix, read restart data for time-averaged pcm output quantities 30 ! - Output of plant-canopy quantities will fill values 31 ! 32 ! 4356 2019-12-20 17:09:33Z suehring 29 33 ! Correct single message call, local check must be given by the respective 30 34 ! mpi rank. … … 140 144 !------------------------------------------------------------------------------! 141 145 MODULE plant_canopy_model_mod 142 146 143 147 USE arrays_3d, & 144 148 ONLY: dzu, dzw, e, exner, hyp, pt, q, s, tend, u, v, w, zu, zw … … 146 150 USE basic_constants_and_equations_mod, & 147 151 ONLY: c_p, degc_to_k, l_v, lv_d_cp, r_d, rd_d_rv 148 152 149 153 USE bulk_cloud_model_mod, & 150 154 ONLY: bulk_cloud_model, microphysics_seifert 151 155 152 156 USE control_parameters, & 153 ONLY: average_count_3d, coupling_char, debug_output, dt_3d, dz, & 154 humidity, message_string, ocean_mode, passive_scalar, & 155 plant_canopy, urban_surface 156 157 ONLY: average_count_3d, & 158 coupling_char, & 159 debug_output, & 160 dt_3d, & 161 dz, & 162 humidity, & 163 length, & 164 message_string, & 165 ocean_mode, & 166 passive_scalar, & 167 plant_canopy, & 168 restart_string, & 169 urban_surface 170 157 171 USE grid_variables, & 158 172 ONLY: dx, dy … … 163 177 164 178 USE kinds 165 179 166 180 USE netcdf_data_input_mod, & 167 181 ONLY: input_pids_static, leaf_area_density_f 168 182 169 183 USE pegrid 170 184 171 185 USE surface_mod, & 172 186 ONLY: surf_def_h, surf_lsm_h, surf_usm_h … … 223 237 ! 224 238 !-- Public functions 225 PUBLIC pcm_calc_transpiration_rate, pcm_check_data_output, & 226 pcm_check_parameters, pcm_3d_data_averaging, & 227 pcm_data_output_3d, pcm_define_netcdf_grid, & 228 pcm_header, pcm_init, pcm_parin, pcm_tendency 239 PUBLIC pcm_calc_transpiration_rate, & 240 pcm_check_data_output, & 241 pcm_check_parameters, & 242 pcm_3d_data_averaging, & 243 pcm_data_output_3d, & 244 pcm_define_netcdf_grid, & 245 pcm_header, & 246 pcm_init, & 247 pcm_parin, & 248 pcm_rrd_local, & 249 pcm_tendency, & 250 pcm_wrd_local 229 251 230 252 ! … … 273 295 MODULE PROCEDURE pcm_read_plant_canopy_3d 274 296 END INTERFACE pcm_read_plant_canopy_3d 275 297 298 INTERFACE pcm_rrd_local 299 MODULE PROCEDURE pcm_rrd_local 300 END INTERFACE pcm_rrd_local 301 276 302 INTERFACE pcm_tendency 277 303 MODULE PROCEDURE pcm_tendency 278 304 MODULE PROCEDURE pcm_tendency_ij 279 305 END INTERFACE pcm_tendency 306 307 INTERFACE pcm_wrd_local 308 MODULE PROCEDURE pcm_wrd_local 309 END INTERFACE pcm_wrd_local 280 310 281 311 … … 685 715 DO i = nxl, nxr 686 716 DO j = nys, nyn 687 DO k = MAX( 1, nzb_do ), MIN( pch_index , nzt_do )717 DO k = MAX( 1, nzb_do ), MIN( pch_index_ji(j,i), nzt_do ) 688 718 local_pf(i,j,k) = pcm_heating_rate(k,j,i) 689 719 ENDDO … … 693 723 DO i = nxl, nxr 694 724 DO j = nys, nyn 695 DO k = MAX( 1, nzb_do ), MIN( pch_index , nzt_do )725 DO k = MAX( 1, nzb_do ), MIN( pch_index_ji(j,i), nzt_do ) 696 726 local_pf(i,j,k) = pcm_heatrate_av(k,j,i) 697 727 ENDDO … … 704 734 DO i = nxl, nxr 705 735 DO j = nys, nyn 706 DO k = MAX( 1, nzb_do ), MIN( pch_index , nzt_do )736 DO k = MAX( 1, nzb_do ), MIN( pch_index_ji(j,i), nzt_do ) 707 737 local_pf(i,j,k) = pcm_latent_rate(k,j,i) 708 738 ENDDO … … 712 742 DO i = nxl, nxr 713 743 DO j = nys, nyn 714 DO k = MAX( 1, nzb_do ), MIN( pch_index , nzt_do )744 DO k = MAX( 1, nzb_do ), MIN( pch_index_ji(j,i), nzt_do ) 715 745 local_pf(i,j,k) = pcm_latentrate_av(k,j,i) 716 746 ENDDO … … 723 753 DO i = nxl, nxr 724 754 DO j = nys, nyn 725 DO k = MAX( 1, nzb_do ), MIN( pch_index , nzt_do )755 DO k = MAX( 1, nzb_do ), MIN( pch_index_ji(j,i), nzt_do ) 726 756 local_pf(i,j,k) = pcm_transpiration_rate(k,j,i) 727 757 ENDDO … … 731 761 DO i = nxl, nxr 732 762 DO j = nys, nyn 733 DO k = MAX( 1, nzb_do ), MIN( pch_index , nzt_do )763 DO k = MAX( 1, nzb_do ), MIN( pch_index_ji(j,i), nzt_do ) 734 764 local_pf(i,j,k) = pcm_transpirationrate_av(k,j,i) 735 765 ENDDO … … 742 772 DO i = nxl, nxr 743 773 DO j = nys, nyn 744 DO k = MAX( 1, nzb_do ), MIN( pch_index , nzt_do )774 DO k = MAX( 1, nzb_do ), MIN( pch_index_ji(j,i), nzt_do ) 745 775 local_pf(i,j,k) = lad_s(k,j,i) 746 776 ENDDO … … 1151 1181 MPI_MAX, comm2d, ierr) 1152 1182 #endif 1153 1183 ! 1154 1184 !-- Allocation of arrays pcm_heating_rate, pcm_transpiration_rate and pcm_latent_rate 1155 1185 ALLOCATE( pcm_heating_rate(0:pch_index,nysg:nyng,nxlg:nxrg) ) … … 1437 1467 1438 1468 END SUBROUTINE pcm_read_plant_canopy_3d 1439 1440 1469 1470 !------------------------------------------------------------------------------! 1471 ! Description: 1472 ! ------------ 1473 !> Subroutine reads local (subdomain) restart data 1474 !------------------------------------------------------------------------------! 1475 SUBROUTINE pcm_rrd_local( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, & 1476 nxr_on_file, nynf, nync, nyn_on_file, nysf, & 1477 nysc, nys_on_file, tmp_2d, tmp_3d, found ) 1478 1479 INTEGER(iwp) :: k !< 1480 INTEGER(iwp) :: nxlc !< 1481 INTEGER(iwp) :: nxlf !< 1482 INTEGER(iwp) :: nxl_on_file !< 1483 INTEGER(iwp) :: nxrc !< 1484 INTEGER(iwp) :: nxrf !< 1485 INTEGER(iwp) :: nxr_on_file !< 1486 INTEGER(iwp) :: nync !< 1487 INTEGER(iwp) :: nynf !< 1488 INTEGER(iwp) :: nyn_on_file !< 1489 INTEGER(iwp) :: nysc !< 1490 INTEGER(iwp) :: nysf !< 1491 INTEGER(iwp) :: nys_on_file !< 1492 1493 LOGICAL, INTENT(OUT) :: found 1494 1495 REAL(wp), DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp, & 1496 nxl_on_file-nbgp:nxr_on_file+nbgp) :: tmp_2d !< temporary 2D array 1497 1498 REAL(wp), DIMENSION(nzb:nzt+1, & 1499 nys_on_file-nbgp:nyn_on_file+nbgp, & 1500 nxl_on_file-nbgp:nxr_on_file+nbgp) :: tmp_3d !< temporary 3D array with entire vertical dimension 1501 1502 REAL(wp), DIMENSION(0:pch_index, & 1503 nys_on_file-nbgp:nyn_on_file+nbgp, & 1504 nxl_on_file-nbgp:nxr_on_file+nbgp) :: tmp_3d2 !< temporary 3D array for entire vertical 1505 !< extension of canopy layer 1506 found = .TRUE. 1507 1508 SELECT CASE ( restart_string(1:length) ) 1509 1510 CASE ( 'pcm_heatrate_av' ) 1511 IF ( .NOT. ALLOCATED( pcm_heatrate_av ) ) THEN 1512 ALLOCATE( pcm_heatrate_av(0:pch_index,nysg:nyng,nxlg:nxrg) ) 1513 pcm_heatrate_av = 0.0_wp 1514 ENDIF 1515 IF ( k == 1 ) READ ( 13 ) tmp_3d2 1516 pcm_heatrate_av(0:pch_index,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1517 tmp_3d2(0:pch_index,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1518 1519 CASE ( 'pcm_latentrate_av' ) 1520 IF ( .NOT. ALLOCATED( pcm_latentrate_av ) ) THEN 1521 ALLOCATE( pcm_latentrate_av(0:pch_index,nysg:nyng,nxlg:nxrg) ) 1522 pcm_latentrate_av = 0.0_wp 1523 ENDIF 1524 IF ( k == 1 ) READ ( 13 ) tmp_3d2 1525 pcm_latentrate_av(0:pch_index,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1526 tmp_3d2(0:pch_index,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1527 1528 CASE ( 'pcm_transpirationrate_av' ) 1529 IF ( .NOT. ALLOCATED( pcm_transpirationrate_av ) ) THEN 1530 ALLOCATE( pcm_transpirationrate_av(0:pch_index,nysg:nyng,nxlg:nxrg) ) 1531 pcm_transpirationrate_av = 0.0_wp 1532 ENDIF 1533 IF ( k == 1 ) READ ( 13 ) tmp_3d2 1534 pcm_transpirationrate_av(0:pch_index,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1535 tmp_3d2(0:pch_index,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1536 1537 CASE DEFAULT 1538 1539 found = .FALSE. 1540 1541 END SELECT 1542 1543 END SUBROUTINE pcm_rrd_local 1544 1441 1545 !------------------------------------------------------------------------------! 1442 1546 ! Description: … … 2188 2292 END SUBROUTINE pcm_tendency_ij 2189 2293 2294 !------------------------------------------------------------------------------! 2295 ! Description: 2296 ! ------------ 2297 !> Subroutine writes local (subdomain) restart data 2298 !------------------------------------------------------------------------------! 2299 SUBROUTINE pcm_wrd_local 2300 2301 IF ( ALLOCATED( pcm_heatrate_av ) ) THEN 2302 CALL wrd_write_string( 'pcm_heatrate_av' ) 2303 WRITE ( 14 ) pcm_heatrate_av 2304 ENDIF 2305 2306 IF ( ALLOCATED( pcm_latentrate_av ) ) THEN 2307 CALL wrd_write_string( 'pcm_latentrate_av' ) 2308 WRITE ( 14 ) pcm_latentrate_av 2309 ENDIF 2310 2311 IF ( ALLOCATED( pcm_transpirationrate_av ) ) THEN 2312 CALL wrd_write_string( 'pcm_transpirationrate_av' ) 2313 WRITE ( 14 ) pcm_transpirationrate_av 2314 ENDIF 2315 2316 END SUBROUTINE pcm_wrd_local 2317 2190 2318 2191 2319 END MODULE plant_canopy_model_mod
Note: See TracChangeset
for help on using the changeset viewer.