Changeset 5117 for LMDZ6/branches/Amaury_dev/libf/misc/lmdz_new_unit.f90
- Timestamp:
- Jul 24, 2024, 4:23:34 PM (4 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/misc/lmdz_new_unit.f90
r5116 r5117 1 module new_unit_m1 module lmdz_new_unit 2 2 3 3 IMPLICIT NONE … … 5 5 contains 6 6 7 ! Returns an existing unit id that isn't already opened 7 8 SUBROUTINE new_unit(unit) 9 INTEGER, INTENT(OUT):: unit 8 10 9 integer, intent(out):: unit 10 11 ! Variables local to the procedure: 12 logical opened, exist 13 14 !------------------------------------------------------ 11 LOGICAL opened, exist 15 12 16 13 unit = 0 17 do18 inquire(unit=unit, opened=opened, exist=exist)19 if (exist .and. .not. opened) exit14 DO 15 INQUIRE(unit=unit, opened=opened, exist=exist) 16 IF (exist .AND. .NOT. opened) RETURN 20 17 unit = unit + 1 21 18 END DO … … 23 20 END SUBROUTINE new_unit 24 21 25 end module new_unit_m22 end module lmdz_new_unit
Note: See TracChangeset
for help on using the changeset viewer.