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

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

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

revision 1.18 by jmc, Mon Apr 16 23:27:21 2007 UTC revision 1.24 by mlosch, Fri Jan 25 16:02:56 2008 UTC
# Line 111  c     Jan. through Dec. Line 111  c     Jan. through Dec.
111    
112           elseif ( genperiod .lt. 0 ) then           elseif ( genperiod .lt. 0 ) then
113              print *, 'genperiod is out of range'              print *, 'genperiod is out of range'
114              STOP 'ABNORMAL END: S/R EXF_GETFFIELDREC'              STOP 'ABNORMAL END: S/R EXF_SET_GEN'
115    
116           else           else
117  c     get record numbers and interpolation factor for gen  c     get record numbers and interpolation factor for gen
# Line 127  c     get record numbers and interpolati Line 127  c     get record numbers and interpolati
127           endif           endif
128    
129           if ( first ) then           if ( first ) then
130              if (useExfYearlyFields.and.genperiod.gt.0) then              call exf_GetYearlyFieldName(
131  C     Complete filename with YR or _YEAR extension       I         useExfYearlyFields, twoDigitYear, genperiod, year0,
132                 il = ilnblnk( genfile )       I         genfile,
133                 if (twoDigitYear) then       O         genfile0,
134                    if (year0.ge.2000) then       I         mytime, myiter, mythid )
                      write(genfile0(1:128),'(a,i2.2)')  
      &                    genfile(1:il),year0-2000  
                   else  
                      write(genfile0(1:128),'(a,i2.2)')  
      &                    genfile(1:il),year0-1900  
                   endif  
                else  
                   write(genfile0(1:128),'(2a,i4.4)')  
      &                 genfile(1:il),'_',year0  
                endif  
             else  
                genfile0 = genfile  
             endif  
   
135    
136  #ifdef USE_EXF_INTERPOLATION  #ifdef USE_EXF_INTERPOLATION
137              call exf_interp( genfile0, exf_iprec              call exf_interp( genfile0, exf_iprec
# Line 155  C     Complete filename with YR or _YEAR Line 141  C     Complete filename with YR or _YEAR
141       &           , gen_nlon,gen_nlat,interp_method,mythid       &           , gen_nlon,gen_nlat,interp_method,mythid
142       &           )       &           )
143  #else  #else
144                _BARRIER
145              call mdsreadfield( genfile0, exf_iprec, exf_yftype, 1              call mdsreadfield( genfile0, exf_iprec, exf_yftype, 1
146       &           , gen1, count0, mythid       &           , gen1, count0, mythid
147       &           )       &           )
148                _BARRIER
149  #endif /* USE_EXF_INTERPOLATION */  #endif /* USE_EXF_INTERPOLATION */
150    
151              if (exf_yftype .eq. 'RL') then              if (exf_yftype .eq. 'RL') then
# Line 170  C     Complete filename with YR or _YEAR Line 158  C     Complete filename with YR or _YEAR
158           if (( first ) .or. ( changed )) then           if (( first ) .or. ( changed )) then
159              call exf_SwapFFields( gen0, gen1, mythid )              call exf_SwapFFields( gen0, gen1, mythid )
160                            
161              if (useExfYearlyFields.and.genperiod.gt.0) then              call exf_GetYearlyFieldName(
162  C     Complete filename with YR or _YEAR extension       I         useExfYearlyFields, twoDigitYear, genperiod, year1,
163                 il = ilnblnk( genfile )       I         genfile,
164                 if (twoDigitYear) then       O         genfile1,
165                    if (year1.ge.2000) then       I         mytime, myiter, mythid )
166                       write(genfile1(1:128),'(a,i2.2)')  
      &                    genfile(1:il),year1-2000  
                   else  
                      write(genfile1(1:128),'(a,i2.2)')  
      &                    genfile(1:il),year1-1900  
                   endif  
                else  
                   write(genfile1(1:128),'(2a,i4.4)')  
      &                 genfile(1:il),'_',year1  
                endif  
             else  
                genfile1 = genfile  
             endif  
167  #ifdef USE_EXF_INTERPOLATION  #ifdef USE_EXF_INTERPOLATION
168              call exf_interp( genfile1, exf_iprec              call exf_interp( genfile1, exf_iprec
169       &           , gen1, count1, gen_xout, gen_yout       &           , gen1, count1, gen_xout, gen_yout
# Line 196  C     Complete filename with YR or _YEAR Line 172  C     Complete filename with YR or _YEAR
172       &           , gen_nlon,gen_nlat,interp_method,mythid       &           , gen_nlon,gen_nlat,interp_method,mythid
173       &           )       &           )
174  #else  #else
175                _BARRIER
176              call mdsreadfield( genfile1, exf_iprec, exf_yftype, 1              call mdsreadfield( genfile1, exf_iprec, exf_yftype, 1
177       &           , gen1, count1, mythid       &           , gen1, count1, mythid
178       &           )       &           )
179                _BARRIER
180  #endif /* USE_EXF_INTERPOLATION */  #endif /* USE_EXF_INTERPOLATION */
181    
182              if (exf_yftype .eq. 'RL') then              if (exf_yftype .eq. 'RL') then
# Line 221  c     Interpolate linearly onto the  tim Line 199  c     Interpolate linearly onto the  tim
199       &            genfld(i,j,bi,bj) -       &            genfld(i,j,bi,bj) -
200       &            exf_inscal_gen * ( genremove_intercept +       &            exf_inscal_gen * ( genremove_intercept +
201       &            genremove_slope*(mytime-starttime) )       &            genremove_slope*(mytime-starttime) )
                   enddo  
                enddo  
202              enddo              enddo
203               enddo
204              enddo
205           enddo           enddo
206    
207        endif        endif
208    
209        end        RETURN
210          END
211    
212  C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
213  C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Line 322  c     == end of interface == Line 300  c     == end of interface ==
300       &        , gen_nlon,gen_nlat,interp_method,mythid       &        , gen_nlon,gen_nlat,interp_method,mythid
301       &        )       &        )
302  #else  #else
303             _BARRIER
304           call mdsreadfield( genfile, exf_iprec, exf_yftype, 1           call mdsreadfield( genfile, exf_iprec, exf_yftype, 1
305       &        , genfld, count, mythid       &        , genfld, count, mythid
306       &        )       &        )
307             _BARRIER
308  #endif /* USE_EXF_INTERPOLATION */  #endif /* USE_EXF_INTERPOLATION */
309    
310           if (exf_yftype .eq. 'RL') then           if (exf_yftype .eq. 'RL') then
# Line 333  c     == end of interface == Line 313  c     == end of interface ==
313              call exf_filter_rs( genfld, genmask, mythid )              call exf_filter_rs( genfld, genmask, mythid )
314           end if           end if
315    
316  c     Loop over tiles.  c     Loop over tiles and scale genfld
317           do bj = mybylo(mythid),mybyhi(mythid)           do bj = mybylo(mythid),mybyhi(mythid)
318              do bi = mybxlo(mythid),mybxhi(mythid)              do bi = mybxlo(mythid),mybxhi(mythid)
319                 do j = 1,sny                 do j = 1,sny
320                    do i = 1,snx                    do i = 1,snx
 c     Interpolate linearly onto the  time.  
321                       genfld(i,j,bi,bj) =                       genfld(i,j,bi,bj) =
322       &                    exf_inscal_gen * genfld(i,j,bi,bj)       &                    exf_inscal_gen * genfld(i,j,bi,bj)
323                    enddo                    enddo
# Line 348  c     Interpolate linearly onto the  tim Line 327  c     Interpolate linearly onto the  tim
327    
328        endif        endif
329    
330        end        RETURN
331          END

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.24

  ViewVC Help
Powered by ViewVC 1.1.22