78 |
ladinit = .false. |
ladinit = .false. |
79 |
dumiter = 0 |
dumiter = 0 |
80 |
dumtime = 0. _d 0 |
dumtime = 0. _d 0 |
81 |
|
write(fname(1:80),'(80a)') ' ' |
82 |
|
|
83 |
if ( grdchkvarindex .eq. 0 ) then |
if ( grdchkvarindex .eq. 0 ) then |
84 |
STOP 'GRDCHK INDEX 0 NOT ALLOWED' |
STOP 'GRDCHK INDEX 0 NOT ALLOWED' |
86 |
#ifdef ALLOW_THETA0_CONTROL |
#ifdef ALLOW_THETA0_CONTROL |
87 |
else if ( grdchkvarindex .eq. 1 ) then |
else if ( grdchkvarindex .eq. 1 ) then |
88 |
il=ilnblnk( xx_theta_file ) |
il=ilnblnk( xx_theta_file ) |
|
write(fname(1:80),'(80a)') ' ' |
|
89 |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
90 |
write(fname(1:80),'(3a,i10.10)') |
write(fname(1:80),'(3a,i10.10)') |
91 |
& yadmark, xx_theta_file(1:il),'.',optimcycle |
& yadmark, xx_theta_file(1:il),'.',optimcycle |
111 |
#ifdef ALLOW_SALT0_CONTROL |
#ifdef ALLOW_SALT0_CONTROL |
112 |
else if ( grdchkvarindex .eq. 2 ) then |
else if ( grdchkvarindex .eq. 2 ) then |
113 |
il=ilnblnk( xx_salt_file ) |
il=ilnblnk( xx_salt_file ) |
|
write(fname(1:80),'(80a)') ' ' |
|
114 |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
115 |
write(fname(1:80),'(3a,i10.10)') |
write(fname(1:80),'(3a,i10.10)') |
116 |
& yadmark, xx_salt_file(1:il),'.',optimcycle |
& yadmark, xx_salt_file(1:il),'.',optimcycle |
136 |
#ifdef ALLOW_HFLUX_CONTROL |
#ifdef ALLOW_HFLUX_CONTROL |
137 |
else if ( grdchkvarindex .eq. 3 ) then |
else if ( grdchkvarindex .eq. 3 ) then |
138 |
il=ilnblnk( xx_hflux_file ) |
il=ilnblnk( xx_hflux_file ) |
|
write(fname(1:80),'(80a)') ' ' |
|
139 |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
140 |
write(fname(1:80),'(3a,i10.10)') |
write(fname(1:80),'(3a,i10.10)') |
141 |
& yadmark, xx_hflux_file(1:il),'.',optimcycle |
& yadmark, xx_hflux_file(1:il),'.',optimcycle |
161 |
#ifdef ALLOW_SFLUX_CONTROL |
#ifdef ALLOW_SFLUX_CONTROL |
162 |
else if ( grdchkvarindex .eq. 4 ) then |
else if ( grdchkvarindex .eq. 4 ) then |
163 |
il=ilnblnk( xx_sflux_file ) |
il=ilnblnk( xx_sflux_file ) |
|
write(fname(1:80),'(80a)') ' ' |
|
164 |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
165 |
write(fname(1:80),'(3a,i10.10)') |
write(fname(1:80),'(3a,i10.10)') |
166 |
& yadmark, xx_sflux_file(1:il),'.',optimcycle |
& yadmark, xx_sflux_file(1:il),'.',optimcycle |
186 |
#ifdef ALLOW_USTRESS_CONTROL |
#ifdef ALLOW_USTRESS_CONTROL |
187 |
else if ( grdchkvarindex .eq. 5 ) then |
else if ( grdchkvarindex .eq. 5 ) then |
188 |
il=ilnblnk( xx_tauu_file ) |
il=ilnblnk( xx_tauu_file ) |
|
write(fname(1:80),'(80a)') ' ' |
|
189 |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
190 |
write(fname(1:80),'(3a,i10.10)') |
write(fname(1:80),'(3a,i10.10)') |
191 |
& yadmark, xx_tauu_file(1:il),'.',optimcycle |
& yadmark, xx_tauu_file(1:il),'.',optimcycle |
211 |
#ifdef ALLOW_VSTRESS_CONTROL |
#ifdef ALLOW_VSTRESS_CONTROL |
212 |
else if ( grdchkvarindex .eq. 6 ) then |
else if ( grdchkvarindex .eq. 6 ) then |
213 |
il=ilnblnk( xx_tauv_file ) |
il=ilnblnk( xx_tauv_file ) |
|
write(fname(1:80),'(80a)') ' ' |
|
214 |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
215 |
write(fname(1:80),'(3a,i10.10)') |
write(fname(1:80),'(3a,i10.10)') |
216 |
& yadmark, xx_tauv_file(1:il),'.',optimcycle |
& yadmark, xx_tauv_file(1:il),'.',optimcycle |
233 |
|
|
234 |
#endif /* ALLOW_VSTRESS_CONTROL */ |
#endif /* ALLOW_VSTRESS_CONTROL */ |
235 |
|
|
236 |
|
#ifdef ALLOW_ATEMP_CONTROL |
237 |
|
else if ( grdchkvarindex .eq. 7 ) then |
238 |
|
il=ilnblnk( xx_atemp_file ) |
239 |
|
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
240 |
|
write(fname(1:80),'(3a,i10.10)') |
241 |
|
& yadmark, xx_atemp_file(1:il),'.',optimcycle |
242 |
|
else if ( theSimulationMode .EQ. FORWARD_SIMULATION ) then |
243 |
|
write(fname(1:80),'(2a,i10.10)') |
244 |
|
& xx_atemp_file(1:il),'.',optimcycle |
245 |
|
end if |
246 |
|
|
247 |
|
call active_read_xy( fname, tmpfld2d, icvrec, |
248 |
|
& doglobalread, ladinit, optimcycle, |
249 |
|
& mythid, dummy) |
250 |
|
|
251 |
|
xx_comp_ref = tmpfld2d( itilepos,jtilepos,itile,jtile ) |
252 |
|
xx_comp_pert = xx_comp_ref + localEps |
253 |
|
tmpfld2d( itilepos,jtilepos,itile,jtile ) = xx_comp_pert |
254 |
|
|
255 |
|
call active_write_xy( fname, tmpfld2d, icvrec, |
256 |
|
& optimcycle, |
257 |
|
& mythid, dummy) |
258 |
|
|
259 |
|
#endif /* ALLOW_ATEMP_CONTROL */ |
260 |
|
|
261 |
|
#ifdef ALLOW_AQH_CONTROL |
262 |
|
else if ( grdchkvarindex .eq. 8 ) then |
263 |
|
il=ilnblnk( xx_aqh_file ) |
264 |
|
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
265 |
|
write(fname(1:80),'(3a,i10.10)') |
266 |
|
& yadmark, xx_aqh_file(1:il),'.',optimcycle |
267 |
|
else if ( theSimulationMode .EQ. FORWARD_SIMULATION ) then |
268 |
|
write(fname(1:80),'(2a,i10.10)') |
269 |
|
& xx_aqh_file(1:il),'.',optimcycle |
270 |
|
end if |
271 |
|
|
272 |
|
call active_read_xy( fname, tmpfld2d, icvrec, |
273 |
|
& doglobalread, ladinit, optimcycle, |
274 |
|
& mythid, dummy) |
275 |
|
|
276 |
|
xx_comp_ref = tmpfld2d( itilepos,jtilepos,itile,jtile ) |
277 |
|
xx_comp_pert = xx_comp_ref + localEps |
278 |
|
tmpfld2d( itilepos,jtilepos,itile,jtile ) = xx_comp_pert |
279 |
|
|
280 |
|
call active_write_xy( fname, tmpfld2d, icvrec, |
281 |
|
& optimcycle, |
282 |
|
& mythid, dummy) |
283 |
|
|
284 |
|
#endif /* ALLOW_AQH_CONTROL */ |
285 |
|
|
286 |
|
#ifdef ALLOW_UWIND_CONTROL |
287 |
|
else if ( grdchkvarindex .eq. 9 ) then |
288 |
|
il=ilnblnk( xx_uwind_file ) |
289 |
|
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
290 |
|
write(fname(1:80),'(3a,i10.10)') |
291 |
|
& yadmark, xx_uwind_file(1:il),'.',optimcycle |
292 |
|
else if ( theSimulationMode .EQ. FORWARD_SIMULATION ) then |
293 |
|
write(fname(1:80),'(2a,i10.10)') |
294 |
|
& xx_uwind_file(1:il),'.',optimcycle |
295 |
|
end if |
296 |
|
|
297 |
|
call active_read_xy( fname, tmpfld2d, icvrec, |
298 |
|
& doglobalread, ladinit, optimcycle, |
299 |
|
& mythid, dummy) |
300 |
|
|
301 |
|
xx_comp_ref = tmpfld2d( itilepos,jtilepos,itile,jtile ) |
302 |
|
xx_comp_pert = xx_comp_ref + localEps |
303 |
|
tmpfld2d( itilepos,jtilepos,itile,jtile ) = xx_comp_pert |
304 |
|
|
305 |
|
call active_write_xy( fname, tmpfld2d, icvrec, |
306 |
|
& optimcycle, |
307 |
|
& mythid, dummy) |
308 |
|
|
309 |
|
#endif /* ALLOW_UWIND_CONTROL */ |
310 |
|
|
311 |
|
#ifdef ALLOW_VWIND_CONTROL |
312 |
|
else if ( grdchkvarindex .eq. 10 ) then |
313 |
|
il=ilnblnk( xx_vwind_file ) |
314 |
|
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
315 |
|
write(fname(1:80),'(3a,i10.10)') |
316 |
|
& yadmark, xx_vwind_file(1:il),'.',optimcycle |
317 |
|
else if ( theSimulationMode .EQ. FORWARD_SIMULATION ) then |
318 |
|
write(fname(1:80),'(2a,i10.10)') |
319 |
|
& xx_vwind_file(1:il),'.',optimcycle |
320 |
|
end if |
321 |
|
|
322 |
|
call active_read_xy( fname, tmpfld2d, icvrec, |
323 |
|
& doglobalread, ladinit, optimcycle, |
324 |
|
& mythid, dummy) |
325 |
|
|
326 |
|
xx_comp_ref = tmpfld2d( itilepos,jtilepos,itile,jtile ) |
327 |
|
xx_comp_pert = xx_comp_ref + localEps |
328 |
|
tmpfld2d( itilepos,jtilepos,itile,jtile ) = xx_comp_pert |
329 |
|
|
330 |
|
call active_write_xy( fname, tmpfld2d, icvrec, |
331 |
|
& optimcycle, |
332 |
|
& mythid, dummy) |
333 |
|
|
334 |
|
#endif /* ALLOW_VWIND_CONTROL */ |
335 |
|
|
336 |
|
#ifdef ALLOW_OBCSN_CONTROL |
337 |
|
else if ( grdchkvarindex .eq. 11 ) then |
338 |
|
il=ilnblnk( xx_obcsn_file ) |
339 |
|
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
340 |
|
write(fname(1:80),'(3a,i10.10)') |
341 |
|
& yadmark, xx_obcsn_file(1:il),'.',optimcycle |
342 |
|
else if ( theSimulationMode .EQ. FORWARD_SIMULATION ) then |
343 |
|
write(fname(1:80),'(2a,i10.10)') |
344 |
|
& xx_obcsn_file(1:il),'.',optimcycle |
345 |
|
end if |
346 |
|
|
347 |
|
call active_read_xz( fname, tmpfldxz, icvrec, |
348 |
|
& doglobalread, ladinit, optimcycle, |
349 |
|
& mythid, dummy) |
350 |
|
|
351 |
|
xx_comp_ref = tmpfldxz( itilepos,layer,itile,jtile ) |
352 |
|
xx_comp_pert = xx_comp_ref + localEps |
353 |
|
tmpfldxz( itilepos,layer,itile,jtile ) = xx_comp_pert |
354 |
|
|
355 |
|
call active_write_xz( fname, tmpfldxz, icvrec, |
356 |
|
& optimcycle, |
357 |
|
& mythid, dummy) |
358 |
|
|
359 |
|
#endif /* ALLOW_OBCSN_CONTROL */ |
360 |
|
|
361 |
|
#ifdef ALLOW_OBCSS_CONTROL |
362 |
|
else if ( grdchkvarindex .eq. 12 ) then |
363 |
|
il=ilnblnk( xx_obcss_file ) |
364 |
|
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
365 |
|
write(fname(1:80),'(3a,i10.10)') |
366 |
|
& yadmark, xx_obcss_file(1:il),'.',optimcycle |
367 |
|
else if ( theSimulationMode .EQ. FORWARD_SIMULATION ) then |
368 |
|
write(fname(1:80),'(2a,i10.10)') |
369 |
|
& xx_obcss_file(1:il),'.',optimcycle |
370 |
|
end if |
371 |
|
|
372 |
|
call active_read_xz( fname, tmpfldxz, icvrec, |
373 |
|
& doglobalread, ladinit, optimcycle, |
374 |
|
& mythid, dummy) |
375 |
|
|
376 |
|
xx_comp_ref = tmpfldxz( itilepos,layer,itile,jtile ) |
377 |
|
xx_comp_pert = xx_comp_ref + localEps |
378 |
|
tmpfldxz( itilepos,layer,itile,jtile ) = xx_comp_pert |
379 |
|
|
380 |
|
call active_write_xz( fname, tmpfldxz, icvrec, |
381 |
|
& optimcycle, |
382 |
|
& mythid, dummy) |
383 |
|
|
384 |
|
#endif /* ALLOW_OBCSS_CONTROL */ |
385 |
|
|
386 |
|
#ifdef ALLOW_OBCSW_CONTROL |
387 |
|
else if ( grdchkvarindex .eq. 13 ) then |
388 |
|
il=ilnblnk( xx_obcsw_file ) |
389 |
|
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
390 |
|
write(fname(1:80),'(3a,i10.10)') |
391 |
|
& yadmark, xx_obcsw_file(1:il),'.',optimcycle |
392 |
|
else if ( theSimulationMode .EQ. FORWARD_SIMULATION ) then |
393 |
|
write(fname(1:80),'(2a,i10.10)') |
394 |
|
& xx_obcsw_file(1:il),'.',optimcycle |
395 |
|
end if |
396 |
|
|
397 |
|
call active_read_yz( fname, tmpfldyz, icvrec, |
398 |
|
& doglobalread, ladinit, optimcycle, |
399 |
|
& mythid, dummy) |
400 |
|
|
401 |
|
xx_comp_ref = tmpfldyz( jtilepos,layer,itile,jtile ) |
402 |
|
xx_comp_pert = xx_comp_ref + localEps |
403 |
|
tmpfldyz( jtilepos,layer,itile,jtile ) = xx_comp_pert |
404 |
|
|
405 |
|
call active_write_yz( fname, tmpfldyz, icvrec, |
406 |
|
& optimcycle, |
407 |
|
& mythid, dummy) |
408 |
|
|
409 |
|
#endif /* ALLOW_OBCSW_CONTROL */ |
410 |
|
|
411 |
|
#ifdef ALLOW_OBCSE_CONTROL |
412 |
|
else if ( grdchkvarindex .eq. 14 ) then |
413 |
|
il=ilnblnk( xx_obcse_file ) |
414 |
|
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
415 |
|
write(fname(1:80),'(3a,i10.10)') |
416 |
|
& yadmark, xx_obcse_file(1:il),'.',optimcycle |
417 |
|
else if ( theSimulationMode .EQ. FORWARD_SIMULATION ) then |
418 |
|
write(fname(1:80),'(2a,i10.10)') |
419 |
|
& xx_obcse_file(1:il),'.',optimcycle |
420 |
|
end if |
421 |
|
|
422 |
|
call active_read_yz( fname, tmpfldyz, icvrec, |
423 |
|
& doglobalread, ladinit, optimcycle, |
424 |
|
& mythid, dummy) |
425 |
|
|
426 |
|
xx_comp_ref = tmpfldyz( jtilepos,layer,itile,jtile ) |
427 |
|
xx_comp_pert = xx_comp_ref + localEps |
428 |
|
tmpfldyz( jtilepos,layer,itile,jtile ) = xx_comp_pert |
429 |
|
|
430 |
|
call active_write_yz( fname, tmpfldyz, icvrec, |
431 |
|
& optimcycle, |
432 |
|
& mythid, dummy) |
433 |
|
|
434 |
|
#endif /* ALLOW_OBCSE_CONTROL */ |
435 |
|
|
436 |
#ifdef ALLOW_TR10_CONTROL |
#ifdef ALLOW_TR10_CONTROL |
437 |
else if ( grdchkvarindex .eq. 17 ) then |
else if ( grdchkvarindex .eq. 17 ) then |
438 |
il=ilnblnk( xx_tr1_file ) |
il=ilnblnk( xx_tr1_file ) |
|
write(fname(1:80),'(80a)') ' ' |
|
439 |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
440 |
write(fname(1:80),'(3a,i10.10)') |
write(fname(1:80),'(3a,i10.10)') |
441 |
& yadmark, xx_tr1_file(1:il),'.',optimcycle |
& yadmark, xx_tr1_file(1:il),'.',optimcycle |
461 |
#ifdef ALLOW_SST0_CONTROL |
#ifdef ALLOW_SST0_CONTROL |
462 |
else if ( grdchkvarindex .eq. 18 ) then |
else if ( grdchkvarindex .eq. 18 ) then |
463 |
il=ilnblnk( xx_sst_file ) |
il=ilnblnk( xx_sst_file ) |
|
write(fname(1:80),'(80a)') ' ' |
|
464 |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
465 |
write(fname(1:80),'(3a,i10.10)') |
write(fname(1:80),'(3a,i10.10)') |
466 |
& yadmark, xx_sst_file(1:il),'.',optimcycle |
& yadmark, xx_sst_file(1:il),'.',optimcycle |
486 |
#ifdef ALLOW_SSS0_CONTROL |
#ifdef ALLOW_SSS0_CONTROL |
487 |
else if ( grdchkvarindex .eq. 19 ) then |
else if ( grdchkvarindex .eq. 19 ) then |
488 |
il=ilnblnk( xx_sss_file ) |
il=ilnblnk( xx_sss_file ) |
|
write(fname(1:80),'(80a)') ' ' |
|
489 |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
490 |
write(fname(1:80),'(3a,i10.10)') |
write(fname(1:80),'(3a,i10.10)') |
491 |
& yadmark, xx_sss_file(1:il),'.',optimcycle |
& yadmark, xx_sss_file(1:il),'.',optimcycle |
511 |
#ifdef ALLOW_HFACC_CONTROL |
#ifdef ALLOW_HFACC_CONTROL |
512 |
else if ( grdchkvarindex .eq. 20 ) then |
else if ( grdchkvarindex .eq. 20 ) then |
513 |
il=ilnblnk( xx_hfacc_file ) |
il=ilnblnk( xx_hfacc_file ) |
|
write(fname(1:80),'(80a)') ' ' |
|
514 |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
if ( theSimulationMode .EQ. TANGENT_SIMULATION ) then |
515 |
write(fname(1:80),'(3a,i10.10)') |
write(fname(1:80),'(3a,i10.10)') |
516 |
& yadmark, xx_hfacc_file(1:il),'.',optimcycle |
& yadmark, xx_hfacc_file(1:il),'.',optimcycle |