/[MITgcm]/MITgcm/pkg/fizhi/update_ocean_exports.F
ViewVC logotype

Diff of /MITgcm/pkg/fizhi/update_ocean_exports.F

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

revision 1.10 by molod, Sun Jul 18 23:17:00 2004 UTC revision 1.12 by molod, Tue Jul 20 16:24:49 2004 UTC
# Line 70  c -------------------------------- Line 70  c --------------------------------
70         end         end
71    
72         subroutine getsice(iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,         subroutine getsice(iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,
73       .           nSx,nSy,nPx,nPy,bi,bj,biglobal,bjglobal,nymd,nhms,sice)       .     nSumx,nSumy,nPgx,nPgy,bi,bj,biglobal,bjglobal,nymd,nhms,sice)
74  C************************************************************************  C************************************************************************
75  C  C
76  C!ROUTINE:      GETSICE  C!ROUTINE:      GETSICE
# Line 89  C!      im1       Begin of x-direction s Line 89  C!      im1       Begin of x-direction s
89  C!      im2       End of x-direction span for filling sice  C!      im2       End of x-direction span for filling sice
90  C!      jm1       Begin of y-direction span for filling sice  C!      jm1       Begin of y-direction span for filling sice
91  C!      jm2       End of y-direction span for filling sice  C!      jm2       End of y-direction span for filling sice
92  C!      nSx       Number of processors in x-direction (local processor)  C!      nSumx     Number of processors in x-direction (local processor)
93  C!      nSy       Number of processors in y-direction (local processor)  C!      nSumy     Number of processors in y-direction (local processor)
94  C!      nPx       Number of processors in x-direction (global)  C!      nPgx      Number of processors in x-direction (global)
95  C!      nPy       Number of processors in y-direction (global)  C!      nPgx      Number of processors in y-direction (global)
96  C!      bi        Processor number in x-direction (local to processor)  C!      bi        Processor number in x-direction (local to processor)
97  C!      bj        Processor number in y-direction (local to processor)  C!      bj        Processor number in y-direction (local to processor)
98  C!      biglobal  Processor number in x-direction (global)  C!      biglobal  Processor number in x-direction (global)
# Line 101  C!     nymd      YYMMDD of the current model ti Line 101  C!     nymd      YYMMDD of the current model ti
101  C!      nhms      HHMMSS of the model time  C!      nhms      HHMMSS of the model time
102  C  C
103  C!OUTPUT PARAMETERS:  C!OUTPUT PARAMETERS:
104  C!      sice(idim1:idim2,jdim1:jdim2,nSx,nSy) Sea ice depth in meters  C!      sice(idim1:idim2,jdim1:jdim2,nSumx,nSumy) Sea ice depth in meters
105  C  C
106  C!ROUTINES CALLED:  C!ROUTINES CALLED:
107  C  C
# Line 113  C--------------------------------------- Line 113  C---------------------------------------
113    
114        implicit none        implicit none
115  #include "CPP_EEOPTIONS.h"  #include "CPP_EEOPTIONS.h"
116    #include "SIZE.h"
117    
118        integer iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,nSx,nSy        integer iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,nSumx,nSumy
119        integer nPx,nPy,bi,bj,biglobal,bjglobal,nymd,nhms        integer nPgx,nPgy,bi,bj,biglobal,bjglobal,nymd,nhms
120    
121        _RL sice(idim1:idim2,jdim1:jdim2,nSx,nSy)        _RL sice(idim1:idim2,jdim1:jdim2,nSumx,nSumy)
122    
123  C Maximum number of dates in one year for the data  C Maximum number of dates in one year for the data
124        integer   ndmax        integer   ndmax
# Line 131  C Maximum number of dates in one year fo Line 132  C Maximum number of dates in one year fo
132        integer ndatebc,nhmsbc(ndmax), nhmsbc1, nhmsbc2,nrec        integer ndatebc,nhmsbc(ndmax), nhmsbc1, nhmsbc2,nrec
133        integer nymdbc(ndmax),nymdbc1,nymdbc2,nymdmod        integer nymdbc(ndmax),nymdbc1,nymdbc2,nymdmod
134    
135        real sicebc1(im2,jm2,nPx,nPy),sicebc2(im2,jm2,nPx,nPy)        real sicebc1(sNx,sNy,nSx*nPx,nSy*nPy)
136          real sicebc2(sNx,sNy,nSx*nPx,nSy*nPy)
137    
138  C--------- Variable Initialization ---------------------------------  C--------- Variable Initialization ---------------------------------
139    
140        data first /.true./        data first /.true./
141        data error /.false./        data error /.false./
142    
       save  
   
143  c  save header info  c  save header info
144  c     save imbc,jmbc,npxbc,npybc,lat0,lon0,ndatebc,undef,nymdbc,nhmsbc        save imbc,jmbc,npxbc,npybc,lat0,lon0,ndatebc,undef,nymdbc,nhmsbc
145  c     save nymdbc1, nymdbc2, nhmsbc1, nhmsbc2        save nymdbc1, nymdbc2, nhmsbc1, nhmsbc2
146  c     save first        save first
147  c     save sicebc1, sicebc2        save sicebc1, sicebc2
148    
149  c  this only works for between 1950-2050  c  this only works for between 1950-2050
150        if (nymd .lt. 500101) then        if (nymd .lt. 500101) then
# Line 177  C---------- Read in Header file -------- Line 177  C---------- Read in Header file --------
177    
178         close(iunit)         close(iunit)
179         open (iunit,form='unformatted',access='direct',         open (iunit,form='unformatted',access='direct',
180       .                                          recl=im2*jm2*nPx*nPy*4)       .                                         recl=im2*jm2*nPgx*nPgy*4)
181         nrec = 1         nrec = 1
182         call bcheader (iunit, ndmax, nrec,         call bcheader (iunit, ndmax, nrec,
183       .          cname, cdscrip, imbc, jmbc, npxbc, npybc, lat0, lon0,       .          cname, cdscrip, imbc, jmbc, npxbc, npybc, lat0, lon0,
# Line 192  C Check for correct data in boundary con Line 192  C Check for correct data in boundary con
192         endif         endif
193    
194  C Check Horizontal Resolution  C Check Horizontal Resolution
195         if(.not.error .and. imbc*jmbc*npxbc*npybc.ne.im2*jm2*npx*npy)then         if(.not.error.and.imbc*jmbc*npxbc*npybc.ne.im2*jm2*npgx*npgy)then
196          write(6,*) ' B.C. Resolution DOES NOT match Model Resolution!'          write(6,*) ' B.C. Resolution DOES NOT match Model Resolution!'
197          write(6,*) ' B.C. Resolution:  ',imbc*jmbc*npxbc*npybc          write(6,*) ' B.C. Resolution:  ',imbc*jmbc*npxbc*npybc
198          write(6,*) 'Model Resolution:  ',im2*jm2*npx*npy          write(6,*) 'Model Resolution:  ',im2*jm2*npgx*npgy
199          error = .true.          error = .true.
200         endif         endif
201    
# Line 265  c  from previous call to getsice then re Line 265  c  from previous call to getsice then re
265           nymdbc2 = nymdbc(nd)           nymdbc2 = nymdbc(nd)
266           nhmsbc1 = nhmsbc(nd-1)           nhmsbc1 = nhmsbc(nd-1)
267           nhmsbc2 = nhmsbc(nd)           nhmsbc2 = nhmsbc(nd)
268           call bcdata (iunit,imbc,jmbc,nPx,nPy,nd,nd+1,sicebc1,sicebc2)           call bcdata (iunit,imbc,jmbc,nPgx,nPgy,nd,nd+1,sicebc1,sicebc2)
269           found = .true.           found = .true.
270          else          else
271           nd = nd + 1           nd = nd + 1
# Line 317  C--------------------------------------- Line 317  C---------------------------------------
317        return        return
318        end        end
319        subroutine getsst(iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,        subroutine getsst(iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,
320       .            nSx,nSy,nPx,nPy,bi,bj,biglobal,bjglobal,nymd,nhms,sst)       .      nSumx,nSumy,nPgx,nPgy,bi,bj,biglobal,bjglobal,nymd,nhms,sst)
321  C************************************************************************  C************************************************************************
322  C  C
323  C!ROUTINE:      GETSST  C!ROUTINE:      GETSST
# Line 336  C!      im1       Begin of x-direction s Line 336  C!      im1       Begin of x-direction s
336  C!      im2       End of x-direction span for filling sice  C!      im2       End of x-direction span for filling sice
337  C!      jm1       Begin of y-direction span for filling sice  C!      jm1       Begin of y-direction span for filling sice
338  C!      jm2       End of y-direction span for filling sice  C!      jm2       End of y-direction span for filling sice
339  C!      nSx       Number of processors in x-direction (local processor)  C!      nSumx     Number of processors in x-direction (local processor)
340  C!      nSy       Number of processors in y-direction (local processor)  C!      nSumy     Number of processors in y-direction (local processor)
341  C!      nPx       Number of processors in x-direction (global)  C!      nPgx      Number of processors in x-direction (global)
342  C!      nPy       Number of processors in y-direction (global)  C!      nPgy      Number of processors in y-direction (global)
343  C!      bi        Processor number in x-direction (local to processor)  C!      bi        Processor number in x-direction (local to processor)
344  C!      bj        Processor number in y-direction (local to processor)  C!      bj        Processor number in y-direction (local to processor)
345  C!      biglobal  Processor number in x-direction (global)  C!      biglobal  Processor number in x-direction (global)
# Line 348  C!     nymd      YYMMDD of the current model ti Line 348  C!     nymd      YYMMDD of the current model ti
348  C!      nhms      HHMMSS of the model time  C!      nhms      HHMMSS of the model time
349  C  C
350  C!OUTPUT PARAMETERS:  C!OUTPUT PARAMETERS:
351  C!      sst(idim1:idim2,jdim1:jdim2,nSx,nSy) Sea surface temperature (K)  C!      sst(idim1:idim2,jdim1:jdim2,nSumx,nSumy) Sea surface temperature (K)
352  C  C
353  C!ROUTINES CALLED:  C!ROUTINES CALLED:
354  C  C
# Line 360  C--------------------------------------- Line 360  C---------------------------------------
360    
361        implicit none        implicit none
362  #include "CPP_EEOPTIONS.h"  #include "CPP_EEOPTIONS.h"
363    #include "SIZE.h"
364    
365        integer iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,nSx,nSy        integer iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,nSumx,nSumy
366        integer nPx,nPy,bi,bj,biglobal,bjglobal,nymd,nhms        integer nPgx,nPgy,bi,bj,biglobal,bjglobal,nymd,nhms
367    
368        _RL sst(idim1:idim2,jdim1:jdim2,nSx,nSy)        _RL sst(idim1:idim2,jdim1:jdim2,nSumx,nSumy)
369    
370  C Maximum number of dates in one year for the data  C Maximum number of dates in one year for the data
371        integer   ndmax        integer   ndmax
# Line 378  C Maximum number of dates in one year fo Line 379  C Maximum number of dates in one year fo
379        integer ndatebc,nhmsbc(ndmax), nhmsbc1, nhmsbc2,nrec        integer ndatebc,nhmsbc(ndmax), nhmsbc1, nhmsbc2,nrec
380        integer nymdbc(ndmax),nymdbc1,nymdbc2,nymdmod        integer nymdbc(ndmax),nymdbc1,nymdbc2,nymdmod
381    
382        real sstbc1(im2,jm2,nPx,nPy),sstbc2(im2,jm2,nPx,nPy)        real sstbc1(sNx,sNy,nSx*nPx,nSy*nPy)
383          real sstbc2(sNx,sNy,nSx*nPx,nSy*nPy)
384    
385  C--------- Variable Initialization ---------------------------------  C--------- Variable Initialization ---------------------------------
386    
# Line 386  C--------- Variable Initialization ----- Line 388  C--------- Variable Initialization -----
388        data error /.false./        data error /.false./
389    
390  c  save header info  c  save header info
391  c     save imbc,jmbc,npxbc,npybc,lat0,lon0,ndatebc,undef,nymdbc,nhmsbc        save imbc,jmbc,npxbc,npybc,lat0,lon0,ndatebc,undef,nymdbc,nhmsbc
392  c     save nymdbc1, nymdbc2, nhmsbc1, nhmsbc2        save nymdbc1, nymdbc2, nhmsbc1, nhmsbc2
393  c     save first        save first
394  c     save sstbc1, sstbc2        save sstbc1, sstbc2
395    
396  c  this only works for between 1950-2050  c  this only works for between 1950-2050
397        if (nymd .lt. 500101) then        if (nymd .lt. 500101) then
# Line 421  C---------- Read in Header file -------- Line 423  C---------- Read in Header file --------
423    
424         close(iunit)         close(iunit)
425         open (iunit,form='unformatted',access='direct',         open (iunit,form='unformatted',access='direct',
426       .                                          recl=im2*jm2*nPx*nPy*4)       .                                        recl=im2*jm2*nPgx*nPgy*4)
427         nrec = 1         nrec = 1
428         call bcheader (iunit, ndmax, nrec,         call bcheader (iunit, ndmax, nrec,
429       .          cname, cdscrip, imbc, jmbc, npxbc, npybc, lat0, lon0,       .          cname, cdscrip, imbc, jmbc, npxbc, npybc, lat0, lon0,
# Line 436  C Check for correct data in boundary con Line 438  C Check for correct data in boundary con
438         endif         endif
439    
440  C Check Horizontal Resolution  C Check Horizontal Resolution
441         if(.not.error .and. imbc*jmbc*npxbc*npybc.ne.im2*jm2*npx*npy)then         if(.not.error.and.imbc*jmbc*npxbc*npybc.ne.im2*jm2*npgx*npgy)then
442          write(6,*) ' B.C. Resolution DOES NOT match Model Resolution!'          write(6,*) ' B.C. Resolution DOES NOT match Model Resolution!'
443          write(6,*) ' B.C. Resolution:  ',imbc*jmbc*npxbc*npybc          write(6,*) ' B.C. Resolution:  ',imbc*jmbc*npxbc*npybc
444          write(6,*) 'Model Resolution:  ',im2*jm2*npx*npy          write(6,*) 'Model Resolution:  ',im2*jm2*npgx*npgy
445          error = .true.          error = .true.
446         endif         endif
447    
# Line 510  c  from previous call to getsst then rea Line 512  c  from previous call to getsst then rea
512           nymdbc2 = nymdbc(nd)           nymdbc2 = nymdbc(nd)
513           nhmsbc1 = nhmsbc(nd-1)           nhmsbc1 = nhmsbc(nd-1)
514           nhmsbc2 = nhmsbc(nd)           nhmsbc2 = nhmsbc(nd)
515           call bcdata (iunit,imbc,jmbc,nPx,nPy,nd,nd+1,sstbc1,sstbc2)           call bcdata (iunit,imbc,jmbc,nPgx,nPgy,nd,nd+1,sstbc1,sstbc2)
516           found = .true.           found = .true.
517          else          else
518           nd = nd + 1           nd = nd + 1
# Line 568  C!      field2(im,jm,nPx,nPy)  data fiel Line 570  C!      field2(im,jm,nPx,nPy)  data fiel
570  C  C
571  C--------------------------------------------------------------------------  C--------------------------------------------------------------------------
572        implicit none        implicit none
573    #include "PACKAGES_CONFIG.h"
574  #include "CPP_EEOPTIONS.h"  #include "CPP_EEOPTIONS.h"
575    
576        integer iunit,im,jm,nPx,nPy,nrec1,nrec2        integer iunit,im,jm,nPx,nPy,nrec1,nrec2
# Line 584  C--------- Read file ------------------- Line 587  C--------- Read file -------------------
587    
588        do n2=1,nPy        do n2=1,nPy
589        do n1=1,nPx        do n1=1,nPx
590    #ifdef _BYTESWAPIO
591          call MDS_BYTESWAPR4( im*jm, f1(1,1,n1,n2))
592          call MDS_BYTESWAPR4( im*jm, f2(1,1,n1,n2))
593    #endif
594        do j=1,jm        do j=1,jm
595        do i=1,im        do i=1,im
596         field1(i,j,n1,n2) = f1(i,j,n1,n2)         field1(i,j,n1,n2) = f1(i,j,n1,n2)
# Line 625  C!      error         logical TRUE if da Line 632  C!      error         logical TRUE if da
632  C  C
633  C--------------------------------------------------------------------------  C--------------------------------------------------------------------------
634        implicit none        implicit none
635    #include "PACKAGES_CONFIG.h"
636  #include "CPP_EEOPTIONS.h"  #include "CPP_EEOPTIONS.h"
637    
638        integer iunit, ndmax, nrec        integer iunit, ndmax, nrec
# Line 635  C--------------------------------------- Line 643  C---------------------------------------
643        real lat0,lon0,undef        real lat0,lon0,undef
644        logical error        logical error
645    
646        integer i,n        integer i
647        integer*4 im_32,jm_32,npx_32,npy_32        integer*4 im_32,jm_32,npx_32,npy_32
648        integer*4 ndatebc_32,nhmsbc_32(ndmax),nymdbc_32(ndmax)        integer*4 ndatebc_32,nhmsbc_32(ndmax),nymdbc_32(ndmax)
649        real*4 lat0_32,lon0_32,undef_32        real*4 lat0_32,lon0_32,undef_32
# Line 646  C--------- Read file ------------------- Line 654  C--------- Read file -------------------
654       .     im_32, jm_32, npx_32, npy_32, lat0_32, lon0_32,       .     im_32, jm_32, npx_32, npy_32, lat0_32, lon0_32,
655       .     ndatebc_32, undef_32,       .     ndatebc_32, undef_32,
656       .     (nymdbc_32(i), nhmsbc_32(i), i=1,ndatebc_32)       .     (nymdbc_32(i), nhmsbc_32(i), i=1,ndatebc_32)
657    #ifdef _BYTESWAPIO
658          call MDS_BYTESWAPR4( 1, lat0_32)
659          call MDS_BYTESWAPR4( 1, lon0_32)
660          call MDS_BYTESWAPR4( 1, undef_32)
661    #endif
662    
663        im = im_32        im = im_32
664        jm = jm_32        jm = jm_32

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.22