/[MITgcm]/MITgcm/verification/fizhi-gridalt-hs/code/update_ocean_exports.F
ViewVC logotype

Diff of /MITgcm/verification/fizhi-gridalt-hs/code/update_ocean_exports.F

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

revision 1.1 by molod, Fri Jun 4 16:20:00 2004 UTC revision 1.4 by molod, Thu Jun 16 15:09:42 2005 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
4    #include "FIZHI_OPTIONS.h"
5         subroutine update_ocean_exports (myTime, myIter, myThid)         subroutine update_ocean_exports (myTime, myIter, myThid)
6  c----------------------------------------------------------------------  c----------------------------------------------------------------------
7  c  Subroutine update_ocean_exports - 'Wrapper' routine to update  c  Subroutine update_ocean_exports - 'Wrapper' routine to update
8  c        the fields related to the ocean's surface that are needed  c        the fields related to the ocean's surface that are needed
9  c        by fizhi.  c        by fizhi (sst and sea ice extent).
 c        Also: Set up "bi, bj loop" and some timers and clocks here.  
10  c  c
11  c Call:  getsst  (Return the current sst field-read dataset if needed)  c Call:  getsst  (Return the current sst field-read dataset if needed)
12  c        getsice (Return the current sea ice field-read data if needed)  c        getsice (Return the current sea ice field-read data if needed)
13  c-----------------------------------------------------------------------  c-----------------------------------------------------------------------
14         implicit none         implicit none
 #include "CPP_OPTIONS.h"  
15  #include "SIZE.h"  #include "SIZE.h"
16  #include "GRID.h"  #include "GRID.h"
17  #include "ocean_coms.h"  #include "fizhi_ocean_coms.h"
18  #include "EEPARAMS.h"  #include "EEPARAMS.h"
19    #include "chronos.h"
20    
21         integer myTime, myIter, myThid         integer myIter, myThid
22           _RL myTime
23    
24         integer i, j, L, bi, bj         integer i, j, bi, bj, biglobal, bjglobal
25         integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2         integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2
26           integer nSxglobal, nSyglobal
27         im1 = 1-OLx         _RL        sstmin
28         im2 = sNx+OLx         parameter ( sstmin = 273.16 )
29         jm1 = 1-OLy  
30         jm2 = sNy+OLy         idim1 = 1-OLx
31         idim1 = 1         idim2 = sNx+OLx
32         idim2 = sNx         jdim1 = 1-OLy
33         jdim1 = 1         jdim2 = sNy+OLy
34         jdim2 = sNy         im1 = 1
35           im2 = sNx
36         do bj = myByLo(myThid), myByHi(myThid)         jm1 = 1
37         do bi = myBxLo(myThid), myBxHi(myThid)         jm2 = sNy
38           nSxglobal = nSx*nPx
39  c      call getsst         nSyglobal = nSy*nPy
40  c      call getsice  
41    C***********************************************************************
42    
43           DO BJ = myByLo(myThid),myByHi(myThid)
44           DO BI = myBxLo(myThid),myBxHi(myThid)
45    
46           biglobal=bi+(myXGlobalLo-1)/im2
47           bjglobal=bj+(myYGlobalLo-1)/jm2
48    
49           call getsst(ksst,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,nSx,
50         .  nSy,nSxglobal,nSyglobal,bi,bj,biglobal,bjglobal,nymd,nhms,sst)
51           call getsice(kice,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,nSx,
52         .  nSy,nSxglobal,nSyglobal,bi,bj,biglobal,bjglobal,nymd,nhms,sice)
53    
54    c Check for Minimum Open-Water SST
55    c --------------------------------
56           do j=jm1,jm2
57           do i=im1,im2
58           if(sice(i,j,bi,bj).eq.0.0 .and. sst(i,j,bi,bj).lt.sstmin)
59         .                                          sst(i,j,bi,bj) = sstmin
60         enddo         enddo
61         enddo         enddo
62    
63           ENDDO
64           ENDDO
65    
66         return         return
67         end         end
68    
69           subroutine getsice(iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,
70         .     nSumx,nSumy,nPgx,nPgy,bi,bj,biglobal,bjglobal,nymd,nhms,sice)
71    C************************************************************************
72    C
73    C!ROUTINE:      GETSICE
74    C!DESCRIPTION:  GETSICE returns the sea ice depth.
75    C!              This routine is adaptable for any frequency
76    C!              data upto a daily frequency.  
77    C!              note: for diurnal data ndmax should be increased.
78    C
79    C!INPUT PARAMETERS:
80    C!      iunit     Unit number assigned to the sice data file
81    C!      idim1     Start dimension in x-direction
82    C!      idim2     End dimension in x-direction
83    C!      jdim1     Start dimension in y-direction
84    C!      jdim2     End dimension in y-direction
85    C!      im1       Begin of x-direction span for filling sice
86    C!      im2       End of x-direction span for filling sice
87    C!      jm1       Begin of y-direction span for filling sice
88    C!      jm2       End of y-direction span for filling sice
89    C!      nSumx     Number of processors in x-direction (local processor)
90    C!      nSumy     Number of processors in y-direction (local processor)
91    C!      nPgx      Number of processors in x-direction (global)
92    C!      nPgx      Number of processors in y-direction (global)
93    C!      bi        Processor number in x-direction (local to processor)
94    C!      bj        Processor number in y-direction (local to processor)
95    C!      biglobal  Processor number in x-direction (global)
96    C!      bjglobal  Processor number in y-direction (global)
97    C!      nymd      YYMMDD of the current model timestep
98    C!      nhms      HHMMSS of the model time
99    C
100    C!OUTPUT PARAMETERS:
101    C!      sice(idim1:idim2,jdim1:jdim2,nSumx,nSumy) Sea ice depth in meters
102    C
103    C!ROUTINES CALLED:
104    C
105    C!      bcdata       Reads the data for a given unit number
106    C!      bcheader     Reads the header info for a given unit number
107    C!      interp_time  Returns weights for linear interpolation
108    C
109    C--------------------------------------------------------------------------
110    
111          implicit none
112    #include "SIZE.h"
113    
114          integer iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,nSumx,nSumy
115          integer nPgx,nPgy,bi,bj,biglobal,bjglobal,nymd,nhms
116    
117          _RL sice(idim1:idim2,jdim1:jdim2,nSumx,nSumy)
118    
119          integer i,j
120    
121          do j = jm1,jm2
122          do i = im1,im2
123           sice(i,j,bi,bj) = 0.
124          enddo
125          enddo
126    
127          return
128          end
129          subroutine getsst(iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,
130         .      nSumx,nSumy,nPgx,nPgy,bi,bj,biglobal,bjglobal,nymd,nhms,sst)
131    C************************************************************************
132    C
133    C!ROUTINE:      GETSST
134    C!DESCRIPTION:  GETSST gets the SST data.
135    C!              This routine is adaptable for any frequency
136    C!              data upto a daily frequency.  
137    C!              note: for diurnal data ndmax should be increased.
138    C
139    C!INPUT PARAMETERS:
140    C!      iunit     Unit number assigned to the sice data file
141    C!      idim1     Start dimension in x-direction
142    C!      idim2     End dimension in x-direction
143    C!      jdim1     Start dimension in y-direction
144    C!      jdim2     End dimension in y-direction
145    C!      im1       Begin of x-direction span for filling sice
146    C!      im2       End of x-direction span for filling sice
147    C!      jm1       Begin of y-direction span for filling sice
148    C!      jm2       End of y-direction span for filling sice
149    C!      nSumx     Number of processors in x-direction (local processor)
150    C!      nSumy     Number of processors in y-direction (local processor)
151    C!      nPgx      Number of processors in x-direction (global)
152    C!      nPgy      Number of processors in y-direction (global)
153    C!      bi        Processor number in x-direction (local to processor)
154    C!      bj        Processor number in y-direction (local to processor)
155    C!      biglobal  Processor number in x-direction (global)
156    C!      bjglobal  Processor number in y-direction (global)
157    C!      nymd      YYMMDD of the current model timestep
158    C!      nhms      HHMMSS of the model time
159    C
160    C!OUTPUT PARAMETERS:
161    C!      sst(idim1:idim2,jdim1:jdim2,nSumx,nSumy) Sea surface temperature (K)
162    C
163    C!ROUTINES CALLED:
164    C
165    C!      bcdata          Reads the data for a given unit number
166    C!      bcheader        Reads the header info for a given unit number
167    C!     interp_time   Returns weights for linear interpolation
168    C
169    C--------------------------------------------------------------------------
170    
171          implicit none
172    #include "SIZE.h"
173    
174          integer iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,nSumx,nSumy
175          integer nPgx,nPgy,bi,bj,biglobal,bjglobal,nymd,nhms
176    
177          _RL sst(idim1:idim2,jdim1:jdim2,nSumx,nSumy)
178    
179          integer i,j
180    
181          do j = jm1,jm2
182          do i = im1,im2
183           sst(i,j,bi,bj) = 280.
184          enddo
185          enddo
186    
187          return
188          end

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22