cpld_gridgen  1.7.0
 All Data Structures Files Functions Variables
debugprint.F90
Go to the documentation of this file.
1 
7 
8 module debugprint
9 
10  use esmf, only : esmf_logfounderror, esmf_logerr_passthru
11  use grdvars, only : ni,nj,ipole,angle,anglet
12  use grdvars, only : htn,latct,lonct,latcv,loncv,latcu,loncu,latbu,lonbu
13  use grdvars, only : xlatct,xlonct,xlatcu,xloncu
14  use grdvars, only : latbu_vert,lonbu_vert,latcv_vert,loncv_vert
15  use grdvars, only : latct_vert,lonct_vert,latcu_vert,loncu_vert
16 
17  implicit none
18  private
19 
21 
22  contains
26 
27  subroutine checkseam
28 
29  ! local variables
30  integer :: j,i1,i2
31 
32  j = nj
33  i1 = ipole(1); i2 = ipole(2)+1
34 
35  !htn must be the same along seam
36  j = nj
37  i1 = ipole(1); i2 = ipole(2)+1
38  print *,'HTN across seam '
39  print *,htn(i1-2,j),htn(i2+2,j)
40  print *,htn(i1-1,j),htn(i2+1,j)
41  print *,htn(i1, j),htn(i2, j)
42  print *,htn(i1+1,j),htn(i2-1,j)
43  print *,htn(i1+2,j),htn(i2-2,j)
44 
45  print *,'latCv across seam '
46  print *,latcv(i1-2,j),latcv(i2+2,j)
47  print *,latcv(i1-1,j),latcv(i2+1,j)
48  print *,latcv(i1, j),latcv(i2, j)
49  print *,latcv(i1+1,j),latcv(i2-1,j)
50  print *,latcv(i1+2,j),latcv(i2-2,j)
51 
52  print *,'lonCv across seam '
53  print *,loncv(i1-2,j),loncv(i2+2,j)
54  print *,loncv(i1-1,j),loncv(i2+1,j)
55  print *,loncv(i1, j),loncv(i2, j)
56  print *,loncv(i1+1,j),loncv(i2-1,j)
57  print *,loncv(i1+2,j),loncv(i2-2,j)
58 
59  print *,'angleT across seam '
60  print *,anglet(i1-2,j),anglet(i2+2,j)
61  print *,anglet(i1-1,j),anglet(i2+1,j)
62  print *,anglet(i1, j),anglet(i2, j)
63  print *,anglet(i1+1,j),anglet(i2-1,j)
64  print *,anglet(i1+2,j),anglet(i2-2,j)
65 
66  print *,'latCu across seam '
67  print *,latcu(i1-3,j),latcu(i2+2,j),latcu(i1-3,j)-latcu(i2+2,j)
68  print *,latcu(i1-2,j),latcu(i2+1,j)
69  print *,latcu(i1-1,j),latcu(i2+0,j)
70  print *,latcu(i1, j),latcu(i2-1,j)
71  print *,latcu(i1+1,j),latcu(i2-2,j)
72  print *,latcu(i1+2,j),latcu(i2-3,j)
73  print *,latcu(i1+3,j),latcu(i2-4,j)
74 
75  print *,'lonCu across seam '
76  print *,loncu(i1-3,j),loncu(i2+2,j),loncu(i1-3,j)+loncu(i2+2,j)
77  print *,loncu(i1-2,j),loncu(i2+1,j)
78  print *,loncu(i1-1,j),loncu(i2+0,j)
79  print *,loncu(i1, j),loncu(i2-1,j)
80  print *,loncu(i1+1,j),loncu(i2-2,j)
81  print *,loncu(i1+2,j),loncu(i2-3,j)
82  print *,loncu(i1+3,j),loncu(i2-4,j)
83 
84  print *,'latCt across seam '
85  print *,latct(i1-3,j),latct(i2+3,j),latct(i1-3,j)-latct(i2+3,j)
86  print *,latct(i1-2,j),latct(i2+2,j)
87  print *,latct(i1-1,j),latct(i2+1,j)
88  print *,latct(i1, j),latct(i2, j)
89  print *,latct(i1+1,j),latct(i2-1,j)
90  print *,latct(i1+2,j),latct(i2-2,j)
91  print *,latct(i1+3,j),latct(i2-3,j)
92 
93  print *,'lonCt across seam '
94  print *,lonct(i1-3,j),lonct(i2+3,j),lonct(i1-3,j)+lonct(i2+3,j)
95  print *,lonct(i1-2,j),lonct(i2+2,j)
96  print *,lonct(i1-1,j),lonct(i2+1,j)
97  print *,lonct(i1, j),lonct(i2, j)
98  print *,lonct(i1+1,j),lonct(i2-1,j)
99  print *,lonct(i1+2,j),lonct(i2-2,j)
100  print *,lonct(i1+3,j),lonct(i2-3,j)
101  print *
102  end subroutine checkseam
103 
107 
108  subroutine checkxlatlon
109 
110  ! local variables
111  integer :: i
112 
113  print *,'============== Ct grid ==============='
114  print *,'============== Left pole ============'
115  do i = ipole(1)-3,ipole(1)+3
116  print '(i5,6f12.5)',i,lonct(i,nj),xlonct(i),lonct(i,nj)+xlonct(i),latct(i,nj),xlatct(i),latct(i,nj)-xlatct(i)
117  enddo
118  print *
119 
120  print *,'============ Right pole ============'
121  do i = ipole(2)-3,ipole(2)+3
122  print '(i5,6f12.5)',i,lonct(i,nj),xlonct(i),lonct(i,nj)+xlonct(i),latct(i,nj),xlatct(i),latct(i,nj)-xlatct(i)
123  enddo
124  print *
125 
126  print *,'============== Ct grid ==============='
127  print *,'============== Left edge ============'
128  do i = 1,5
129  print '(i5,6f12.5)',i,lonct(i,nj),xlonct(i),lonct(i,nj)+xlonct(i),latct(i,nj),xlatct(i),latct(i,nj)-xlatct(i)
130  enddo
131  print *
132  print *,'============== Right edge ==========='
133  do i = ni-4,ni
134  print '(i5,6f12.5)',i,lonct(i,nj),xlonct(i),lonct(i,nj)+xlonct(i),latct(i,nj),xlatct(i),latct(i,nj)-xlatct(i)
135  enddo
136  print *
137 
138 
139  print *,'============== Cu grid ==============='
140  print *,'============== Left pole ============='
141  do i = ipole(1)-3,ipole(1)+3
142  print '(i5,6f12.5)',i,loncu(i,nj),xloncu(i),loncu(i,nj)+xloncu(i),latcu(i,nj),xlatcu(i),latcu(i,nj)-xlatcu(i)
143  enddo
144  print *
145 
146  print *,'============ Right pole ============'
147  do i = ipole(2)-3,ipole(2)+3
148  print '(i5,6f12.5)',i,loncu(i,nj),xloncu(i),loncu(i,nj)+xloncu(i),latcu(i,nj),xlatcu(i),latcu(i,nj)-xlatcu(i)
149  enddo
150  print *
151 
152  print *,'============== Cu grid ==============='
153  print *,'============== Left edge ============'
154  do i = 1,5
155  print '(i5,6f12.5)',i,loncu(i,nj),xloncu(i),loncu(i,nj)+xloncu(i),latcu(i,nj),xlatcu(i),latcu(i,nj)-xlatcu(i)
156  enddo
157  print *
158  print *,'============== Right edge ==========='
159  do i = ni-4,ni
160  print '(i5,6f12.5)',i,loncu(i,nj),xloncu(i),loncu(i,nj)+xloncu(i),latcu(i,nj),xlatcu(i),latcu(i,nj)-xlatcu(i)
161  enddo
162  print *
163 
164  end subroutine checkxlatlon
165 
169 
170  subroutine checkpoint
171 
172  ! local variables
173  integer :: i,j
174 
175  ! check
176  i = 1; j = nj
177  print '(f12.5,a,f12.5)',latbu_vert(i,j,2),' ',latbu_vert(i,j,1)
178  print '(a12,f12.5)',' ',latbu(i,j)
179  print '(f12.5,a,f12.5)',latbu_vert(i,j,3),' ',latbu_vert(i,j,4)
180  print *
181  print '(f12.5,a,f12.5)',lonbu_vert(i,j,2),' ',lonbu_vert(i,j,1)
182  print '(a12,f12.5)',' ',lonbu(i,j)
183  print '(f12.5,a,f12.5)',lonbu_vert(i,j,3),' ',lonbu_vert(i,j,4)
184  print *
185  print *
186  ! check
187  print '(f12.5,a,f12.5)',latcv_vert(i,j,2),' ',latcv_vert(i,j,1)
188  print '(a12,f12.5)',' ',latcv(i,j)
189  print '(f12.5,a,f12.5)',latcv_vert(i,j,3),' ',latcv_vert(i,j,4)
190  print *
191  print '(f12.5,a,f12.5)',loncv_vert(i,j,2),' ',loncv_vert(i,j,1)
192  print '(a12,f12.5)',' ',loncv(i,j)
193  print '(f12.5,a,f12.5)',loncv_vert(i,j,3),' ',loncv_vert(i,j,4)
194 
195  print *
196  print *
197 
198  i = 1; j = 10
199  print '(f12.5,a,f12.5)',latct_vert(i,j,2),' ',latct_vert(i,j,1)
200  print '(a12,f12.5)',' ',latct(i,j)
201  print '(f12.5,a,f12.5)',latct_vert(i,j,3),' ',latct_vert(i,j,4)
202  print *
203  print '(f12.5,a,f12.5)',lonct_vert(i,j,2),' ',lonct_vert(i,j,1)
204  print '(a12,f12.5)',' ',lonct(i,j)
205  print '(f12.5,a,f12.5)',lonct_vert(i,j,3),' ',lonct_vert(i,j,4)
206  print *
207  print *
208  ! check
209  print '(f12.5,a,f12.5)',latcu_vert(i,j,2),' ',latcu_vert(i,j,1)
210  print '(a12,f12.5)',' ',latcu(i,j)
211  print '(f12.5,a,f12.5)',latcu_vert(i,j,3),' ',latcu_vert(i,j,4)
212  print *
213  print '(f12.5,a,f12.5)',loncu_vert(i,j,2),' ',loncu_vert(i,j,1)
214  print '(a12,f12.5)',' ',loncu(i,j)
215  print '(f12.5,a,f12.5)',loncu_vert(i,j,3),' ',loncu_vert(i,j,4)
216 
217 
218  i = ni; j = 10
219  print '(f12.5,a,f12.5)',latct_vert(i,j,2),' ',latct_vert(i,j,1)
220  print '(a12,f12.5)',' ',latct(i,j)
221  print '(f12.5,a,f12.5)',latct_vert(i,j,3),' ',latct_vert(i,j,4)
222  print *
223  print '(f12.5,a,f12.5)',lonct_vert(i,j,2),' ',lonct_vert(i,j,1)
224  print '(a12,f12.5)',' ',lonct(i,j)
225  print '(f12.5,a,f12.5)',lonct_vert(i,j,3),' ',lonct_vert(i,j,4)
226  print *
227  print *
228  ! check
229  print '(f12.5,a,f12.5)',latcu_vert(i,j,2),' ',latcu_vert(i,j,1)
230  print '(a12,f12.5)',' ',latcu(i,j)
231  print '(f12.5,a,f12.5)',latcu_vert(i,j,3),' ',latcu_vert(i,j,4)
232  print *
233  print '(f12.5,a,f12.5)',loncu_vert(i,j,2),' ',loncu_vert(i,j,1)
234  print '(a12,f12.5)',' ',loncu(i,j)
235  print '(f12.5,a,f12.5)',loncu_vert(i,j,3),' ',loncu_vert(i,j,4)
236 
237  print *,"latCt minmax ",minval(latct),maxval(latct)
238  print *,"latCu minmax ",minval(latcu),maxval(latcu)
239  print *,"latCv minmax ",minval(latcv),maxval(latcv)
240  print *,"latBu minmax ",minval(latbu),maxval(latbu)
241 
242  ! print *,minval(latCt_vert),maxval(latCt_vert)
243  ! print *,minval(lonCt_vert),maxval(lonCt_vert)
244  ! print *,minval(latBu_vert),maxval(latBu_vert)
245  ! print *,minval(lonBu_vert),maxval(lonBu_vert)
246  end subroutine checkpoint
247 end module debugprint
subroutine, public checkseam
Print values across the tripole seam.
Definition: debugprint.F90:27
subroutine, public checkpoint
Print values at specified point.
Definition: debugprint.F90:170
subroutine, public checkxlatlon
Print values near the poles and along the domain edges.
Definition: debugprint.F90:108