Closed pmarguinaud closed 4 months ago
The following code :
REAL(KIND=JPRB) :: ZZ (NPROMA,NFLEVG,NGPBLKS) REAL(KIND=JPRB) :: ZP (:,:,:) CLASS (FIELD_3RB), POINTER :: YLF CALL FIELD_NEW (YLF, DATA=ZZ) ! Transfer H -> D ZP => GET_DEVICE_DATA_RDONLY (YLF)
would trigger a transfer, even if ZZ is not initialized.
This PR fixes this issue, introducing the INITIALIZED argument of the FIELD_NEW constructor interface :
REAL(KIND=JPRB) :: ZZ (NPROMA,NFLEVG,NGPBLKS) REAL(KIND=JPRB) :: ZP (:,:,:) CLASS (FIELD_3RB), POINTER :: YLF CALL FIELD_NEW (YLF, DATA=ZZ, INITIALIZED=.FALSE.) ! No transfer H -> D ZP => GET_DEVICE_DATA_RDONLY (YLF)
Thank you very much for pointing this out. I have followed your advice; the changes are now minimal, and the code looks much simpler.
The following code :
would trigger a transfer, even if ZZ is not initialized.
This PR fixes this issue, introducing the INITIALIZED argument of the FIELD_NEW constructor interface :