File indexing completed on 2018-03-02 18:41:30 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
cc36b35673 Jean*0001 #include "GRIDALT_OPTIONS.h"
0002
8aa94f3b31 Andr*0003 subroutine dyn2phys(qdyn,pedyn,im1,im2,jm1,jm2,lmdyn,Nsx,Nsy,
0004 . idim1,idim2,jdim1,jdim2,bi,bj,windphy,pephy,Lbot,lmphy,nlperdyn,
0005 . flg,qphy)
0006
0007
0008
cc36b35673 Jean*0009
8aa94f3b31 Andr*0010
0011
0012
cc36b35673 Jean*0013
8aa94f3b31 Andr*0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 implicit none
0042
0043 integer im1, im2, jm1, jm2, lmdyn, lmphy, Nsx, Nsy, flg
0044 integer idim1, idim2, jdim1, jdim2, bi, bj
0045 _RL qdyn(im1:im2,jm1:jm2,lmdyn,Nsx,Nsy)
0046 _RL pedyn(im1:im2,jm1:jm2,lmdyn+1,Nsx,Nsy)
0047 _RL pephy(im1:im2,jm1:jm2,lmphy+1,Nsx,Nsy)
0048 _RL windphy(im1:im2,jm1:jm2,lmphy,Nsx,Nsy)
0049 integer nlperdyn(im1:im2,jm1:jm2,lmdyn,Nsx,Nsy)
0050 _RL qphy(im1:im2,jm1:jm2,lmphy,Nsx,Nsy)
0051 integer Lbot(im1:im2,jm1:jm2,Nsx,Nsy)
0052
0053 _RL weights(im1:im2,jm1:jm2,lmphy)
29d4ea4c99 Andr*0054 _RL pphy(im1:im2,jm1:jm2,lmphy)
8bb9f0d9db Andr*0055 _RL dpkedyn, dpkephy, windsum, qd
8aa94f3b31 Andr*0056 integer i,j,L,Lout1,Lout2,Lphy
4d198cba86 Jean*0057
0058 #ifdef ALLOW_FIZHI
0059
0060 #else
0061
0062
0063
0064 #endif
8aa94f3b31 Andr*0065
4d198cba86 Jean*0066 #ifdef ALLOW_FIZHI
0067
0068 #else
0069
0070 #endif
8aa94f3b31 Andr*0071
29d4ea4c99 Andr*0072
0073 do Lphy = 1,lmphy
0074 do j = jdim1,jdim2
0075 do i = idim1,idim2
cc36b35673 Jean*0076 pphy(i,j,Lphy) =
29d4ea4c99 Andr*0077 . (pephy(i,j,Lphy,bi,bj)+pephy(i,j,Lphy+1,bi,bj))/2.
0078 enddo
0079 enddo
0080 enddo
0081
8aa94f3b31 Andr*0082
8bb9f0d9db Andr*0083 do L = 1,lmdyn
0084
0085 do j = jdim1,jdim2
0086 do i = idim1,idim2
0087 qd = qdyn(i,j,L,bi,bj)
8aa94f3b31 Andr*0088
0089 if(L.ge.Lbot(i,j,bi,bj))then
0090 if(L.eq.Lbot(i,j,bi,bj)) then
0091 Lout1 = 0
0092 else
0093 Lout1 = nlperdyn(i,j,L-1,bi,bj)
0094 endif
0095 Lout2 = nlperdyn(i,j,L,bi,bj)
0096
29d4ea4c99 Andr*0097
0098
0099 dpkedyn = pedyn(i,j,L,bi,bj)-pedyn(i,j,L+1,bi,bj)
8aa94f3b31 Andr*0100 if(flg.eq.1)then
0101 windsum = 0.
0102 do Lphy = Lout1+1,Lout2
616b995d4d Andr*0103
0104
0105 dpkephy = pephy(i,j,Lphy,bi,bj)-pephy(i,j,Lphy+1,bi,bj)
8aa94f3b31 Andr*0106 windsum = windsum+(windphy(i,j,Lphy,bi,bj)*dpkephy)/dpkedyn
0107 enddo
0108 endif
0109
0110 do Lphy = Lout1+1,Lout2
0111 weights(i,j,Lphy) = 1.
0112 if( (flg.eq.1).and.(windsum.ne.0.) )
0113 . weights(i,j,Lphy)=windphy(i,j,Lphy,bi,bj)/windsum
29d4ea4c99 Andr*0114 if( (flg.eq.2) .and. (pedyn(i,j,L,bi,bj).lt.10000.)) then
cc36b35673 Jean*0115 weights(i,j,Lphy) =
29d4ea4c99 Andr*0116 . (qd-5. + (10.*(pedyn(i,j,L,bi,bj)-pphy(i,j,Lphy))/dpkedyn))/qd
0117 elseif( (flg.eq.2) .and. (pedyn(i,j,L,bi,bj).ge.10000.)) then
0118 weights(i,j,Lphy) = 1.
cc36b35673 Jean*0119 endif
8bb9f0d9db Andr*0120 qphy(i,j,Lphy,bi,bj) = qd * weights(i,j,Lphy)
8aa94f3b31 Andr*0121 enddo
0122 endif
0123 enddo
0124 enddo
0125 enddo
0126
0127 return
0128 end