- Timestamp:
- 2020-06-03T16:36:09+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendors/AGRIF/dev_r12970_AGRIF_CMEMS/AGRIF_FILES/modcurgridfunctions.F90
r5656 r13027 29 29 implicit none 30 30 ! 31 32 interface Agrif_Parent 33 module procedure Agrif_Parent_Real_4, & 34 Agrif_Parent_Real_8, & 35 Agrif_Parent_Array2_Real_8, & 36 Agrif_Parent_Integer, & 37 Agrif_Parent_Character, & 38 Agrif_Parent_Logical 39 end interface 40 interface Agrif_Child 41 module procedure Agrif_Child_Logical 42 end interface 43 31 44 contains 32 45 ! … … 657 670 end subroutine Agrif_Set_coeffreft_z 658 671 !=================================================================================================== 672 ! subroutine Agrif_Set_coeffreft 673 !--------------------------------------------------------------------------------------------------- 674 subroutine Agrif_Set_coeffreft ( coeffref ) 675 !--------------------------------------------------------------------------------------------------- 676 integer, intent(in) :: coeffref 677 integer :: i 678 679 if (coeffref < 0) then 680 write(*,*)'Coefficient of time raffinement should be positive' 681 stop 682 else 683 do i=1,Agrif_Probdim 684 Agrif_coeffreft(i) = coeffref 685 Agrif_Curgrid % timeref(i) = coeffref 686 enddo 687 endif 688 !--------------------------------------------------------------------------------------------------- 689 end subroutine Agrif_Set_coeffreft 690 !=================================================================================================== 659 691 ! 660 692 !=================================================================================================== … … 738 770 end function Agrif_Level 739 771 !=================================================================================================== 772 !=================================================================================================== 773 ! subroutine Agrif_set_periodicity 774 !--------------------------------------------------------------------------------------------------- 775 776 subroutine Agrif_set_periodicity(i,decal) 777 !--------------------------------------------------------------------------------------------------- 778 integer :: i, decal 779 780 Agrif_curgrid%periodicity(i)=.TRUE. 781 Agrif_curgrid%periodicity_decal(i)=decal 782 783 !--------------------------------------------------------------------------------------------------- 784 end subroutine Agrif_set_periodicity 740 785 ! 741 786 !=================================================================================================== … … 763 808 !=================================================================================================== 764 809 ! 810 811 function Agrif_Parent_Real_4(real_variable) result(real_variable_parent) 812 real(KIND=4) :: real_variable 813 real(KIND=4) :: real_variable_parent 814 815 integer :: i 816 logical :: i_found 817 818 i_found = .FALSE. 819 820 do i=1,Agrif_NbVariables(2) 821 if (LOC(real_variable) == LOC(agrif_curgrid%tabvars_r(i)%array0)) then 822 real_variable_parent = agrif_curgrid%tabvars_r(i)%parent_var%array0 823 i_found = .TRUE. 824 EXIT 825 endif 826 enddo 827 828 IF (.NOT.i_found) THEN 829 do i=1,Agrif_NbVariables(2) 830 if (LOC(real_variable) == LOC(agrif_curgrid%tabvars_r(i)%sarray0)) then 831 real_variable_parent = agrif_curgrid%tabvars_r(i)%parent_var%sarray0 832 i_found = .TRUE. 833 EXIT 834 endif 835 enddo 836 ENDIF 837 838 if (.NOT.i_found) STOP 'Agrif_Parent_Real_4 : Variable not found' 839 840 end function Agrif_Parent_Real_4 841 842 function Agrif_Parent_Real_8(real_variable) result(real_variable_parent) 843 real(KIND=8) :: real_variable 844 real(KIND=8) :: real_variable_parent 845 846 integer :: i 847 logical :: i_found 848 849 i_found = .FALSE. 850 851 do i=1,Agrif_NbVariables(2) 852 if (LOC(real_variable) == LOC(agrif_curgrid%tabvars_r(i)%array0)) then 853 real_variable_parent = agrif_curgrid%tabvars_r(i)%parent_var%array0 854 i_found = .TRUE. 855 EXIT 856 endif 857 enddo 858 859 IF (.NOT.i_found) THEN 860 do i=1,Agrif_NbVariables(2) 861 if (LOC(real_variable) == LOC(agrif_curgrid%tabvars_r(i)%darray0)) then 862 real_variable_parent = agrif_curgrid%tabvars_r(i)%parent_var%darray0 863 i_found = .TRUE. 864 EXIT 865 endif 866 enddo 867 ENDIF 868 869 if (.NOT.i_found) STOP 'Agrif_Parent_Real_8 : Variable not found' 870 871 end function Agrif_Parent_Real_8 872 873 function Agrif_Parent_Array2_Real_8(real_variable,ji,jj) result(real_variable_parent) 874 real(KIND=8), DIMENSION(:,:) :: real_variable 875 real(KIND=8) :: real_variable_parent 876 integer :: ji,jj 877 878 integer :: i 879 logical :: i_found 880 881 i_found = .FALSE. 882 883 do i=1,Agrif_NbVariables(0) 884 if (LOC(real_variable) == LOC(agrif_curgrid%tabvars(i)%array2)) then 885 real_variable_parent = agrif_curgrid%tabvars(i)%parent_var%array2(ji,jj) 886 i_found = .TRUE. 887 EXIT 888 endif 889 enddo 890 891 if (.NOT.i_found) STOP 'Agrif_Parent_Array2_Real_8 : Variable not found' 892 893 end function Agrif_Parent_Array2_Real_8 894 895 896 function Agrif_Parent_Integer(integer_variable) result(integer_variable_parent) 897 integer :: integer_variable 898 integer :: integer_variable_parent 899 900 integer :: i 901 logical :: i_found 902 903 i_found = .FALSE. 904 905 do i=1,Agrif_NbVariables(4) 906 if (LOC(integer_variable) == LOC(agrif_curgrid%tabvars_i(i)%iarray0)) then 907 integer_variable_parent = agrif_curgrid%tabvars_i(i)%parent_var%iarray0 908 i_found = .TRUE. 909 EXIT 910 endif 911 enddo 912 913 if (.NOT.i_found) STOP 'Agrif_Parent : Variable not found' 914 915 end function Agrif_Parent_Integer 916 917 function Agrif_Parent_Character(character_variable) result(character_variable_parent) 918 character(*) :: character_variable 919 character(len(character_variable)) :: character_variable_parent 920 921 integer :: i 922 logical :: i_found 923 924 i_found = .FALSE. 925 926 do i=1,Agrif_NbVariables(1) 927 if (LOC(character_variable) == LOC(agrif_curgrid%tabvars_c(i)%carray0)) then 928 character_variable_parent = agrif_curgrid%tabvars_c(i)%parent_var%carray0 929 i_found = .TRUE. 930 EXIT 931 endif 932 enddo 933 934 if (.NOT.i_found) STOP 'Agrif_Parent : Variable not found' 935 936 end function Agrif_Parent_Character 937 938 function Agrif_Parent_Logical(logical_variable) result(logical_variable_parent) 939 logical :: logical_variable 940 logical :: logical_variable_parent 941 942 integer :: i 943 logical :: i_found 944 945 i_found = .FALSE. 946 947 do i=1,Agrif_NbVariables(3) 948 if (LOC(logical_variable) == LOC(agrif_curgrid%tabvars_l(i)%larray0)) then 949 logical_variable_parent = agrif_curgrid%tabvars_l(i)%parent_var%larray0 950 i_found = .TRUE. 951 EXIT 952 endif 953 enddo 954 955 if (.NOT.i_found) STOP 'Agrif_Parent : Variable not found' 956 957 end function Agrif_Parent_Logical 958 959 function Agrif_Child_Logical(logical_variable) result(logical_variable_child) 960 logical :: logical_variable 961 logical :: logical_variable_child 962 963 integer :: i 964 logical :: i_found 965 966 i_found = .FALSE. 967 968 do i=1,Agrif_NbVariables(3) 969 if (LOC(logical_variable) == LOC(agrif_curgrid%tabvars_l(i)%larray0)) then 970 logical_variable_child = Agrif_CurChildgrid%tabvars_l(i)%larray0 971 i_found = .TRUE. 972 EXIT 973 endif 974 enddo 975 976 if (.NOT.i_found) STOP 'Agrif_Child : Variable not found' 977 978 end function Agrif_Child_Logical 979 980 function Agrif_Irhox() result(i_val) 981 integer :: i_val 982 i_val = agrif_curgrid%spaceref(1) 983 end function Agrif_Irhox 984 985 function Agrif_Irhoy() result(i_val) 986 integer :: i_val 987 i_val = agrif_curgrid%spaceref(2) 988 end function Agrif_Irhoy 989 990 function Agrif_Irhoz() result(i_val) 991 integer :: i_val 992 i_val = agrif_curgrid%spaceref(3) 993 end function Agrif_Irhoz 994 995 function Agrif_NearCommonBorderX() result(l_val) 996 logical :: l_val 997 l_val = agrif_curgrid%nearRootBorder(1) 998 end function Agrif_NearCommonBorderX 999 1000 subroutine Agrif_Set_NearCommonBorderX(l_val) 1001 logical,intent(in) :: l_val 1002 agrif_curgrid%nearRootBorder(1)=l_val 1003 end subroutine Agrif_Set_NearCommonBorderX 1004 1005 function Agrif_NearCommonBorderY() result(l_val) 1006 logical :: l_val 1007 l_val = agrif_curgrid%nearRootBorder(2) 1008 end function Agrif_NearCommonBorderY 1009 1010 subroutine Agrif_Set_NearCommonBorderY(l_val) 1011 logical,intent(in) :: l_val 1012 agrif_curgrid%nearRootBorder(2)=l_val 1013 end subroutine Agrif_Set_NearCommonBorderY 1014 1015 function Agrif_NearCommonBorderZ() result(l_val) 1016 logical :: l_val 1017 l_val = agrif_curgrid%nearRootBorder(3) 1018 end function Agrif_NearCommonBorderZ 1019 1020 subroutine Agrif_Set_NearCommonBorderZ(l_val) 1021 logical,intent(in) :: l_val 1022 agrif_curgrid%nearRootBorder(3)=l_val 1023 end subroutine Agrif_Set_NearCommonBorderZ 1024 1025 function Agrif_DistantCommonBorderX() result(l_val) 1026 logical :: l_val 1027 l_val = agrif_curgrid%DistantRootBorder(1) 1028 end function Agrif_DistantCommonBorderX 1029 1030 subroutine Agrif_Set_DistantCommonBorderX(l_val) 1031 logical,intent(in) :: l_val 1032 agrif_curgrid%DistantRootBorder(1)=l_val 1033 end subroutine Agrif_Set_DistantCommonBorderX 1034 1035 function Agrif_DistantCommonBorderY() result(l_val) 1036 logical :: l_val 1037 l_val = agrif_curgrid%DistantRootBorder(2) 1038 end function Agrif_DistantCommonBorderY 1039 1040 subroutine Agrif_Set_DistantCommonBorderY(l_val) 1041 logical,intent(in) :: l_val 1042 agrif_curgrid%DistantRootBorder(2)=l_val 1043 end subroutine Agrif_Set_DistantCommonBorderY 1044 1045 function Agrif_DistantCommonBorderZ() result(l_val) 1046 logical :: l_val 1047 l_val = agrif_curgrid%DistantRootBorder(3) 1048 end function Agrif_DistantCommonBorderZ 1049 1050 subroutine Agrif_Set_DistantCommonBorderZ(l_val) 1051 logical,intent(in) :: l_val 1052 agrif_curgrid%DistantRootBorder(3)=l_val 1053 end subroutine Agrif_Set_DistantCommonBorderZ 1054 1055 function Agrif_Ix() result(i_val) 1056 integer :: i_val 1057 i_val = agrif_curgrid%ix(1) 1058 end function Agrif_Ix 1059 1060 function Agrif_Iy() result(i_val) 1061 integer :: i_val 1062 i_val = agrif_curgrid%ix(2) 1063 end function Agrif_Iy 1064 1065 function Agrif_Iz() result(i_val) 1066 integer :: i_val 1067 i_val = agrif_curgrid%ix(3) 1068 end function Agrif_Iz 1069 1070 function Agrif_Get_grid_id() result(i_val) 1071 integer :: i_val 1072 i_val = agrif_curgrid % grid_id 1073 end function Agrif_Get_grid_id 1074 1075 function Agrif_Get_parent_id() result(i_val) 1076 integer :: i_val 1077 i_val = agrif_curgrid % parent % grid_id 1078 end function Agrif_Get_parent_id 1079 1080 function Agrif_rhox() result(r_val) 1081 real :: r_val 1082 r_val = real(agrif_curgrid%spaceref(1)) 1083 end function Agrif_rhox 1084 1085 function Agrif_rhoy() result(r_val) 1086 real :: r_val 1087 r_val = real(agrif_curgrid%spaceref(2)) 1088 end function Agrif_rhoy 1089 1090 function Agrif_rhoz() result(r_val) 1091 real :: r_val 1092 r_val = real(agrif_curgrid%spaceref(3)) 1093 end function Agrif_rhoz 1094 1095 function Agrif_Nb_Step() result(i_val) 1096 integer :: i_val 1097 i_val = agrif_curgrid%ngridstep 1098 end function Agrif_Nb_Step 1099 1100 function Agrif_Nb_Fine_Grids() result(i_val) 1101 integer :: i_val 1102 i_val = Agrif_nbfixedgrids 1103 end function Agrif_Nb_Fine_Grids 1104 1105 ! Set the name of the External mapping subroutine (if needed) 1106 subroutine Agrif_Set_ExternalMapping(external_mapping) 1107 Procedure(mapping) :: external_mapping 1108 1109 agrif_external_mapping => external_mapping 1110 1111 end subroutine Agrif_Set_ExternalMapping 1112 1113 ! Set the name of the user linear interp function (if needed) 1114 subroutine Agrif_Set_external_linear_interp(external_linear_interp) 1115 Procedure(linear_interp) :: external_linear_interp 1116 1117 agrif_external_linear_interp => external_linear_interp 1118 1119 end subroutine Agrif_Set_external_linear_interp 1120 1121 subroutine Agrif_UnSet_external_linear_interp() 1122 1123 nullify(agrif_external_linear_interp) 1124 1125 end subroutine Agrif_UnSet_external_linear_interp 1126 765 1127 end module Agrif_CurgridFunctions
Note: See TracChangeset
for help on using the changeset viewer.