Changeset 620 for trunk/LMDZ.MARS/libf
- Timestamp:
- Apr 13, 2012, 6:29:11 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/thermcell_dqup.F90
r619 r620 41 41 REAL gammae(ngridmx,nlayermx) 42 42 REAL alphamid(ngridmx,nlayermx) 43 43 REAL Z(2,2,ngridmx,nlayermx) 44 REAL X(2,1,ngridmx,nlayermx) 44 45 ! =========== Init ============================================== 45 46 … … 51 52 if (fm0(ig,k)+entr0(ig,k) .gt. 0.) then 52 53 gammaf(ig,k)=fm0(ig,k)/(fm0(ig,k)+entr0(ig,k)) 53 gammae(ig,k)=fm0(ig,k+1)/(fm0(ig,k)+entr0(ig,k))54 54 else 55 55 gammaf(ig,k)=0. 56 endif 57 if (fm0(ig,k+1) .gt. 0.) then 58 gammae(ig,k)=(fm0(ig,k)+entr0(ig,k))/fm0(ig,k+1) 59 else 56 60 gammae(ig,k)=1. 57 61 endif 58 62 enddo 59 63 enddo 64 do k=1,nlayermx 65 do ig=1, ngridmx 66 Z(1,1,ig,k)=1. 67 Z(1,2,ig,k)=0. 68 Z(2,1,ig,k)=0. 69 Z(2,2,ig,k)=1. 70 enddo 71 enddo 72 do k=2,nlayermx 73 do ig=1, ngridmx 74 if (gammaf(ig,k) .gt. 0.) then 75 Z(1,1,ig,k)=1./gammae(ig,k-1) + (gammaf(ig,k)-1.)* & 76 & (1.-gammae(ig,k-1))/(gammae(ig,k-1)*gammaf(ig,k)) 77 Z(1,2,ig,k)=-(1.-gammae(ig,k-1)) & 78 & /(gammae(ig,k-1)*gammaf(ig,k)) 79 Z(2,1,ig,k)=(gammaf(ig,k)-1.)/gammaf(ig,k) 80 Z(2,2,ig,k)=1./gammaf(ig,k) 81 else 82 Z(1,1,ig,k)=1./gammae(ig,k-1) -1. 83 Z(1,2,ig,k)=1. 84 Z(2,:,ig,k)=0. 85 endif 60 86 61 62 ! =========== Updraft ============================================ 63 64 ! qa(:,1)=q_therm(:,1) 65 66 67 do ig=1,ngridmx 68 do k=2, nlayermx 69 70 qa(ig,k)=gammaf(ig,k)*qa(ig,k-1)+(1.-gammaf(ig,k))*q(ig,k) 71 72 enddo 87 enddo 73 88 enddo 74 89 75 ! =========== Environnement ======================================= 90 X(1,1,:,:)=q_therm(:,:) 91 X(2,1,:,:)=q_therm(:,:) 76 92 77 ! q(:,nlayermx)=q_therm(:,nlayermx) 93 do k=nlayermx,2,-1 94 do ig=1, ngridmx 95 X(:,1,ig,k-1)=MATMUL(Z(:,:,ig,k),X(:,1,ig,k)) 78 96 79 do ig=1,ngridmx 80 do k=nlayermx-1, 1,-1 81 82 q(ig,k)=gammae(ig,k)*q(ig,k+1)+(1.-gammae(ig,k))*qa(ig,k) 83 84 enddo 97 enddo 85 98 enddo 86 99 87 ! ====== dq ====================================================== 100 q(:,:)=X(1,1,:,:) 101 qa(:,:)=X(2,1,:,:) 88 102 89 103 dq_therm(:,:)=0.
Note: See TracChangeset
for help on using the changeset viewer.