Changeset 932 for XIOS/trunk/src/generate_interface_impl.hpp
- Timestamp:
- 09/21/16 14:35:03 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/generate_interface_impl.hpp
r674 r932 440 440 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; \ 441 441 oss << "}" << std::endl; \ 442 } \ 443 \ 444 template <> \ 445 void CInterface::AttributeCInterface<CArray<T,4> >(ostream& oss, const string& className, const string& name) \ 446 { \ 447 string typeName=getStrType<T>(); \ 448 \ 449 oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int* extent)" << iendl; \ 450 oss << "{" << iendl; \ 451 oss << " CTimer::get(\"XIOS\").resume();" << iendl; \ 452 oss << " CArray<" << typeName << ",4> tmp(" << name << ", shape(extent[0], extent[1], extent[2], extent[3]), neverDeleteData);" << iendl; \ 453 oss << " " << className << "_hdl->" << name << ".reference(tmp.copy());" << iendl; \ 454 /*oss << " " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl;*/ \ 455 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; \ 456 oss << "}" << std::endl; \ 457 oss << iendl; \ 458 oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int* extent)" << iendl; \ 459 oss << "{" << iendl; \ 460 oss << " CTimer::get(\"XIOS\").resume();" << iendl; \ 461 oss << " CArray<" << typeName << ",4> tmp(" << name << ", shape(extent[0], extent[1], extent[2], extent[3]), neverDeleteData);" << iendl; \ 462 oss << " tmp=" << className << "_hdl->" << name << ".getInheritedValue();" << iendl; \ 463 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; \ 464 oss << "}" << std::endl; \ 465 } \ 466 \ 467 template <> \ 468 void CInterface::AttributeCInterface<CArray<T,5> >(ostream& oss, const string& className, const string& name) \ 469 { \ 470 string typeName=getStrType<T>(); \ 471 \ 472 oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int* extent)" << iendl; \ 473 oss << "{" << iendl; \ 474 oss << " CTimer::get(\"XIOS\").resume();" << iendl; \ 475 oss << " CArray<" << typeName << ",5> tmp(" << name << ", shape(extent[0], extent[1], extent[2], extent[3], extent[4]), neverDeleteData);" << iendl; \ 476 oss << " " << className << "_hdl->" << name << ".reference(tmp.copy());" << iendl; \ 477 /*oss << " " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl;*/ \ 478 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; \ 479 oss << "}" << std::endl; \ 480 oss << iendl; \ 481 oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int* extent)" << iendl; \ 482 oss << "{" << iendl; \ 483 oss << " CTimer::get(\"XIOS\").resume();" << iendl; \ 484 oss << " CArray<" << typeName << ",5> tmp(" << name << ", shape(extent[0], extent[1], extent[2], extent[3], extent[4]), neverDeleteData);" << iendl; \ 485 oss << " tmp=" << className << "_hdl->" << name << ".getInheritedValue();" << iendl; \ 486 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; \ 487 oss << "}" << std::endl; \ 488 } \ 489 \ 490 template <> \ 491 void CInterface::AttributeCInterface<CArray<T,6> >(ostream& oss, const string& className, const string& name) \ 492 { \ 493 string typeName=getStrType<T>(); \ 494 \ 495 oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int* extent)" << iendl; \ 496 oss << "{" << iendl; \ 497 oss << " CTimer::get(\"XIOS\").resume();" << iendl; \ 498 oss << " CArray<" << typeName << ",6> tmp(" << name << ", shape(extent[0], extent[1], extent[2], extent[3], extent[4], extent[5]), neverDeleteData);" << iendl; \ 499 oss << " " << className << "_hdl->" << name << ".reference(tmp.copy());" << iendl; \ 500 /*oss << " " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl;*/ \ 501 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; \ 502 oss << "}" << std::endl; \ 503 oss << iendl; \ 504 oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int* extent)" << iendl; \ 505 oss << "{" << iendl; \ 506 oss << " CTimer::get(\"XIOS\").resume();" << iendl; \ 507 oss << " CArray<" << typeName << ",6> tmp(" << name << ", shape(extent[0], extent[1], extent[2], extent[3], extent[4], extent[5]), neverDeleteData);" << iendl; \ 508 oss << " tmp=" << className << "_hdl->" << name << ".getInheritedValue();" << iendl; \ 509 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; \ 510 oss << "}" << std::endl; \ 511 } \ 512 \ 513 template <> \ 514 void CInterface::AttributeCInterface<CArray<T,7> >(ostream& oss, const string& className, const string& name) \ 515 { \ 516 string typeName=getStrType<T>(); \ 517 \ 518 oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int* extent)" << iendl; \ 519 oss << "{" << iendl; \ 520 oss << " CTimer::get(\"XIOS\").resume();" << iendl; \ 521 oss << " CArray<" << typeName << ",7> tmp(" << name << ", shape(extent[0], extent[1], extent[2], extent[3], extent[4], extent[5], extent[6]), neverDeleteData);" << iendl; \ 522 oss << " " << className << "_hdl->" << name << ".reference(tmp.copy());" << iendl; \ 523 /*oss << " " << className << "_hdl->sendAttributToServer(" << className << "_hdl->" << name << ");" << iendl;*/ \ 524 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; \ 525 oss << "}" << std::endl; \ 526 oss << iendl; \ 527 oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << typeName << "* " << name << ", int* extent)" << iendl; \ 528 oss << "{" << iendl; \ 529 oss << " CTimer::get(\"XIOS\").resume();" << iendl; \ 530 oss << " CArray<" << typeName << ",7> tmp(" << name << ", shape(extent[0], extent[1], extent[2], extent[3], extent[4], extent[5], extent[6]), neverDeleteData);" << iendl; \ 531 oss << " tmp=" << className << "_hdl->" << name << ".getInheritedValue();" << iendl; \ 532 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; \ 533 oss << "}" << std::endl; \ 442 534 } 443 535 … … 494 586 oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 495 587 } \ 496 588 \ 497 589 template <> \ 498 590 void CInterface::AttributeFortran2003Interface<CArray<T,3> >(ostream& oss, const string& className, const string& name) \ 591 { \ 592 string fortranType=getStrFortranType<T>(); \ 593 string fortranKindC=getStrFortranKindC<T>(); \ 594 \ 595 oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent) BIND(C)" << iendl; \ 596 oss << " USE ISO_C_BINDING" << iendl; \ 597 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; \ 598 oss << " " << fortranType << " " << fortranKindC << " , DIMENSION(*) :: " << name << iendl; \ 599 oss << " INTEGER (kind = C_INT), DIMENSION(*) :: extent" << iendl; \ 600 oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 601 oss << iendl; \ 602 oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent) BIND(C)" << iendl; \ 603 oss << " USE ISO_C_BINDING" << iendl; \ 604 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; \ 605 oss << " " << fortranType << " " << fortranKindC << " , DIMENSION(*) :: " << name << iendl; \ 606 oss << " INTEGER (kind = C_INT), DIMENSION(*) :: extent" << iendl; \ 607 oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 608 } \ 609 \ 610 template <> \ 611 void CInterface::AttributeFortran2003Interface<CArray<T,4> >(ostream& oss, const string& className, const string& name) \ 612 { \ 613 string fortranType=getStrFortranType<T>(); \ 614 string fortranKindC=getStrFortranKindC<T>(); \ 615 \ 616 oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent) BIND(C)" << iendl; \ 617 oss << " USE ISO_C_BINDING" << iendl; \ 618 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; \ 619 oss << " " << fortranType << " " << fortranKindC << " , DIMENSION(*) :: " << name << iendl; \ 620 oss << " INTEGER (kind = C_INT), DIMENSION(*) :: extent" << iendl; \ 621 oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 622 oss << iendl; \ 623 oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent) BIND(C)" << iendl; \ 624 oss << " USE ISO_C_BINDING" << iendl; \ 625 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; \ 626 oss << " " << fortranType << " " << fortranKindC << " , DIMENSION(*) :: " << name << iendl; \ 627 oss << " INTEGER (kind = C_INT), DIMENSION(*) :: extent" << iendl; \ 628 oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 629 }\ 630 \ 631 template <> \ 632 void CInterface::AttributeFortran2003Interface<CArray<T,5> >(ostream& oss, const string& className, const string& name) \ 633 { \ 634 string fortranType=getStrFortranType<T>(); \ 635 string fortranKindC=getStrFortranKindC<T>(); \ 636 \ 637 oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent) BIND(C)" << iendl; \ 638 oss << " USE ISO_C_BINDING" << iendl; \ 639 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; \ 640 oss << " " << fortranType << " " << fortranKindC << " , DIMENSION(*) :: " << name << iendl; \ 641 oss << " INTEGER (kind = C_INT), DIMENSION(*) :: extent" << iendl; \ 642 oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 643 oss << iendl; \ 644 oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent) BIND(C)" << iendl; \ 645 oss << " USE ISO_C_BINDING" << iendl; \ 646 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; \ 647 oss << " " << fortranType << " " << fortranKindC << " , DIMENSION(*) :: " << name << iendl; \ 648 oss << " INTEGER (kind = C_INT), DIMENSION(*) :: extent" << iendl; \ 649 oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 650 }\ 651 \ 652 template <> \ 653 void CInterface::AttributeFortran2003Interface<CArray<T,6> >(ostream& oss, const string& className, const string& name) \ 654 { \ 655 string fortranType=getStrFortranType<T>(); \ 656 string fortranKindC=getStrFortranKindC<T>(); \ 657 \ 658 oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent) BIND(C)" << iendl; \ 659 oss << " USE ISO_C_BINDING" << iendl; \ 660 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; \ 661 oss << " " << fortranType << " " << fortranKindC << " , DIMENSION(*) :: " << name << iendl; \ 662 oss << " INTEGER (kind = C_INT), DIMENSION(*) :: extent" << iendl; \ 663 oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 664 oss << iendl; \ 665 oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", extent) BIND(C)" << iendl; \ 666 oss << " USE ISO_C_BINDING" << iendl; \ 667 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; \ 668 oss << " " << fortranType << " " << fortranKindC << " , DIMENSION(*) :: " << name << iendl; \ 669 oss << " INTEGER (kind = C_INT), DIMENSION(*) :: extent" << iendl; \ 670 oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 671 }\ 672 \ 673 template <> \ 674 void CInterface::AttributeFortran2003Interface<CArray<T,7> >(ostream& oss, const string& className, const string& name) \ 499 675 { \ 500 676 string fortranType=getStrFortranType<T>(); \ … … 562 738 oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:,:)"; \ 563 739 if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:)"; \ 740 }\ 741 \ 742 template <> \ 743 void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,4> >(ostream& oss, const string& className, const string& name) \ 744 { \ 745 oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:,:,:)"; \ 746 if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:,:)"; \ 747 } \ 748 \ 749 template <> \ 750 void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,4> >(ostream& oss, const string& className, const string& name) \ 751 { \ 752 oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:,:,:)"; \ 753 if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:,:)"; \ 754 }\ 755 \ 756 template <> \ 757 void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,5> >(ostream& oss, const string& className, const string& name) \ 758 { \ 759 oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:,:,:,:)"; \ 760 if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:,:,:)"; \ 761 } \ 762 \ 763 template <> \ 764 void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,5> >(ostream& oss, const string& className, const string& name) \ 765 { \ 766 oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:,:,:,:)"; \ 767 if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:,:,:)"; \ 768 }\ 769 \ 770 template <> \ 771 void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,6> >(ostream& oss, const string& className, const string& name) \ 772 { \ 773 oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:,:,:,:,:)"; \ 774 if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:,:,:,:)"; \ 775 } \ 776 \ 777 template <> \ 778 void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,6> >(ostream& oss, const string& className, const string& name) \ 779 { \ 780 oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:,:,:,:,:)"; \ 781 if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:,:,:,:)"; \ 782 }\ 783 \ 784 template <> \ 785 void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,7> >(ostream& oss, const string& className, const string& name) \ 786 { \ 787 oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(IN) :: " << name << "(:,:,:,:,:,:,:)"; \ 788 if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:,:,:,:,:)"; \ 789 } \ 790 \ 791 template <> \ 792 void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,7> >(ostream& oss, const string& className, const string& name) \ 793 { \ 794 oss << getStrFortranType<T>() << " " << getStrFortranKind<T>() << " , OPTIONAL, INTENT(OUT) :: " << name << "(:,:,:,:,:,:,:)"; \ 795 if (!matchingTypeCFortran<T>()) oss << iendl << getStrFortranType<T>() << " " << getStrFortranKindC<T>() << " , ALLOCATABLE :: " << name << "_tmp(:,:,:,:,:,:,:)"; \ 564 796 } 565 797 … … 602 834 oss << "ENDIF"; \ 603 835 } \ 604 836 \ 605 837 template <> \ 606 838 void CInterface::AttributeFortranInterfaceBody< CArray<T,3> >(ostream& oss, const string& className, const string& name) \ … … 617 849 else oss << " CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 618 850 oss << "ENDIF"; \ 851 }\ 852 \ 853 template <> \ 854 void CInterface::AttributeFortranInterfaceBody< CArray<T,4> >(ostream& oss, const string& className, const string& name) \ 855 { \ 856 string name_tmp=name+"__tmp"; \ 857 \ 858 oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 859 if (!matchingTypeCFortran<T>()) \ 860 { \ 861 oss << " ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4)))" << iendl; \ 862 oss << " " << name_tmp << " = " << name << "_" << iendl; \ 863 oss << " CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 864 } \ 865 else oss << " CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 866 oss << "ENDIF"; \ 867 }\ 868 \ 869 template <> \ 870 void CInterface::AttributeFortranInterfaceBody< CArray<T,5> >(ostream& oss, const string& className, const string& name) \ 871 { \ 872 string name_tmp=name+"__tmp"; \ 873 \ 874 oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 875 if (!matchingTypeCFortran<T>()) \ 876 { \ 877 oss << " ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4), SIZE(" << name << "_,5)))" << iendl; \ 878 oss << " " << name_tmp << " = " << name << "_" << iendl; \ 879 oss << " CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 880 } \ 881 else oss << " CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 882 oss << "ENDIF"; \ 883 }\ 884 \ 885 template <> \ 886 void CInterface::AttributeFortranInterfaceBody< CArray<T,6> >(ostream& oss, const string& className, const string& name) \ 887 { \ 888 string name_tmp=name+"__tmp"; \ 889 \ 890 oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 891 if (!matchingTypeCFortran<T>()) \ 892 { \ 893 oss << " ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4), SIZE(" << name << "_,5), SIZE(" << name << "_,6)))" << iendl; \ 894 oss << " " << name_tmp << " = " << name << "_" << iendl; \ 895 oss << " CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 896 } \ 897 else oss << " CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 898 oss << "ENDIF"; \ 899 }\ 900 \ 901 template <> \ 902 void CInterface::AttributeFortranInterfaceBody< CArray<T,7> >(ostream& oss, const string& className, const string& name) \ 903 { \ 904 string name_tmp=name+"__tmp"; \ 905 \ 906 oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 907 if (!matchingTypeCFortran<T>()) \ 908 { \ 909 oss << " ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4), SIZE(" << name << "_,5), SIZE(" << name << "_,6), SIZE(" << name << "_,7)))" << iendl; \ 910 oss << " " << name_tmp << " = " << name << "_" << iendl; \ 911 oss << " CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 912 } \ 913 else oss << " CALL cxios_set_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 914 oss << "ENDIF"; \ 619 915 } 620 916 … … 657 953 oss << "ENDIF"; \ 658 954 } \ 659 955 \ 660 956 template <> \ 661 957 void CInterface::AttributeFortranInterfaceGetBody< CArray<T,3> >(ostream& oss, const string& className, const string& name) \ … … 672 968 else oss << " CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 673 969 oss << "ENDIF"; \ 970 } \ 971 \ 972 template <> \ 973 void CInterface::AttributeFortranInterfaceGetBody< CArray<T,4> >(ostream& oss, const string& className, const string& name) \ 974 { \ 975 string name_tmp=name+"__tmp"; \ 976 \ 977 oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 978 if (!matchingTypeCFortran<T>()) \ 979 { \ 980 oss << " ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4)))" << iendl; \ 981 oss << " CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 982 oss << " " << name << "_ = " << name_tmp << iendl; \ 983 } \ 984 else oss << " CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 985 oss << "ENDIF"; \ 986 } \ 987 \ 988 template <> \ 989 void CInterface::AttributeFortranInterfaceGetBody< CArray<T,5> >(ostream& oss, const string& className, const string& name) \ 990 { \ 991 string name_tmp=name+"__tmp"; \ 992 \ 993 oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 994 if (!matchingTypeCFortran<T>()) \ 995 { \ 996 oss << " ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4), SIZE(" << name << "_,5)))" << iendl; \ 997 oss << " CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 998 oss << " " << name << "_ = " << name_tmp << iendl; \ 999 } \ 1000 else oss << " CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 1001 oss << "ENDIF"; \ 1002 }\ 1003 \ 1004 template <> \ 1005 void CInterface::AttributeFortranInterfaceGetBody< CArray<T,6> >(ostream& oss, const string& className, const string& name) \ 1006 { \ 1007 string name_tmp=name+"__tmp"; \ 1008 \ 1009 oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 1010 if (!matchingTypeCFortran<T>()) \ 1011 { \ 1012 oss << " ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4), SIZE(" << name << "_,5), SIZE(" << name << "_,6)))" << iendl; \ 1013 oss << " CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 1014 oss << " " << name << "_ = " << name_tmp << iendl; \ 1015 } \ 1016 else oss << " CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 1017 oss << "ENDIF"; \ 1018 } \ 1019 \ 1020 template <> \ 1021 void CInterface::AttributeFortranInterfaceGetBody< CArray<T,7> >(ostream& oss, const string& className, const string& name) \ 1022 { \ 1023 string name_tmp=name+"__tmp"; \ 1024 \ 1025 oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 1026 if (!matchingTypeCFortran<T>()) \ 1027 { \ 1028 oss << " ALLOCATE(" << name_tmp << "(SIZE(" << name << "_,1), SIZE(" << name << "_,2), SIZE(" << name << "_,3), SIZE(" << name << "_,4), SIZE(" << name << "_,5), SIZE(" << name << "_,6), SIZE(" << name << "_,7)))" << iendl; \ 1029 oss << " CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name_tmp << ", SHAPE(" << name << "_))" << iendl; \ 1030 oss << " " << name << "_ = " << name_tmp << iendl; \ 1031 } \ 1032 else oss << " CALL cxios_get_" << className << "_" << name << "(" << className << "_hdl%daddr, " << name << "_, SHAPE(" << name << "_))" << iendl; \ 1033 oss << "ENDIF"; \ 674 1034 } 675 1035
Note: See TracChangeset
for help on using the changeset viewer.