Changeset 895 for trunk/NEMO/OPA_SRC/SBC/sbcfwb.F90
- Timestamp:
- 2008-04-21T17:32:02+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/SBC/sbcfwb.F90
r888 r895 60 60 INTEGER, INTENT( in ) :: kn_fwb ! ocean time-step index 61 61 !! 62 INTEGER :: inum = 11! temporary logical unit62 INTEGER :: inum ! temporary logical unit 63 63 INTEGER :: ikty, iyear ! 64 64 LOGICAL :: llbon 65 CHARACTER (len=32) :: clname = 'EMPave_old.dat'65 CHARACTER (len=32) :: clname 66 66 REAL(wp) :: z_emp ! temporary scalars 67 67 !!---------------------------------------------------------------------- … … 98 98 IF( kt == nit000 ) THEN 99 99 ! Read the corrective factor on precipitations (empold) 100 INQUIRE( FILE=clname, EXIST=llbon ) 101 IF( llbon ) THEN 102 OPEN ( inum, FILE=clname) 103 READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 104 CLOSE( inum ) 105 empold = a_fwb ! current year freshwater budget correction 106 ! ! estimate from the previous year budget 107 IF(lwp)WRITE(numout,*) 108 IF(lwp)WRITE(numout,*)'sbc_fwb : year = ',iyear , ' freshwater budget correction = ', empold 109 IF(lwp)WRITE(numout,*)' year = ',iyear-1, ' freshwater budget read = ', a_fwb 110 IF(lwp)WRITE(numout,*)' year = ',iyear-2, ' freshwater budget read = ', a_fwb_b 111 ELSE 112 WRITE(ctmp1,*)'sbc_fwb : unable to read the file', clname 113 CALL ctl_stop( ctmp1 ) 114 ENDIF 115 ENDIF 100 clname = 'EMPave_old.dat' 101 CALL ctlopn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', & 102 & 1, numout, .FALSE., 1 ) 103 104 READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 105 CLOSE( inum ) 106 empold = a_fwb ! current year freshwater budget correction 107 ! ! estimate from the previous year budget 108 IF(lwp)WRITE(numout,*) 109 IF(lwp)WRITE(numout,*)'sbc_fwb : year = ',iyear , ' freshwater budget correction = ', empold 110 IF(lwp)WRITE(numout,*)' year = ',iyear-1, ' freshwater budget read = ', a_fwb 111 IF(lwp)WRITE(numout,*)' year = ',iyear-2, ' freshwater budget read = ', a_fwb_b 112 ENDIF 116 113 ! 117 114 ! Update empold if new year start … … 134 131 ! 135 132 ! save empold value in a file 136 IF( kt == nitend ) THEN 137 OPEN( inum, FILE='EMPave.dat' ) 133 IF( kt == nitend .AND. lwp ) THEN 134 clname = 'EMPav.dat' 135 CALL ctlopn( inum, clname, 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', & 136 & 1, numout, .FALSE., 0 ) 138 137 WRITE(inum, "(24X,I8,2ES24.16)" ) nyear, a_fwb_b, a_fwb 139 138 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.