저는 Fortran을 처음 접했고 연구를 위해 모델 러닝 괴물을 구해야하므로 계속 진행하면서 배우고 있습니다. 그래서 "어리석은"질문을하면 유감입니다. 커맨드 라인에서 (Mac OSX,) 컴파일하려고하는데 이미 몇 가지 문제를 해결할 수 있었지만 지금은 해결 방법을 모르겠습니다. 나는 오류 뒤에 아이디어를 얻은 것 같지만, 다시 고칠 방법을 모르겠습니다.포트란 - 명시 적 인터페이스
모델이 거대하기 때문에 관련성이 있다고 생각하는 코드 섹션 만 게시합니다 (잘못된 것일 수도 있음). 20.54 :
실제, 외부 :: compute_co2_storage 1
내가
budget_utils.f90의 라인을 따라 오류 메시지를받을
!==========================================================================================!
! This subroutine simply updates the budget variables. !
!------------------------------------------------------------------------------------------!
subroutine update_budget(csite,lsl,ipaa,ipaz)
use ed_state_vars, only : sitetype ! ! structure
implicit none
!----- Arguments -----------------------------------------------------------------------!
type(sitetype) , target :: csite
integer , intent(in) :: lsl
integer , intent(in) :: ipaa
integer , intent(in) :: ipaz
!----- Local variables. ----------------------------------------------------------------!
integer :: ipa
!----- External functions. -------------------------------------------------------------!
real , external :: compute_water_storage
real , external :: compute_energy_storage
real , external :: compute_co2_storage
!---------------------------------------------------------------------------------------!
do ipa=ipaa,ipaz
!------------------------------------------------------------------------------------!
! Computing the storage terms for CO2, energy, and water budgets. !
!------------------------------------------------------------------------------------!
csite%co2budget_initialstorage(ipa) = compute_co2_storage(csite,ipa)
csite%wbudget_initialstorage(ipa) = compute_water_storage(csite,lsl,ipa)
csite%ebudget_initialstorage(ipa) = compute_energy_storage(csite,lsl,ipa)
end do
return
end subroutine update_budget
!==========================================================================================!
!==========================================================================================!
: 나는으로 시작하는 여러 서브 루틴을 가진 파일이 오류 : (1)에서 프로 시저 'compute_co2_storage'의 더미 인수 'csite'에이 프로 시저에 대한 명시 적 인터페이스가 필요한 속성이 있습니다.
(I ge 그러나 그들은 본질적으로 모두 동일합니다. 이것은 또 다른 500 개 라인 정도에 대해 하나의 이동 - 이제 (서브 루틴에서 "사용"하는) ed_state_vars.f90보고, 나는 기타 등
!============================================================================!
!============================================================================!
!---------------------------------------------------------------------------!
! Site type:
! The following are the patch level arrays that populate the current site.
!---------------------------------------------------------------------------!
type sitetype
integer :: npatches
! The global index of the first cohort in all patches
integer,pointer,dimension(:) :: paco_id
! The number of cohorts in each patch
integer,pointer,dimension(:) :: paco_n
! Global index of the first patch in this vector, across all patches
! on the grid
integer :: paglob_id
! The patches containing the cohort arrays
type(patchtype),pointer,dimension(:) :: patch
을 찾을 수 있습니다. 요점을 알려면 원래의 서브 루틴은 (더미) 인수 csite를 사용할 수 있도록 프로 시저에 대한 명시 적 인터페이스가 필요합니다. 다시 말하지만, 저는 Fortran에게 새로운 것이지만, 실제로 어떻게 생각하는지 이해하려고합니다. 나는 그것을 (그리고 어떻게 사용 하는가?) 명백한 인터페이스를 갖는 것이 무엇을 의미 하는지를 조사해왔다. 그러나 그것이 내 경우에 어떻게 적용되는지는 알 수 없다. 다른 컴파일러 (Intel?)를 사용해야할까요? 어떤 힌트?
편집 : 그래서 csite
는 모든 절차에서 target
을 선언하고 sitetype
에 규정 된 선언에서 type(site type)
는 pointer
s의 전체 무리가 포함되어 있습니다. 그러나 모든 절차에서 sitetype
이 다른 모듈 (ed_state_vars.f90
)의 use
d 일 수 있습니다. 그래서 나에게 명백한 인터페이스 오류를주는 이유는 아직도 혼란 스럽다.
모듈에 'compute_water_storage'와 다른 함수가 있습니까? – SethMMorton
오류 메시지가'update_budget()'에서보다는 루틴에서 선언 된 속성을 참조하기 때문에'compute_co2_storage()'에서'csite'의 선언을 볼 필요가 있습니다. 나는 그것이'OPTIONAL' 또는'POINTER'라고 선언 된 것으로 의심된다. – Deditos
모든 의견에 감사드립니다. @SethMMorton : 예, '실제 기능'입니다. @Deditos :'compute_co2_storage()'에서'csite'는 제가 게시 한 서브 루틴 :'type (sitetype), target :: csite'에서와 같이 선언됩니다. – Geraldine