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

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

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

revision 1.1 by gforget, Tue Apr 13 06:57:33 2010 UTC revision 1.2 by gforget, Tue Apr 13 16:24:50 2010 UTC
# Line 53  c -------------- Line 53  c --------------
53        SOLC   = 1368. _d 0        SOLC   = 1368. _d 0
54    
55         DO bj = myByLo(myThid),myByHi(myThid)         DO bj = myByLo(myThid),myByHi(myThid)
56          DO bi = myBxLo(myThid),myBxHi(myThid)                    DO bi = myBxLo(myThid),myBxHi(myThid)
57           DO iLat=1,181           DO iLat=1,181
58            DO iTyear=1,366            DO iTyear=1,366
59    
60          LLLAT=(iLat-91. _d 0)          LLLAT=(iLat-91. _d 0)
61          TYEAR=(iTyear-1. _d 0)/365. _d 0          TYEAR=(iTyear-1. _d 0)/365. _d 0
62    
63  c determine solar declination  c determine solar declination
64  c ---------------------------  c ---------------------------
# Line 89  c       (formula from Hartmann textbook, Line 89  c       (formula from Hartmann textbook,
89       &         + 0.000077 _d 0 * sin ( 2. _d 0 * ALPHA )       &         + 0.000077 _d 0 * sin ( 2. _d 0 * ALPHA )
90    
91          tmpINT1=0. _d 0          tmpINT1=0. _d 0
92          tmpINT2=0. _d 0                      tmpINT2=0. _d 0    
93          DO iTday=1,100          DO iTday=1,100
94              TDAY=iTday/100. _d 0                                      TDAY=iTday/100. _d 0
95  c determine DAILY VARYING cos of solar zenith angle CZEN  c determine DAILY VARYING cos of solar zenith angle CZEN
96  c ------------------------------------------------------  c ------------------------------------------------------
97              CZEN = TMPA + TMPB *              CZEN = TMPA + TMPB *
98       &         cos( 2. _d 0 *PI* TDAY + 0. _d 0 * deg2rad )       &         cos( 2. _d 0 *PI* TDAY + 0. _d 0 * deg2rad )
99              if ( CZEN .LE.0 ) CZEN = 0. _d 0              if ( CZEN .LE.0 ) CZEN = 0. _d 0
100  c compute incoming flux at the top of the atm.:  c compute incoming flux at the top of the atm.:
101  c ---------------------------------------------  c ---------------------------------------------
102              FSOL = SOLC * dD0dDsq * MAX( 0. _d 0, CZEN )              FSOL = SOLC * dD0dDsq * MAX( 0. _d 0, CZEN )
# Line 110  c accumulate averages Line 110  c accumulate averages
110  c -------------------  c -------------------
111              tmpINT1=tmpINT1+FSOL*ALBSEA1/100. _d 0              tmpINT1=tmpINT1+FSOL*ALBSEA1/100. _d 0
112              tmpINT2=tmpINT2+FSOL/100. _d 0              tmpINT2=tmpINT2+FSOL/100. _d 0
113          ENDDO           ENDDO
114  c compute weighted average of albedo  c compute weighted average of albedo
115  c ----------------------------------  c ----------------------------------
116          if ( 0.5 _d 0 * tmpINT2 .GT. tmpINT1) then           if ( 0.5 _d 0 * tmpINT2 .GT. tmpINT1) then
117            zen_albedo_table(iTyear,iLat,bi,bj)=tmpINT1/tmpINT2              zen_albedo_table(iTyear,iLat,bi,bj)=tmpINT1/tmpINT2
118          else           else
119            zen_albedo_table(iTyear,iLat,bi,bj)=0.5 _d 0              zen_albedo_table(iTyear,iLat,bi,bj)=0.5 _d 0
120          endif           endif
121    
122            ENDDO            ENDDO
123           ENDDO           ENDDO
# Line 128  c ---------------------------------- Line 128  c ----------------------------------
128    
129  c determine interpolation coefficient for each grid point  c determine interpolation coefficient for each grid point
130         DO bj = myByLo(myThid),myByHi(myThid)         DO bj = myByLo(myThid),myByHi(myThid)
131          DO bi = myBxLo(myThid),myBxHi(myThid)                    DO bi = myBxLo(myThid),myBxHi(myThid)
132           DO j = 1,sNy           DO j = 1,sNy
133            DO i = 1,sNx            DO i = 1,sNx
134             LLLAT=yC(i,j,bi,bj)+91. _d 0             LLLAT=yC(i,j,bi,bj)+91. _d 0
135  c ensure that it is in valid range                  c ensure that it is in valid range  
136             LLLAT=max(LLLAT, 1._d 0)             LLLAT=max(LLLAT, 1._d 0)
137             LLLAT=min(LLLAT, 181._d 0)             LLLAT=min(LLLAT, 181._d 0)
138  c store  c store
139             zen_albedo_pointer(i,j,bi,bj)=LLLAT             zen_albedo_pointer(i,j,bi,bj)=LLLAT
140            ENDDO            ENDDO

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

  ViewVC Help
Powered by ViewVC 1.1.22