Changeset 1355 in lmdz_wrf
- Timestamp:
- Nov 25, 2016, 9:57:52 PM (8 years ago)
- Location:
- trunk/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/interpolate.F90
r1184 r1355 225 225 REAL(r_k), ALLOCATABLE, DIMENSION(:,:) :: fractionlon, fractionlat 226 226 INTEGER :: fracdx, fracdy 227 CHARACTER(LEN=50) :: fname , errormsg227 CHARACTER(LEN=50) :: fname 228 228 229 229 !!!!!!! Variables -
trunk/tools/module_ForInterpolate.F90
r1185 r1355 10 10 MODULE module_ForInterpolate 11 11 12 USE module_generic 13 12 14 CONTAINS 13 15 … … 15 17 Nperx, Npery, ilonlat, mindiffLl) 16 18 ! Function to search a given value from a coarser version of the data 17 18 USE module_generic19 19 20 20 IMPLICIT NONE … … 206 206 iv, lonv, latv, per, Nperx, Npery, mindiff, ilonlat, mindiffLl) 207 207 ! Function to search a given value from a coarser version of the data 208 209 USE module_generic210 208 211 209 IMPLICIT NONE … … 437 435 ! Function to search a given value from a coarser version of the data 438 436 439 USE module_generic440 441 437 IMPLICIT NONE 442 438 … … 489 485 ! approche from percentages of the whole domain 490 486 491 USE module_generic492 493 487 IMPLICIT NONE 494 488 … … 592 586 ! Subroutine which finds the closest grid point within a projection throughout a first guest 593 587 ! and then whole domain approche from percentages of the whole domain 594 595 USE module_generic596 588 597 589 IMPLICIT NONE … … 724 716 ! Subroutine which provides the indices for a given interpolation of a projection 725 717 726 USE module_generic727 728 718 IMPLICIT NONE 729 719 … … 738 728 INTEGER :: i,j,iv, ix, iy 739 729 REAL(r_k) :: mindiffLl, dist 740 REAL(r_k) :: inclon, inclat, maxdiffprojlonlat 730 REAL(r_k) :: inclon, inclat, maxdiffprojlonlat, & 731 maxdiffinlonlat 741 732 REAL(r_k), DIMENSION(idimx,idimy) :: difflonlat 733 REAL(r_k), DIMENSION(idimx,idimy) :: idifflon, idifflat 742 734 REAL(r_k), DIMENSION(pdimx,pdimy) :: difflon, difflat 743 735 REAL(r_k), DIMENSION(2) :: extremelon, extremelat, ipos … … 763 755 extremelat = (/ MINVAL(projlat), MAXVAL(projlat) /) 764 756 757 ! Maximum distance between grid points in input projection 758 idifflon = 0. 759 idifflat = 0. 760 idifflon(1:idimx-1,:) = inlonv(2:idimx,:)-inlonv(1:idimx-1,:) 761 idifflat(:,1:idimy-1) = inlatv(:,2:idimy)-inlatv(:,1:idimy-1) 762 maxdiffinlonlat = MAXVAL(SQRT(idifflon**2. + idifflat**2.)) 765 763 ! Maximum distance between grid points in target projection 766 764 difflon = 0. … … 770 768 maxdiffprojlonlat = MAXVAL(SQRT(difflon**2. + difflat**2.)) 771 769 770 IF (maxdiffinlonlat > maxdiffprojlonlat) THEN 771 PRINT *,TRIM(warnmsg) 772 PRINT *,' ' //TRIM(fname)// '; input resolution: ', maxdiffinlonlat, ' is coarser than target:', & 773 maxdiffprojlonlat, ' !!' 774 END IF 775 772 776 ! Using case outside loop to be more efficient 773 777 SELECT CASE(TRIM(intkind)) … … 781 785 difflonlat = SQRT((projlon(i,j)-inlonv)**2. + (projlat(i,j)-inlatv)**2.) 782 786 mindiffLl = MINVAL(difflonlat) 783 IF ( mindiffLl > maxdiffprojlonlat) THEN787 IF ( (mindiffLl > maxdiffprojlonlat) .AND. (mindiffLl > maxdiffinlonlat)) THEN 784 788 outLlw(3,:,i,j) = 0. 785 789 outLlw(3,:,i,j) = -1. … … 852 856 ! We do not want that values larger that the maximum distance between target grid points 853 857 ! PRINT *,i,j,':',mindiffLl,'maxdiffLl:',maxdiffprojlonlat 854 IF ( mindiffLl .gt. maxdiffprojlonlat) THEN858 IF ((mindiffLl .gt. maxdiffprojlonlat) .AND. (mindiffLl > maxdiffinlonlat)) THEN 855 859 ! PRINT *,' ' // TRIM(fname) // ': reprojected minimum distance to nearest grid point:', & 856 860 ! mindiffLl, ' larger than the maximum distance between grid points in target projection!!' … … 870 874 idimy, pdimx, pdimy) 871 875 ! Subroutine to interpolate a 2D variable 872 873 USE module_generic874 876 875 877 IMPLICIT NONE … … 949 951 idimy, pdimx, pdimy, d3) 950 952 ! Subroutine to interpolate a 3D variable 951 952 USE module_generic953 953 954 954 IMPLICIT NONE … … 1032 1032 idimy, pdimx, pdimy, d3, d4) 1033 1033 ! Subroutine to interpolate a 4D variable 1034 1035 USE module_generic1036 1034 1037 1035 IMPLICIT NONE … … 1119 1117 idimy, pdimx, pdimy, d3, d4, d5) 1120 1118 ! Subroutine to interpolate a 5D variable 1121 1122 USE module_generic1123 1119 1124 1120 IMPLICIT NONE … … 1211 1207 ! Subroutine which finds the closest grid point within a projection 1212 1208 1213 USE module_generic1214 1215 1209 IMPLICIT NONE 1216 1210 … … 1309 1303 Ninpts) 1310 1304 ! Subroutine which finds the closest grid point within a projection with 1D longitudes and latitudes 1311 1312 USE module_generic1313 1305 1314 1306 IMPLICIT NONE -
trunk/tools/module_generic.F90
r1313 r1355 8 8 ! Fill value at 64 bits 9 9 REAL(r_k) :: fillval64 = 1.e20 10 CHARACTER(len=50), PARAMETER :: errormsg = 'ERROR -- error -- ERROR -- error' 11 CHARACTER(len=50), PARAMETER :: warnmsg = 'WARNING -- warning -- WARNING -- warning' 10 12 11 13 CONTAINS
Note: See TracChangeset
for help on using the changeset viewer.