在/src/io/calc_df.F90中,有許多:
DO WHILE(ASSOCIATED(current))
下面整理一些有關(guān)associated的用法。
簡單的說associated返回一個邏輯值,用于指針的語法。
ASSOCIATED
Inquiry Intrinsic Function (Generic):
Returns the association status of its pointer argument or indicates whether the pointer is associated with the target.
Syntax
result = ASSOCIATED (pointer [, target])
pointer (Input)
Must be a pointer (of any data type).
target (Optional; input)
Must be a pointer or target.
The pointer (in pointer or target) must not have an association status that is undefined. ???
Results:
The result is a scalar of type default logical.
- If only pointer appears, the result is true if it is currently associated with a target; otherwise, the result is false.
- If target also appears and is a target, if pointer is currently associated with target; otherwise, the result is false.
- If target is a pointer, the result is true if both pointer and target are currently associated with the same target; otherwise, the result is false.
- If either pointer or target is disassociated, the result is false.
如果上面的英文對你來說還不夠的話,下面再貼上一個中文的解釋(個人感覺更看不懂)。
fortran中有關(guān)指針的用法總結(jié)(此文來自科學(xué)網(wǎng)何林博客)