Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:44:29 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
2d104ee1fd Jean*0001 #include "THSICE_OPTIONS.h"
                0002 #ifdef ALLOW_BULK_FORCE
147f2f3fa7 Jean*0003 # include "BULK_FORCE_OPTIONS.h"
                0004 #endif
                0005 #ifdef ALLOW_CHEAPAML
                0006 # include "CHEAPAML_OPTIONS.h"
2d104ee1fd Jean*0007 #endif
                0008 
                0009 CBOP
                0010 C     !ROUTINE: THSICE_GET_PRECIP
                0011 C     !INTERFACE:
                0012       SUBROUTINE THSICE_GET_PRECIP(
e22ef29cc8 Jean*0013      I                  iceMsk, locSST,
                0014      O                  precip, snowPrc, qPrcRnO, flxSW,
2d104ee1fd Jean*0015      I                  iMin,iMax,jMin,jMax, bi,bj, myThid )
                0016 C     !DESCRIPTION: \bv
                0017 C     *==========================================================*
                0018 C     | S/R  THSICE_GET_PRECIP
7f3e8d8dce Jean*0019 C     | Interface S/R : get Precip, Snow-precip
147f2f3fa7 Jean*0020 C     |             and downward short-wave from pkg BULK_FORCE
                0021 C     |      - or - get Precip, Snow-precip from pkg cheapAML
2d104ee1fd Jean*0022 C     *==========================================================*
                0023 C     \ev
                0024 
                0025 C     !USES:
                0026       IMPLICIT NONE
                0027 
                0028 C     == Global data ==
                0029 #include "SIZE.h"
                0030 #include "EEPARAMS.h"
e22ef29cc8 Jean*0031 #include "PARAMS.h"
2d104ee1fd Jean*0032 #ifdef ALLOW_BULK_FORCE
147f2f3fa7 Jean*0033 # include "BULKF_PARAMS.h"
                0034 # include "BULKF.h"
                0035 #elif defined(ALLOW_CHEAPAML)
                0036 # include "CHEAPAML.h"
2d104ee1fd Jean*0037 #endif
                0038 
                0039 C     !INPUT/OUTPUT PARAMETERS:
                0040 C     === Routine arguments ===
                0041 C     iceMsk    :: sea-ice fraction: no ice=0, grid all ice 1  []
e22ef29cc8 Jean*0042 C     locSST    :: local Sea-Surface Temperature [deg.C]
2d104ee1fd Jean*0043 C     precip    :: Total Precipitation (including run-off) [kg/m2/s]
                0044 C     snowPrc   :: Snow Precipitation [kg/m2/s]
e22ef29cc8 Jean*0045 C     qPrcRnO   :: Energy content of Precip+RunOff (+=down) [W/m2]
7f3e8d8dce Jean*0046 C     flxSW     :: Downward short-wave surface flux (+=down) [W/m2]
2d104ee1fd Jean*0047 C     iMin,iMax :: range of indices of computation domain
                0048 C     jMin,jMax :: range of indices of computation domain
                0049 C     bi,bj     :: current tile indices
                0050 C     myThid      :: Thread no. that called this routine.
                0051       _RL iceMsk (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
e22ef29cc8 Jean*0052       _RL locSST (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
2d104ee1fd Jean*0053       _RL precip (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0054       _RL snowPrc(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
e22ef29cc8 Jean*0055       _RL qPrcRnO(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
2d104ee1fd Jean*0056       _RL flxSW  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0057       INTEGER iMin,iMax
                0058       INTEGER jMin,jMax
                0059       INTEGER bi,bj
                0060       INTEGER myThid
                0061 CEOP
                0062 
                0063 #ifdef ALLOW_THSICE
147f2f3fa7 Jean*0064 #if defined(ALLOW_BULK_FORCE) || defined(ALLOW_CHEAPAML)
2d104ee1fd Jean*0065 
                0066 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0067 C     === Local variables ===
                0068 C     i,j   :: current grid point indices
                0069       INTEGER i,j
                0070 
147f2f3fa7 Jean*0071 #ifdef ALLOW_BULK_FORCE
                0072       IF ( useBulkforce ) THEN
                0073 
                0074        DO j = jMin, jMax
2d104ee1fd Jean*0075         DO i = iMin, iMax
e22ef29cc8 Jean*0076           precip(i,j) = ( rain(i,j,bi,bj)+runoff(i,j,bi,bj) )*rhofw
                0077           flxSW (i,j) = solar(i,j,bi,bj)
2d104ee1fd Jean*0078         ENDDO
147f2f3fa7 Jean*0079        ENDDO
2d104ee1fd Jean*0080 
147f2f3fa7 Jean*0081 c      IF ( SnowFile .NE. ' ' ) THEN
                0082 c      ELSE
e22ef29cc8 Jean*0083 C     If specific snow precipitiation is not available, use
                0084 C     precipitation when ever the air temperature is below 0 degC
                0085         DO j = jMin, jMax
                0086          DO i = iMin, iMax
                0087           IF ( iceMsk(i,j,bi,bj).GT.0. _d 0
                0088      &      .AND. Tair(i,j,bi,bj).LE.Tf0kel )  THEN
                0089              snowPrc(i,j) = rain(i,j,bi,bj)*rhofw
                0090           ENDIF
                0091          ENDDO
                0092         ENDDO
147f2f3fa7 Jean*0093 c      ENDIF
e22ef29cc8 Jean*0094 
147f2f3fa7 Jean*0095        IF ( temp_EvPrRn .NE. UNSET_RL ) THEN
e22ef29cc8 Jean*0096 C--   Account for energy content of Precip + RunOff :
                0097 C     assume 1) rain has same temp as Air (higher altitude, e.g., 850.mb would
                0098 C      be better); 2) Snow has no heat capacity (+ is counted separately)
                0099 C     3) no distinction between sea-water Cp and fresh-water Cp
                0100 C     4) Run-Off comes at the temp of surface water (with same Cp)
147f2f3fa7 Jean*0101         DO j = jMin, jMax
                0102          DO i = iMin, iMax
                0103           qPrcRnO(i,j) = HeatCapacity_Cp*(
e22ef29cc8 Jean*0104      &           ( Tair(i,j,bi,bj) - Tf0kel - temp_EvPrRn )
                0105      &          *( rain(i,j,bi,bj)*rhofw - snowPrc(i,j) )
                0106      &         + ( locSST(i,j,bi,bj) - temp_EvPrRn )
                0107      &          *runoff(i,j,bi,bj)*rhofw )
147f2f3fa7 Jean*0108          ENDDO
                0109         ENDDO
                0110        ENDIF
                0111 
                0112 C-    end if useBulkforce
                0113       ENDIF
                0114 
                0115       IF ( useCheapAML )
                0116      & STOP 'cannot use thsIce and CheapAML with BULK_FORCE compiled'
                0117 
                0118 #elif defined(ALLOW_CHEAPAML)
                0119       IF ( useCheapAML ) THEN
                0120 
                0121        DO j = jMin, jMax
                0122         DO i = iMin, iMax
                0123           precip(i,j) = cheapPrecip(i,j,bi,bj)
                0124 c    &                + runoff(i,j,bi,bj)*rhofw
e22ef29cc8 Jean*0125         ENDDO
                0126        ENDDO
147f2f3fa7 Jean*0127 
                0128 c      IF ( SnowFile .NE. ' ' ) THEN
                0129 c      ELSE
                0130 C     If specific snow precipitiation is not available, use
                0131 C     precipitation when ever the air temperature is below 0 degC
                0132         DO j = jMin, jMax
                0133          DO i = iMin, iMax
                0134           IF ( iceMsk(i,j,bi,bj).GT.0. _d 0
                0135      &      .AND. Tair(i,j,bi,bj).LT.zeroRL )  THEN
                0136              snowPrc(i,j) = cheapPrecip(i,j,bi,bj)
                0137           ENDIF
                0138          ENDDO
                0139         ENDDO
                0140 c      ENDIF
                0141 
                0142        IF ( temp_EvPrRn .NE. UNSET_RL ) THEN
                0143 C--   Account for energy content of Precip + RunOff :
                0144 C     assume 1) rain has same temp as Air (higher altitude, e.g., 850.mb would
                0145 C      be better); 2) Snow has no heat capacity (+ is counted separately)
                0146 C     3) no distinction between sea-water Cp and fresh-water Cp
                0147         DO j = jMin, jMax
                0148          DO i = iMin, iMax
                0149           qPrcRnO(i,j) = HeatCapacity_Cp*
                0150      &           ( Tair(i,j,bi,bj) - temp_EvPrRn )
                0151      &          *( cheapPrecip(i,j,bi,bj) - snowPrc(i,j) )
                0152 c                      + HeatCapacity_Cp*
                0153 c    &           ( locSST(i,j,bi,bj) - temp_EvPrRn )
                0154 c    &          *runoff(i,j,bi,bj)*rhofw
                0155          ENDDO
                0156         ENDDO
                0157        ENDIF
                0158 
                0159 C-    end if useCheapAML
e22ef29cc8 Jean*0160       ENDIF
147f2f3fa7 Jean*0161 #endif /* if ALLOW_BULK_FORCE elif ALLOW_CHEAPAML */
e22ef29cc8 Jean*0162 
2d104ee1fd Jean*0163 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0164 
147f2f3fa7 Jean*0165 #endif /* ALLOW_BULK_FORCE or ALLOW_CHEAPAML */
2d104ee1fd Jean*0166 #endif /* ALLOW_THSICE */
                0167 
                0168       RETURN
                0169       END