MOM6
mom_restart::query_initialized Interface Reference

Detailed Description

Indicate whether a field has been read from a restart file.

Definition at line 116 of file MOM_restart.F90.

Private functions

logical function query_initialized_name (name, CS)
 query_initialized_name determines whether a named field has been successfully read from a restart file yet. More...
 
logical function query_initialized_0d (f_ptr, CS)
 Indicate whether the field pointed to by f_ptr has been initialized from a restart file. More...
 
logical function query_initialized_0d_name (f_ptr, name, CS)
 Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file. More...
 
logical function query_initialized_1d (f_ptr, CS)
 Indicate whether the field pointed to by f_ptr has been initialized from a restart file. More...
 
logical function query_initialized_1d_name (f_ptr, name, CS)
 Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file. More...
 
logical function query_initialized_2d (f_ptr, CS)
 Indicate whether the field pointed to by f_ptr has been initialized from a restart file. More...
 
logical function query_initialized_2d_name (f_ptr, name, CS)
 Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file. More...
 
logical function query_initialized_3d (f_ptr, CS)
 Indicate whether the field pointed to by f_ptr has been initialized from a restart file. More...
 
logical function query_initialized_3d_name (f_ptr, name, CS)
 Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file. More...
 
logical function query_initialized_4d (f_ptr, CS)
 Indicate whether the field pointed to by f_ptr has been initialized from a restart file. More...
 
logical function query_initialized_4d_name (f_ptr, name, CS)
 Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file. More...
 

Functions and subroutines

◆ query_initialized_0d()

logical function mom_restart::query_initialized::query_initialized_0d ( real, intent(in), target  f_ptr,
type(mom_restart_cs), pointer  CS 
)
private

Indicate whether the field pointed to by f_ptr has been initialized from a restart file.

Parameters
[in]f_ptrA pointer to the field that is being queried
csA pointer to a MOM_restart_CS object (intent in)

Definition at line 464 of file MOM_restart.F90.

464  real, target, intent(in) :: f_ptr !< A pointer to the field that is being queried
465  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
466  logical :: query_initialized
467 ! This subroutine tests whether the field pointed to by f_ptr has
468 ! been initialized from a restart file.
469 
470  integer :: m,n
471  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
472  "query_initialized: Module must be initialized before it is used.")
473  if (cs%novars > cs%max_fields) call restart_error(cs)
474 
475  query_initialized = .false.
476  n = cs%novars+1
477  do m=1,cs%novars
478  if (associated(cs%var_ptr0d(m)%p,f_ptr)) then
479  if (cs%restart_field(m)%initialized) query_initialized = .true.
480  n = m ; exit
481  endif
482  enddo
483 ! Assume that you are going to initialize it now, so set flag to initialized if
484 ! queried again.
485  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
486 

◆ query_initialized_0d_name()

logical function mom_restart::query_initialized::query_initialized_0d_name ( real, intent(in), target  f_ptr,
character(len=*), intent(in)  name,
type(mom_restart_cs), pointer  CS 
)
private

Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file.

Parameters
[in]f_ptrA pointer to the field that is being queried
[in]nameThe name of the field that is being queried
csA pointer to a MOM_restart_CS object (intent in)

Definition at line 603 of file MOM_restart.F90.

603  real, target, intent(in) :: f_ptr !< A pointer to the field that is being queried
604  character(len=*), intent(in) :: name !< The name of the field that is being queried
605  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
606  logical :: query_initialized
607 ! This subroutine tests whether the field pointed to by f_ptr or with the
608 ! specified variable name has been initialized from a restart file.
609 
610  integer :: m,n
611  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
612  "query_initialized: Module must be initialized before it is used.")
613  if (cs%novars > cs%max_fields) call restart_error(cs)
614 
615  query_initialized = .false.
616  n = cs%novars+1
617  do m=1,cs%novars
618  if (associated(cs%var_ptr0d(m)%p,f_ptr)) then
619  if (cs%restart_field(m)%initialized) query_initialized = .true.
620  n = m ; exit
621  endif
622  enddo
623 ! Assume that you are going to initialize it now, so set flag to initialized if
624 ! queried again.
625  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
626  if (n==cs%novars+1) then
627  if (is_root_pe()) &
628  call mom_error(note,"MOM_restart: Unable to find "//name//" queried by pointer, "//&
629  "probably because of the suspect comparison of pointers by ASSOCIATED.")
630  query_initialized = query_initialized_name(name, cs)
631  endif
632 

◆ query_initialized_1d()

logical function mom_restart::query_initialized::query_initialized_1d ( real, dimension(:), intent(in), target  f_ptr,
type(mom_restart_cs), pointer  CS 
)
private

Indicate whether the field pointed to by f_ptr has been initialized from a restart file.

Parameters
[in]f_ptrA pointer to the field that is being queried
csA pointer to a MOM_restart_CS object (intent in)

Definition at line 491 of file MOM_restart.F90.

491  real, dimension(:), target, intent(in) :: f_ptr !< A pointer to the field that is being queried
492  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
493  logical :: query_initialized
494 ! This subroutine tests whether the field pointed to by f_ptr has
495 ! been initialized from a restart file.
496 
497  integer :: m,n
498  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
499  "query_initialized: Module must be initialized before it is used.")
500  if (cs%novars > cs%max_fields) call restart_error(cs)
501 
502  query_initialized = .false.
503  n = cs%novars+1
504  do m=1,cs%novars
505  if (associated(cs%var_ptr1d(m)%p,f_ptr)) then
506  if (cs%restart_field(m)%initialized) query_initialized = .true.
507  n = m ; exit
508  endif
509  enddo
510 ! Assume that you are going to initialize it now, so set flag to initialized if
511 ! queried again.
512  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
513 

◆ query_initialized_1d_name()

logical function mom_restart::query_initialized::query_initialized_1d_name ( real, dimension(:), intent(in), target  f_ptr,
character(len=*), intent(in)  name,
type(mom_restart_cs), pointer  CS 
)
private

Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file.

Parameters
[in]f_ptrA pointer to the field that is being queried
[in]nameThe name of the field that is being queried
csA pointer to a MOM_restart_CS object (intent in)

Definition at line 638 of file MOM_restart.F90.

638  real, dimension(:), &
639  target, intent(in) :: f_ptr !< A pointer to the field that is being queried
640  character(len=*), intent(in) :: name !< The name of the field that is being queried
641  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
642  logical :: query_initialized
643 ! This subroutine tests whether the field pointed to by f_ptr or with the
644 ! specified variable name has been initialized from a restart file.
645 
646  integer :: m,n
647  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
648  "query_initialized: Module must be initialized before it is used.")
649  if (cs%novars > cs%max_fields) call restart_error(cs)
650 
651  query_initialized = .false.
652  n = cs%novars+1
653  do m=1,cs%novars
654  if (associated(cs%var_ptr1d(m)%p,f_ptr)) then
655  if (cs%restart_field(m)%initialized) query_initialized = .true.
656  n = m ; exit
657  endif
658  enddo
659 ! Assume that you are going to initialize it now, so set flag to initialized if
660 ! queried again.
661  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
662  if (n==cs%novars+1) then
663  if (is_root_pe()) &
664  call mom_error(note,"MOM_restart: Unable to find "//name//" queried by pointer, "//&
665  "probably because of the suspect comparison of pointers by ASSOCIATED.")
666  query_initialized = query_initialized_name(name, cs)
667  endif
668 

◆ query_initialized_2d()

logical function mom_restart::query_initialized::query_initialized_2d ( real, dimension(:,:), intent(in), target  f_ptr,
type(mom_restart_cs), pointer  CS 
)
private

Indicate whether the field pointed to by f_ptr has been initialized from a restart file.

Parameters
[in]f_ptrA pointer to the field that is being queried
csA pointer to a MOM_restart_CS object (intent in)

Definition at line 518 of file MOM_restart.F90.

518  real, dimension(:,:), &
519  target, intent(in) :: f_ptr !< A pointer to the field that is being queried
520  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
521  logical :: query_initialized
522 ! This subroutine tests whether the field pointed to by f_ptr has
523 ! been initialized from a restart file.
524 
525  integer :: m,n
526  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
527  "query_initialized: Module must be initialized before it is used.")
528  if (cs%novars > cs%max_fields) call restart_error(cs)
529 
530  query_initialized = .false.
531  n = cs%novars+1
532  do m=1,cs%novars
533  if (associated(cs%var_ptr2d(m)%p,f_ptr)) then
534  if (cs%restart_field(m)%initialized) query_initialized = .true.
535  n = m ; exit
536  endif
537  enddo
538 ! Assume that you are going to initialize it now, so set flag to initialized if
539 ! queried again.
540  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
541 

◆ query_initialized_2d_name()

logical function mom_restart::query_initialized::query_initialized_2d_name ( real, dimension(:,:), intent(in), target  f_ptr,
character(len=*), intent(in)  name,
type(mom_restart_cs), pointer  CS 
)
private

Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file.

Parameters
[in]f_ptrA pointer to the field that is being queried
[in]nameThe name of the field that is being queried
csA pointer to a MOM_restart_CS object (intent in)

Definition at line 674 of file MOM_restart.F90.

674  real, dimension(:,:), &
675  target, intent(in) :: f_ptr !< A pointer to the field that is being queried
676  character(len=*), intent(in) :: name !< The name of the field that is being queried
677  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
678  logical :: query_initialized
679 ! This subroutine tests whether the field pointed to by f_ptr or with the
680 ! specified variable name has been initialized from a restart file.
681 
682  integer :: m,n
683  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
684  "query_initialized: Module must be initialized before it is used.")
685  if (cs%novars > cs%max_fields) call restart_error(cs)
686 
687  query_initialized = .false.
688  n = cs%novars+1
689  do m=1,cs%novars
690  if (associated(cs%var_ptr2d(m)%p,f_ptr)) then
691  if (cs%restart_field(m)%initialized) query_initialized = .true.
692  n = m ; exit
693  endif
694  enddo
695 ! Assume that you are going to initialize it now, so set flag to initialized if
696 ! queried again.
697  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
698  if (n==cs%novars+1) then
699  if (is_root_pe()) &
700  call mom_error(note,"MOM_restart: Unable to find "//name//" queried by pointer, "//&
701  "probably because of the suspect comparison of pointers by ASSOCIATED.")
702  query_initialized = query_initialized_name(name, cs)
703  endif
704 

◆ query_initialized_3d()

logical function mom_restart::query_initialized::query_initialized_3d ( real, dimension(:,:,:), intent(in), target  f_ptr,
type(mom_restart_cs), pointer  CS 
)
private

Indicate whether the field pointed to by f_ptr has been initialized from a restart file.

Parameters
[in]f_ptrA pointer to the field that is being queried
csA pointer to a MOM_restart_CS object (intent in)

Definition at line 546 of file MOM_restart.F90.

546  real, dimension(:,:,:), &
547  target, intent(in) :: f_ptr !< A pointer to the field that is being queried
548  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
549  logical :: query_initialized
550 ! This subroutine tests whether the field pointed to by f_ptr has
551 ! been initialized from a restart file.
552 
553  integer :: m,n
554  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
555  "query_initialized: Module must be initialized before it is used.")
556  if (cs%novars > cs%max_fields) call restart_error(cs)
557 
558  query_initialized = .false.
559  n = cs%novars+1
560  do m=1,cs%novars
561  if (associated(cs%var_ptr3d(m)%p,f_ptr)) then
562  if (cs%restart_field(m)%initialized) query_initialized = .true.
563  n = m ; exit
564  endif
565  enddo
566 ! Assume that you are going to initialize it now, so set flag to initialized if
567 ! queried again.
568  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
569 

◆ query_initialized_3d_name()

logical function mom_restart::query_initialized::query_initialized_3d_name ( real, dimension(:,:,:), intent(in), target  f_ptr,
character(len=*), intent(in)  name,
type(mom_restart_cs), pointer  CS 
)
private

Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file.

Parameters
[in]f_ptrA pointer to the field that is being queried
[in]nameThe name of the field that is being queried
csA pointer to a MOM_restart_CS object (intent in)

Definition at line 710 of file MOM_restart.F90.

710  real, dimension(:,:,:), &
711  target, intent(in) :: f_ptr !< A pointer to the field that is being queried
712  character(len=*), intent(in) :: name !< The name of the field that is being queried
713  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
714  logical :: query_initialized
715 ! This subroutine tests whether the field pointed to by f_ptr or with the
716 ! specified variable name has been initialized from a restart file.
717 
718  integer :: m, n
719  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
720  "query_initialized: Module must be initialized before it is used.")
721  if (cs%novars > cs%max_fields) call restart_error(cs)
722 
723  query_initialized = .false.
724  n = cs%novars+1
725  do m=1,cs%novars
726  if (associated(cs%var_ptr3d(m)%p,f_ptr)) then
727  if (cs%restart_field(m)%initialized) query_initialized = .true.
728  n = m ; exit
729  endif
730  enddo
731 ! Assume that you are going to initialize it now, so set flag to initialized if
732 ! queried again.
733  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
734  if (n==cs%novars+1) then
735  if (is_root_pe()) &
736  call mom_error(note, "MOM_restart: Unable to find "//name//" queried by pointer, "//&
737  "possibly because of the suspect comparison of pointers by ASSOCIATED.")
738  query_initialized = query_initialized_name(name, cs)
739  endif
740 

◆ query_initialized_4d()

logical function mom_restart::query_initialized::query_initialized_4d ( real, dimension(:,:,:,:), intent(in), target  f_ptr,
type(mom_restart_cs), pointer  CS 
)
private

Indicate whether the field pointed to by f_ptr has been initialized from a restart file.

Parameters
[in]f_ptrA pointer to the field that is being queried
csA pointer to a MOM_restart_CS object (intent in)

Definition at line 574 of file MOM_restart.F90.

574  real, dimension(:,:,:,:), &
575  target, intent(in) :: f_ptr !< A pointer to the field that is being queried
576  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
577  logical :: query_initialized
578 ! This subroutine tests whether the field pointed to by f_ptr has
579 ! been initialized from a restart file.
580 
581  integer :: m,n
582  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
583  "query_initialized: Module must be initialized before it is used.")
584  if (cs%novars > cs%max_fields) call restart_error(cs)
585 
586  query_initialized = .false.
587  n = cs%novars+1
588  do m=1,cs%novars
589  if (associated(cs%var_ptr4d(m)%p,f_ptr)) then
590  if (cs%restart_field(m)%initialized) query_initialized = .true.
591  n = m ; exit
592  endif
593  enddo
594 ! Assume that you are going to initialize it now, so set flag to initialized if
595 ! queried again.
596  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
597 

◆ query_initialized_4d_name()

logical function mom_restart::query_initialized::query_initialized_4d_name ( real, dimension(:,:,:,:), intent(in), target  f_ptr,
character(len=*), intent(in)  name,
type(mom_restart_cs), pointer  CS 
)
private

Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file.

Parameters
[in]f_ptrA pointer to the field that is being queried
[in]nameThe name of the field that is being queried
csA pointer to a MOM_restart_CS object (intent in)

Definition at line 746 of file MOM_restart.F90.

746  real, dimension(:,:,:,:), &
747  target, intent(in) :: f_ptr !< A pointer to the field that is being queried
748  character(len=*), intent(in) :: name !< The name of the field that is being queried
749  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
750  logical :: query_initialized
751 ! This subroutine tests whether the field pointed to by f_ptr or with the
752 ! specified variable name has been initialized from a restart file.
753 
754  integer :: m, n
755  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
756  "query_initialized: Module must be initialized before it is used.")
757  if (cs%novars > cs%max_fields) call restart_error(cs)
758 
759  query_initialized = .false.
760  n = cs%novars+1
761  do m=1,cs%novars
762  if (associated(cs%var_ptr4d(m)%p,f_ptr)) then
763  if (cs%restart_field(m)%initialized) query_initialized = .true.
764  n = m ; exit
765  endif
766  enddo
767 ! Assume that you are going to initialize it now, so set flag to initialized if
768 ! queried again.
769  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
770  if (n==cs%novars+1) then
771  if (is_root_pe()) &
772  call mom_error(note, "MOM_restart: Unable to find "//name//" queried by pointer, "//&
773  "possibly because of the suspect comparison of pointers by ASSOCIATED.")
774  query_initialized = query_initialized_name(name, cs)
775  endif
776 

◆ query_initialized_name()

logical function mom_restart::query_initialized::query_initialized_name ( character(len=*), intent(in)  name,
type(mom_restart_cs), pointer  CS 
)
private

query_initialized_name determines whether a named field has been successfully read from a restart file yet.

Parameters
[in]nameThe name of the field that is being queried
csA pointer to a MOM_restart_CS object (intent in)

Definition at line 430 of file MOM_restart.F90.

430  character(len=*), intent(in) :: name !< The name of the field that is being queried
431  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
432  logical :: query_initialized
433 ! This subroutine returns .true. if the field referred to by name has
434 ! initialized from a restart file, and .false. otherwise.
435 
436  integer :: m,n
437  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
438  "query_initialized: Module must be initialized before it is used.")
439  if (cs%novars > cs%max_fields) call restart_error(cs)
440 
441  query_initialized = .false.
442  n = cs%novars+1
443  do m=1,cs%novars
444  if (trim(name) == cs%restart_field(m)%var_name) then
445  if (cs%restart_field(m)%initialized) query_initialized = .true.
446  n = m ; exit
447  endif
448  enddo
449 ! Assume that you are going to initialize it now, so set flag to initialized if
450 ! queried again.
451  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
452  if ((n==cs%novars+1) .and. (is_root_pe())) &
453  call mom_error(note,"MOM_restart: Unknown restart variable "//name// &
454  " queried for initialization.")
455 
456  if ((is_root_pe()) .and. query_initialized) &
457  call mom_error(note,"MOM_restart: "//name// &
458  " initialization confirmed by name.")
459 

The documentation for this interface was generated from the following file: