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

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

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

revision 1.1.4.4 by dimitri, Sun Jan 12 08:20:10 2003 UTC revision 1.1.4.5 by dimitri, Sun Feb 9 16:27:56 2003 UTC
# Line 58  c     == local variables == Line 58  c     == local variables ==
58    
59  c     == end of interface ==  c     == end of interface ==
60    
61          if ( climtempfile .NE. ' ' ) then
62    
63  #ifdef ALLOW_CLIM_CYCLIC  #ifdef ALLOW_CLIM_CYCLIC
64  c     record numbers are assumed 1 to 12 corresponding to  c     record numbers are assumed 1 to 12 corresponding to
65  c     Jan. through Dec.  c     Jan. through Dec.
66        call cal_GetMonthsRec(           call cal_GetMonthsRec(
67       O                       fac, first, changed,       O        fac, first, changed,
68       O                       count0, count1,       O        count0, count1,
69       I                       mycurrenttime, mycurrentiter, mythid       I        mycurrenttime, mycurrentiter, mythid
70       &                     )       &        )
71  #else  #else
72  c     get record numbers and interpolation factor for climtemp  c     get record numbers and interpolation factor for climtemp
73        call exf_GetFFieldRec(           call exf_GetFFieldRec(
74       I                       climtempstartdate, climtempperiod       I        climtempstartdate, climtempperiod
75       O                     , fac, first, changed       O        , fac, first, changed
76       O                     , count0, count1       O        , count0, count1
77       I                     , mycurrenttime, mycurrentiter, mythid       I        , mycurrenttime, mycurrentiter, mythid
78       &                     )       &        )
79  #endif  #endif
80    
81        if ( first ) then           if ( first ) then
82          if ( climtempfile .NE. ' ' )              call mdsreadfield( climtempfile, exf_clim_iprec
83       &        call mdsreadfield( climtempfile, exf_clim_iprec       &           , exf_clim_yftype, nr
84       &                   , exf_clim_yftype, nr       &           , climtemp1, count0, mythid
85       &                   , climtemp1, count0, mythid       &           )
86       &                   )              if (exf_clim_yftype .eq. 'RL') then
87          if (exf_clim_yftype .eq. 'RL') then                 call exf_filter_rl( climtemp1, climtempmask, mythid )
88             call exf_filter_rl( climtemp1, climtempmask, mythid )              else
89          else                 call exf_filter_rs( climtemp1, climtempmask, mythid )
90             call exf_filter_rs( climtemp1, climtempmask, mythid )              end if
91          end if           endif
92        endif  
93             if (( first ) .or. ( changed )) then
94        if (( first ) .or. ( changed )) then              call exf_SwapFFields_3d( climtemp0, climtemp1, mythid )
95          call exf_SwapFFields_3d( climtemp0, climtemp1, mythid )  
96                call mdsreadfield( climtempfile, exf_clim_iprec
97          if ( climtempfile .NE. ' ' )       &           , exf_clim_yftype, nr
98       &        call mdsreadfield( climtempfile, exf_clim_iprec       &           , climtemp1, count1, mythid
99       &                   , exf_clim_yftype, nr       &           )
100       &                   , climtemp1, count1, mythid              if (exf_clim_yftype .eq. 'RL') then
101       &                   )                 call exf_filter_rl( climtemp1, climtempmask, mythid )
102          if (exf_clim_yftype .eq. 'RL') then              else
103             call exf_filter_rl( climtemp1, climtempmask, mythid )                 call exf_filter_rs( climtemp1, climtempmask, mythid )
104          else              end if
105             call exf_filter_rs( climtemp1, climtempmask, mythid )           endif
         end if  
       endif  
106    
107  c     Loop over tiles.  c     Loop over tiles.
108        do bj = mybylo(mythid),mybyhi(mythid)           do bj = mybylo(mythid),mybyhi(mythid)
109          do bi = mybxlo(mythid),mybxhi(mythid)              do bi = mybxlo(mythid),mybxhi(mythid)
110            do k = 1,nr                 do k = 1,nr
111              do j = 1,sny                    do j = 1,sny
112                do i = 1,snx                       do i = 1,snx
113    
114  c             Set to freezing temperature if less  c     Set to freezing temperature if less
115                if (climtemp0(i,j,k,bi,bj) .lt. climtempfreeze) then                          if (climtemp0(i,j,k,bi,bj) .lt. climtempfreeze)
116                    climtemp0(i,j,k,bi,bj) = climtempfreeze       &                       climtemp0(i,j,k,bi,bj) = climtempfreeze
117                endif                          if (climtemp1(i,j,k,bi,bj) .lt. climtempfreeze)
118                if (climtemp1(i,j,k,bi,bj) .lt. climtempfreeze) then       &                       climtemp1(i,j,k,bi,bj) = climtempfreeze
119                    climtemp1(i,j,k,bi,bj) = climtempfreeze  
120                endif  c     Interpolate linearly onto the current time.
121                            climtemp(i,j,k,bi,bj) =
122  c             Interpolate linearly onto the current time.       &                       fac * climtemp0(i,j,k,bi,bj) +
123                climtemp(i,j,k,bi,bj) =       &                       (exf_one - fac) * climtemp1(i,j,k,bi,bj)
124       &             fac             *climtemp0(i,j,k,bi,bj)+  
125       &             (exf_one - fac) *climtemp1(i,j,k,bi,bj)                       enddo
126                      enddo
127                enddo                 enddo
128              enddo              enddo
129            enddo           enddo
130          enddo  
131        enddo        endif
132                    
133  #endif /* ALLOW_CLIMTEMP_RELAXATION */  #endif /* ALLOW_CLIMTEMP_RELAXATION */
134    

Legend:
Removed from v.1.1.4.4  
changed lines
  Added in v.1.1.4.5

  ViewVC Help
Powered by ViewVC 1.1.22