My Project
Public Member Functions | List of all members
mod_ncll::insert_file_link Interface Reference

Public Member Functions

subroutine insert_filep_byncf (LIST, NCF, FOUND)
 

Detailed Description

Definition at line 200 of file mod_ncll.f90.

Member Function/Subroutine Documentation

◆ insert_filep_byncf()

subroutine mod_ncll::insert_file_link::insert_filep_byncf ( type(ncfilelist), intent(inout)  LIST,
type(ncfile), pointer  NCF,
logical, intent(out)  FOUND 
)

Definition at line 703 of file mod_ncll.f90.

703  ! ONLY INSERT NEW FILE IF NOT FOUND
704  ! ALWAYS INSERT NCFILEP AT THE END OF THE LIST
705  IMPLICIT NONE
706  TYPE(NCFILE),POINTER :: NCF
707  LOGICAL, INTENT(OUT) :: FOUND
708  TYPE(NCFILELIST), INTENT(INOUT) :: LIST
709  TYPE(NCFILEP), pointer :: CURRENT, PREVIOUS
710 
711  IF(.NOT.ASSOCIATED(ncf))&
712  & CALL fatal_error("INSERT_FILEP_BYNCF: NCF NOT ASSOCIATED!")
713 
714  previous => list%FIRST
715  current => previous%NEXT
716  found = .false.
717  ! DO NOT MAKE DUPLICATE ENTRIES IN THE LIST
718  DO
719  IF(.NOT. ASSOCIATED(current)) EXIT !END OF LIST
720  IF( ncf%FNAME == current%NCF%FNAME ) THEN ! FOUND THE FILE LINK
721  found = .true.
722  RETURN
723  ELSE
724  previous => previous%NEXT
725  current => current%NEXT
726  END IF
727  END DO
728  ! NOT FOUND - ADD NEW FILE TO END OF LIST
729 
730  previous%NEXT => new_filep()
731  previous%NEXT%NCF => ncf
732 

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