-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
! (C) Copyright 2022- ECMWF. | ||
! (C) Copyright 2022- Meteo-France. | ||
! | ||
! This software is licensed under the terms of the Apache Licence Version 2.0 | ||
! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
! In applying this licence, ECMWF does not waive the privileges and immunities | ||
! granted to it by virtue of its status as an intergovernmental organisation | ||
! nor does it submit to any jurisdiction. | ||
|
||
PROGRAM WRAPPER_CLONE | ||
! TEST IF WRAPPER IS REALLY WRAPPING DATA | ||
! IF IT IS WRAPPING THEN MODIFYING THE WRAPED DATA SHOULD BE SEEN IN | ||
! WRAPPER TOO | ||
|
||
USE FIELD_MODULE | ||
USE FIELD_FACTORY_MODULE | ||
USE PARKIND1 | ||
IMPLICIT NONE | ||
CLASS(FIELD_2RB), POINTER :: W => NULL() | ||
CLASS(FIELD_2RB), POINTER :: O => NULL() | ||
REAL(KIND=JPRB), ALLOCATABLE :: D(:,:) | ||
|
||
ALLOCATE(D(10,10)) | ||
D=7 | ||
|
||
CALL FIELD_NEW(W, DATA=D) | ||
D=42 | ||
|
||
CALL FIELD_CLONE(OLDOBJ=W, NEWOBJ=O) | ||
|
||
IF (.NOT. ALL(W%PTR == 42)) THEN | ||
ERROR STOP | ||
END IF | ||
IF (.NOT. ALL(O%PTR == 42)) THEN | ||
ERROR STOP | ||
END IF | ||
|
||
CALL FIELD_DELETE(W) | ||
|
||
IF (.NOT. ASSOCIATED(O%PTR)) THEN | ||
ERROR STOP | ||
END IF | ||
|
||
CALL O%FINAL() | ||
|
||
IF (ASSOCIATED(O%PTR)) THEN | ||
ERROR STOP | ||
END IF | ||
|
||
CALL FIELD_DELETE(O) | ||
END PROGRAM WRAPPER_CLONE |