File indexing completed on 2018-03-02 18:37:27 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
b3097ed02d Jean*0001 #include "AIM_OPTIONS.h"
0002
0003
0004
0005
0006 SUBROUTINE SUFLUX_SICE(
0007 I PSA, FMASK, EMISloc,
0008 I Tsurf, dTskin, SSR, SLRD,
e749d70ece Jean*0009 I T1, T0, Q0, DENVV,
b3097ed02d Jean*0010 O SHF, EVAP, SLRU,
e749d70ece Jean*0011 O Shf0, dShf, Evp0, dEvp, Slr0, dSlr, sFlx,
b3097ed02d Jean*0012 O TSFC, TSKIN,
0013 I bi,bj,myThid)
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 IMPLICIT NONE
0026
0027
0028
0029
0030 #include "AIM_SIZE.h"
0031 #include "EEPARAMS.h"
a232c4b875 Jean*0032 #include "PARAMS.h"
b3097ed02d Jean*0033
0034
0035 #include "AIM_PARAMS.h"
0036
0037
0038 #include "com_physcon.h"
0039
0040
0041 #include "com_sflcon.h"
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
e749d70ece Jean*0053
b3097ed02d Jean*0054
0055
e749d70ece Jean*0056
b3097ed02d Jean*0057
0058
0059
0060
e749d70ece Jean*0061
0062
b3097ed02d Jean*0063
0064
0065
0066
cdcb187d4c Jean*0067
b3097ed02d Jean*0068
0069
0070
0071
0072
0073
0074
0075 _RL PSA(NGP), FMASK(NGP), EMISloc
0076 _RL Tsurf(NGP), dTskin(NGP)
0077 _RL SSR(NGP), SLRD(NGP)
e749d70ece Jean*0078 _RL T1(NGP), T0(NGP), Q0(NGP), DENVV(NGP)
b3097ed02d Jean*0079
0080 _RL SHF(NGP), EVAP(NGP), SLRU(NGP)
e749d70ece Jean*0081 _RL Shf0(NGP), dShf(NGP), Evp0(NGP), dEvp(NGP)
0082 _RL Slr0(NGP), dSlr(NGP), sFlx(NGP,0:2)
b3097ed02d Jean*0083 _RL TSFC(NGP), TSKIN(NGP)
0084
0085 INTEGER bi,bj,myThid
0086
0087
0088 #ifdef ALLOW_AIM
0089
0090
e749d70ece Jean*0091
a232c4b875 Jean*0092
e749d70ece Jean*0093 _RL CDENVV(NGP), RDTH, FSSICE
097d65e6b5 Jean*0094 _RL ALHevp, Fstb0, dTstb, dFstb
b3097ed02d Jean*0095 _RL QSAT0(NGP,2)
0096 _RL QDUMMY(1), RDUMMY(1), TS2
0097 INTEGER J
0098
0099
0100
097d65e6b5 Jean*0101 ALHevp = ALHC
0102
a232c4b875 Jean*0103 IF ( aim_energPrecip .OR. useThSIce ) ALHevp = ALHC + ALHF
097d65e6b5 Jean*0104
b3097ed02d Jean*0105
0106
0107
0108 DO J=1,NGP
0109
0110
0111 TSKIN(J) = Tsurf(J)
0112 TSFC(J)=273.16 _d 0
0113 ENDDO
0114
0115
0116
e749d70ece Jean*0117
b3097ed02d Jean*0118
e749d70ece Jean*0119 RDTH = FSTAB/DTHETA
b3097ed02d Jean*0120
0121 DO J=1,NGP
e749d70ece Jean*0122 FSSICE=1.+MIN(DTHETA,MAX(-DTHETA,TSKIN(J)-T1(J)))*RDTH
0123 CDENVV(J)=CHS*DENVV(J)*FSSICE
b3097ed02d Jean*0124 ENDDO
0125
e749d70ece Jean*0126 IF ( dTstab.GT.0. _d 0 ) THEN
0127
0128
0129
0130 DO J=1,NGP
0131 Fstb0 = 1.+MIN(DTHETA,MAX(-DTHETA,TSFC(J) -T1(J)))*RDTH
097d65e6b5 Jean*0132 Shf0(J) = CHS*DENVV(J)*Fstb0
e749d70ece Jean*0133 dTstb = ( DTHETA+dTstab-ABS(TSKIN(J)-T1(J)) )/dTstab
0134 dFstb = RDTH*MIN(1. _d 0, MAX(0. _d 0, dTstb*0.5 _d 0))
097d65e6b5 Jean*0135 dShf(J) = CHS*DENVV(J)*dFstb
e749d70ece Jean*0136 ENDDO
097d65e6b5 Jean*0137
0138
a232c4b875 Jean*0139
097d65e6b5 Jean*0140
e749d70ece Jean*0141 ENDIF
0142
0143
b3097ed02d Jean*0144
0145 CALL SHTORH (2, NGP, TSKIN, PSA, 1. _d 0, QDUMMY, dEvp,
0146 & QSAT0(1,1), myThid)
0147 CALL SHTORH (0, NGP, TSFC, PSA, 1. _d 0, QDUMMY, RDUMMY,
0148 & QSAT0(1,2), myThid)
0149
e749d70ece Jean*0150 IF ( dTstab.GT.0. _d 0 ) THEN
0151
0152 DO J=1,NGP
0153 EVAP(J) = CDENVV(J)*(QSAT0(J,1)-Q0(J))
0154 Evp0(J) = Shf0(J)*(QSAT0(J,2)-Q0(J))
0155 dEvp(J) = CDENVV(J)*dEvp(J)
0156 & + dShf(J)*(QSAT0(J,1)-Q0(J))
0157 ENDDO
0158 ELSE
0159 DO J=1,NGP
b3097ed02d Jean*0160 EVAP(J) = CDENVV(J)*(QSAT0(J,1)-Q0(J))
0161 Evp0(J) = CDENVV(J)*(QSAT0(J,2)-Q0(J))
0162 dEvp(J) = CDENVV(J)*dEvp(J)
e749d70ece Jean*0163 ENDDO
0164 ENDIF
0165
0166
0167
0168 IF ( dTstab.GT.0. _d 0 ) THEN
0169
0170 DO J=1,NGP
0171 SHF(J) = CDENVV(J)*CP*(TSKIN(J)-T0(J))
0172 Shf0(J) = Shf0(J)*CP*(TSFC(J) -T0(J))
0173 dShf(J) = CDENVV(J)*CP
0174 & + dShf(J)*CP*(TSKIN(J)-T0(J))
097d65e6b5 Jean*0175 dShf(J) = MAX( dShf(J), 0. _d 0 )
0176
a232c4b875 Jean*0177
097d65e6b5 Jean*0178
0179 dEvp(J) = MAX( dEvp(J), -dShf(J)/ALHevp )
e749d70ece Jean*0180 ENDDO
0181 ELSE
0182 DO J=1,NGP
0183 SHF(J) = CDENVV(J)*CP*(TSKIN(J)-T0(J))
0184 Shf0(J) = CDENVV(J)*CP*(TSFC(J) -T0(J))
0185 dShf(J) = CDENVV(J)*CP
0186 ENDDO
0187 ENDIF
b3097ed02d Jean*0188
0189
0190
0191 DO J=1,NGP
0192 TS2 = TSFC(J)*TSFC(J)
0193 Slr0(J) = SBC*TS2*TS2
0194 TS2 = TSKIN(J)*TSKIN(J)
0195 SLRU(J) = SBC*TS2*TS2
0196 dSlr(J) = 4. _d 0 *SBC*TS2*TSKIN(J)
0197 ENDDO
0198
0199
0200 DO J=1,NGP
e749d70ece Jean*0201 sFlx(J,0)= ( SLRD(J) - EMISloc*Slr0(J) )
097d65e6b5 Jean*0202 & - ( Shf0(J) + ALHevp*Evp0(J) )
e749d70ece Jean*0203 sFlx(J,1)= ( SLRD(J) - EMISloc*SLRU(J) )
097d65e6b5 Jean*0204 & - ( SHF(J) + ALHevp*EVAP(J) )
e749d70ece Jean*0205 sFlx(J,2)= -EMISloc*dSlr(J)
097d65e6b5 Jean*0206 & - ( dShf(J) + ALHevp*dEvp(J) )
b3097ed02d Jean*0207 ENDDO
097d65e6b5 Jean*0208
0209
0210
0211
0212
0213
0214
0215
0216
0217
0218
0219
0220
0221
b3097ed02d Jean*0222
0223
0224
0225
0226
0227
0228 #endif /* ALLOW_AIM */
0229
0230 RETURN
0231 END