Changeset 12080 for utils/tools/SIREN/src/boundary.f90
- Timestamp:
- 2019-12-06T10:30:14+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
utils/tools/SIREN/src/boundary.f90
r9598 r12080 2 2 ! NEMO system team, System and Interface for oceanic RElocable Nesting 3 3 !---------------------------------------------------------------------- 4 !5 ! MODULE: boundary6 4 ! 7 5 ! DESCRIPTION: … … 106 104 !> 107 105 !> @author J.Paul 108 ! REVISION HISTORY:106 !> 109 107 !> @date November, 2013 - Initial Version 110 108 !> @date September, 2014 … … 119 117 !> @todo add schematic to boundary structure description 120 118 !> 121 !> @note Software governed by the CeCILL licence ( ./LICENSE)119 !> @note Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 122 120 !---------------------------------------------------------------------- 123 121 MODULE boundary 122 124 123 USE netcdf ! nf90 library 125 124 USE global ! global parameter … … 131 130 132 131 IMPLICIT NONE 132 133 133 ! NOTE_avoid_public_variables_if_possible 134 134 … … 220 220 221 221 CONTAINS 222 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 223 FUNCTION boundary__copy_arr(td_bdy) & 224 & RESULT (tf_bdy) 222 225 !------------------------------------------------------------------- 223 226 !> @brief … … 240 243 !> @return copy of input array of boundary structure 241 244 !------------------------------------------------------------------- 242 FUNCTION boundary__copy_arr( td_bdy ) 245 243 246 IMPLICIT NONE 247 244 248 ! Argument 245 TYPE(TBDY), DIMENSION(:), INTENT(IN) :: td_bdy 249 TYPE(TBDY), DIMENSION(:) , INTENT(IN) :: td_bdy 250 246 251 ! function 247 TYPE(TBDY), DIMENSION(SIZE(td_bdy(:))) :: boundary__copy_arr252 TYPE(TBDY), DIMENSION(SIZE(td_bdy(:))) :: tf_bdy 248 253 249 254 ! local variable … … 253 258 254 259 DO jk=1,SIZE(td_bdy(:)) 255 boundary__copy_arr(jk)=boundary_copy(td_bdy(jk))260 tf_bdy(jk)=boundary_copy(td_bdy(jk)) 256 261 ENDDO 257 262 258 263 END FUNCTION boundary__copy_arr 264 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 265 FUNCTION boundary__copy_unit(td_bdy) & 266 & RESULT (tf_bdy) 259 267 !------------------------------------------------------------------- 260 268 !> @brief … … 277 285 !> @return copy of input boundary structure 278 286 !------------------------------------------------------------------- 279 FUNCTION boundary__copy_unit( td_bdy ) 287 280 288 IMPLICIT NONE 289 281 290 ! Argument 282 291 TYPE(TBDY), INTENT(IN) :: td_bdy 292 283 293 ! function 284 TYPE(TBDY) :: boundary__copy_unit294 TYPE(TBDY) :: tf_bdy 285 295 286 296 ! local variable … … 290 300 291 301 ! copy variable name, id, .. 292 boundary__copy_unit%c_card = TRIM(td_bdy%c_card)293 boundary__copy_unit%i_nseg = td_bdy%i_nseg294 boundary__copy_unit%l_use = td_bdy%l_use302 tf_bdy%c_card = TRIM(td_bdy%c_card) 303 tf_bdy%i_nseg = td_bdy%i_nseg 304 tf_bdy%l_use = td_bdy%l_use 295 305 296 306 ! copy segment 297 IF( ASSOCIATED( boundary__copy_unit%t_seg) )THEN298 CALL seg__clean( boundary__copy_unit%t_seg(:))299 DEALLOCATE( boundary__copy_unit%t_seg)307 IF( ASSOCIATED(tf_bdy%t_seg) )THEN 308 CALL seg__clean(tf_bdy%t_seg(:)) 309 DEALLOCATE(tf_bdy%t_seg) 300 310 ENDIF 301 IF( ASSOCIATED(td_bdy%t_seg) .AND. boundary__copy_unit%i_nseg > 0 )THEN302 ALLOCATE( boundary__copy_unit%t_seg(boundary__copy_unit%i_nseg) )303 DO ji=1, boundary__copy_unit%i_nseg304 boundary__copy_unit%t_seg(ji)=td_bdy%t_seg(ji)311 IF( ASSOCIATED(td_bdy%t_seg) .AND. tf_bdy%i_nseg > 0 )THEN 312 ALLOCATE( tf_bdy%t_seg(tf_bdy%i_nseg) ) 313 DO ji=1,tf_bdy%i_nseg 314 tf_bdy%t_seg(ji)=td_bdy%t_seg(ji) 305 315 ENDDO 306 316 ENDIF 307 317 308 318 END FUNCTION boundary__copy_unit 319 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 320 SUBROUTINE boundary__clean_unit(td_bdy) 309 321 !------------------------------------------------------------------- 310 322 !> @brief This subroutine clean boundary structure … … 312 324 !> @author J.Paul 313 325 !> @date November, 2013 - Initial Version 326 !> @date January, 2019 327 !> - nullify segment structure inside boundary structure 314 328 ! 315 329 !> @param[inout] td_bdy boundary strucutre 316 330 !------------------------------------------------------------------- 317 SUBROUTINE boundary__clean_unit( td_bdy ) 331 318 332 IMPLICIT NONE 333 319 334 ! Argument 320 335 TYPE(TBDY), INTENT(INOUT) :: td_bdy … … 334 349 CALL seg__clean(td_bdy%t_seg(:) ) 335 350 DEALLOCATE( td_bdy%t_seg ) 351 NULLIFY(td_bdy%t_seg) 336 352 ENDIF 337 353 … … 340 356 341 357 END SUBROUTINE boundary__clean_unit 358 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 359 SUBROUTINE boundary__clean_arr(td_bdy) 342 360 !------------------------------------------------------------------- 343 361 !> @brief This subroutine clean array of boundary structure … … 348 366 !> @param[inout] td_bdy boundary strucutre 349 367 !------------------------------------------------------------------- 350 SUBROUTINE boundary__clean_arr( td_bdy ) 368 351 369 IMPLICIT NONE 370 352 371 ! Argument 353 372 TYPE(TBDY), DIMENSION(:), INTENT(INOUT) :: td_bdy … … 363 382 364 383 END SUBROUTINE boundary__clean_arr 384 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 385 FUNCTION boundary_set_filename(cd_file, cd_card, id_seg, cd_date) & 386 & RESULT (cf_file) 365 387 !------------------------------------------------------------------- 366 388 !> @brief This function put cardinal name and date inside file name. … … 389 411 !> @return file name with cardinal name inside 390 412 !------------------------------------------------------------------- 391 FUNCTION boundary_set_filename(cd_file, cd_card, id_seg, cd_date) 413 392 414 IMPLICIT NONE 415 393 416 ! Argument 394 417 CHARACTER(LEN=*), INTENT(IN) :: cd_file … … 398 421 399 422 ! function 400 CHARACTER(LEN=lc) :: boundary_set_filename423 CHARACTER(LEN=lc) :: cf_file 401 424 402 425 ! local variable … … 415 438 !---------------------------------------------------------------- 416 439 ! init 417 boundary_set_filename=''440 cf_file='' 418 441 419 442 IF( TRIM(cd_file) /= '' .AND. TRIM(cd_card) /= '' )THEN … … 455 478 ENDIF 456 479 457 boundary_set_filename=TRIM(cl_dirname)//"/"//TRIM(cl_name)480 cf_file=TRIM(cl_dirname)//"/"//TRIM(cl_name) 458 481 ELSE 459 482 CALL logger_error("BOUNDARY SET FILENAME: file or cardinal name "//& … … 462 485 463 486 END FUNCTION boundary_set_filename 487 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 488 FUNCTION boundary__init_wrapper(td_var, & 489 & ld_north, ld_south, ld_east, ld_west, & 490 & cd_north, cd_south, cd_east, cd_west, & 491 & ld_oneseg) & 492 & RESULT (tf_bdy) 464 493 !------------------------------------------------------------------- 465 494 !> @brief This function initialise a boundary structure. … … 503 532 !> @return boundary structure 504 533 !------------------------------------------------------------------- 505 FUNCTION boundary__init_wrapper(td_var, & 506 & ld_north, ld_south, ld_east, ld_west, & 507 & cd_north, cd_south, cd_east, cd_west, & 508 & ld_oneseg ) 534 509 535 IMPLICIT NONE 536 510 537 ! Argument 511 538 TYPE(TVAR) , INTENT(IN) :: td_var … … 521 548 522 549 ! function 523 TYPE(TBDY) , DIMENSION(ip_ncard) :: boundary__init_wrapper550 TYPE(TBDY) , DIMENSION(ip_ncard) :: tf_bdy 524 551 525 552 ! local variable … … 532 559 CHARACTER(LEN=lc), DIMENSION(ip_ncard) :: cl_card 533 560 534 TYPE(TBDY) , DIMENSION(ip_ncard) :: tl_bdy535 561 TYPE(TBDY) :: tl_tmp 536 562 … … 555 581 556 582 ! init 557 t l_bdy(jp_north)=boundary__init('north',ld_north)558 t l_bdy(jp_south)=boundary__init('south',ld_south)559 t l_bdy(jp_east )=boundary__init('east ',ld_east )560 t l_bdy(jp_west )=boundary__init('west ',ld_west )583 tf_bdy(jp_north)=boundary__init('north',ld_north) 584 tf_bdy(jp_south)=boundary__init('south',ld_south) 585 tf_bdy(jp_east )=boundary__init('east ',ld_east ) 586 tf_bdy(jp_west )=boundary__init('west ',ld_west ) 561 587 562 588 ! if EW cyclic no east west boundary and force to use one segment … … 564 590 CALL logger_info("BOUNDARY INIT: cyclic domain, "//& 565 591 & "no East West boundary") 566 t l_bdy(jp_east )%l_use=.FALSE.567 t l_bdy(jp_west )%l_use=.FALSE.592 tf_bdy(jp_east )%l_use=.FALSE. 593 tf_bdy(jp_west )%l_use=.FALSE. 568 594 569 595 CALL logger_info("BOUNDARY INIT: force to use one segment due"//& … … 618 644 tl_seg=seg__init(il_index(jk),il_width,il_min(jk),il_max(jk)) 619 645 620 IF( t l_bdy(jk)%l_use )THEN646 IF( tf_bdy(jk)%l_use )THEN 621 647 622 648 ! get namelist information … … 625 651 ! get segments indices 626 652 DO ji=1,tl_tmp%i_nseg 627 CALL boundary__add_seg(t l_bdy(jk),tl_tmp%t_seg(ji))653 CALL boundary__add_seg(tf_bdy(jk),tl_tmp%t_seg(ji)) 628 654 ENDDO 629 655 ! indices from namelist or not 630 t l_bdy(jk)%l_nam=tl_tmp%l_nam656 tf_bdy(jk)%l_nam=tl_tmp%l_nam 631 657 632 658 CALL boundary_clean(tl_tmp) 633 659 634 IF( t l_bdy(jk)%i_nseg == 0 )THEN660 IF( tf_bdy(jk)%i_nseg == 0 )THEN 635 661 ! add default segment 636 CALL boundary__add_seg(t l_bdy(jk),tl_seg)662 CALL boundary__add_seg(tf_bdy(jk),tl_seg) 637 663 ELSE 638 664 ! fill undefined value 639 WHERE( t l_bdy(jk)%t_seg(:)%i_index == 0 )640 t l_bdy(jk)%t_seg(:)%i_index = tl_seg%i_index665 WHERE( tf_bdy(jk)%t_seg(:)%i_index == 0 ) 666 tf_bdy(jk)%t_seg(:)%i_index = tl_seg%i_index 641 667 END WHERE 642 WHERE( t l_bdy(jk)%t_seg(:)%i_width == 0 )643 t l_bdy(jk)%t_seg(:)%i_width = tl_seg%i_width668 WHERE( tf_bdy(jk)%t_seg(:)%i_width == 0 ) 669 tf_bdy(jk)%t_seg(:)%i_width = tl_seg%i_width 644 670 END WHERE 645 WHERE( t l_bdy(jk)%t_seg(:)%i_first == 0 )646 t l_bdy(jk)%t_seg(:)%i_first = tl_seg%i_first671 WHERE( tf_bdy(jk)%t_seg(:)%i_first == 0 ) 672 tf_bdy(jk)%t_seg(:)%i_first = tl_seg%i_first 647 673 END WHERE 648 WHERE( t l_bdy(jk)%t_seg(:)%i_last == 0 )649 t l_bdy(jk)%t_seg(:)%i_last = tl_seg%i_last674 WHERE( tf_bdy(jk)%t_seg(:)%i_last == 0 ) 675 tf_bdy(jk)%t_seg(:)%i_last = tl_seg%i_last 650 676 END WHERE 651 677 ENDIF … … 657 683 ENDDO 658 684 659 CALL boundary_get_indices(tl_bdy(:), td_var, ll_oneseg) 660 661 CALL boundary_check(tl_bdy, td_var) 662 663 boundary__init_wrapper(:)=boundary_copy(tl_bdy(:)) 664 665 ! clean 666 DO jk=1,ip_ncard 667 CALL boundary_clean(tl_bdy(jk)) 668 ENDDO 685 CALL boundary_get_indices(tf_bdy(:), td_var, ll_oneseg) 686 687 CALL boundary_check(tf_bdy, td_var) 669 688 670 689 ENDIF 671 690 672 691 END FUNCTION boundary__init_wrapper 692 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 693 FUNCTION boundary__init(cd_card, ld_use, ld_nam, td_seg) & 694 & RESULT (tf_bdy) 673 695 !------------------------------------------------------------------- 674 696 !> @brief This function initialise basically a boundary structure with … … 687 709 !> @return boundary structure 688 710 !------------------------------------------------------------------- 689 FUNCTION boundary__init( cd_card, ld_use, ld_nam, td_seg ) 711 690 712 IMPLICIT NONE 713 691 714 ! Argument 692 715 CHARACTER(LEN=*), INTENT(IN) :: cd_card … … 696 719 697 720 ! function 698 TYPE(TBDY) :: boundary__init721 TYPE(TBDY) :: tf_bdy 699 722 700 723 ! local variable 701 702 724 ! loop indices 703 725 !---------------------------------------------------------------- … … 706 728 CASE ('north','south','east','west') 707 729 708 boundary__init%c_card=TRIM(cd_card)709 710 boundary__init%l_use=.TRUE.711 IF( PRESENT(ld_use) ) boundary__init%l_use=ld_use712 713 boundary__init%l_nam=.FALSE.714 IF( PRESENT(ld_nam) ) boundary__init%l_nam=ld_nam730 tf_bdy%c_card=TRIM(cd_card) 731 732 tf_bdy%l_use=.TRUE. 733 IF( PRESENT(ld_use) ) tf_bdy%l_use=ld_use 734 735 tf_bdy%l_nam=.FALSE. 736 IF( PRESENT(ld_nam) ) tf_bdy%l_nam=ld_nam 715 737 716 738 IF( PRESENT(td_seg) )THEN 717 CALL boundary__add_seg( boundary__init, td_seg)739 CALL boundary__add_seg(tf_bdy, td_seg) 718 740 ENDIF 719 741 … … 723 745 724 746 END FUNCTION boundary__init 747 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 748 SUBROUTINE boundary__add_seg(td_bdy, td_seg) 725 749 !------------------------------------------------------------------- 726 750 !> @brief This subroutine add one segment structure to a boundary structure … … 734 758 !> @param[in] td_seg segment structure 735 759 !------------------------------------------------------------------- 736 SUBROUTINE boundary__add_seg(td_bdy, td_seg) 760 737 761 IMPLICIT NONE 762 738 763 ! Argument 739 764 TYPE(TBDY), INTENT(INOUT) :: td_bdy … … 793 818 794 819 END SUBROUTINE boundary__add_seg 820 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 821 SUBROUTINE boundary__del_seg(td_bdy) 795 822 !------------------------------------------------------------------- 796 823 !> @brief This subroutine remove all segments of a boundary structure … … 803 830 !> @param[inout] td_bdy boundary structure 804 831 !------------------------------------------------------------------- 805 SUBROUTINE boundary__del_seg(td_bdy) 832 806 833 IMPLICIT NONE 834 807 835 ! Argument 808 836 TYPE(TBDY), INTENT(INOUT) :: td_bdy … … 820 848 821 849 END SUBROUTINE boundary__del_seg 850 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 851 FUNCTION boundary__get_info(cd_card, id_jcard) & 852 & RESULT (tf_bdy) 822 853 !------------------------------------------------------------------- 823 854 !> @brief This function get information about boundary from string character. … … 839 870 !> @return boundary structure 840 871 !------------------------------------------------------------------- 841 FUNCTION boundary__get_info(cd_card, id_jcard) 872 842 873 IMPLICIT NONE 874 843 875 ! Argument 844 876 CHARACTER(LEN=lc), INTENT(IN) :: cd_card … … 846 878 847 879 ! function 848 TYPE(TBDY) :: boundary__get_info880 TYPE(TBDY) :: tf_bdy 849 881 850 882 ! local variable … … 876 908 ! initialise boundary 877 909 ! temporaty boundary, so it doesn't matter which caridnal is used 878 boundary__get_info=boundary__init('north',ld_nam=.TRUE.)910 tf_bdy=boundary__init('north',ld_nam=.TRUE.) 879 911 880 912 il_ind1=SCAN(fct_lower(cl_seg),'(') … … 953 985 IF( (tl_seg%i_first == 0 .AND. tl_seg%i_last == 0) .OR. & 954 986 & (tl_seg%i_first /= 0 .AND. tl_seg%i_last /= 0) )THEN 955 CALL boundary__add_seg( boundary__get_info, tl_seg)987 CALL boundary__add_seg(tf_bdy, tl_seg) 956 988 ELSE 957 989 CALL logger_error("BOUNDARY INIT: first or last segment indices "//& … … 967 999 968 1000 END FUNCTION boundary__get_info 1001 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1002 SUBROUTINE boundary_get_indices(td_bdy, td_var, ld_oneseg) 969 1003 !------------------------------------------------------------------- 970 1004 !> @brief This subroutine get indices of each semgent for each boundary. … … 989 1023 !> @param[in] ld_onseg use only one sgment for each boundary 990 1024 !------------------------------------------------------------------- 991 SUBROUTINE boundary_get_indices( td_bdy, td_var, ld_oneseg) 1025 992 1026 IMPLICIT NONE 1027 993 1028 ! Argument 994 1029 TYPE(TBDY) , DIMENSION(ip_ncard), INTENT(INOUT) :: td_bdy … … 1057 1092 1058 1093 END SUBROUTINE boundary_get_indices 1094 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1095 SUBROUTINE boundary__get_seg_number(td_bdy, td_var) 1059 1096 !------------------------------------------------------------------- 1060 1097 !> @brief This subroutine compute the number of sea segment. … … 1073 1110 !> @param[in] td_var variable structure 1074 1111 !------------------------------------------------------------------- 1075 SUBROUTINE boundary__get_seg_number( td_bdy, td_var) 1112 1076 1113 IMPLICIT NONE 1114 1077 1115 ! Argument 1078 1116 TYPE(TBDY) , INTENT(INOUT) :: td_bdy … … 1155 1193 1156 1194 END SUBROUTINE boundary__get_seg_number 1195 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1196 SUBROUTINE boundary__get_seg_indices(td_bdy, td_var, & 1197 & id_index, id_width, id_first, id_last) 1157 1198 !------------------------------------------------------------------- 1158 1199 !> @brief This subroutine get segment indices for one boundary. … … 1170 1211 !> @param[in] id_last boundary last indice 1171 1212 !------------------------------------------------------------------- 1172 SUBROUTINE boundary__get_seg_indices( td_bdy, td_var, & 1173 & id_index, id_width, id_first, id_last) 1213 1174 1214 IMPLICIT NONE 1215 1175 1216 ! Argument 1176 1217 TYPE(TBDY) , INTENT(INOUT) :: td_bdy … … 1305 1346 1306 1347 END SUBROUTINE boundary__get_seg_indices 1348 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1349 SUBROUTINE boundary_check_corner(td_bdy, td_var) 1307 1350 !------------------------------------------------------------------- 1308 1351 !> @brief This subroutine check if there is boundary at corner, and … … 1322 1365 !> @param[in] td_var variable structure 1323 1366 !------------------------------------------------------------------- 1324 SUBROUTINE boundary_check_corner( td_bdy, td_var ) 1367 1325 1368 IMPLICIT NONE 1369 1326 1370 ! Argument 1327 1371 TYPE(TBDY) , DIMENSION(ip_ncard), INTENT(INOUT) :: td_bdy … … 1520 1564 1521 1565 END SUBROUTINE boundary_check_corner 1566 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1567 SUBROUTINE boundary_check(td_bdy, td_var) 1522 1568 !------------------------------------------------------------------- 1523 1569 !> @brief This subroutine check boundary. … … 1536 1582 !> @param[in] td_var variable structure 1537 1583 !------------------------------------------------------------------- 1538 SUBROUTINE boundary_check(td_bdy, td_var) 1584 1539 1585 IMPLICIT NONE 1586 1540 1587 ! Argument 1541 1588 TYPE(TBDY) , DIMENSION(ip_ncard), INTENT(INOUT) :: td_bdy … … 1594 1641 1595 1642 END SUBROUTINE boundary_check 1643 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1644 SUBROUTINE boundary_swap(td_var, td_bdy) 1596 1645 !------------------------------------------------------------------- 1597 1646 !> @brief This subroutine swap array for east and north boundary. … … 1605 1654 !> @param[in ] td_bdy boundary strucutre 1606 1655 !------------------------------------------------------------------- 1607 SUBROUTINE boundary_swap( td_var, td_bdy ) 1656 1608 1657 IMPLICIT NONE 1658 1609 1659 ! Argument 1610 1660 TYPE(TVAR), INTENT(INOUT) :: td_var … … 1659 1709 ENDIF 1660 1710 END SUBROUTINE boundary_swap 1711 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1712 SUBROUTINE boundary__print_unit(td_bdy) 1661 1713 !------------------------------------------------------------------- 1662 1714 !> @brief This subroutine print information about one boundary. … … 1667 1719 !> @param[in] td_bdy boundary structure 1668 1720 !------------------------------------------------------------------- 1669 SUBROUTINE boundary__print_unit( td_bdy ) 1721 1670 1722 IMPLICIT NONE 1723 1671 1724 ! Argument 1672 1725 TYPE(TBDY), INTENT(IN) :: td_bdy 1726 1673 1727 ! local variable 1674 1728 ! loop indices … … 1688 1742 1689 1743 END SUBROUTINE boundary__print_unit 1744 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1745 SUBROUTINE boundary__print_arr(td_bdy) 1690 1746 !------------------------------------------------------------------- 1691 1747 !> @brief This subroutine print information about a array of boundary … … 1698 1754 !> @param[in] td_bdy boundary structure 1699 1755 !------------------------------------------------------------------- 1700 SUBROUTINE boundary__print_arr( td_bdy ) 1756 1701 1757 IMPLICIT NONE 1758 1702 1759 ! Argument 1703 1760 TYPE(TBDY), DIMENSION(:), INTENT(IN) :: td_bdy 1761 1704 1762 ! local variable 1705 1763 ! loop indices … … 1712 1770 1713 1771 END SUBROUTINE boundary__print_arr 1772 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1773 FUNCTION seg__copy_unit(td_seg) & 1774 & RESULT (tf_seg) 1714 1775 !------------------------------------------------------------------- 1715 1776 !> @brief … … 1731 1792 !> @return copy of input segment structure 1732 1793 !------------------------------------------------------------------- 1733 FUNCTION seg__copy_unit( td_seg ) 1794 1734 1795 IMPLICIT NONE 1796 1735 1797 ! Argument 1736 1798 TYPE(TSEG), INTENT(IN) :: td_seg 1799 1737 1800 ! function 1738 TYPE(TSEG) :: seg__copy_unit1801 TYPE(TSEG) :: tf_seg 1739 1802 1740 1803 ! local variable … … 1743 1806 1744 1807 ! copy segment index, width, .. 1745 seg__copy_unit%i_index = td_seg%i_index1746 seg__copy_unit%i_width = td_seg%i_width1747 seg__copy_unit%i_first = td_seg%i_first1748 seg__copy_unit%i_last = td_seg%i_last1808 tf_seg%i_index = td_seg%i_index 1809 tf_seg%i_width = td_seg%i_width 1810 tf_seg%i_first = td_seg%i_first 1811 tf_seg%i_last = td_seg%i_last 1749 1812 1750 1813 END FUNCTION seg__copy_unit 1814 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1815 FUNCTION seg__copy_arr(td_seg) & 1816 & RESULT (tf_seg) 1751 1817 !------------------------------------------------------------------- 1752 1818 !> @brief … … 1768 1834 !> @return copy of input array of segment structure 1769 1835 !------------------------------------------------------------------- 1770 FUNCTION seg__copy_arr( td_seg ) 1836 1771 1837 IMPLICIT NONE 1838 1772 1839 ! Argument 1773 TYPE(TSEG), DIMENSION(:), INTENT(IN) :: td_seg 1840 TYPE(TSEG), DIMENSION(:), INTENT(IN) :: td_seg 1841 1774 1842 ! function 1775 TYPE(TSEG), DIMENSION(SIZE(td_seg(:))) :: seg__copy_arr1843 TYPE(TSEG), DIMENSION(SIZE(td_seg(:))) :: tf_seg 1776 1844 1777 1845 ! local variable … … 1781 1849 1782 1850 DO ji=1,SIZE(td_seg(:)) 1783 seg__copy_arr(ji)=seg__copy(td_seg(ji))1851 tf_seg(ji)=seg__copy(td_seg(ji)) 1784 1852 ENDDO 1785 1853 1786 1854 END FUNCTION seg__copy_arr 1855 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1856 FUNCTION seg__init(id_index, id_width, id_first, id_last) & 1857 & RESULT(tf_seg) 1787 1858 !------------------------------------------------------------------- 1788 1859 !> @brief This function initialise segment structure. … … 1801 1872 !> @return segment structure 1802 1873 !------------------------------------------------------------------- 1803 FUNCTION seg__init( id_index, id_width, id_first, id_last ) 1874 1804 1875 IMPLICIT NONE 1876 1805 1877 ! Argument 1806 1878 INTEGER(i4), INTENT(IN) :: id_index … … 1810 1882 1811 1883 ! function 1812 TYPE(TSEG) :: seg__init1884 TYPE(TSEG) :: tf_seg 1813 1885 1814 1886 ! local variable … … 1817 1889 !---------------------------------------------------------------- 1818 1890 1819 seg__init%i_index=id_index1820 1821 IF( PRESENT(id_width) ) seg__init%i_width=id_width1822 IF( PRESENT(id_first) ) seg__init%i_first=id_first1823 IF( PRESENT(id_last ) ) seg__init%i_last =id_last1891 tf_seg%i_index=id_index 1892 1893 IF( PRESENT(id_width) ) tf_seg%i_width=id_width 1894 IF( PRESENT(id_first) ) tf_seg%i_first=id_first 1895 IF( PRESENT(id_last ) ) tf_seg%i_last =id_last 1824 1896 1825 1897 END FUNCTION seg__init 1898 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1899 SUBROUTINE seg__clean_unit(td_seg) 1826 1900 !------------------------------------------------------------------- 1827 1901 !> @brief This subroutine clean segment structure. … … 1832 1906 !> @param[inout] td_seg segment structure 1833 1907 !------------------------------------------------------------------- 1834 SUBROUTINE seg__clean_unit(td_seg) 1908 1835 1909 IMPLICIT NONE 1910 1836 1911 ! Argument 1837 1912 TYPE(TSEG), INTENT(INOUT) :: td_seg 1913 1838 1914 ! local variable 1839 1915 TYPE(TSEG) :: tl_seg … … 1844 1920 1845 1921 END SUBROUTINE seg__clean_unit 1922 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1923 SUBROUTINE seg__clean_arr(td_seg) 1846 1924 !------------------------------------------------------------------- 1847 1925 !> @brief This subroutine clean segment structure. … … 1852 1930 !> @param[inout] td_seg array of segment structure 1853 1931 !------------------------------------------------------------------- 1854 SUBROUTINE seg__clean_arr(td_seg) 1932 1855 1933 IMPLICIT NONE 1934 1856 1935 ! Argument 1857 1936 TYPE(TSEG), DIMENSION(:), INTENT(INOUT) :: td_seg 1937 1858 1938 ! local variable 1859 1939 ! loop indices … … 1866 1946 1867 1947 END SUBROUTINE seg__clean_arr 1948 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1868 1949 END MODULE boundary
Note: See TracChangeset
for help on using the changeset viewer.