/[MITgcm]/MITgcm/pkg/exf/exf_interp.F
ViewVC logotype

Diff of /MITgcm/pkg/exf/exf_interp.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.8 by dimitri, Tue Sep 28 15:40:10 2004 UTC revision 1.9 by heimbach, Sat Apr 30 16:20:40 2005 UTC
# Line 73  C subroutine variables Line 73  C subroutine variables
73        _RL           lat_0, lat_inc(ny_in-1)        _RL           lat_0, lat_inc(ny_in-1)
74        integer       method, mythid        integer       method, mythid
75    
 C Functions  
       integer MDS_RECLEN  
   
76  C local variables  C local variables
       integer  ierr, length_of_rec  
77        real*8   ne_fac,nw_fac,se_fac,sw_fac        real*8   ne_fac,nw_fac,se_fac,sw_fac
78        integer  e_ind(snx,sny),w_ind(snx,sny)        integer  e_ind(snx,sny),w_ind(snx,sny)
79        integer  n_ind(snx,sny),s_ind(snx,sny)        integer  n_ind(snx,sny),s_ind(snx,sny)
# Line 87  C local variables Line 83  C local variables
83        real*4   arrayin(-1:nx_in+2 ,      -1:ny_in+2)        real*4   arrayin(-1:nx_in+2 ,      -1:ny_in+2)
84        real*8   x_in   (-1:nx_in+2), y_in(-1:ny_in+2)        real*8   x_in   (-1:nx_in+2), y_in(-1:ny_in+2)
85        integer  i, j, k, l, js, bi, bj, sp, interp_unit        integer  i, j, k, l, js, bi, bj, sp, interp_unit
       real*4   global(nx_in,ny_in)  
   
       _BEGIN_MASTER( myThid )  
   
 C check input arguments  
        if ( .NOT. (filePrec .EQ. 32) )  
      &     stop 'stop in exf_interp.F: value of filePrec not allowed'  
   
 C read in input data  
 #ifdef ALLOW_USE_MPI  
        if (useSingleCPUIO) then  
86    
87  C master thread of process 0, only, opens a global file         call exf_interp_read(
88          IF( mpiMyId .EQ. 0 ) THEN       I   infile,
89           call mdsfindunit( interp_unit, mythid)       I   filePrec,
90           length_of_rec=MDS_RECLEN( filePrec, nx_in*ny_in, mythid )       O   arrayin,
91           open(interp_unit,file=infile,status='old',access='direct',       I   irecord, xG, yG,
92       &        recl=length_of_rec)       I   lon_0, lon_inc,
93           read(interp_unit,rec=irecord)       I   lat_0, lat_inc,
94       &        ((global(i,j),i=1,nx_in),j=1,ny_in)       I   nx_in, ny_in, method, mythid)
          close(interp_unit)  
         ENDIF  
95    
96  C broadcast to all processes        _BEGIN_MASTER( myThid )
         call MPI_BCAST(global,nx_in*ny_in,MPI_REAL,  
      &       0,MPI_COMM_MODEL,ierr)  
         do j=1,ny_in  
          do i=1,nx_in  
           arrayin(i,j)=global(i,j)  
          enddo  
         enddo  
   
        else  
 #endif /* ALLOW_USE_MPI */  
   
         call mdsfindunit( interp_unit, mythid)  
         length_of_rec=MDS_RECLEN( filePrec, nx_in*ny_in, mythid )  
         open(interp_unit,file=infile,status='old',access='direct',  
      &       recl=length_of_rec)  
         read(interp_unit,rec=irecord)  
      &       ((arrayin(i,j),i=1,nx_in),j=1,ny_in)  
         close(interp_unit)  
   
 #ifdef ALLOW_USE_MPI  
        endif  
 #endif /* ALLOW_USE_MPI */  
   
 #ifdef _BYTESWAPIO  
        call MDS_BYTESWAPR4((nx_in+4)*(ny_in+4), arrayin )  
 #endif /* _BYTESWAPIO */  
97    
98  C setup input grid  C setup input grid
99         do i=-1,nx_in+2         do i=-1,nx_in+2

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.22