/[MITgcm]/MITgcm/pkg/thsice/thsice_get_precip.F
ViewVC logotype

Diff of /MITgcm/pkg/thsice/thsice_get_precip.F

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

revision 1.3 by jmc, Tue Apr 23 16:34:24 2013 UTC revision 1.4 by jmc, Tue Jun 11 01:48:22 2013 UTC
# Line 3  C $Name$ Line 3  C $Name$
3    
4  #include "THSICE_OPTIONS.h"  #include "THSICE_OPTIONS.h"
5  #ifdef ALLOW_BULK_FORCE  #ifdef ALLOW_BULK_FORCE
6  #include "BULK_FORCE_OPTIONS.h"  # include "BULK_FORCE_OPTIONS.h"
7    #endif
8    #ifdef ALLOW_CHEAPAML
9    # include "CHEAPAML_OPTIONS.h"
10  #endif  #endif
11    
12  CBOP  CBOP
# Line 17  C     !DESCRIPTION: \bv Line 20  C     !DESCRIPTION: \bv
20  C     *==========================================================*  C     *==========================================================*
21  C     | S/R  THSICE_GET_PRECIP  C     | S/R  THSICE_GET_PRECIP
22  C     | Interface S/R : get Precip, Snow-precip  C     | Interface S/R : get Precip, Snow-precip
23  C     |                 and downward short-wave  C     |             and downward short-wave from pkg BULK_FORCE
24  C     |                 from pkg BULK_FORCE  C     |      - or - get Precip, Snow-precip from pkg cheapAML
 C     *==========================================================*  
25  C     *==========================================================*  C     *==========================================================*
26  C     \ev  C     \ev
27    
# Line 31  C     == Global data == Line 33  C     == Global data ==
33  #include "EEPARAMS.h"  #include "EEPARAMS.h"
34  #include "PARAMS.h"  #include "PARAMS.h"
35  #ifdef ALLOW_BULK_FORCE  #ifdef ALLOW_BULK_FORCE
36  #include "BULKF_PARAMS.h"  # include "BULKF_PARAMS.h"
37  #include "BULKF.h"  # include "BULKF.h"
38    #elif defined(ALLOW_CHEAPAML)
39    # include "CHEAPAML.h"
40  #endif  #endif
41    
42  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
# Line 60  C     myThid      :: Thread no. that cal Line 64  C     myThid      :: Thread no. that cal
64  CEOP  CEOP
65    
66  #ifdef ALLOW_THSICE  #ifdef ALLOW_THSICE
67  #ifdef ALLOW_BULK_FORCE  #if defined(ALLOW_BULK_FORCE) || defined(ALLOW_CHEAPAML)
68    
69  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
70  C     === Local variables ===  C     === Local variables ===
71  C     i,j   :: current grid point indices  C     i,j   :: current grid point indices
72        INTEGER i,j        INTEGER i,j
73    
74        DO j = jMin, jMax  #ifdef ALLOW_BULK_FORCE
75          IF ( useBulkforce ) THEN
76    
77           DO j = jMin, jMax
78          DO i = iMin, iMax          DO i = iMin, iMax
79            precip(i,j) = ( rain(i,j,bi,bj)+runoff(i,j,bi,bj) )*rhofw            precip(i,j) = ( rain(i,j,bi,bj)+runoff(i,j,bi,bj) )*rhofw
80            flxSW (i,j) = solar(i,j,bi,bj)            flxSW (i,j) = solar(i,j,bi,bj)
81          ENDDO          ENDDO
82        ENDDO         ENDDO
83    
84  c     IF ( SnowFile .NE. ' ' ) THEN  c      IF ( SnowFile .NE. ' ' ) THEN
85  c     ELSE  c      ELSE
86  C     If specific snow precipitiation is not available, use  C     If specific snow precipitiation is not available, use
87  C     precipitation when ever the air temperature is below 0 degC  C     precipitation when ever the air temperature is below 0 degC
88          DO j = jMin, jMax          DO j = jMin, jMax
# Line 86  C     precipitation when ever the air te Line 93  C     precipitation when ever the air te
93            ENDIF            ENDIF
94           ENDDO           ENDDO
95          ENDDO          ENDDO
96  c     ENDIF  c      ENDIF
97    
98        IF ( temp_EvPrRn .NE. UNSET_RL ) THEN         IF ( temp_EvPrRn .NE. UNSET_RL ) THEN
99  C--   Account for energy content of Precip + RunOff :  C--   Account for energy content of Precip + RunOff :
100  C     assume 1) rain has same temp as Air (higher altitude, e.g., 850.mb would  C     assume 1) rain has same temp as Air (higher altitude, e.g., 850.mb would
101  C      be better); 2) Snow has no heat capacity (+ is counted separately)  C      be better); 2) Snow has no heat capacity (+ is counted separately)
102  C     3) no distinction between sea-water Cp and fresh-water Cp  C     3) no distinction between sea-water Cp and fresh-water Cp
103  C     4) Run-Off comes at the temp of surface water (with same Cp)  C     4) Run-Off comes at the temp of surface water (with same Cp)
104         DO j = jMin, jMax          DO j = jMin, jMax
105          DO i = iMin, iMax           DO i = iMin, iMax
106           qPrcRnO(i,j) = HeatCapacity_Cp*(            qPrcRnO(i,j) = HeatCapacity_Cp*(
107       &           ( Tair(i,j,bi,bj) - Tf0kel - temp_EvPrRn )       &           ( Tair(i,j,bi,bj) - Tf0kel - temp_EvPrRn )
108       &          *( rain(i,j,bi,bj)*rhofw - snowPrc(i,j) )       &          *( rain(i,j,bi,bj)*rhofw - snowPrc(i,j) )
109       &         + ( locSST(i,j,bi,bj) - temp_EvPrRn )       &         + ( locSST(i,j,bi,bj) - temp_EvPrRn )
110       &          *runoff(i,j,bi,bj)*rhofw )       &          *runoff(i,j,bi,bj)*rhofw )
111             ENDDO
112            ENDDO
113           ENDIF
114    
115    C-    end if useBulkforce
116          ENDIF
117    
118          IF ( useCheapAML )
119         & STOP 'cannot use thsIce and CheapAML with BULK_FORCE compiled'
120    
121    #elif defined(ALLOW_CHEAPAML)
122          IF ( useCheapAML ) THEN
123    
124           DO j = jMin, jMax
125            DO i = iMin, iMax
126              precip(i,j) = cheapPrecip(i,j,bi,bj)
127    c    &                + runoff(i,j,bi,bj)*rhofw
128          ENDDO          ENDDO
129         ENDDO         ENDDO
130    
131    c      IF ( SnowFile .NE. ' ' ) THEN
132    c      ELSE
133    C     If specific snow precipitiation is not available, use
134    C     precipitation when ever the air temperature is below 0 degC
135            DO j = jMin, jMax
136             DO i = iMin, iMax
137              IF ( iceMsk(i,j,bi,bj).GT.0. _d 0
138         &      .AND. Tair(i,j,bi,bj).LT.zeroRL )  THEN
139                 snowPrc(i,j) = cheapPrecip(i,j,bi,bj)
140              ENDIF
141             ENDDO
142            ENDDO
143    c      ENDIF
144    
145           IF ( temp_EvPrRn .NE. UNSET_RL ) THEN
146    C--   Account for energy content of Precip + RunOff :
147    C     assume 1) rain has same temp as Air (higher altitude, e.g., 850.mb would
148    C      be better); 2) Snow has no heat capacity (+ is counted separately)
149    C     3) no distinction between sea-water Cp and fresh-water Cp
150            DO j = jMin, jMax
151             DO i = iMin, iMax
152              qPrcRnO(i,j) = HeatCapacity_Cp*
153         &           ( Tair(i,j,bi,bj) - temp_EvPrRn )
154         &          *( cheapPrecip(i,j,bi,bj) - snowPrc(i,j) )
155    c                      + HeatCapacity_Cp*
156    c    &           ( locSST(i,j,bi,bj) - temp_EvPrRn )
157    c    &          *runoff(i,j,bi,bj)*rhofw
158             ENDDO
159            ENDDO
160           ENDIF
161    
162    C-    end if useCheapAML
163        ENDIF        ENDIF
164    #endif /* if ALLOW_BULK_FORCE elif ALLOW_CHEAPAML */
165    
166  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
167    
168  #endif /* ALLOW_BULK_FORCE */  #endif /* ALLOW_BULK_FORCE or ALLOW_CHEAPAML */
169  #endif /* ALLOW_THSICE */  #endif /* ALLOW_THSICE */
170    
171        RETURN        RETURN

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

  ViewVC Help
Powered by ViewVC 1.1.22