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 |
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) |
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 |
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 |
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 |
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, |
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 |
|
|
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 |
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 |
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) |
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 |
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 |
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 |
|
|
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 |
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, |
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 |
|
|
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 |
637 |
real lat0,lon0,undef |
real lat0,lon0,undef |
638 |
logical error |
logical error |
639 |
|
|
640 |
integer i,n |
integer i |
641 |
integer*4 im_32,jm_32,npx_32,npy_32 |
integer*4 im_32,jm_32,npx_32,npy_32 |
642 |
integer*4 ndatebc_32,nhmsbc_32(ndmax),nymdbc_32(ndmax) |
integer*4 ndatebc_32,nhmsbc_32(ndmax),nymdbc_32(ndmax) |
643 |
real*4 lat0_32,lon0_32,undef_32 |
real*4 lat0_32,lon0_32,undef_32 |