...
One example is in src/ifs/phys_ec/local_state_ini.F90:
Code Block |
---|
SUBROUTINE LOCAL_STATE_INI(KDIM, keymask, state_t0, state_tmp, |
...
& & tendency_dyn, tendency_cml, tendency_tmp, tendency_vdf, tendency_loc, & |
...
& PSTATE_ARRG,PSTATE_ARRL, PSTATE_CLD, & |
...
& PU, PV, PT ,PGFL, PTENGMV, PTENGFL) |
...
... |
...
TYPE (STATE_TYPE) ,INTENT(OUT) |
...
:: state_t0 , tendency_dyn, tendency_cml |
...
REAL(KIND=JPRB) |
...
,INTENT(IN), |
...
TARGET :: PT(KDIM%KLON,KDIM%KLEV) |
...
... |
...
state_ |
...
t0%T => |
...
PT ! here a pointer to an input argument is assigned and returned in an output argument |
When the dummy argument is declared with an explicit size (as in the function above), it is system-dependent whether or not pointers associated with the dummy argument are valid after the subroutine finishes.
...
Fredrik Jansson & Gijs van den Oord Jira