Changeset 12080 for utils/tools/SIREN/src/interp_linear.f90
- Timestamp:
- 2019-12-06T10:30:14+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
utils/tools/SIREN/src/interp_linear.f90
r9598 r12080 2 2 ! NEMO system team, System and Interface for oceanic RElocable Nesting 3 3 !---------------------------------------------------------------------- 4 !5 ! MODULE: interp6 4 ! 7 5 ! DESCRIPTION: … … 23 21 !> @author 24 22 !> J.Paul 25 ! REVISION HISTORY:23 !> 26 24 !> @date September, 2014 - Initial version 27 25 !> 28 !> @note Software governed by the CeCILL licence ( ./LICENSE)26 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 29 27 !---------------------------------------------------------------------- 30 31 28 MODULE interp_linear 32 29 … … 55 52 PRIVATE :: interp_linear__get_weight1D !< compute interpoaltion weight for 1D array. 56 53 57 CONTAINS 54 CONTAINS 55 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 SUBROUTINE interp_linear_fill(dd_value, dd_fill, id_detect, & 57 & id_rho, ld_even, ld_discont) 58 58 !------------------------------------------------------------------- 59 59 !> @brief … … 73 73 !> @param[in] ld_discont longitudinal discontinuity (-180°/180°, 0°/360°) or not 74 74 !------------------------------------------------------------------- 75 SUBROUTINE interp_linear_fill(dd_value, dd_fill, id_detect, & 76 & id_rho, ld_even, ld_discont )77 IMPLICIT NONE 75 76 IMPLICIT NONE 77 78 78 ! Argument 79 79 REAL(dp) , DIMENSION(:,:,:,:), INTENT(INOUT) :: dd_value … … 163 163 164 164 END SUBROUTINE interp_linear_fill 165 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 166 SUBROUTINE interp_linear__2D(dd_value, dd_fill, & 167 & id_detect, & 168 & dd_weight, & 169 & id_rhoi, id_rhoj, & 170 & ld_discont) 165 171 !------------------------------------------------------------------- 166 172 !> @brief … … 181 187 !> @param[in] ld_discont longitudinal discontinuity (-180°/180°, 0°/360°) or not 182 188 !------------------------------------------------------------------- 183 SUBROUTINE interp_linear__2D( dd_value, dd_fill, & 184 & id_detect, & 185 & dd_weight, & 186 & id_rhoi, id_rhoj, & 187 & ld_discont ) 188 189 IMPLICIT NONE 189 190 IMPLICIT NONE 191 190 192 ! Argument 191 193 REAL(dp) , DIMENSION(:,:), INTENT(INOUT) :: dd_value … … 298 300 299 301 END SUBROUTINE interp_linear__2D 302 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 303 SUBROUTINE interp_linear__1D(dd_value, dd_fill, & 304 & id_detect, & 305 & dd_weight, & 306 & id_rhoi, & 307 & ld_discont) 300 308 !------------------------------------------------------------------- 301 309 !> @brief … … 314 322 !> @param[in] ld_discont longitudinal discontinuity (-180°/180°, 0°/360°) or not 315 323 !------------------------------------------------------------------- 316 SUBROUTINE interp_linear__1D( dd_value, dd_fill, & 317 & id_detect, & 318 & dd_weight, & 319 & id_rhoi, & 320 & ld_discont ) 321 322 IMPLICIT NONE 324 325 IMPLICIT NONE 326 323 327 ! Argument 324 328 REAL(dp) , DIMENSION(:) , INTENT(INOUT) :: dd_value … … 412 416 413 417 END SUBROUTINE interp_linear__1D 418 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 419 FUNCTION interp_linear__2D_coef(dd_value, dd_fill) & 420 & RESULT (df_coef) 414 421 !------------------------------------------------------------------- 415 422 !> @brief … … 422 429 !> @param[in] dd_fill FillValue of variable 423 430 !------------------------------------------------------------------- 424 FUNCTION interp_linear__2D_coef( dd_value, dd_fill ) 425 IMPLICIT NONE 431 432 IMPLICIT NONE 433 426 434 ! Argument 427 435 REAL(dp), DIMENSION(:,:) , INTENT(IN) :: dd_value … … 429 437 430 438 ! function 431 REAL(dp), DIMENSION(4) :: interp_linear__2D_coef439 REAL(dp), DIMENSION(4) :: df_coef 432 440 433 441 ! local variable … … 443 451 !---------------------------------------------------------------- 444 452 ! init 445 interp_linear__2D_coef(:)=dd_fill453 df_coef(:)=dd_fill 446 454 447 455 dl_vect( 1: 4)=PACK(dd_value(:,:),.TRUE. ) 448 interp_linear__2D_coef(:)=MATMUL(dl_matrix(:,:),dl_vect(:))456 df_coef(:)=MATMUL(dl_matrix(:,:),dl_vect(:)) 449 457 450 458 END FUNCTION interp_linear__2D_coef 459 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 460 SUBROUTINE interp_linear__2D_fill(dd_value, id_detect, & 461 & dd_weight, dd_coef, & 462 & dd_fill, id_rhoi, id_rhoj) 451 463 !------------------------------------------------------------------- 452 464 !> @brief … … 464 476 !> @param[in] id_rhoj refinement factor in j-direction 465 477 !------------------------------------------------------------------- 466 SUBROUTINE interp_linear__2D_fill( dd_value, id_detect, & 467 & dd_weight, dd_coef, & 468 & dd_fill, id_rhoi, id_rhoj ) 469 IMPLICIT NONE 478 479 IMPLICIT NONE 480 470 481 ! Argument 471 482 REAL(dp) , DIMENSION(:,:), INTENT(INOUT) :: dd_value … … 509 520 510 521 END SUBROUTINE interp_linear__2D_fill 522 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 523 FUNCTION interp_linear__1D_coef(dd_value, dd_fill) & 524 & RESULT (df_coef) 511 525 !------------------------------------------------------------------- 512 526 !> @brief … … 519 533 !> @param[in] dd_fill FillValue of variable 520 534 !------------------------------------------------------------------- 521 FUNCTION interp_linear__1D_coef( dd_value, dd_fill ) 522 IMPLICIT NONE 535 536 IMPLICIT NONE 537 523 538 ! Argument 524 539 REAL(dp), DIMENSION(:) , INTENT(IN) :: dd_value … … 526 541 527 542 ! function 528 REAL(dp), DIMENSION(2) :: interp_linear__1D_coef543 REAL(dp), DIMENSION(2) :: df_coef 529 544 530 545 ! local variable … … 538 553 !---------------------------------------------------------------- 539 554 ! init 540 interp_linear__1D_coef(:)=dd_fill555 df_coef(:)=dd_fill 541 556 542 557 dl_vect( 1: 2)=PACK(dd_value(:),.TRUE. ) 543 interp_linear__1D_coef(:)=MATMUL(dl_matrix(:,:),dl_vect(:))558 df_coef(:)=MATMUL(dl_matrix(:,:),dl_vect(:)) 544 559 545 560 END FUNCTION interp_linear__1D_coef 561 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 562 SUBROUTINE interp_linear__1D_fill(dd_value, id_detect, & 563 & dd_weight, dd_coef, & 564 & dd_fill, id_rho) 546 565 !------------------------------------------------------------------- 547 566 !> @brief … … 558 577 !> @param[in] id_rho refinement factor 559 578 !------------------------------------------------------------------- 560 SUBROUTINE interp_linear__1D_fill( dd_value, id_detect, & 561 & dd_weight, dd_coef, & 562 & dd_fill, id_rho ) 563 IMPLICIT NONE 579 580 IMPLICIT NONE 581 564 582 ! Argument 565 583 REAL(dp) , DIMENSION(:) , INTENT(INOUT) :: dd_value … … 595 613 596 614 END SUBROUTINE interp_linear__1D_fill 615 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 616 SUBROUTINE interp_linear__get_weight2D(dd_weight, id_rho, ld_even) 597 617 !------------------------------------------------------------------- 598 618 !> @brief … … 606 626 !> @param[in] id_rho refinement factor 607 627 !------------------------------------------------------------------- 608 SUBROUTINE interp_linear__get_weight2D(dd_weight, & 609 & id_rho, ld_even) 610 IMPLICIT NONE 611 ! Argument 628 629 IMPLICIT NONE 630 631 ! Argument 632 612 633 REAL(dp) , DIMENSION(:,:), INTENT(INOUT) :: dd_weight 613 634 INTEGER(I4), DIMENSION(:) , INTENT(IN ) :: id_rho 614 635 LOGICAL , DIMENSION(:) , INTENT(IN ) :: ld_even 636 615 637 ! local variable 616 638 REAL(dp) :: dl_dx … … 664 686 665 687 END SUBROUTINE interp_linear__get_weight2D 688 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 689 SUBROUTINE interp_linear__get_weight1D(dd_weight, id_rho, ld_even) 666 690 !------------------------------------------------------------------- 667 691 !> @brief … … 675 699 !> @param[in] id_rho refinement factor 676 700 !------------------------------------------------------------------- 677 SUBROUTINE interp_linear__get_weight1D(dd_weight, & 678 & id_rho, ld_even)679 IMPLICIT NONE 701 702 IMPLICIT NONE 703 680 704 ! Argument 681 705 REAL(dp) , DIMENSION(:,:), INTENT(INOUT) :: dd_weight … … 708 732 709 733 END SUBROUTINE interp_linear__get_weight1D 734 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 710 735 END MODULE interp_linear
Note: See TracChangeset
for help on using the changeset viewer.