File indexing completed on 2018-03-02 18:37:20 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
b3097ed02d Jean*0001 #include "AIM_OPTIONS.h"
0002 #ifdef ALLOW_LAND
0003 #include "LAND_OPTIONS.h"
0004 #endif
0005
0006
0007
0008
0009 SUBROUTINE AIM_LAND_IMPL(
1b19160514 Jean*0010 I FMASK, dTskin,
e749d70ece Jean*0011 I Shf0, dShf, Evp0, dEvp, Slr0, dSlr,
1b19160514 Jean*0012 U sFlx,
e749d70ece Jean*0013 U Tsurf, SHF, EVAP, SLRU,
0014 O dTsurf,
b3097ed02d Jean*0015 I bi, bj, myTime, myIter, myThid)
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 IMPLICIT NONE
0026
0027
0028
0029 #include "AIM_SIZE.h"
0030
0031 #include "EEPARAMS.h"
0032 #include "PARAMS.h"
0033
0034 #include "AIM_FFIELDS.h"
0035 #include "com_physcon.h"
0036
0037
0038 #ifdef ALLOW_LAND
0039 #include "LAND_SIZE.h"
0040 #include "LAND_PARAMS.h"
0041 #include "LAND_VARS.h"
0042 #endif
0043
0044
0045
0046
0047
e749d70ece Jean*0048
0049
b3097ed02d Jean*0050
0051
0052
1b19160514 Jean*0053
0054
0055
b3097ed02d Jean*0056
e749d70ece Jean*0057
b3097ed02d Jean*0058
0059
e749d70ece Jean*0060
b3097ed02d Jean*0061
0062
0063
0064
1b19160514 Jean*0065 _RL FMASK(NGP), dTskin(NGP)
e749d70ece Jean*0066 _RL Shf0(NGP), dShf(NGP), Evp0(NGP), dEvp(NGP)
0067 _RL Slr0(NGP), dSlr(NGP), sFlx(NGP,0:2)
0068 _RL Tsurf(NGP), SHF(NGP), EVAP(NGP), SLRU(NGP)
0069 _RL dTsurf(NGP)
b3097ed02d Jean*0070 INTEGER bi, bj, myIter, myThid
0071 _RL myTime
0072
0073
0074 #ifdef ALLOW_AIM
0075 #ifdef ALLOW_LAND
0076
0077
0078 INTEGER i,j, I2
0079
1b19160514 Jean*0080 IF ( useLand .AND. land_impl_grT ) THEN
b3097ed02d Jean*0081
1b19160514 Jean*0082
b3097ed02d Jean*0083 DO j=1,sNy
0084 DO i=1,sNx
0085 I2 = i+(j-1)*sNx
0086
0087
0088 dTsurf(I2) = 0.
0089 land_Pr_m_Ev(i,j,bi,bj) = 0. _d 0
1b19160514 Jean*0090 land_EnWFlux(i,j,bi,bj) = 0. _d 0
b3097ed02d Jean*0091
0092 ENDDO
0093 ENDDO
0094
1b19160514 Jean*0095 IF ( land_calc_snow ) THEN
0096
0097 DO j=1,sNy
0098 DO i=1,sNx
0099 I2 = i+(j-1)*sNx
0100 IF ( land_skinT(i,j,bi,bj).LT. 0. _d 0 .OR.
0101 & land_hSnow(i,j,bi,bj).GT. 0. _d 0 ) THEN
0102 sFlx(I2,0) = sFlx(I2,0) - ALHF*Evp0(I2)
0103 sFlx(I2,1) = sFlx(I2,1) - ALHF*EVAP(I2)
0104 sFlx(I2,2) = sFlx(I2,2) - ALHF*dEvp(I2)
0105 land_EnWFlux(i,j,bi,bj) = -ALHF
0106 ENDIF
0107 ENDDO
0108 ENDDO
0109 ENDIF
0110
b3097ed02d Jean*0111 CALL LAND_IMPL_TEMP(
0112 I aim_landFr,
0113 I dTskin, sFlx,
0114 O dTsurf,
0115 I bi, bj, myTime, myIter, myThid)
0116
1b19160514 Jean*0117
e749d70ece Jean*0118
b3097ed02d Jean*0119 DO J=1,NGP
0120 IF ( dTsurf(J) .GT. 999. ) THEN
e749d70ece Jean*0121 SHF (J) = Shf0(J)
b3097ed02d Jean*0122 EVAP(J) = Evp0(J)
0123 SLRU(J) = Slr0(J)
0124 ELSE
e749d70ece Jean*0125 SHF (J) = SHF (J) + dTsurf(J)*dShf(J)
b3097ed02d Jean*0126 EVAP(J) = EVAP(J) + dTsurf(J)*dEvp(J)
0127 SLRU(J) = SLRU(J) + dTsurf(J)*dSlr(J)
0128 ENDIF
0129 ENDDO
0130
e749d70ece Jean*0131
1b19160514 Jean*0132 DO j=1,sNy
0133 DO i=1,sNx
0134 I2 = i+(j-1)*sNx
0135
0136 IF ( dTsurf(I2) .GT. 999. ) THEN
0137 land_HeatFlx(i,j,bi,bj) = sFlx(I2,0)
0138 ELSE
0139 land_HeatFlx(i,j,bi,bj) = sFlx(I2,1)+dTsurf(I2)*sFlx(I2,2)
0140 ENDIF
0141
0142 land_EnWFlux(i,j,bi,bj) = -land_EnWFlux(i,j,bi,bj)*EVAP(I2)
0143 ENDDO
0144 ENDDO
0145
e749d70ece Jean*0146
0147 DO J=1,NGP
0148 IF ( dTsurf(J) .GT. 999. ) THEN
0149 dTsurf(J)= tFreeze - Tsurf(J)
0150 Tsurf(J) = tFreeze
0151 ELSE
0152 Tsurf(J) = Tsurf(J)+ dTsurf(J)
0153 ENDIF
0154 ENDDO
0155
1b19160514 Jean*0156
b3097ed02d Jean*0157 ENDIF
0158
0159 #endif /* ALLOW_LAND */
0160 #endif /* ALLOW_AIM */
0161
0162 RETURN
0163 END