MOM6
mom_restart::query_initialized Interface Reference

Detailed Description

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

Definition at line 127 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...
 

Detailed Description

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

Definition at line 127 of file MOM_restart.F90.

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 536 of file MOM_restart.F90.

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

◆ 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 675 of file MOM_restart.F90.

675  real, 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_ptr0d(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_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 563 of file MOM_restart.F90.

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

◆ 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 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_ptr1d(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  "probably because of the suspect comparison of pointers by ASSOCIATED.")
738  query_initialized = query_initialized_name(name, cs)
739  endif
740 

◆ 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 590 of file MOM_restart.F90.

590  real, dimension(:,:), &
591  target, intent(in) :: f_ptr !< A pointer to the field that is being queried
592  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
593  logical :: query_initialized
594 ! This subroutine tests whether the field pointed to by f_ptr has
595 ! been initialized from a restart file.
596 
597  integer :: m,n
598  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
599  "query_initialized: Module must be initialized before it is used.")
600  if (cs%novars > cs%max_fields) call restart_error(cs)
601 
602  query_initialized = .false.
603  n = cs%novars+1
604  do m=1,cs%novars
605  if (associated(cs%var_ptr2d(m)%p,f_ptr)) then
606  if (cs%restart_field(m)%initialized) query_initialized = .true.
607  n = m ; exit
608  endif
609  enddo
610 ! Assume that you are going to initialize it now, so set flag to initialized if
611 ! queried again.
612  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
613 

◆ 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 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_ptr2d(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  "probably because of the suspect comparison of pointers by ASSOCIATED.")
774  query_initialized = query_initialized_name(name, cs)
775  endif
776 

◆ 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 618 of file MOM_restart.F90.

618  real, dimension(:,:,:), &
619  target, intent(in) :: f_ptr !< A pointer to the field that is being queried
620  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
621  logical :: query_initialized
622 ! This subroutine tests whether the field pointed to by f_ptr has
623 ! been initialized from a restart file.
624 
625  integer :: m,n
626  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
627  "query_initialized: Module must be initialized before it is used.")
628  if (cs%novars > cs%max_fields) call restart_error(cs)
629 
630  query_initialized = .false.
631  n = cs%novars+1
632  do m=1,cs%novars
633  if (associated(cs%var_ptr3d(m)%p,f_ptr)) then
634  if (cs%restart_field(m)%initialized) query_initialized = .true.
635  n = m ; exit
636  endif
637  enddo
638 ! Assume that you are going to initialize it now, so set flag to initialized if
639 ! queried again.
640  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
641 

◆ 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 782 of file MOM_restart.F90.

782  real, dimension(:,:,:), &
783  target, intent(in) :: f_ptr !< A pointer to the field that is being queried
784  character(len=*), intent(in) :: name !< The name of the field that is being queried
785  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
786  logical :: query_initialized
787 ! This subroutine tests whether the field pointed to by f_ptr or with the
788 ! specified variable name has been initialized from a restart file.
789 
790  integer :: m, n
791  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
792  "query_initialized: Module must be initialized before it is used.")
793  if (cs%novars > cs%max_fields) call restart_error(cs)
794 
795  query_initialized = .false.
796  n = cs%novars+1
797  do m=1,cs%novars
798  if (associated(cs%var_ptr3d(m)%p,f_ptr)) then
799  if (cs%restart_field(m)%initialized) query_initialized = .true.
800  n = m ; exit
801  endif
802  enddo
803 ! Assume that you are going to initialize it now, so set flag to initialized if
804 ! queried again.
805  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
806  if (n==cs%novars+1) then
807  if (is_root_pe()) &
808  call mom_error(note, "MOM_restart: Unable to find "//name//" queried by pointer, "//&
809  "possibly because of the suspect comparison of pointers by ASSOCIATED.")
810  query_initialized = query_initialized_name(name, cs)
811  endif
812 

◆ 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 646 of file MOM_restart.F90.

646  real, dimension(:,:,:,:), &
647  target, intent(in) :: f_ptr !< A pointer to the field that is being queried
648  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
649  logical :: query_initialized
650 ! This subroutine tests whether the field pointed to by f_ptr has
651 ! been initialized from a restart file.
652 
653  integer :: m,n
654  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
655  "query_initialized: Module must be initialized before it is used.")
656  if (cs%novars > cs%max_fields) call restart_error(cs)
657 
658  query_initialized = .false.
659  n = cs%novars+1
660  do m=1,cs%novars
661  if (associated(cs%var_ptr4d(m)%p,f_ptr)) then
662  if (cs%restart_field(m)%initialized) query_initialized = .true.
663  n = m ; exit
664  endif
665  enddo
666 ! Assume that you are going to initialize it now, so set flag to initialized if
667 ! queried again.
668  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
669 

◆ 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 818 of file MOM_restart.F90.

818  real, dimension(:,:,:,:), &
819  target, intent(in) :: f_ptr !< A pointer to the field that is being queried
820  character(len=*), intent(in) :: name !< The name of the field that is being queried
821  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
822  logical :: query_initialized
823 ! This subroutine tests whether the field pointed to by f_ptr or with the
824 ! specified variable name has been initialized from a restart file.
825 
826  integer :: m, n
827  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
828  "query_initialized: Module must be initialized before it is used.")
829  if (cs%novars > cs%max_fields) call restart_error(cs)
830 
831  query_initialized = .false.
832  n = cs%novars+1
833  do m=1,cs%novars
834  if (associated(cs%var_ptr4d(m)%p,f_ptr)) then
835  if (cs%restart_field(m)%initialized) query_initialized = .true.
836  n = m ; exit
837  endif
838  enddo
839 ! Assume that you are going to initialize it now, so set flag to initialized if
840 ! queried again.
841  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
842  if (n==cs%novars+1) then
843  if (is_root_pe()) &
844  call mom_error(note, "MOM_restart: Unable to find "//name//" queried by pointer, "//&
845  "possibly because of the suspect comparison of pointers by ASSOCIATED.")
846  query_initialized = query_initialized_name(name, cs)
847  endif
848 

◆ 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 502 of file MOM_restart.F90.

502  character(len=*), intent(in) :: name !< The name of the field that is being queried
503  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in)
504  logical :: query_initialized
505 ! This subroutine returns .true. if the field referred to by name has
506 ! initialized from a restart file, and .false. otherwise.
507 
508  integer :: m,n
509  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
510  "query_initialized: Module must be initialized before it is used.")
511  if (cs%novars > cs%max_fields) call restart_error(cs)
512 
513  query_initialized = .false.
514  n = cs%novars+1
515  do m=1,cs%novars
516  if (trim(name) == cs%restart_field(m)%var_name) then
517  if (cs%restart_field(m)%initialized) query_initialized = .true.
518  n = m ; exit
519  endif
520  enddo
521 ! Assume that you are going to initialize it now, so set flag to initialized if
522 ! queried again.
523  if (n<=cs%novars) cs%restart_field(n)%initialized = .true.
524  if ((n==cs%novars+1) .and. (is_root_pe())) &
525  call mom_error(note,"MOM_restart: Unknown restart variable "//name// &
526  " queried for initialization.")
527 
528  if ((is_root_pe()) .and. query_initialized) &
529  call mom_error(note,"MOM_restart: "//name// &
530  " initialization confirmed by name.")
531 

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