385
386
388
389
390
391 integer, intent(in) :: ng, model
392
393
394
395 integer :: Is, Ie
396 integer :: i, ivar, status
397
398# ifdef DISTRIBUTE
399 integer :: vrecord = -1
400
401 real(r8) :: scale = 1.0_r8
402# endif
403 real(r8) :: rval
404
405 character (len=1 ) :: char1
406 character (len=2 ) :: char2
407 character (len=256) :: ncname
408
409 character (len=*), parameter :: MyFile = &
410 & __FILE__//", get_gst_pio"
411
412 TYPE (Var_desc_t) :: pioVar
413
414 sourcefile=myfile
415
416
417
418
419
420
421
422 ncname=gst(ng)%name
423 IF (gst(ng)%pioFile%fh.eq.-1) THEN
425 IF (founderror(exit_flag, noerror, __line__, myfile)) THEN
426 WRITE (stdout,10) trim(ncname)
427 RETURN
428 END IF
429 END IF
430
431
432
434 & piofile = gst(ng)%pioFile)
435 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
436 IF (ivar.ne.nev) THEN
437 IF (master) WRITE (stdout,20) ', NEV = ', ivar, nev
438 exit_flag=6
439 RETURN
440 END IF
441
442
443
445 & piofile = gst(ng)%pioFile)
446 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
447 IF (ivar.ne.ncv) THEN
448 IF (master) WRITE (stdout,20) ', NCV = ', ivar, ncv
449 exit_flag=6
450 RETURN
451 END IF
452
453
454
456 & piofile = gst(ng)%pioFile)
457 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
458 IF (ivar.ne.mstate(ng)) THEN
459 IF (master) WRITE (stdout,20) ', Mstate = ', ivar, mstate(ng)
460 exit_flag=6
461 RETURN
462 END IF
463
464
465
467 & piofile = gst(ng)%pioFile)
468 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
469 IF (ivar.ne.numthreads) THEN
470 IF (master) WRITE (stdout,20) ', Nnodes = ', ivar, numthreads
471 exit_flag=6
472 RETURN
473 END IF
474
475
476
478 & piofile = gst(ng)%pioFile)
479 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
480
481
482
484 & piofile = gst(ng)%pioFile)
485 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
486
487
488
490 & piofile = gst(ng)%pioFile)
491 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
492
493
494
496 & piofile = gst(ng)%pioFile)
497 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
498 IF (char1.ne.bmat) THEN
499 IF (master) WRITE (stdout,30) ', bmat = ', char1, bmat
500 exit_flag=6
501 RETURN
502 END IF
503
504
505
507 & piofile = gst(ng)%pioFile, &
508 & start = (/1/), &
509 & total = (/2/))
510 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
511 IF (char2(1:2).ne.which(1:2)) THEN
512 IF (master) WRITE (stdout,30) ', which = ', char2, which
513 exit_flag=6
514 RETURN
515 END IF
516
517
518
520 & piofile = gst(ng)%pioFile, &
521 & start = (/1/), &
522 & total = (/1/))
523 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
524 IF (char1.ne.howmany) THEN
525 IF (master) WRITE (stdout,30) ', howmany = ', char1, howmany
526 exit_flag=6
527 RETURN
528 END IF
529
530
531
533 & piofile = gst(ng)%pioFile)
534 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
535 IF (rval.ne.ritz_tol) THEN
536 IF (master) WRITE (stdout,40) ', Ritz_tol = ', rval, ritz_tol
537 END IF
538 ritz_tol=rval
539
540
541
543 & piofile = gst(ng)%pioFile, &
544 & start = (/1/), &
545 & total = (/SIZE(iparam)/))
546 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
547
548
549
551 & piofile = gst(ng)%pioFile, &
552 & start = (/1/), &
553 & total = (/SIZE(ipntr)/))
554 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
555
556
557
559 & piofile = gst(ng)%pioFile, &
560 & start = (/1/), &
561 & total = (/SIZE(iaupd)/))
562 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
563
564
565
567 & piofile = gst(ng)%pioFile, &
568 & start = (/1/), &
569 & total = (/SIZE(iaitr)/))
570 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
571
572
573
575 & piofile = gst(ng)%pioFile, &
576 & start = (/1/), &
577 & total = (/SIZE(iaup2)/))
578 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
579
580
581
583 & piofile = gst(ng)%pioFile, &
584 & start = (/1/), &
585 & total = (/SIZE(laitr)/))
586 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
587
588
589
591 & piofile = gst(ng)%pioFile, &
592 & start = (/1/), &
593 & total = (/SIZE(laup2)/))
594 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
595
596
597
599 & piofile = gst(ng)%pioFile, &
600 & start = (/1/), &
601 & total = (/SIZE(raitr)/))
602 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
603
604
605
607 & piofile = gst(ng)%pioFile, &
608 & start = (/1/), &
609 & total = (/SIZE(raup2)/))
610 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
611
612
613
614
615
616
617
618 status=pio_inq_varid(gst(ng)%pioFile, 'Bvec', piovar)
619 IF (founderror(status, pio_noerr, __line__, myfile)) RETURN
620
621 IF (kind(storage(ng)%Bvec).eq.8) THEN
622 CALL pio_read_darray (gst(ng)%pioFile, piovar, &
624 & storage(ng)%Bvec(nstr(ng):,:), status)
625 IF (founderror(status, pio_noerr, __line__, myfile)) RETURN
626 ELSE
627 CALL pio_read_darray (gst(ng)%pioFile, piovar, &
629 & storage(ng)%Bvec(nstr(ng):,:), status)
630 IF (founderror(status, pio_noerr, __line__, myfile)) RETURN
631 END IF
632
633
634
635 status=pio_inq_varid(gst(ng)%pioFile, 'resid', piovar)
636 IF (founderror(status, pio_noerr, __line__, myfile)) RETURN
637
638 IF (kind(storage(ng)%Bvec).eq.8) THEN
639 CALL pio_read_darray (gst(ng)%pioFile, piovar, &
641 & storage(ng)%resid(nstr(ng):), status)
642 IF (founderror(status, pio_noerr, __line__, myfile)) RETURN
643 ELSE
644 CALL pio_read_darray (gst(ng)%pioFile, piovar, &
646 & storage(ng)%resid(nstr(ng):), status)
647 IF (founderror(status, pio_noerr, __line__, myfile)) RETURN
648 END IF
649
650
651
652 is=myrank*3*nstate(ng)+1
653 ie=min(is+3*nstate(ng)-1, 3*mstate(ng))
654
655 status=pio_inq_varid(gst(ng)%pioFile, 'SworkD', piovar)
656 IF (founderror(status, pio_noerr, __line__, myfile)) RETURN
657
658 IF (kind(storage(ng)%SworkD).eq.8) THEN
659 CALL pio_read_darray (gst(ng)%pioFile, piovar, &
661 & storage(ng)%SworkD(nstr(ng):), status)
662 IF (founderror(status, pio_noerr, __line__, myfile)) RETURN
663 ELSE
664 CALL pio_read_darray (gst(ng)%pioFile, piovar, &
666 & storage(ng)%SworkD(nstr(ng):), status)
667 IF (founderror(status, pio_noerr, __line__, myfile)) RETURN
668 END IF
669
670
671
673 & sworkl(:,ng), &
674 & piofile = gst(ng)%pioFile, &
675 & start = (/1/), &
676 & total = (/lworkl/))
677 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
678
679 10 FORMAT (/,' GET_GST_PIO - unable to open checkpointing NetCDF', &
680 & ' file:', a)
681 20 FORMAT (/,' GET_GST_PIO - inconsistent input parameter', a, 2i4)
682 30 FORMAT (/,' GET_GST_PIO - inconsistent input parameter', a, a, a)
683 40 FORMAT (/,' GET_GST_PIO - input parameter', a, 1pe10.2,0p, &
684 & /, 16x,'has been reset to: ', 1pe10.2)
685
686 RETURN
type(io_desc_t), dimension(:), pointer iodesc_dp_resid
type(io_desc_t), dimension(:), pointer iodesc_sp_bvec
type(io_desc_t), dimension(:), pointer iodesc_dp_bvec
subroutine, public pio_netcdf_open(ng, model, ncname, omode, piofile)
type(io_desc_t), dimension(:), pointer iodesc_sp_sworkd
type(io_desc_t), dimension(:), pointer iodesc_dp_sworkd