AGRI_NP_INIT Subroutine

public subroutine AGRI_NP_INIT(YNAG, KPATCH)

Arguments

Type IntentOptional AttributesName
type(AGRI_NP_t), intent(inout) :: YNAG
integer, intent(in) :: KPATCH

Contents

Source Code


Source Code

SUBROUTINE AGRI_NP_INIT(YNAG,KPATCH)
TYPE(AGRI_NP_t), INTENT(INOUT) :: YNAG
INTEGER, INTENT(IN) :: KPATCH
INTEGER :: JP
REAL(KIND=JPRB) :: ZHOOK_HANDLE
IF (LHOOK) CALL DR_HOOK("MODD_AGRI_N:AGRI_NP_INIT",0,ZHOOK_HANDLE)
! 
IF (ASSOCIATED(YNAG%AL)) THEN
  DO JP = 1,KPATCH
    CALL AGRI_INIT(YNAG%AL(JP))
  ENDDO
  DEALLOCATE(YNAG%AL)
ELSE
  ALLOCATE(YNAG%AL(KPATCH))
  DO JP = 1,KPATCH
    CALL AGRI_INIT(YNAG%AL(JP))
  ENDDO
ENDIF
!
IF (LHOOK) CALL DR_HOOK("MODD_AGRI_N:AGRI_NP_INIT",1,ZHOOK_HANDLE)
END SUBROUTINE AGRI_NP_INIT