Changeset 1488 for trunk/NEMO/OPA_SRC/IOM/iom_ioipsl.F90
- Timestamp:
- 2009-07-16T11:19:46+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/IOM/iom_ioipsl.F90
r1271 r1488 48 48 !! ** Purpose : open an input file with IOIPSL (only fliocom module) 49 49 !!--------------------------------------------------------------------- 50 CHARACTER(len=*) , INTENT(inout) :: cdname ! File name 51 INTEGER , INTENT( out) :: kiomid ! ioipsl identifier of the opened file 52 LOGICAL , INTENT(in ) :: ldwrt ! read or write the file? 53 LOGICAL , INTENT(in ) :: ldok ! check the existence 54 INTEGER, DIMENSION(2,5), INTENT(in ), OPTIONAL :: kdompar ! domain parameters: 55 56 CHARACTER(LEN=100) :: clinfo ! info character 57 INTEGER :: iln ! lengths of character 58 INTEGER :: istop ! temporary storage of nstop 59 INTEGER :: ifliodom ! model domain identifier (see flio_dom_set) 60 INTEGER :: ioipslid ! ioipsl identifier of the opened file 61 INTEGER :: jl ! loop variable 50 CHARACTER(len=*) , INTENT(inout) :: cdname ! File name 51 INTEGER , INTENT( out) :: kiomid ! ioipsl identifier of the opened file 52 LOGICAL , INTENT(in ) :: ldwrt ! read or write the file? 53 LOGICAL , INTENT(in ) :: ldok ! check the existence 54 INTEGER, DIMENSION(2,5), INTENT(in ), OPTIONAL :: kdompar ! domain parameters: 55 56 CHARACTER(LEN=100) :: clinfo ! info character 57 CHARACTER(LEN=10 ) :: clstatus ! status of opened file (REPLACE or NEW) 58 INTEGER :: iln ! lengths of character 59 INTEGER :: istop ! temporary storage of nstop 60 INTEGER :: ifliodom ! model domain identifier (see flio_dom_set) 61 INTEGER :: ioipslid ! ioipsl identifier of the opened file 62 INTEGER :: jl ! loop variable 63 LOGICAL :: llclobber ! local definition of ln_clobber 62 64 !--------------------------------------------------------------------- 63 65 … … 65 67 istop = nstop 66 68 ! 67 IF( ldok ) THEN ! Open existing file... 69 llclobber = ldwrt .AND. ln_clobber 70 IF( ldok .AND. .NOT. llclobber ) THEN ! Open existing file... 68 71 ! ! ============= 69 72 IF( ldwrt ) THEN ! ... in write mode … … 78 81 iln = INDEX( cdname, '.nc' ) 79 82 IF( ldwrt ) THEN ! the file should be open in write mode so we create it... 83 IF( llclobber ) THEN ; clstatus = 'REPLACE' 84 ELSE ; clstatus = 'NEW' 85 ENDIF 80 86 IF( jpnij > 1 ) THEN 81 87 ! define the domain position regarding to the global domain (mainly useful in mpp) … … 86 92 IF(lwp) WRITE(numout,*) TRIM(clinfo)//' create new file: '//cdname(1:iln-1)//'... in WRITE mode' 87 93 CALL fliocrfd( cdname, (/'x' , 'y' , 'z', 't'/) & 88 & , (/kdompar(1,1), kdompar(2,1), jpk, -1 /), ioipslid, ifliodom )94 & , (/kdompar(1,1), kdompar(2,1), jpk, -1 /), ioipslid, ifliodom, mode = clstatus ) 89 95 ELSE ! the file should be open for read mode so it must exist... 90 96 IF(lwp) WRITE(numout,*) TRIM(clinfo)//' create new file: '//cdname//' in WRITE mode' 91 97 CALL fliocrfd( cdname, (/'x' , 'y' , 'z', 't'/) & 92 & , (/kdompar(1,1), kdompar(2,1), jpk, -1 /), ioipslid )98 & , (/kdompar(1,1), kdompar(2,1), jpk, -1 /), ioipslid, mode = clstatus ) 93 99 ENDIF 94 100 ELSE ! the file should be open for read mode so it must exist...
Note: See TracChangeset
for help on using the changeset viewer.