-
Notifications
You must be signed in to change notification settings - Fork 0
/
fvcore_pert.f
108 lines (95 loc) · 2.44 KB
/
fvcore_pert.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
program bv_atm_norm
! implicit none
! generate the bv_norm for coupled model
PARAMETER (IM = 180)
PARAMETER (JM =1080)
PARAMETER (LM = 72)
REAL*8 ak(lm+1)
REAL*8 bk(lm+1)
REAL*8 q1(im,jm), qo1(im,jm)
REAL*8 q2(im,jm), qo2(im,jm)
REAL*8 qq(im,jm)
REAL*8 pertcoef
integer headr1(6)
integer headr2(5)
character(len=80) bfile1, bfile2
c bfile1='fvcore_internal_rst11'
c bfile2='fvcore_internal_rst12'
c bfile='fvcore_internal_rst'
c
c open(11,file=trim(bfile1),status='old')
c open(12,file=trim(bfile2),status='old')
c open(13,file=trim(bfile),status='old')
pertcoef=8.0
c pertcoef=248.0
DO K = 1, 3
read (10+K) headr1
read (10+K) headr2
read (10+K) ak
read (10+K) bk
ENDDO
write(31) headr1
write(31) headr2
write(31) ak
write(31) bk
write(32) headr1
write(32) headr2
write(32) ak
write(32) bk
write(6,*) headr1
write(6,*) headr2
! U
do l = 1, lm
read (11) q1
read (12) q2
read (13) qq
do j = 1, jm
do i = 1, im
qo1(i,j) = qq(i,j) + (q2(i,j)-q1(i,j))/pertcoef
qo2(i,j) = qq(i,j) - (q2(i,j)-q1(i,j))/pertcoef
enddo
enddo
write(31) qo1
write(32) qo2
enddo
write(6,*) lm
! V
do l = 1, lm
read (11) q1
read (12) q2
read (13) qq
do j = 1, jm
do i = 1, im
qo1(i,j) = qq(i,j) + (q2(i,j)-q1(i,j))/pertcoef
qo2(i,j) = qq(i,j) - (q2(i,j)-q1(i,j))/pertcoef
enddo
enddo
write(31) qo1
write(32) qo2
enddo
write(6,*) lm
! PT
do l = 1, lm
read (11) q1
read (12) q2
read (13) qq
do j = 1, jm
do i = 1, im
qo1(i,j) = qq(i,j) + (q2(i,j)-q1(i,j))/pertcoef
qo2(i,j) = qq(i,j) - (q2(i,j)-q1(i,j))/pertcoef
enddo
enddo
write(31) qo1
write(32) qo2
enddo
write(6,*) lm
! PE, PKZ, DZ and W
do l = 1, lm*4+1
read (11) q1
read (12) q2
read (13) qq
write(31) qq
write(32) qq
enddo
write(6,*) lm
end