588 528 36161 10276 709 498 636 528 36161 10277 715 492 640 528 36161 10278 794 492 650 528 36161 10278 787 487 645 528 36161 10278 745 508 647 528 36161 10279 763 489 651 528 36161 10280 765 502 638 528 36161 10281 796 461 633 528 36161 10281 714 474 645 528 36161 10282 726 454 614 528 36161 10283 691 463 637 528 36161 10284 770 496 644 528 36161 10284 722 482 638 528 36161 10284 764 489 658 528 36161 10285 744 501 659 528 36161 10286 772 487 648 527 36161 10287 745 490 640 528 36161 10287 841 508 688 527 36161 10288 801 509 665 527 36161 10288 836 515 645 527 36161 10289 838 511 656 527 36161 10290 873 512 659 528 36161 10290 814 505 655 527 36161 10291 811 504 643 527 36161 10292 744 482 639 528 36161 10293 752 496 654 527 36161 10293 817 505 643 527 36161 10293 828 496 636 527 36161 10294 833 482 613 527 36161 10295 748 463 615 527 36161 10296 738 477 624 527 36161 10296 691 457 623 527 36161 10297 676 481 646 527 36161 10298 726 477 640 527 36161 10298 742 490 655 527 36161 10299 843 517 655 527 36161 10299 855 513 653 527 36161 10300 857 527 679 527 36161 10301 829 513 666 527 36161 10302 810 508 650 527 36161 10302 777 506 655 527 36161 10302 780 498 651 527 36161 10303 782 511 663 527 36161 10304 765 500 661 527 36161 10305 770 512 658 527 36161 10305 798 509 669 527 36161 10306 804 529 689 527 36161 10307 916 559 697 527 36161 10307 911 542 668 526 36161 10308 937 536 663 527 36161 10308 849 511 652 526 36161 10309 791 495 656 527 36161 10310 825 503 659 527 36161 10311 784 494 648 526 36161 10311 774 486 640 527 36161 10312 774 492 646 526 36161 10312 823 517 666 526 36161 10313 809 503 661 526 36161 10314 789 515 671 526 36161 10314 798 500 667 527 36161 10315 810 520 677 526 36161 10316 813 518 669 526 36161 10317 794 507 659 526 36161 10317 803 509 675 526 36161 10317 848 525 676 526 36161 10318 858 madtIlocblob(madtbwspblobbplist00  \WindowBounds[ShowSidebar]ShowStatusBar[ShowPathbar[ShowToolbar\SidebarWidth_{{1187, 193}, {931, 672}}  ".WvisibleUwidthYascendingd Ulabel@AB D FWvisibleUwidthYascendingK WversionHIJ  MWvisibleUwidthYascending XcommentsOPQ S UWvisibleUwidthYascending^dateLastOpenedWXYZ UwidthYascendingWvisibleYdateAdded##@*##@00BV^py *3;AKLMYbjpz{}~&'(1:BHRSUVent~bmadtlsvpblobbplist00 _`ab^_useRelativeDates_showIconPreview_calculateAllSizesWcolumns_scrollPositionYXtextSize_scrollPositionXZsortColumnXiconSize_viewOptionsVersion !)19AIQXXcomments^dateLastOpened[dateCreatedTsizeUlabelTkindWversionTname\dateModified  WvisibleUwidthYascendingUindex, "#$ & (WvisibleUwidthYascending*+, . 0WvisibleUwidthYascending234 6 8WvisibleUwidthYascending a:;< > @WvisibleUwidthYascendingd BCD F HWvisibleUwidthYascending s JKL N PWvisibleUwidthYascendingK RSTU UwidthYascendingWvisible YZ[ . ^WvisibleUwidthYascending ##@*##@00BV^py !)/9?@CDFOW]ghjkmv~  *+-.09?IQSTU^flvwxzcmadtvSrnlonguvIlocblobR(uvbwspblobbplist00  \WindowBounds[ShowSidebar]ShowStatusBar[ShowPathbar[ShowToolbar\SidebarWidth_{{1490, 706}, {931, 672}}  ".?@  CWvisibleUwidthYascendingYdateAdded#@( #@0.@T\ep "$%&/5789BJLMNW`cden}GuvlsvpblobWbplist00 E G_viewOptionsVersion_showIconPreview_calculateAllSizesWcolumnsXtextSizeZsortColumn_useRelativeDatesXiconSize  $).38=BXcomments^dateLastOpened[dateCreatedTsizeUlabelTkindWversionTname\dateModified UindexUwidthYascendingWvisible,  ! %& *+ a /0 d 45 s 9: K >?   &  #@( #@0.@T\ep(*,-.79;<=FHJKLUWYZ[dfhijsuwxyHuvvSrnlonghIlocblobF(hbwspblobbplist00  \WindowBounds[ShowSidebar]ShowStatusBar[ShowPathbar[ShowToolbar\SidebarWidth_{{1002, 189}, {1379, 1076}}  ".WvisibleUwidthYascendingd Ulabel@AB D FWvisibleUwidthYascendingK WversionHIJ L NWvisibleUwidthYascending, XcommentsPQR T VWvisibleUwidthYascending^dateLastOpenedXYZ[ UwidthYascendingWvisibleYdateAdded#@#@(# #@02DX`r{ +4<BLMNZckq{|~'(+,5>FLVWYZirxchlsvpblobbplist00 _`a c_viewOptionsVersion_showIconPreview_calculateAllSizesWcolumns_scrollPositionYXtextSize_scrollPositionXZsortColumn_useRelativeDatesXiconSize !)19AIQYXcommentsTname[dateCreatedTsizeUlabelTkindWversion^dateLastOpened\dateModified  WvisibleUwidthYascendingUindex, "#$%& UwidthYascendingWvisible *+, . 0WvisibleUwidthYascending234 6 8WvisibleUwidthYascending a:;< > @WvisibleUwidthYascendingd BCD F HWvisibleUwidthYascending s JKL N PWvisibleUwidthYascendingK RST V XWvisibleUwidthYascendingZ[\ . WvisibleUwidthYascending #@#@(# #@02DX`r{ "*0:@ADEGPV`hjmnox  ",-/02;CISTVWYbjpz{|dmadtvSrnlonguvIlocblobR(uvbwspblobbplist00  \WindowBounds[ShowSidebar]ShowStatusBar[ShowPathbar[ShowToolbar\SidebarWidth_{{1490, 706}, {931, 672}}  ".?@  CWvisibleUwidthYascendingYdateAdded#@( #@0.@T\ep "$%&/5789BJLMNW`cden}GuvlsvpblobWbplist00 E G_viewOptionsVersion_showIconPreview_calculateAllSizesWcolumnsXtextSizeZsortColumn_useRelativeDatesXiconSize  $).38=BXcomments^dateLastOpened[dateCreatedTsizeUlabelTkindWversionTname\dateModified UindexUwidthYascendingWvisible,  ! %& *+ a /0 d 45 s 9: K >?   &  #@( #@0.@T\ep(*,-.79;<=FHJKLUWYZ[dfhijsuwxyHuvvSrnlong0 E % DSDB`8@ @ @ew_calculateAllSizesWcolumns_scrollPositionYXtextSize_scrollPositionXZsortColumn_useRelativeDatesXiconSize !)19AIQYXcommentsTname[dateCreatedTsizeUlabelTkindWversion^dateLastOpened\dateModified  WvisibleUwidthYascendingUindex, "#$%& UwidthYascendingWvisible *+, . 0WvisibleUwidthYascending234 6 8WvisibleUwidthYascending a:;< > @WvisibleUwidthYascendingd BCD F HWvisibleUwidthYascending s JKL N PWvisibleUwidthYascendingK RST V XWvisibleUwidthYascendingZ[\ . WvisibleUwidthYascending #@#@(# #@02DX`r{ "*0:@ADEGPV`hjmnox  ",-/02;CIS parentarray(2,1,2),parentarray(2,2,2), & parentarray(3,1,2),parentarray(3,2,2), & parentarray(4,1,2),parentarray(4,2,2), & parentarray(5,1,2),parentarray(5,2,2)) CASE(6) CALL procname(tempP%var%array6, & parentarray(1,1,2),parentarray(1,2,2), & parentarray(2,1,2),parentarray(2,2,2), & parentarray(3,1,2),parentarray(3,2,2), & parentarray(4,1,2),parentarray(4,2,2), & parentarray(5,1,2),parentarray(5,2,2), & parentarray(6,1,2),parentarray(6,2,2)) END SELECT Call Agrif_ParentGrid_to_ChildGrid() ELSE Call Agrif_nbdim_VarEQvar(tempP%var, & parentarray(:,1,1),parentarray(:,2,1), & parent%var,parentarray(:,1,2),parentarray(:,2,2), & nbdim) ENDIF ENDIF #ifdef AGRIF_MPI tab3(:,1) = indminglob2(:) tab3(:,2) = indmaxglob2(:) tab3(:,3) = indmin(:) tab3(:,4) = indmax(:) C Call MPI_BARRIER(MPI_COMM_WORLD,code) C Call MPI_ALLGATHER(tab3,4*nbdim,MPI_INTEGER,tab4,4*nbdim, & MPI_INTEGER,MPI_COMM_WORLD,code) Allocate(tempPextend%var) DO k=0,Agrif_Nbprocs-1 do j=1,4 do i=1,nbdim tab4t(i,k,j) = tab4(i,j,k) enddo enddo enddo Call Get_External_Data(tempP,tempPextend,tab4t(:,:,1), & tab4t(:,:,2), & tab4t(:,:,3),tab4t(:,:,4),nbdim,member,memberin) #else tempPextend%var => tempP%var #endif C C IF (memberin) THEN allocate(tempC%var) C Call Agrif_nbdim_allocation(tempC%var,pttruetab,cetruetab,nbdim) C C C Special values on the parent grid if (Agrif_UseSpecialValue) then C noraftab(1:nbdim) = & child % var % root_var % interptab(1:nbdim) .EQ. 'N' C Allocate(parentvalues%var) C Call Agrif_nbdim_allocation & (parentvalues%var,indmin,indmax,nbdim) Call Agrif_nbdim_Full_VarEQvar & (parentvalues%var,tempPextend%var,nbdim) C Call Agrif_CheckMasknD(tempPextend, & parentvalues, & indmin(1:nbdim),indmax(1:nbdim), & indmin(1:nbdim),indmax(1:nbdim), & noraftab(1:nbdim),nbdim) C Call Agrif_nbdim_deallocation(parentvalues%var,nbdim) Deallocate(parentvalues%var) C C ENDIF C C C Interpolation of the current grid IF (memberin) THEN if ( nbdim .EQ. 1 ) then Call Agrif_Interp_1D_recursive(TypeInterp, & tempPextend%var%array1,tempC%var%array1, & indmin,indmax, & pttruetab,cetruetab, & s_Child_temp,s_Parent_temp, & ds_Child,ds_Parent,nbdim) elseif ( nbdim .EQ. 2 ) then Call Agrif_Interp_2D_recursive(TypeInterp, & tempPextend%var%array2,tempC%var%array2, & indmin,indmax, & pttruetab,cetruetab, & s_Child_temp,s_Parent_temp, & ds_Child,ds_Parent,nbdim) elseif ( nbdim .EQ. 3 ) then Call Agrif_Interp_3D_recursive(TypeInterp, & tempPextend%var%array3,tempC%var%array3, & indmin,indmax, & pttruetab,cetruetab, & s_Child_temp,s_Parent_temp, & ds_Child,ds_Parent,nbdim) elseif ( nbdim .EQ. 4 ) then Call Agrif_Interp_4D_recursive(TypeInterp, & tempPextend%var%array4,tempC%var%array4, & indmin,indmax, & pttruetab,cetruetab, & s_Child_temp,s_Parent_temp, & ds_Child,ds_Parent,nbdim) elseif ( nbdim .EQ. 5 ) then Call Agrif_Interp_5D_recursive(TypeInterp, & tempPextend%var%array5,tempC%var%array5, & indmin,indmax, & pttruetab,cetruetab, & s_Child_temp,s_Parent_temp, & ds_Child,ds_Parent,nbdim) elseif ( nbdim .EQ. 6 ) then Call Agrif_Interp_6D_recursive(TypeInterp, & tempPextend%var%array6,tempC%var%array6, & indmin,indmax, & pttruetab,cetruetab, & s_Child_temp,s_Parent_temp, & ds_Child,ds_Parent,nbdim) endif C C C Special values on the child grid if (Agrif_UseSpecialValueFineGrid) then C #ifdef AGRIF_MPI C Call GiveAgrif_SpecialValueToTab_mpi(child%var,tempC%var, & childarray, & pttruetab,cetruetab, & Agrif_SpecialValueFineGrid,nbdim) C #else C Call GiveAgrif_SpecialValueToTab(child%var,tempC%var, & pttruetab,cetruetab, & Agrif_SpecialValueFineGrid,nbdim) C #endif C C endif C Call Agrif_nbdim_Get_bound_dimension(child % var, & lowerbound,upperbound,nbdim) #ifdef AGRIF_MPI Call Agrif_GlobtoLocInd2(childarray, & lowerbound,upperbound, & pttruetab,cetruetab, & nbdim,Agrif_Procrank, & memberout) #else childarray(:,1,1) = pttruetab childarray(:,2,1) = cetruetab childarray(:,1,2) = pttruetab childarray(:,2,2) = cetruetab memberout = .TRUE. #endif endif C if (torestore) then C #ifdef AGRIF_MPI C if ( nbdim .EQ. 1 ) then do i = pttruetab(1),cetruetab(1) if (restore%var%restore1D(i) == 0) & child%var%array1(childarray(i,1,2) & ) = & tempC%var%array1(i) enddo endif C if ( nbdim .EQ. 2 ) then do j = pttruetab(2),cetruetab(2) do i = pttruetab(1),cetruetab(1) if (restore%var%restore2D(i,j) == 0) & child%var%array2(childarray(i,1,2), & childarray(j,2,2)) = & tempC%var%array2(i,j) enddo enddo endif C if ( nbdim .EQ. 3 ) then do k = pttruetab(3),cetruetab(3) do j = pttruetab(2),cetruetab(2) do i = pttruetab(1),cetruetab(1) if (restore%var%restore3D(i,j,k) == 0) & child%var%array3(childarray(i,1,2), & childarray(j,2,2), & childarray(k,3,2)) = & tempC%var%array3(i,j,k) enddo enddo enddo endif C if ( nbdim .EQ. 4 ) then do l = pttruetab(4),cetruetab(4) do k = pttruetab(3),cetruetab(3) do j = pttruetab(2),cetruetab(2) do i = pttruetab(1),cetruetab(1) if (restore%var%restore4D(i,j,k,l) == 0) & child%var%array4(childarray(i,1,2), & childarray(j,2,2), & childarray(k,3,2), & childarray(l,4,2)) = & tempC%var%array4(i,j,k,l) enddo enddo enddo enddo endif C if ( nbdim .EQ. 5 ) then do m = pttruetab(5),cetruetab(5) do l = pttruetab(4),cetruetab(4) do k = pttruetab(3),cetruetab(3) do j = pttruetab(2),cetruetab(2) do i = pttruetab(1),cetruetab(1) if (restore%var%restore5D(i,j,k,l,m) == 0) & child%var%array5(childarray(i,1,2), & childarray(j,2,2), & childarray(k,3,2), & childarray(l,4,2), & childarray(m,5,2)) = & tempC%var%array5(i,j,k,l,m) enddo enddo enddo enddo enddo endif C if ( nbdim .EQ. 6 ) then do n = pttruetab(6),cetruetab(6) do m = pttruetab(5),cetruetab(5) do l = pttruetab(4),cetruetab(4) do k = pttruetab(3),cetruetab(3) do j = pttruetab(2),cetruetab(2) do i = pttruetab(1),cetruetab(1) if (restore%var%restore6D(i,j,k,l,m,n) == 0) & child%var%array6(childarray(i,1,2), & childarray(j,2,2), & childarray(k,3,2), & childarray(l,4,2), & childarray(m,5,2), & childarray(n,6,2)) = & tempC%var%array6(i,j,k,l,m,n) enddo enddo enddo enddo enddo enddo endif C #else if ( nbdim .EQ. 1 ) then do i = pttruetab(1),cetruetab(1) if (restore%var%restore1D(i) == 0) & child % var % array1(i) = & tempC % var % array1(i) enddo endif C if ( nbdim .EQ. 2 ) then do j = pttruetab(2),cetruetab(2) do i = pttruetab(1),cetruetab(1) if (restore%var%restore2D(i,j) == 0) & child % var % array2(i,j) = & tempC % var % array2(i,j) enddo enddo endif C if ( nbdim .EQ. 3 ) then do k = pttruetab(3),cetruetab(3) do j = pttruetab(2),cetruetab(2) do i = pttruetab(1),cetruetab(1) if (restore%var%restore3D(i,j,k) == 0) & child % var % array3(i,j,k) = & tempC % var % array3(i,j,k) enddo enddo enddo endif C if ( nbdim .EQ. 4 ) then do l = pttruetab(4),cetruetab(4) do k = pttruetab(3),cetruetab(3) do j = pttruetab(2),cetruetab(2) do i = pttruetab(1),cetruetab(1) if (restore%var%restore4D(i,j,k,l) == 0) & child % var % array4(i,j,k,l) = & tempC % var % array4(i,j,k,l) enddo enddo enddo enddo endif C if ( nbdim .EQ. 5 ) then do m = pttruetab(5),cetruetab(5) do l = pttruetab(4),cetruetab(4) do k = pttruetab(3),cetruetab(3) do j = pttruetab(2),cetruetab(2) do i = pttruetab(1),cetruetab(1) if (restore%var%restore5D(i,j,k,l,m) == 0) & child % var % array5(i,j,k,l,m) = & tempC % var % array5(i,j,k,l,m) enddo enddo enddo enddo enddo endif C if ( nbdim .EQ. 6 ) then do n = pttruetab(6),cetruetab(6) do m = pttruetab(5),cetruetab(5) do l = pttruetab(4),cetruetab(4) do k = pttruetab(3),cetruetab(3) do j = pttruetab(2),cetruetab(2) do i = pttruetab(1),cetruetab(1) if (restore%var%restore6D(i,j,k,l,m,n) == 0) & child % var % array6(i,j,k,l,m,n) = & tempC % var % array6(i,j,k,l,m,n) enddo enddo enddo enddo enddo enddo endif C #endif C else C C IF (memberin) THEN SELECT CASE (nbdim) CASE (1) child%var%array1(childarray(1,1,2):childarray(1,2,2)) = & tempC%var%array1(childarray(1,1,1):childarray(1,2,1)) CASE (2) child%var%array2(childarray(1,1,2):childarray(1,2,2), & childarray(2,1,2):childarray(2,2,2)) = & tempC%var%array2(childarray(1,1,1):childarray(1,2,1), & childarray(2,1,1):childarray(2,2,1)) CASE (3) child%var%array3(childarray(1,1,2):childarray(1,2,2), & childarray(2,1,2):childarray(2,2,2), & childarray(3,1,2):childarray(3,2,2)) = & tempC%var%array3(childarray(1,1,1):childarray(1,2,1), & childarray(2,1,1):childarray(2,2,1), & childarray(3,1,1):childarray(3,2,1)) CASE (4) child%var%array4(childarray(1,1,2):childarray(1,2,2), & childarray(2,1,2):childarray(2,2,2), & childarray(3,1,2):childarray(3,2,2), & childarray(4,1,2):childarray(4,2,2)) = & tempC%var%array4(childarray(1,1,1):childarray(1,2,1), & childarray(2,1,1):childarray(2,2,1), & childarray(3,1,1):childarray(3,2,1), & childarray(4,1,1):childarray(4,2,1)) CASE (5) child%var%array5(childarray(1,1,2):childarray(1,2,2), & childarray(2,1,2):childarray(2,2,2), & childarray(3,1,2):childarray(3,2,2), & childarray(4,1,2):childarray(4,2,2), & childarray(5,1,2):childarray(5,2,2)) = & tempC%var%array5(childarray(1,1,1):childarray(1,2,1), & childarray(2,1,1):childarray(2,2,1), & childarray(3,1,1):childarray(3,2,1), & childarray(4,1,1):childarray(4,2,1), & childarray(5,1,1):childarray(5,2,1)) CASE (6) child%var%array6(childarray(1,1,2):childarray(1,2,2), & childarray(2,1,2):childarray(2,2,2), & childarray(3,1,2):childarray(3,2,2), & childarray(4,1,2):childarray(4,2,2), & childarray(5,1,2):childarray(5,2,2), & childarray(6,1,2):childarray(6,2,2)) = & tempC%var%array6(childarray(1,1,1):childarray(1,2,1), & childarray(2,1,1):childarray(2,2,1), & childarray(3,1,1):childarray(3,2,1), & childarray(4,1,1):childarray(4,2,1), & childarray(5,1,1):childarray(5,2,1), & childarray(6,1,1):childarray(6,2,1)) END SELECT ENDIF C C endif Call Agrif_nbdim_deallocation(tempPextend%var,nbdim) deallocate(tempPextend%var) Call Agrif_nbdim_deallocation(tempC%var,nbdim) Deallocate(tempC % var) ELSE deallocate(tempPextend%var) ENDIF C C C Deallocations #ifdef AGRIF_MPI IF (member) THEN Call Agrif_nbdim_deallocation(tempP%var,nbdim) Deallocate(tempP % var) ENDIF #endif C C C C End Subroutine Agrif_InterpnD C C C C C C ************************************************************************** CCC Subroutine Agrif_Parentbounds C ************************************************************************** C Subroutine Agrif_Parentbounds(TYPEinterp,nbdim,indmin,indmax, & s_Parent_temp, & s_Child_temp,s_Child,ds_Child, & s_Parent,ds_Parent, & pttruetab,cetruetab,pttab_Child, & pttab_Parent,posvar,interptab) C CCC Description: CCC Subroutine calculating the bounds of the parent grid for the interpolation CCC of the child grid C C C Declarations: C C #ifdef AGRIF_MPI C #include "mpif.h" C #endif C C Arguments INTEGER :: nbdim,TYPEinterp INTEGER,DIMENSION(nbdim) :: indmin,indmax REAL,DIMENSION(nbdim) :: s_Parent_temp,s_child_temp REAL,DIMENSION(nbdim) :: s_Child,ds_child REAL,DIMENSION(nbdim) :: s_Parent,ds_Parent INTEGER,DIMENSION(nbdim) :: pttruetab,cetruetab INTEGER,DIMENSION(nbdim) :: pttab_Child,pttab_Parent INTEGER,DIMENSION(nbdim) :: posvar CHARACTER(6), DIMENSION(nbdim) :: interptab C C Local variables INTEGER :: i INTEGER, DIMENSION(nbdim,2) :: lubglob2 REAL,DIMENSION(nbdim) :: dim_newmin,dim_newmax C #ifdef AGRIF_MPI INTEGER :: code INTEGER, DIMENSION(nbdim,2) :: lubglob #endif C C dim_newmin = s_Child + (pttruetab - pttab_Child) * ds_Child dim_newmax = s_Child + (cetruetab - pttab_Child) * ds_Child DO i = 1,nbdim C indmin(i) = pttab_Parent(i) + & agrif_int((dim_newmin(i)-s_Parent(i))/ds_Parent(i)) C indmax(i) = pttab_Parent(i) + & agrif_ceiling((dim_newmax(i)- & s_Parent(i))/ds_Parent(i)) C C C Necessary for the Quadratic interpolation C IF ((pttruetab(i) == cetruetab(i)) .AND. & (posvar(i) == 1)) THEN ELSEIF (interptab(i) .EQ. 'N') THEN ELSEIF ( TYPEinterp .eq. Agrif_ppm .or. & TYPEinterp .eq. Agrif_eno ) THEN indmin(i) = indmin(i) - 2 indmax(i) = indmax(i) + 2 ELSE IF( TYPEinterp .ne. Agrif_constant ) THEN indmin(i) = indmin(i) - 1 indmax(i) = indmax(i) + 1 ENDIF C ENDDO C s_Parent_temp = s_Parent + (indmin - pttab_Parent) * ds_Parent C s_Child_temp = s_Child + (pttruetab - pttab_Child) * ds_Child C C Return C C End Subroutine Agrif_Parentbounds C C C C ************************************************************************** CCC Subroutine Agrif_Interp_1D_Recursive C ************************************************************************** C Subroutine Agrif_Interp_1D_recursive(TypeInterp,tabin,tabout, & indmin,indmax, & pttab_child,petab_child, & s_child,s_parent,ds_child,ds_parent,nbdim) C CCC Description: CCC Subroutine for the interpolation of a 1D grid variable. CCC It calls Agrif_InterpBase. C C Declarations: C C C Arguments INTEGER :: nbdim INTEGER :: TypeInterp INTEGER, DIMENSION(nbdim) :: indmin,indmax INTEGER, DIMENSION(nbdim) :: pttab_child,petab_child REAL, DIMENSION(nbdim) :: s_child,s_parent REAL, DIMENSION(nbdim) :: ds_child,ds_parent REAL, DIMENSION(indmin(nbdim):indmax(nbdim)) :: tabin REAL, DIMENSION(pttab_child(nbdim):petab_child(nbdim)) :: tabout C C C Commentaire perso : nbdim vaut toujours 1 ici. C Call Agrif_InterpBase(TypeInterp, & tabin(indmin(nbdim):indmax(nbdim)), & tabout(pttab_child(nbdim):petab_child(nbdim)), & indmin(nbdim),indmax(nbdim), & pttab_child(nbdim),petab_child(nbdim), & s_parent(nbdim),s_child(nbdim), & ds_parent(nbdim),ds_child(nbdim)) C Return C C End Subroutine Agrif_Interp_1D_recursive C C C C ************************************************************************** CCC Subroutine Agrif_Interp_2D_Recursive C ************************************************************************** C Subroutine Agrif_Interp_2D_recursive(TypeInterp, & tabin,tabout, & indmin,indmax, & pttab_child,petab_child, & s_child, s_parent, & ds_child,ds_parent, & nbdim) C CCC Description: CCC Subroutine for the interpolation of a 2D grid variable. CCC It calls Agrif_Interp_1D_recursive and Agrif_InterpBase. C C Declarations: C C INTEGER :: nbdim INTEGER :: TypeInterp INTEGER, DIMENSION(nbdim) :: indmin,indmax INTEGER, DIMENSION(nbdim) :: pttab_child,petab_child REAL , DIMENSION(nbdim) :: s_child, s_parent REAL , DIMENSION(nbdim) :: ds_child,ds_parent REAL , DIMENSION( & indmin(nbdim-1):indmax(nbdim-1), & indmin(nbdim):indmax(nbdim) & ) :: tabin REAL , DIMENSION( & pttab_child(nbdim-1):petab_child(nbdim-1), & pttab_child(nbdim):petab_child(nbdim) & ) :: tabout C C Local variables REAL, DIMENSION(:,:), Allocatable :: tabtemp INTEGER i,j C C Allocate(tabtemp(pttab_child(nbdim-1):petab_child(nbdim-1), & indmin(nbdim):indmax(nbdim))) C C C Commentaire perso : nbdim vaut toujours 2 ici. C do j = indmin(nbdim),indmax(nbdim) C Call Agrif_Interp_1D_recursive(TypeInterp, & tabin(indmin(nbdim-1):indmax(nbdim-1),j), & tabtemp(pttab_child(nbdim-1):petab_child(nbdim-1),j), & indmin(1:nbdim-1),indmax(1:nbdim-1), & pttab_child(1:nbdim-1),petab_child(1:nbdim-1), & s_child(1:nbdim-1),s_parent(1:nbdim-1), & ds_child(1:nbdim-1),ds_parent(1:nbdim-1),nbdim-1) C enddo C do i=pttab_child(nbdim-1),petab_child(nbdim-1) C Call Agrif_InterpBase(TypeInterp, & tabtemp(i,indmin(nbdim):indmax(nbdim)), & tabout(i,pttab_child(nbdim):petab_child(nbdim)), & indmin(nbdim),indmax(nbdim), & pttab_child(nbdim),petab_child(nbdim), & s_parent(nbdim),s_child(nbdim), & ds_parent(nbdim),ds_child(nbdim)) C enddo C Deallocate(tabtemp) C Return C C End Subroutine Agrif_Interp_2D_recursive C C C C ************************************************************************** CCC Subroutine Agrif_Interp_3D_Recursive C ************************************************************************** C Subroutine Agrif_Interp_3D_recursive(TypeInterp,tabin,tabout, & indmin,indmax, & pttab_child,petab_child, & s_child,s_parent,ds_child,ds_parent,nbdim) C CCC Description: CCC Subroutine for the interpolation of a 3D grid variable. CCC It calls Agrif_Interp_2D_recursive and Agrif_InterpBase. C C Declarations: C C INTEGER :: nbdim INTEGER :: TypeInterp INTEGER, DIMENSION(nbdim) :: indmin,indmax INTEGER, DIMENSION(nbdim) :: pttab_child,petab_child REAL, DIMENSION(nbdim) :: s_child,s_parent,ds_child,ds_parent REAL, DIMENSION(indmin(nbdim-2):indmax(nbdim-2), & indmin(nbdim-1):indmax(nbdim-1), & indmin(nbdim) :indmax(nbdim)) :: tabin REAL, DIMENSION(pttab_child(nbdim-2):petab_child(nbdim-2), & pttab_child(nbdim-1):petab_child(nbdim-1), & pttab_child(nbdim):petab_child(nbdim)) :: tabout C C Local variables REAL, DIMENSION(:,:,:), Allocatable :: tabtemp INTEGER i,j,k C C Allocate(tabtemp(pttab_child(nbdim-2):petab_child(nbdim-2), & pttab_child(nbdim-1):petab_child(nbdim-1), & indmin(nbdim):indmax(nbdim))) C do k = indmin(nbdim),indmax(nbdim) C Call Agrif_Interp_2D_recursive(TypeInterp, & tabin(indmin(nbdim-2):indmax(nbdim-2), & indmin(nbdim-1):indmax(nbdim-1),k), & tabtemp(pttab_child(nbdim-2):petab_child(nbdim-2), & pttab_child(nbdim-1):petab_child(nbdim-1),k), & indmin(1:nbdim-1),indmax(1:nbdim-1), & pttab_child(1:nbdim-1),petab_child(1:nbdim-1), & s_child(1:nbdim-1),s_parent(1:nbdim-1), & ds_child(1:nbdim-1),ds_parent(1:nbdim-1),nbdim-1) C enddo C do j=pttab_child(nbdim-1),petab_child(nbdim-1) C do i=pttab_child(nbdim-2),petab_child(nbdim-2) C Call Agrif_InterpBase(TypeInterp, & tabtemp(i,j,indmin(nbdim):indmax(nbdim)), & tabout(i,j,pttab_child(nbdim):petab_child(nbdim)), & indmin(nbdim),indmax(nbdim), & pttab_child(nbdim),petab_child(nbdim), & s_parent(nbdim),s_child(nbdim), & ds_parent(nbdim),ds_child(nbdim)) C enddo C enddo C Deallocate(tabtemp) C Return C C End Subroutine Agrif_Interp_3D_recursive C C C C ************************************************************************** CCC Subroutine Agrif_Interp_4D_Recursive C ************************************************************************** C Subroutine Agrif_Interp_4D_recursive(TypeInterp,tabin,tabout, & indmin,indmax, & pttab_child,petab_child, & s_child,s_parent,ds_child,ds_parent,nbdim) C CCC Description: CCC Subroutine for the interpolation of a 4D grid variable. CCC It calls Agrif_Interp_3D_recursive and Agrif_InterpBase. C C Declarations: C C INTEGER :: nbdim INTEGER :: TypeInterp INTEGER, DIMENSION(nbdim) :: indmin,indmax INTEGER, DIMENSION(nbdim) :: pttab_child,petab_child REAL, DIMENSION(nbdim) :: s_child,s_parent,ds_child,ds_parent REAL, DIMENSION(indmin(nbdim-3):indmax(nbdim-3), & indmin(nbdim-2):indmax(nbdim-2), & indmin(nbdim-1):indmax(nbdim-1), & indmin(nbdim):indmax(nbdim)) :: tabin REAL, DIMENSION(pttab_child(nbdim-3):petab_child(nbdim-3), & pttab_child(nbdim-2):petab_child(nbdim-2), & pttab_child(nbdim-1):petab_child(nbdim-1), & pttab_child(nbdim):petab_child(nbdim)) :: tabout C C Local variables REAL, DIMENSION(:,:,:,:), Allocatable :: tabtemp INTEGER i,j,k,l C C Allocate(tabtemp(pttab_child(nbdim-3):petab_child(nbdim-3), & pttab_child(nbdim-2):petab_child(nbdim-2), & pttab_child(nbdim-1):petab_child(nbdim-1), & indmin(nbdim):indmax(nbdim))) C do l = indmin(nbdim),indmax(nbdim) C Call Agrif_Interp_3D_recursive(TypeInterp, & tabin(indmin(nbdim-3):indmax(nbdim-3), & indmin(nbdim-2):indmax(nbdim-2), & indmin(nbdim-1):indmax(nbdim-1),l), & tabtemp(pttab_child(nbdim-3):petab_child(nbdim-3), & pttab_child(nbdim-2):petab_child(nbdim-2), & pttab_child(nbdim-1):petab_child(nbdim-1),l), & indmin(1:nbdim-1),indmax(1:nbdim-1), & pttab_child(1:nbdim-1),petab_child(1:nbdim-1), & s_child(1:nbdim-1),s_parent(1:nbdim-1), & ds_child(1:nbdim-1),ds_parent(1:nbdim-1),nbdim-1) C enddo C do k = pttab_child(nbdim-1),petab_child(nbdim-1) C do j = pttab_child(nbdim-2),petab_child(nbdim-2) C do i = pttab_child(nbdim-3),petab_child(nbdim-3) C Call Agrif_InterpBase(TypeInterp, & tabtemp(i,j,k,indmin(nbdim):indmax(nbdim)), & tabout(i,j,k,pttab_child(nbdim):petab_child(nbdim)), & indmin(nbdim),indmax(nbdim), & pttab_child(nbdim),petab_child(nbdim), & s_parent(nbdim),s_child(nbdim), & ds_parent(nbdim),ds_child(nbdim)) C enddo C enddo C enddo C Deallocate(tabtemp) C Return C C End Subroutine Agrif_Interp_4D_recursive C C C C ************************************************************************** CCC Subroutine Agrif_Interp_5D_Recursive C ************************************************************************** C Subroutine Agrif_Interp_5D_recursive(TypeInterp,tabin,tabout, & indmin,indmax, & pttab_child,petab_child, & s_child,s_parent,ds_child,ds_parent,nbdim) C CCC Description: CCC Subroutine for the interpolation of a 5D grid variable. CCC It calls Agrif_Interp_4D_recursive and Agrif_InterpBase. C C Declarations: C C INTEGER :: nbdim INTEGER :: TypeInterp INTEGER, DIMENSION(nbdim) :: indmin,indmax INTEGER, DIMENSION(nbdim) :: pttab_child,petab_child REAL, DIMENSION(nbdim) :: s_child,s_parent,ds_child,ds_parent REAL, DIMENSION(indmin(nbdim-4):indmax(nbdim-4), & indmin(nbdim-3):indmax(nbdim-3), & indmin(nbdim-2):indmax(nbdim-2), & indmin(nbdim-1):indmax(nbdim-1), & indmin(nbdim):indmax(nbdim)) :: tabin REAL, DIMENSION(pttab_child(nbdim-4):petab_child(nbdim-4), & pttab_child(nbdim-3):petab_child(nbdim-3), & pttab_child(nbdim-2):petab_child(nbdim-2), & pttab_child(nbdim-1):petab_child(nbdim-1), & pttab_child(nbdim):petab_child(nbdim)) :: tabout C C Local variables REAL, DIMENSION(:,:,:,:,:), Allocatable :: tabtemp INTEGER i,j,k,l,m C C Allocate(tabtemp(pttab_child(nbdim-4):petab_child(nbdim-4), & pttab_child(nbdim-3):petab_child(nbdim-3), & pttab_child(nbdim-2):petab_child(nbdim-2), & pttab_child(nbdim-1):petab_child(nbdim-1), & indmin(nbdim):indmax(nbdim))) C do m = indmin(nbdim),indmax(nbdim) C Call Agrif_Interp_4D_recursive(TypeInterp, & tabin(indmin(nbdim-4):indmax(nbdim-4), & indmin(nbdim-3):indmax(nbdim-3), & indmin(nbdim-2):indmax(nbdim-2), & indmin(nbdim-1):indmax(nbdim-1),m), & tabtemp(pttab_child(nbdim-4):petab_child(nbdim-4), & pttab_child(nbdim-3):petab_child(nbdim-3), & pttab_child(nbdim-2):petab_child(nbdim-2), & pttab_child(nbdim-1):petab_child(nbdim-1),m), & indmin(1:nbdim-1),indmax(1:nbdim-1), & pttab_child(1:nbdim-1),petab_child(1:nbdim-1), & s_child(1:nbdim-1),s_parent(1:nbdim-1), & ds_child(1:nbdim-1),ds_parent(1:nbdim-1),nbdim-1) C enddo C do l = pttab_child(nbdim-1),petab_child(nbdim-1) C do k = pttab_child(nbdim-2),petab_child(nbdim-2) C do j = pttab_child(nbdim-3),petab_child(nbdim-3) C do i = pttab_child(nbdim-4),petab_child(nbdim-4) C Call Agrif_InterpBase(TypeInterp, & tabtemp(i,j,k,l,indmin(nbdim):indmax(nbdim)), & tabout(i,j,k,l, & pttab_child(nbdim):petab_child(nbdim)), & indmin(nbdim),indmax(nbdim), & pttab_child(nbdim),petab_child(nbdim), & s_parent(nbdim),s_child(nbdim), & ds_parent(nbdim),ds_child(nbdim)) C enddo C enddo C enddo C enddo C Deallocate(tabtemp) C Return C C End Subroutine Agrif_Interp_5D_recursive C C C C ******************************************************************** ****** CCC Subroutine Agrif_Interp_6D_Recursive C ************************************************************************** C Subroutine Agrif_Interp_6D_recursive(TypeInterp,tabin,tabout, & indmin,indmax, & pttab_child,petab_child, & s_child,s_parent,ds_child,ds_parent,nbdim) C CCC Description: CCC Subroutine for the interpolation of a 6D grid variable. CCC It calls Agrif_Interp_4D_recursive and Agrif_InterpBase. C C Declarations: C C INTEGER :: nbdim INTEGER :: TypeInterp INTEGER, DIMENSION(nbdim) :: indmin,indmax INTEGER, DIMENSION(nbdim) :: pttab_child,petab_child REAL, DIMENSION(nbdim) :: s_child,s_parent,ds_child,ds_parent REAL, DIMENSION(indmin(nbdim-5):indmax(nbdim-5), & indmin(nbdim-4):indmax(nbdim-4), & indmin(nbdim-3):indmax(nbdim-3), & indmin(nbdim-2):indmax(nbdim-2), & indmin(nbdim-1):indmax(nbdim-1), & indmin(nbdim):indmax(nbdim)) :: tabin REAL, DIMENSION(pttab_child(nbdim-5):petab_child(nbdim-5), & pttab_child(nbdim-4):petab_child(nbdim-4), & pttab_child(nbdim-3):petab_child(nbdim-3), & pttab_child(nbdim-2):petab_child(nbdim-2), & pttab_child(nbdim-1):petab_child(nbdim-1), & pttab_child(nbdim):petab_child(nbdim)) :: tabout C C Local variables REAL, DIMENSION(:,:,:,:,:,:), Allocatable :: tabtemp INTEGER i,j,k,l,m C C Allocate(tabtemp(pttab_child(nbdim-5):petab_child(nbdim-5), & pttab_child(nbdim-4):petab_child(nbdim-4), & pttab_child(nbdim-3):petab_child(nbdim-3), & pttab_child(nbdim-2):petab_child(nbdim-2), & pttab_child(nbdim-1):petab_child(nbdim-1), & indmin(nbdim):indmax(nbdim))) C do m = indmin(nbdim),indmax(nbdim) C Call Agrif_Interp_5D_recursive(TypeInterp, & tabin(indmin(nbdim-5):indmax(nbdim-5), & indmin(nbdim-4):indmax(nbdim-4), & indmin(nbdim-3):indmax(nbdim-3), & indmin(nbdim-2):indmax(nbdim-2), & indmin(nbdim-1):indmax(nbdim-1),m), & tabtemp(pttab_child(nbdim-5):petab_child(nbdim-5), & pttab_child(nbdim-4):petab_child(nbdim-4), & pttab_child(nbdim-3):petab_child(nbdim-3), & pttab_child(nbdim-2):petab_child(nbdim-2), & pttab_child(nbdim-1):petab_child(nbdim-1),m), & indmin(1:nbdim-1),indmax(1:nbdim-1), & pttab_child(1:nbdim-1),petab_child(1:nbdim-1), & s_child(1:nbdim-1),s_parent(1:nbdim-1), & ds_child(1:nbdim-1),ds_parent(1:nbdim-1),nbdim-1) C enddo C do m = pttab_child(nbdim-1),petab_child(nbdim-1) do l = pttab_child(nbdim-2),petab_child(nbdim-2) C do k = pttab_child(nbdim-3),petab_child(nbdim-3) C do j = pttab_child(nbdim-4),petab_child(nbdim-4) C do i = pttab_child(nbdim-5),petab_child(nbdim-5) C Call Agrif_InterpBase(TypeInterp, & tabtemp(i,j,k,l,m,indmin(nbdim):indmax(nbdim)), & tabout(i,j,k,l,m, & pttab_child(nbdim):petab_child(nbdim)), & indmin(nbdim),indmax(nbdim), & pttab_child(nbdim),petab_child(nbdim), & s_parent(nbdim),s_child(nbdim), & ds_parent(nbdim),ds_child(nbdim)) C enddo C enddo C enddo C enddo enddo C Deallocate(tabtemp) C Return C C End Subroutine Agrif_Interp_6D_recursive C C C C ************************************************************************** CCC Subroutine Agrif_InterpBase C ************************************************************************** C Subroutine Agrif_InterpBase(TypeInterp, & parenttab,childtab, & indmin,indmax,pttab_child,petab_child, & s_parent,s_child,ds_parent,ds_child) C CCC Description: CCC Subroutine calling the interpolation method chosen by the user (linear, CCC lagrange or spline). C C Declarations: C C INTEGER :: TypeInterp INTEGER :: indmin,indmax INTEGER :: pttab_child,petab_child REAL,DIMENSION(indmin:indmax) :: parenttab REAL,DIMENSION(pttab_child:petab_child) :: childtab REAL :: s_parent,s_child,ds_parent,ds_child C C IF ((indmin == indmax).AND.(pttab_child == petab_child)) THEN childtab(pttab_child) = parenttab(indmin) ELSEIF (TYPEinterp .EQ. AGRIF_LINEAR) then C C Linear interpolation Call linear1D & (parenttab,childtab, & indmax-indmin+1,petab_child-pttab_child+1, & s_parent,s_child,ds_parent,ds_child) C elseif (TYPEinterp .EQ. AGRIF_LAGRANGE) then C C Lagrange interpolation Call lagrange1D & (parenttab,childtab, & indmax-indmin+1,petab_child-pttab_child+1, & s_parent,s_child,ds_parent,ds_child) C elseif (TYPEinterp .EQ. AGRIF_ENO) then C C Eno interpolation Call eno1D & (parenttab,childtab, & indmax-indmin+1,petab_child-pttab_child+1, & s_parent,s_child,ds_parent,ds_child) C Else if (TYPEinterp .EQ. AGRIF_LINEARCONSERV) then C C Linear conservative interpolation Call linear1Dconserv & (parenttab,childtab, & indmax-indmin+1,petab_child-pttab_child+1, & s_parent,s_child,ds_parent,ds_child) C Else if (TYPEinterp .EQ. AGRIF_LINEARCONSERVLIM) then C C Linear conservative interpolation Call linear1Dconservlim & (parenttab,childtab, & indmax-indmin+1,petab_child-pttab_child+1, & s_parent,s_child,ds_parent,ds_child) C elseif (TYPEinterp .EQ. AGRIF_CONSTANT) then C Call constant1D & (parenttab,childtab, & indmax-indmin+1,petab_child-pttab_child+1, & s_parent,s_child,ds_parent,ds_child) C elseif ( TYPEinterp .EQ. AGRIF_PPM ) then Call ppm1D & (parenttab,childtab, & indmax-indmin+1,petab_child-pttab_child+1, & s_parent,s_child,ds_parent,ds_child) C endif C C End Subroutine Agrif_InterpBase C C End Module Agrif_Interpolation