4 include 'wrf_status_codes.h'
6 character (80) FileName
8 character (80) SysDepInfo
20 integer, parameter :: pad = 3
21 integer, parameter :: jds=1 , jde=6 , &
24 integer, parameter :: jms=jds-pad , jme=jde+pad , &
25 ims=ids-pad , ime=ide+pad , &
27 integer, parameter :: jps=jds , jpe=jde , &
31 real u( ims:ime , kms:kme , jms:jme )
32 real v( ims:ime , kms:kme , jms:jme )
33 real rho( ims:ime , kms:kme , jms:jme )
34 real u2( ims:ime , jms:jme )
37 integer int( ims:ime , kms:kme , jms:jme )
38 real*8 r8 ( ims:ime , kms:kme , jms:jme )
44 integer , Dimension(3) :: DomS,DomE,MemS,MemE,PatS,PatE
45 integer , Dimension(2) :: Dom2S,Dom2E,Mem2S,Mem2E,Pat2S,Pat2E
46 integer , Dimension(1) :: Dom1S,Dom1E,Mem1S,Mem1E,Pat1S,Pat1E
47 print *, 'Testing wrf write'
48 print *, ims,ime , kms,kme , jms,jme
49 Date = '2000-09-18_16:42:01'
50 Date2 = '2000-09-18_16:52:01'
52 print *,'After call ext_init, Status =',Status
55 SysDepInfo = 'sys info'
57 print*,'!!!!!!!!!!!!!!!!!!!!!!! ext_open_for_write_begin'
59 call ext_open_for_write_begin( FileName, Comm, SysDepInfo, DataHandle, Status)
60 print *, ' ext_open_for_write_begin Status = ',Status,DataHandle
105 call ext_write_field(DataHandle,Date,'u',u,WRF_REAL,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
106 print *,' dry run : ext_write_field Status = ',Status
107 call ext_write_field(DataHandle,Date,'v',v,WRF_REAL,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
108 print *,' dry run : ext_write_field Status = ',Status
109 call ext_write_field(DataHandle,Date,'rho',rho,WRF_REAL,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
110 print *,' dry run : ext_write_field Status = ',Status
111 call ext_write_field(DataHandle,Date,'u2',u2,WRF_REAL,Comm,Dom,'XY',Dom2S,Dom2E,Mem2S,Mem2E,Pat2S,Pat2E,Status)
112 print *,' dry run : ext_write_field Status = ',Status
113 call ext_write_field(DataHandle,Date,'ud2',u,WRF_REAL,Comm,Dom,"XzY",DomS,DomE,MemS,MemE,PatS,PatE,Status)
114 print *,' dry run : ext_write_field Status = ',Status
115 call ext_write_field(DataHandle,Date,'u1',u1,WRF_REAL,Comm,Dom,'Z',Dom1S,Dom1E,Mem1S,Mem1E,Pat1S,Pat1E,Status)
116 print *,' dry run : ext_write_field Status = ',Status
117 call ext_write_field(DataHandle,Date,'int',int,WRF_INTEGER,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
118 print *,' dry run : ext_write_field Status = ',Status
119 call ext_write_field(DataHandle,Date,'double',r8,WRF_DOUBLE,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
120 print *,' dry run : ext_write_field Status = ',Status
122 call ext_open_for_write_commit(DataHandle, Status)
123 print *, ' ext_open_for_write_commit Status = ', Status,DataHandle
128 u (i,k,j) = 100*i+j+10*k
129 v (i,k,j) = 100*i+j+10*k
130 rho(i,k,j) = 100*i+j+10*k
131 int(i,k,j) = 100*i+j+10*k
132 r8 (i,k,j) = 100*i+j+10*k
145 print *,'testWRFWrite u (2,3,4) = ',u(2,3,4)
146 print *,'testWRFWrite v (4,3,2) = ',v(4,3,2)
147 print *,'testWRFWrite rho(3,4,5) = ',rho(3,4,5)
148 print *,'testWRFWrite u2 (6,5) = ',u2(6,5)
149 print *,'testWRFWrite u1 (9) = ',u1(9)
150 print *,'testWRFWrite int(8,5,6) = ',int(8,5,6)
151 print *,'testWRFWrite r8 (7,4,5) = ',r8(7,4,5)
152 call ext_write_field(DataHandle,Date,'u',u,WRF_REAL,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
153 print *,' first write: ext_write_field Status = ',Status
154 call ext_write_field(DataHandle,Date,'v',v,WRF_REAL,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
155 print *,' first write: ext_write_field Status = ',Status
156 call ext_write_field(DataHandle,Date,'rho',rho,WRF_REAL,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
157 print *,' first write: ext_write_field Status = ',Status
158 call ext_write_field(DataHandle,Date,'u2',u2,WRF_REAL,Comm,Dom,'XY',Dom2S,Dom2E,Mem2S,Mem2E,Pat2S,Pat2E,Status)
159 print *,' first write: ext_write_field Status = ',Status
160 call ext_write_field(DataHandle,Date,'ud2',u,WRF_REAL,Comm,Dom,"XzY",DomS,DomE,MemS,MemE,PatS,PatE,Status)
161 print *,' first write: ext_write_field Status = ',Status
162 call ext_write_field(DataHandle,Date,'u1',u1,WRF_REAL,Comm,Dom,'Z',Dom1S,Dom1E,Mem1S,Mem1E,Pat1S,Pat1E,Status)
163 print *,' first write: ext_write_field Status = ',Status
164 call ext_write_field(DataHandle,Date,'int',int,WRF_INTEGER,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
165 print *,' first write: ext_write_field Status = ',Status
166 call ext_write_field(DataHandle,Date,'double',r8,WRF_DOUBLE,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
167 print *,' dry run : ext_write_field Status = ',Status
169 print *,'2nd : testWRFWrite u(3,3,3) = ',u(3,3,3)
170 print *,'2nd : testWRFWrite v(4,4,4) = ',v(4,4,4)
171 print *,'2nd : testWRFWrite rho(3,4,5) = ',rho(3,4,5)
172 call ext_write_field(DataHandle,Date2,'u',u,WRF_REAL,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
173 print *,' 2nd write : ext_write_field Status = ',Status
174 call ext_write_field(DataHandle,Date2,'v',v,WRF_REAL,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
175 print *,' 2nd write : ext_write_field Status = ',Status
176 call ext_write_field(DataHandle,Date2,'rho',rho,WRF_REAL,Comm,Dom,MemOrd,DomS,DomE,MemS,MemE,PatS,PatE,Status)
177 print *,' 2nd write : ext_write_field Status = ',Status
179 call ext_close( DataHandle, Status)
180 print *, ' After ext_close, Status = ',Status
181 call ext_exit(Status)
182 print *,' End of test program',Status
184 end program testwrite_john