Changeset 2357 in lmdz_wrf
- Timestamp:
- Feb 20, 2019, 4:24:32 PM (6 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/Makefile.llamp
r2244 r2357 54 54 intsrcs = $(srcs) module_ForInterpolate.f90 55 55 scisrcs = $(srcs) 56 gensrcs = module_definitions.f90 module_basic.f90 module_generic.f90 56 57 defsrcs = module_definitions.f90 57 58 … … 62 63 module_basic.o \ 63 64 module_generic.o \ 65 module_NCgeneric.o \ 64 66 module_scientific.o \ 65 67 module_ForInterpolate.o \ … … 91 93 pyintmods.o \ 92 94 pyscimods.o \ 95 pygenmods.o \ 93 96 pydefmods.o \ 94 97 trajectories_overlap.o … … 100 103 pyintmods.o \ 101 104 pyscimods.o \ 105 pygenmods.o \ 102 106 pydefmods.o 103 107 … … 115 119 116 120 clean : 117 $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_For Def.so121 $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForGen.so module_ForDef.so 118 122 119 123 ######## ####### … … 169 173 $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD) 170 174 175 pygenmods.o: 176 $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForGen $(gensrcs) -L$(NCLIBFOLD) 177 171 178 pydefmods.o: 172 179 $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDef $(defsrcs) -L$(NCLIBFOLD) -
trunk/tools/module_generic.f90
r2356 r2357 5 5 ! continguos_homogene_zones: Subroutine to look for contiguous zones by looking by continuous grid points 6 6 ! freeunit: provides the number of a free unit in which open a file 7 ! from_coordlist_2DRKmatrix: Subroutine to construct a 2D RK matrix from a list of values accompaigned 8 ! by a list of coordinates to find i,j grid-point coordinates by minimum distance 7 9 ! from_ptlist_2DRKmatrix: Subroutine to construct a 2D RK matrix from a list of values accompaigned 8 ! by a list of coordinates 10 ! by a list of grid-point coordinates 11 ! from_ptlist_2DRKNmatrix: Subroutine to construct N 2D RK matrix from a list of values accompaigned 12 ! by a list of grid-point coordinates 9 13 ! GetInNamelist: Subroutine to get a paramter from a namelistfile 10 14 ! get_xyconlimits: Subroutine for getting the limits of contiguous values from a given point in a 2D matrix … … 988 992 989 993 SUBROUTINE from_ptlist_2DRKmatrix(Npts, pts, vals, dx, dy, NOval, matrix) 990 ! Subroutine to construct a 2D RK matrix from a list of values accompaigned by a list of coordinates 994 ! Subroutine to construct a 2D RK matrix from a list of values accompaigned by a list of grid-point 995 ! coordinates 991 996 992 997 IMPLICIT NONE … … 1023 1028 END SUBROUTINE from_ptlist_2DRKmatrix 1024 1029 1030 SUBROUTINE from_ptlist_2DRKNmatrix(Npts, pts, Nvals, vals, dx, dy, NOval, Nmatrix) 1031 ! Subroutine to construct N 2D RK matrix from a list of values accompaigned by a list of grid-point 1032 ! coordinates 1033 1034 IMPLICIT NONE 1035 1036 INTEGER, INTENT(in) :: Npts, dx, dy, Nvals 1037 REAL(r_k), INTENT(in) :: NOval 1038 INTEGER, DIMENSION(Npts,2), INTENT(in) :: pts 1039 REAL(r_k), DIMENSION(Npts,Nvals), INTENT(in) :: vals 1040 REAL(r_k), DIMENSION(dx,dy,Nvals), INTENT(out) :: Nmatrix 1041 1042 ! Local 1043 INTEGER :: iv, i, j, ic 1044 1045 !!!!!!! Variables 1046 ! Npts: Number of values of the list 1047 ! pts: 2D matrix coordinates of the values 1048 ! Nvals: number of different values 1049 ! vals: list of N-values correspondant to the coordinates 1050 ! dx, dy: shape of the 2D matrix 1051 ! NOval: Value to assign when there is no coordinate 1052 ! Nmatrix: resultant N-matrix 1053 1054 fname = 'from_ptlist_2DRKNmatrix' 1055 1056 Nmatrix = NOval 1057 1058 DO iv=1, Npts 1059 i = pts(iv,1) 1060 j = pts(iv,2) 1061 Nmatrix(i,j,:) = vals(iv,:) 1062 END DO 1063 1064 RETURN 1065 1066 END SUBROUTINE from_ptlist_2DRKNmatrix 1067 1068 SUBROUTINE from_coordlist_2DRKmatrix(Npts, coords, xcoord, ycoord, vals, dx, dy, NOval, matrix) 1069 ! Subroutine to construct a 2D RK matrix from a list of values accompaigned by a list of coordinates 1070 ! to find i,j grid-point coordinates by minimum distance 1071 1072 IMPLICIT NONE 1073 1074 INTEGER, INTENT(in) :: Npts, dx, dy 1075 REAL(r_k), INTENT(in) :: NOval 1076 REAL(r_k), DIMENSION(Npts,2), INTENT(in) :: coords 1077 REAL(r_k), DIMENSION(Npts), INTENT(in) :: vals 1078 REAL(r_k), DIMENSION(dx,dy), INTENT(in) :: xcoord, ycoord 1079 REAL(r_k), DIMENSION(dx,dy), INTENT(out) :: matrix 1080 1081 ! Local 1082 INTEGER :: iv, i, j 1083 REAL(r_k) :: xi, yi 1084 REAL(r_k), DIMENSION(dx,dy) :: diff 1085 INTEGER, DIMENSION(2) :: minpt 1086 1087 !!!!!!! Variables 1088 ! Npts: Number of values of the list 1089 ! coords: 2D coordinates of the values 1090 ! vals: list of values correspondant to the coordinates 1091 ! xcoord, ycoord: matrix of values correspondant to the each coordinate 1092 ! dx, dy: shape of the 2D matrix 1093 ! NOval: Value to assign when there is no coordinate 1094 ! matrix: resultant matrix 1095 1096 fname = 'from_coordlist_2DRKmatrix' 1097 1098 matrix = NOval 1099 1100 DO iv=1, Npts 1101 xi = coords(iv,1) 1102 yi = coords(iv,2) 1103 diff = SQRT((xcoord-xi)**2+(ycoord-yi)**2) 1104 minpt = MINLOC(diff) 1105 matrix(minpt(1),minpt(2)) = vals(iv) 1106 END DO 1107 1108 RETURN 1109 1110 END SUBROUTINE from_coordlist_2DRKmatrix 1111 1025 1112 END MODULE module_generic
Note: See TracChangeset
for help on using the changeset viewer.