New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 2671 for vendors/AGRIF/current/AGRIF_FILES/modinterpbasic.F – NEMO

Ignore:
Timestamp:
2011-03-08T15:08:49+01:00 (13 years ago)
Author:
rblod
Message:

Load working_directory into vendors/AGRIF/current.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendors/AGRIF/current/AGRIF_FILES/modinterpbasic.F

    r1901 r2671  
    11! 
    2 ! $Id: modinterpbasic.F 898 2008-04-22 15:35:20Z rblod $ 
     2! $Id: modinterpbasic.F 779 2007-12-22 17:04:17Z rblod $ 
    33! 
    44C     AGRIF (Adaptive Grid Refinement In Fortran) 
     
    113113           locind_parent_left = locind_parent_left + 1. 
    114114           globind_parent_right = globind_parent_right + 1. 
     115           ypos2 = ypos*invds+(i-1)*invds2            
    115116        endif 
    116117         
    117118        diff=(globind_parent_right - ypos2) 
    118          
    119119        y(i) = (diff*x(locind_parent_left) 
    120120     &        + (1.-diff)*x(locind_parent_left+1)) 
     
    170170      Real, Dimension(:,:), Allocatable :: coeffparent_tmp 
    171171      REAL    :: ypos,globind_parent_left,globind_parent_right 
    172       REAL    :: invds, invds2 
     172      REAL    :: invds, invds2, invds3 
    173173      REAL :: ypos2,diff 
    174174C 
     
    189189      invds = 1./ds_parent 
    190190      invds2 = ds_child/ds_parent 
     191      invds3 = 0.5/real(coeffraf) 
    191192 
    192193      ypos2 = ypos*invds 
     
    216217           locind_parent_left = locind_parent_left + 1 
    217218           globind_parent_right = globind_parent_right + 1. 
     219           ypos2 = ypos*invds+(i-1)*invds2 
    218220        endif 
    219          
     221 
    220222        diff=(globind_parent_right - ypos2) 
     223        diff = invds3*nint(2*coeffraf*diff) 
    221224        indparent(i,dir) = locind_parent_left 
     225 
    222226        coeffparent(i,dir) = diff 
    223227         
     
    238242C       
    239243       indparent(nc,dir) = locind_parent_left 
    240         
    241          coeffparent(nc,dir) = (globind_parent_left + ds_parent - ypos) 
     244       diff = (globind_parent_left + ds_parent - ypos) 
    242245     &       * invds 
    243       endif                                            
     246        diff = invds3*nint(2*coeffraf*diff) 
     247         coeffparent(nc,dir) = diff 
     248        endif                                            
    244249 
    245250      do i=2, np2 
     
    280285      INTEGER :: i,coeffraf,locind_parent_left 
    281286      REAL    :: ypos,globind_parent_left,globind_parent_right 
    282       REAL    :: invds, invds2 
     287      REAL    :: invds, invds2, invds3 
    283288      REAL :: ypos2,diff 
    284289C 
     
    305310      invds = 1./ds_parent 
    306311      invds2 = ds_child/ds_parent 
     312      invds3 = 0.5/real(coeffraf)       
    307313       
    308314      ypos2 = ypos*invds 
     
    323329           locind_parent_left = locind_parent_left + 1 
    324330           globind_parent_right = globind_parent_right + 1. 
     331           ypos2 = ypos*invds+(i-1)*invds2            
    325332        endif 
    326333         
    327334        diff=(globind_parent_right - ypos2) 
     335         
     336        diff = invds3*nint(2*coeffraf*diff) 
     337                 
    328338        indparent(i,1) = locind_parent_left 
     339 
    329340        coeffparent(i,1) = diff 
    330341        ypos2 = ypos2 + invds2 
     
    344355C       
    345356       indparent(nc,1) = locind_parent_left 
    346         
    347          coeffparent(nc,1) = (globind_parent_left + ds_parent - ypos) 
     357  
     358       diff = (globind_parent_left + ds_parent - ypos) 
    348359     &       * invds 
    349       endif                                           
     360        diff = invds3*nint(2*coeffraf*diff) 
     361         coeffparent(nc,1) = diff 
     362         endif                                           
    350363C            
    351364      Return 
     
    462475     &                        + (locind_parent_left - 1)*ds_parent  
    463476      
    464         deltax = invdsparent*(ypos-globind_parent_left) 
     477C        deltax = invdsparent*(ypos-globind_parent_left) 
     478        deltax = nint(coeffraf*deltax)/real(coeffraf) 
     479         
    465480        ypos = ypos + ds_child 
    466481         if (abs(deltax).LE.0.0001) then 
Note: See TracChangeset for help on using the changeset viewer.