Changeset 4646 for palm/trunk/SOURCE/gust_mod.f90
- Timestamp:
- Aug 24, 2020 4:02:40 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/gust_mod.f90
r4535 r4646 1 1 !> @file gust_mod.f90 2 !------------------------------------------------------------------------------! 3 ! This file is part of PALM. 4 ! 5 ! PALM is free software: you can redistribute it and/or modify it under the 6 ! terms of the GNU General Public License as published by the Free Software 7 ! Foundation, either version 3 of the License, or (at your option) any later 8 ! version. 9 ! 10 ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY 11 ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 ! 14 ! You should have received a copy of the GNU General Public License along with 15 ! PALM. If not, see <http://www.gnu.org/licenses/>. 2 !--------------------------------------------------------------------------------------------------! 3 ! This file is part of the PALM model system. 4 ! 5 ! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General 6 ! Public License as published by the Free Software Foundation, either version 3 of the License, or 7 ! (at your option) any later version. 8 ! 9 ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 10 ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 11 ! Public License for more details. 12 ! 13 ! You should have received a copy of the GNU General Public License along with PALM. If not, see 14 ! <http://www.gnu.org/licenses/>. 16 15 ! 17 16 ! Copyright 1997-2020 Leibniz Universitaet Hannover 18 !------------------------------------------------------------------------------ !17 !--------------------------------------------------------------------------------------------------! 19 18 ! 20 19 ! Current revisions: 21 20 ! ----------------- 22 ! 23 ! 21 ! 22 ! 24 23 ! Former revisions: 25 24 ! ----------------- 26 25 ! $Id$ 26 ! file re-formatted to follow the PALM coding standard 27 ! 28 ! 4535 2020-05-15 12:07:23Z raasch 27 29 ! bugfix for restart data format query 28 ! 30 ! 29 31 ! 4517 2020-05-03 14:29:30Z raasch 30 32 ! added restart with MPI-IO for reading local arrays 31 ! 33 ! 32 34 ! 4495 2020-04-13 20:11:20Z raasch 33 35 ! restart data handling with MPI-IO added 34 ! 36 ! 35 37 ! 4360 2020-01-07 11:25:50Z suehring 36 ! CASE statement for dummy variable u2_av in gust_rrd_local changed to avoid 37 ! unintended interdependencies with user-defined variables38 ! 38 ! CASE statement for dummy variable u2_av in gust_rrd_local changed to avoid unintended 39 ! interdependencies with user-defined variables 40 ! 39 41 ! 3837 2019-03-28 16:55:58Z knoop 40 42 ! unused variable for file index removed from rrd-subroutines parameter list 41 ! 43 ! 42 44 ! 3725 2019-02-07 10:11:02Z raasch 43 45 ! dummy statement modified to avoid compiler warnings about unused variables 44 ! 46 ! 45 47 ! 3685 2019-01-21 01:02:11Z knoop 46 48 ! Some interface calls moved to module_interface + cleanup 47 ! 49 ! 48 50 ! 3665 2019-01-10 08:28:24Z raasch 49 51 ! dummy statements added to avoid compiler warnings about unused variables 50 ! 52 ! 51 53 ! 3655 2019-01-07 16:51:22Z knoop 52 54 ! Bugfix: domain bounds of local_pf corrected 53 ! 54 ! 55 ! 56 ! 55 57 ! Interfaces concerning data output updated 56 ! 57 ! 58 ! 59 ! 58 60 ! renamed gust_par to gust_parameters 59 ! 60 ! 61 ! 62 ! 61 63 ! Initial interface definition 62 64 ! 63 ! 65 ! 64 66 ! Description: 65 67 ! ------------ … … 67 69 !> 68 70 !> @todo This is just a dummy module. The actual module ist not released yet. 69 !------------------------------------------------------------------------------ !71 !--------------------------------------------------------------------------------------------------! 70 72 MODULE gust_mod 71 73 … … 73 75 ONLY: restart_data_format_output 74 76 75 USE indices, &77 USE indices, & 76 78 ONLY: nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt 77 79 … … 94 96 ! 95 97 !-- Public functions 96 PUBLIC &97 gust_parin, &98 gust_check_parameters, &99 gust_check_data_output_pr, &100 gust_check_data_output, &101 gust_init_arrays, &102 gust_init, &103 gust_define_netcdf_grid, &104 gust_header, &105 gust_actions, &106 gust_prognostic_equations, &107 gust_swap_timelevel, &108 gust_3d_data_averaging, &109 gust_data_output_2d, &110 gust_data_output_3d, &111 gust_statistics, &112 gust_rrd_global, &113 gust_wrd_global, &114 gust_rrd_local, &98 PUBLIC & 99 gust_parin, & 100 gust_check_parameters, & 101 gust_check_data_output_pr, & 102 gust_check_data_output, & 103 gust_init_arrays, & 104 gust_init, & 105 gust_define_netcdf_grid, & 106 gust_header, & 107 gust_actions, & 108 gust_prognostic_equations, & 109 gust_swap_timelevel, & 110 gust_3d_data_averaging, & 111 gust_data_output_2d, & 112 gust_data_output_3d, & 113 gust_statistics, & 114 gust_rrd_global, & 115 gust_wrd_global, & 116 gust_rrd_local, & 115 117 gust_wrd_local 116 118 ! 117 119 !-- Public parameters, constants and initial values 118 PUBLIC &120 PUBLIC & 119 121 gust_module_enabled 120 122 … … 203 205 204 206 205 !------------------------------------------------------------------------------ !207 !--------------------------------------------------------------------------------------------------! 206 208 ! Description: 207 209 ! ------------ 208 210 !> Parin for &gust_parameters for gust module 209 !------------------------------------------------------------------------------ !211 !--------------------------------------------------------------------------------------------------! 210 212 SUBROUTINE gust_parin 211 213 … … 215 217 CHARACTER (LEN=80) :: line !< dummy string that contains the current line of the parameter file 216 218 217 NAMELIST /gust_parameters/ &219 NAMELIST /gust_parameters/ & 218 220 gust_module_enabled 219 221 … … 240 242 241 243 242 !------------------------------------------------------------------------------ !244 !--------------------------------------------------------------------------------------------------! 243 245 ! Description: 244 246 ! ------------ 245 247 !> Check parameters routine for gust module 246 !------------------------------------------------------------------------------ !248 !--------------------------------------------------------------------------------------------------! 247 249 SUBROUTINE gust_check_parameters 248 250 … … 254 256 255 257 256 !------------------------------------------------------------------------------ !258 !--------------------------------------------------------------------------------------------------! 257 259 ! Description: 258 260 ! ------------ 259 261 !> Check data output of profiles for gust module 260 !------------------------------------------------------------------------------ !262 !--------------------------------------------------------------------------------------------------! 261 263 SUBROUTINE gust_check_data_output_pr( variable, var_count, unit, dopr_unit ) 262 264 … … 264 266 IMPLICIT NONE 265 267 268 CHARACTER (LEN=*) :: dopr_unit !< local value of dopr_unit 266 269 CHARACTER (LEN=*) :: unit !< 267 270 CHARACTER (LEN=*) :: variable !< 268 CHARACTER (LEN=*) :: dopr_unit !< local value of dopr_unit269 271 270 272 INTEGER(iwp) :: var_count !< … … 276 278 END SUBROUTINE gust_check_data_output_pr 277 279 278 !------------------------------------------------------------------------------ !280 !--------------------------------------------------------------------------------------------------! 279 281 ! Description: 280 282 ! ------------ 281 283 !> Check data output for gust module 282 !------------------------------------------------------------------------------ !284 !--------------------------------------------------------------------------------------------------! 283 285 SUBROUTINE gust_check_data_output( var, unit ) 284 286 … … 296 298 297 299 298 !------------------------------------------------------------------------------ !300 !--------------------------------------------------------------------------------------------------! 299 301 ! Description: 300 302 ! ------------ 301 303 !> Allocate gust module arrays and define pointers 302 !------------------------------------------------------------------------------ !304 !--------------------------------------------------------------------------------------------------! 303 305 SUBROUTINE gust_init_arrays 304 306 … … 310 312 311 313 312 !------------------------------------------------------------------------------ !314 !--------------------------------------------------------------------------------------------------! 313 315 ! Description: 314 316 ! ------------ 315 317 !> Initialization of the gust module 316 !------------------------------------------------------------------------------ !318 !--------------------------------------------------------------------------------------------------! 317 319 SUBROUTINE gust_init 318 320 … … 324 326 325 327 326 !------------------------------------------------------------------------------ !328 !--------------------------------------------------------------------------------------------------! 327 329 ! 328 330 ! Description: … … 330 332 !> Subroutine defining appropriate grid for netcdf variables. 331 333 !> It is called out from subroutine netcdf. 332 !------------------------------------------------------------------------------ !334 !--------------------------------------------------------------------------------------------------! 333 335 SUBROUTINE gust_define_netcdf_grid( var, found, grid_x, grid_y, grid_z ) 334 336 … … 336 338 IMPLICIT NONE 337 339 338 CHARACTER (LEN=*), INTENT(IN) :: var !<339 LOGICAL, INTENT(IN) :: found !<340 340 CHARACTER (LEN=*), INTENT(IN) :: grid_x !< 341 341 CHARACTER (LEN=*), INTENT(IN) :: grid_y !< 342 342 CHARACTER (LEN=*), INTENT(IN) :: grid_z !< 343 CHARACTER (LEN=*), INTENT(IN) :: var !< 344 345 LOGICAL, INTENT(IN) :: found !< 343 346 344 347 ! … … 349 352 350 353 351 !------------------------------------------------------------------------------ !354 !--------------------------------------------------------------------------------------------------! 352 355 ! Description: 353 356 ! ------------ 354 357 !> Header output for gust module 355 !------------------------------------------------------------------------------ !358 !--------------------------------------------------------------------------------------------------! 356 359 SUBROUTINE gust_header ( io ) 357 360 … … 368 371 369 372 370 !------------------------------------------------------------------------------ !373 !--------------------------------------------------------------------------------------------------! 371 374 ! Description: 372 375 ! ------------ 373 376 !> Call for all grid points 374 !------------------------------------------------------------------------------ !377 !--------------------------------------------------------------------------------------------------! 375 378 SUBROUTINE gust_actions( location ) 376 379 … … 387 390 388 391 389 !------------------------------------------------------------------------------ !392 !--------------------------------------------------------------------------------------------------! 390 393 ! Description: 391 394 ! ------------ 392 395 !> Call for grid point i,j 393 !------------------------------------------------------------------------------ !396 !--------------------------------------------------------------------------------------------------! 394 397 SUBROUTINE gust_actions_ij( i, j, location ) 395 398 … … 409 412 410 413 411 !------------------------------------------------------------------------------ !414 !--------------------------------------------------------------------------------------------------! 412 415 ! Description: 413 416 ! ------------ 414 417 !> Call for all grid points 415 !------------------------------------------------------------------------------ !418 !--------------------------------------------------------------------------------------------------! 416 419 SUBROUTINE gust_prognostic_equations() 417 420 … … 423 426 424 427 425 !------------------------------------------------------------------------------ !428 !--------------------------------------------------------------------------------------------------! 426 429 ! Description: 427 430 ! ------------ 428 431 !> Call for grid point i,j 429 !------------------------------------------------------------------------------ !432 !--------------------------------------------------------------------------------------------------! 430 433 SUBROUTINE gust_prognostic_equations_ij( i, j, i_omp_start, tn ) 431 434 432 435 433 436 INTEGER(iwp), INTENT(IN) :: i !< grid index in x-direction 437 INTEGER(iwp), INTENT(IN) :: i_omp_start !< first loop index of i-loop in prognostic_equations 434 438 INTEGER(iwp), INTENT(IN) :: j !< grid index in y-direction 435 INTEGER(iwp), INTENT(IN) :: i_omp_start !< first loop index of i-loop in prognostic_equations436 439 INTEGER(iwp), INTENT(IN) :: tn !< task number of openmp task 437 440 … … 443 446 444 447 445 !------------------------------------------------------------------------------ !448 !--------------------------------------------------------------------------------------------------! 446 449 ! Description: 447 450 ! ------------ 448 451 !> Swapping of timelevels 449 !------------------------------------------------------------------------------ !452 !--------------------------------------------------------------------------------------------------! 450 453 SUBROUTINE gust_swap_timelevel ( mod_count ) 451 454 … … 462 465 463 466 464 !------------------------------------------------------------------------------ !467 !--------------------------------------------------------------------------------------------------! 465 468 ! 466 469 ! Description: 467 470 ! ------------ 468 471 !> Subroutine for averaging 3D data 469 !------------------------------------------------------------------------------ !472 !--------------------------------------------------------------------------------------------------! 470 473 SUBROUTINE gust_3d_data_averaging( mode, variable ) 471 474 … … 474 477 475 478 CHARACTER (LEN=*) :: mode !< 476 CHARACTER (LEN=*) :: variable !<479 CHARACTER (LEN=*) :: variable !< 477 480 478 481 ! … … 482 485 END SUBROUTINE gust_3d_data_averaging 483 486 484 !------------------------------------------------------------------------------ !487 !--------------------------------------------------------------------------------------------------! 485 488 ! 486 489 ! Description: 487 490 ! ------------ 488 491 !> Subroutine defining 2D output variables 489 !------------------------------------------------------------------------------ !490 SUBROUTINE gust_data_output_2d( av, variable, found, grid, mode, local_pf, &491 two_d, nzb_do,nzt_do, fill_value )492 !--------------------------------------------------------------------------------------------------! 493 SUBROUTINE gust_data_output_2d( av, variable, found, grid, mode, local_pf, two_d, nzb_do, & 494 nzt_do, fill_value ) 492 495 493 496 … … 495 498 496 499 CHARACTER (LEN=*), INTENT(INOUT) :: grid !< name of vertical grid 497 CHARACTER (LEN=*), INTENT(IN) :: mode !< either 'xy', 'xz' or 'yz'498 CHARACTER (LEN=*), INTENT(IN) :: variable !< name of variable500 CHARACTER (LEN=*), INTENT(IN) :: mode !< either 'xy', 'xz' or 'yz' 501 CHARACTER (LEN=*), INTENT(IN) :: variable !< name of variable 499 502 500 503 INTEGER(iwp), INTENT(IN) :: av !< flag for (non-)average output … … 508 511 509 512 REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(INOUT) :: local_pf !< local 510 !< array to which output data is resorted to513 !< array to which output data is resorted to 511 514 512 515 ! … … 519 522 520 523 521 !------------------------------------------------------------------------------ !524 !--------------------------------------------------------------------------------------------------! 522 525 ! 523 526 ! Description: 524 527 ! ------------ 525 528 !> Subroutine defining 3D output variables 526 !------------------------------------------------------------------------------ !529 !--------------------------------------------------------------------------------------------------! 527 530 SUBROUTINE gust_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do ) 528 531 … … 550 553 551 554 552 !------------------------------------------------------------------------------ !555 !--------------------------------------------------------------------------------------------------! 553 556 ! Description: 554 557 ! ------------ 555 558 !> This routine computes profile and timeseries data for the gust module. 556 !------------------------------------------------------------------------------ !559 !--------------------------------------------------------------------------------------------------! 557 560 SUBROUTINE gust_statistics( mode, sr, tn, dots_max ) 558 561 … … 573 576 574 577 575 !------------------------------------------------------------------------------ !578 !--------------------------------------------------------------------------------------------------! 576 579 ! Description: 577 580 ! ------------ 578 581 !> Read module-specific global restart data (Fortran binary format). 579 !------------------------------------------------------------------------------ !582 !--------------------------------------------------------------------------------------------------! 580 583 SUBROUTINE gust_rrd_global_ftn( found ) 581 584 582 585 583 USE control_parameters, &586 USE control_parameters, & 584 587 ONLY: length, restart_string 585 588 … … 608 611 609 612 610 !------------------------------------------------------------------------------ !613 !--------------------------------------------------------------------------------------------------! 611 614 ! Description: 612 615 ! ------------ 613 616 !> Read module-specific global restart data (MPI-IO). 614 !------------------------------------------------------------------------------ !617 !--------------------------------------------------------------------------------------------------! 615 618 SUBROUTINE gust_rrd_global_mpi 616 619 … … 622 625 623 626 624 !------------------------------------------------------------------------------ !627 !--------------------------------------------------------------------------------------------------! 625 628 ! Description: 626 629 ! ------------ 627 630 !> Read module-specific local restart data arrays (Fortran binary format). 628 !------------------------------------------------------------------------------! 629 SUBROUTINE gust_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, & 630 nxr_on_file, nynf, nync, nyn_on_file, nysf, & 631 nysc, nys_on_file, tmp_2d, tmp_3d, found ) 631 !--------------------------------------------------------------------------------------------------! 632 SUBROUTINE gust_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, nxr_on_file, nynf, nync,& 633 nyn_on_file, nysf, nysc, nys_on_file, tmp_2d, tmp_3d, found ) 632 634 633 635 … … 696 698 697 699 698 !------------------------------------------------------------------------------ !700 !--------------------------------------------------------------------------------------------------! 699 701 ! Description: 700 702 ! ------------ 701 703 !> Read module-specific local restart data arrays (MPI-IO). 702 !------------------------------------------------------------------------------ !704 !--------------------------------------------------------------------------------------------------! 703 705 SUBROUTINE gust_rrd_local_mpi 704 706 … … 709 711 710 712 711 !------------------------------------------------------------------------------ !713 !--------------------------------------------------------------------------------------------------! 712 714 ! Description: 713 715 ! ------------ 714 716 !> This routine writes the respective restart data for the gust module. 715 !------------------------------------------------------------------------------ !717 !--------------------------------------------------------------------------------------------------! 716 718 SUBROUTINE gust_wrd_global 717 719 … … 742 744 743 745 744 !------------------------------------------------------------------------------ !746 !--------------------------------------------------------------------------------------------------! 745 747 ! Description: 746 748 ! ------------ 747 749 !> This routine writes the respective restart data for the gust module. 748 !------------------------------------------------------------------------------ !750 !--------------------------------------------------------------------------------------------------! 749 751 SUBROUTINE gust_wrd_local 750 752
Note: See TracChangeset
for help on using the changeset viewer.