/[MITgcm]/MITgcm/pkg/ecco/cost_readscatxfields.F
ViewVC logotype

Diff of /MITgcm/pkg/ecco/cost_readscatxfields.F

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

revision 1.1 by heimbach, Thu Nov 6 22:10:07 2003 UTC revision 1.2 by heimbach, Mon Oct 11 16:38:53 2004 UTC
# Line 58  c     == local variables == Line 58  c     == local variables ==
58        _RL spval        _RL spval
59        _RL vartile        _RL vartile
60    
61    cnew(
62          integer  il
63          integer mody, modm
64          integer iyear, imonth
65          character*(80) fnametmp
66          logical exst
67    cnew)
68    
69    c     == external functions ==
70    
71          integer  ilnblnk
72          external ilnblnk
73    
74  c     == end of interface ==  c     == end of interface ==
75    
76        parameter (spval = -1.8 )        parameter (spval = -1.8 )
# Line 72  ce    --> there is certainly a better pl Line 85  ce    --> there is certainly a better pl
85        imin = 1        imin = 1
86        imax = snx        imax = snx
87    
88        beginscatx = scatxstartdate(1)/10000  c      beginscatx = scatxstartdate(1)/10000
89        beginrun = modelstartdate(1)/10000  c      beginrun = modelstartdate(1)/10000
90        if ( beginscatx .eq. beginrun ) then  c      if ( beginscatx .eq. beginrun ) then
91          scatxrec = mod(modelstartdate(1)/100,100) -  c        scatxrec = mod(modelstartdate(1)/100,100) -
92       &           mod(scatxstartdate(1)/100,100) + irec  c     &           mod(scatxstartdate(1)/100,100) + irec
93        else  c      else
94          scatxrec = ( beginrun - beginscatx - 1)*nmonthyear +  c        scatxrec = ( beginrun - beginscatx - 1)*nmonthyear +
95       &           (nmonthyear - mod(scatxstartdate(1)/100,100) +  c     &           (nmonthyear - mod(scatxstartdate(1)/100,100) +
96       &            1) + mod(modelstartdate(1)/100,100) - 1 + irec  c     &            1) + mod(modelstartdate(1)/100,100) - 1 + irec
97    c      endif
98    
99    
100    cnew(
101          mody = modelstartdate(1)/10000
102          modm = modelstartdate(1)/100 - mody*100
103          iyear = mody + INT((modm-1+irec-1)/12)
104          imonth = 1 + MOD(modm-1+irec-1,12)
105    
106          il=ilnblnk(scatxdatfile)
107          write(fnametmp(1:80),'(2a,i4)')
108         &     scatxdatfile(1:il), '_', iyear
109          inquire( file=fnametmp, exist=exst )
110          if (.NOT. exst) then
111             write(fnametmp(1:80),'(a)') scatxdatfile(1:il)
112             imonth = irec
113        endif        endif
114    
115        if ( scatxrec .gt. 0 .and. scatxdatfile .ne. ' ' ) then        print *, 'ph-cost-scatx ', irec, imonth, iyear, fnametmp
116          call mdsreadfield( scatxdatfile, cost_iprec, cost_yftype, 1,        
117       &                   scatxdat, scatxrec, mythid )        call mdsreadfield( fnametmp, cost_iprec, cost_yftype, 1,
118        else       &                   scatxdat, imonth, mythid )
119           do bj = jtlo,jthi  cnew)
             do bi = itlo,ithi  
                do j = jmin,jmax  
                   do i = imin,imax  
                      scatxdat(i,j,bi,bj)=0. _d 0  
                   enddo  
                enddo  
             enddo  
          enddo  
       endif  
120    
121        nobs = 0        nobs = 0
122    
123        do bj = jtlo,jthi        do bj = jtlo,jthi
124          do bi = itlo,ithi          do bi = itlo,ithi
125            k = 1            k = 1
126            do j = jmin,jmax            do j = jmin,jmax
127              do i = imin,imax              do i = imin,imax
128                if (_hFacC(i,j,k,bi,bj) .eq. 0.) then                if (maskW(i,j,k,bi,bj) .eq. 0.) then
129                  scatxmask(i,j,bi,bj) = 0. _d 0                  scatxmask(i,j,bi,bj) = 0. _d 0
130                  else if (_hFacC(i,j,13,bi,bj) .eq. 0.) then
131                    scatxmask(i,j,bi,bj) = 0. _d 0
132                else                else
133                  scatxmask(i,j,bi,bj) = 1. _d 0                  scatxmask(i,j,bi,bj) = 1. _d 0
134                endif                endif

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

  ViewVC Help
Powered by ViewVC 1.1.22