source: codes/icosagcm/trunk/src/output/free_unit_mod.f90

Last change on this file was 548, checked in by dubos, 7 years ago

trunk : reorganize source tree

File size: 392 bytes
Line 
1MODULE free_unit_mod
2
3  PRIVATE
4
5  INTEGER, PARAMETER :: start_unit=1000
6
7  PUBLIC :: free_unit
8
9CONTAINS
10
11  FUNCTION free_unit()
12    INTEGER :: free_unit
13    LOGICAL :: out
14   
15    out=.FALSE.
16    free_unit=start_unit
17   
18    DO WHILE (.NOT. out)
19      free_unit=free_unit+1
20      INQUIRE(unit=free_unit, exist=out)
21    END DO
22   
23  END FUNCTION free_unit
24 
25END MODULE free_unit_mod
26 
Note: See TracBrowser for help on using the repository browser.