Index: IOIPSL/trunk/src/calendar.f90
===================================================================
--- IOIPSL/trunk/src/calendar.f90	(revision 1377)
+++ IOIPSL/trunk/src/calendar.f90	(revision 1378)
@@ -40,5 +40,5 @@
 !---------------------------------------------------------------------
   USE stringop,ONLY  : strlowercase
-  USE errioipsl,ONLY : ipslerr
+  USE errioipsl,ONLY : ipslerr, ipslout
 !-
   PRIVATE
@@ -354,6 +354,6 @@
     tmp_str = input_str
     DO WHILE ( MAX(y_pos,m_pos,d_pos,s_pos) > 0)
-!---- WRITE(*,*) tmp_str
-!---- WRITE(*,*) y_pos,m_pos,d_pos,s_pos
+!---- WRITE(ipslout,*) tmp_str
+!---- WRITE(ipslout,*) y_pos,m_pos,d_pos,s_pos
       IF (y_pos > 0) THEN
         WRITE(fmt,'("(I",I10.10,")")') y_pos-1
@@ -533,5 +533,5 @@
 !---------------------------------------------------------------------
   IF (check) THEN
-    WRITE(*,*) &
+    WRITE(ipslout,*) &
  &    "isittime 1.0 ",itau,date0,dt,freq,last_action,last_check
   ENDIF
@@ -605,10 +605,10 @@
         do_action = .TRUE.
         IF (check) THEN
-          WRITE(*,*) &
+          WRITE(ipslout,*) &
  &         'ACT-TIME : itau, next_act_itau, next_check_itau : ', &
  &         itau,next_act_itau,next_check_itau
           CALL ju2ymds (date_now,year,month,day,sec)
-          WRITE(*,*) 'ACT-TIME : y, m, d, s : ',year,month,day,sec
-          WRITE(*,*) &
+          WRITE(ipslout,*) 'ACT-TIME : y, m, d, s : ',year,month,day,sec
+          WRITE(ipslout,*) &
  &         'ACT-TIME : date_mp1, date_mpf : ',date_mp1,date_mpf
         ENDIF
@@ -619,5 +619,5 @@
 !-
     IF (check) THEN
-      WRITE(*,*) "isittime 2.0 ", &
+      WRITE(ipslout,*) "isittime 2.0 ", &
  &     date_next_check,date_next_act,ABS(dt_action-freq), &
  &     ABS(dt_action+dt_check-freq),dt_action,dt_check, &
Index: IOIPSL/trunk/src/flincom.f90
===================================================================
--- IOIPSL/trunk/src/flincom.f90	(revision 1377)
+++ IOIPSL/trunk/src/flincom.f90	(revision 1378)
@@ -9,5 +9,5 @@
 !-
   USE calendar,  ONLY : ju2ymds, ymds2ju, ioconf_calendar
-  USE errioipsl, ONLY : histerr
+  USE errioipsl, ONLY : histerr, ipslout
   USE stringop,  ONLY : strlowercase
 !-
@@ -193,5 +193,5 @@
 ! Vertical axis
 !-
-  IF (check) WRITE(*,*) 'flincre Vertical axis'
+  IF (check) WRITE(ipslout,*) 'flincre Vertical axis'
 !-
   iret = NF90_DEF_VAR (fid, 'lev', NF90_FLOAT, zdimid1, levid)
@@ -202,5 +202,5 @@
 ! Time axis
 !-
-  IF (check) WRITE(*,*) 'flincre time axis'
+  IF (check) WRITE(ipslout,*) 'flincre time axis'
 !-
   iret = NF90_DEF_VAR (fid, 'tstep', NF90_FLOAT, tdimid1, timeid)
@@ -211,5 +211,5 @@
 ! The longitude
 !-
-  IF (check) WRITE(*,*) 'flincre Longitude axis'
+  IF (check) WRITE(ipslout,*) 'flincre Longitude axis'
 !-
   iret = NF90_DEF_VAR (fid, "nav_lon", NF90_FLOAT, &
@@ -226,5 +226,5 @@
 ! The Latitude
 !-
-  IF (check) WRITE(*,*) 'flincre Latitude axis'
+  IF (check) WRITE(ipslout,*) 'flincre Latitude axis'
 !-
   iret = NF90_DEF_VAR (fid, "nav_lat", NF90_FLOAT, &
@@ -253,17 +253,17 @@
   iret = NF90_ENDDEF (fid)
 !-
-  IF (check) WRITE(*,*) 'flincre Variable'
+  IF (check) WRITE(ipslout,*) 'flincre Variable'
 !-
   iret = NF90_PUT_VAR (fid, levid, lev1(1:llm1))
 !-
-  IF (check) WRITE(*,*) 'flincre Time Variable'
+  IF (check) WRITE(ipslout,*) 'flincre Time Variable'
 !-
   iret = NF90_PUT_VAR (fid, timeid, REAL(itaus(1:ttm1)))
 !-
-  IF (check) WRITE(*,*) 'flincre Longitude'
+  IF (check) WRITE(ipslout,*) 'flincre Longitude'
 !-
   iret = NF90_PUT_VAR (fid, lonid, lon1(1:iim1,1:jjm1))
 !-
-  IF (check) WRITE(*,*) 'flincre Latitude'
+  IF (check) WRITE(ipslout,*) 'flincre Latitude'
 !-
   iret = NF90_PUT_VAR (fid, latid, lat1(1:iim1,1:jjm1))
@@ -423,5 +423,5 @@
 !-
   IF (check) &
-    WRITE(*,*) 'OUT OF flininfo :',tmp_iim,tmp_jjm,tmp_llm,tmp_ttm
+    WRITE(ipslout,*) 'OUT OF flininfo :',tmp_iim,tmp_jjm,tmp_llm,tmp_ttm
 !-
   fid = ncids(fid_out)
@@ -433,5 +433,5 @@
 !-
   IF (check) &
-    WRITE(*,*) 'flininfo 2.2 We test if we have to test : ',do_test
+    WRITE(ipslout,*) 'flininfo 2.2 We test if we have to test : ',do_test
 !-
   IF (do_test) THEN
@@ -453,5 +453,5 @@
 !-- 2.3 Else the sizes of the axes are returned to the user
 !---
-    IF (check) WRITE(*,*) 'flinopen 2.3 Else sizes are returned'
+    IF (check) WRITE(ipslout,*) 'flinopen 2.3 Else sizes are returned'
 !---
     iim = tmp_iim
@@ -465,5 +465,5 @@
 !     if not then we get the lon, lat and lev variables from the file
 !-
-  IF (check) WRITE(*,*) 'flinopen 3.0 we are realy talking'
+  IF (check) WRITE(ipslout,*) 'flinopen 3.0 we are realy talking'
 !-
   IF (do_test) THEN
@@ -474,8 +474,8 @@
 !---
     IF (check) &
-      WRITE(*,*) 'from file lon first and last, modulo 360. ', &
+      WRITE(ipslout,*) 'from file lon first and last, modulo 360. ', &
         x_first, x_last, MODULO(x_first,360.), MODULO(x_last,360.)
     IF (check) &
-      WRITE(*,*) 'from model lon first and last, modulo 360. ', &
+      WRITE(ipslout,*) 'from model lon first and last, modulo 360. ', &
         lon(1,1),lon(iilen,jjlen), &
         MODULO(lon(1,1),360.), MODULO(lon(iilen,jjlen),360.)
@@ -494,7 +494,7 @@
     iret = NF90_GET_VAR (fid, vid, x_last, start=(/ iilast, jjlast /))
 !---
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       'from file lat first and last ',x_first,x_last
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       'from model lat first and last ',lat(1,1),lat(iilen,jjlen)
 !---
@@ -512,7 +512,7 @@
       iret = NF90_GET_VAR (fid, vid, x_last, start=(/ llm /))
 !-----
-      IF (check) WRITE(*,*) &
+      IF (check) WRITE(ipslout,*) &
         'from file lev first and last ',x_first ,x_last
-      IF (check) WRITE(*,*) &
+      IF (check) WRITE(ipslout,*) &
         'from model lev first and last ',lev(1),lev(llm)
 !-----
@@ -530,5 +530,5 @@
 !-- 4.0 extracting the coordinates if we do not check
 !---
-    IF (check) WRITE(*,*) 'flinopen 4.0 extracting the coordinates'
+    IF (check) WRITE(ipslout,*) 'flinopen 4.0 extracting the coordinates'
 !---
     CALL flinfindcood (fid_out, 'lon', vid, nbdim)
@@ -575,5 +575,5 @@
 ! 5.0 Get all the details for the time if possible needed
 !-
-  IF (check) WRITE(*,*) 'flinopen 5.0 Get time'
+  IF (check) WRITE(ipslout,*) 'flinopen 5.0 Get time'
 !-
   IF (ttm > 0) THEN
@@ -609,5 +609,5 @@
     DEALLOCATE(vec_tmp)
 !---
-    IF (check) WRITE(*,*) 'flinopen 5.1 Times ',itaus
+    IF (check) WRITE(ipslout,*) 'flinopen 5.1 Times ',itaus
 !---
 !-- Getting all the details for the time axis
@@ -630,5 +630,5 @@
       CALL ymds2ju (year0, month0, day0, sec0, date0)
       IF (check) &
-        WRITE(*,*) 'flinopen 5.1 gdtt_id year0 ... date0 ', &
+        WRITE(ipslout,*) 'flinopen 5.1 gdtt_id year0 ... date0 ', &
                    year0, month0, day0, sec0, date0
 !-----
@@ -643,5 +643,5 @@
 !-----
       IF (check) &
-        WRITE(*,*) 'flinopen 5.1 gdtmaf_id year0 ... date0 ', &
+        WRITE(ipslout,*) 'flinopen 5.1 gdtmaf_id year0 ... date0 ', &
                    year0, month0, day0, sec0, date0
     ELSE IF (old_id > 0) THEN
@@ -660,5 +660,5 @@
   ENDIF
 !-
-  IF (check) WRITE(*,*) 'flinopen 6.0 File opened', date0, dt
+  IF (check) WRITE(ipslout,*) 'flinopen 6.0 File opened', date0, dt
 !---------------------------
 END SUBROUTINE flinopen_work
@@ -716,5 +716,5 @@
     axname = ADJUSTL(axname)
 !---
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       'flininfo - getting axname',iv,axname,lll
 !---
@@ -780,5 +780,5 @@
   LOGICAL :: check = .FALSE.
 !---------------------------------------------------------------------
-  IF (check) WRITE(*,*) &
+  IF (check) WRITE(ipslout,*) &
      "flinput_r1d : SIZE(var) = ",SIZE(var)
 !-
@@ -807,5 +807,5 @@
   LOGICAL :: check = .FALSE.
 !---------------------------------------------------------------------
-  IF (check) WRITE(*,*) &
+  IF (check) WRITE(ipslout,*) &
      "flinput_r2d : SIZE(var) = ",SIZE(var)
 !-
@@ -834,5 +834,5 @@
   LOGICAL :: check = .FALSE.
 !---------------------------------------------------------------------
-  IF (check) WRITE(*,*) &
+  IF (check) WRITE(ipslout,*) &
      "flinput_r3d : SIZE(var) = ",SIZE(var)
 !-
@@ -861,5 +861,5 @@
   LOGICAL :: check = .FALSE.
 !---------------------------------------------------------------------
-  IF (check) WRITE(*,*) &
+  IF (check) WRITE(ipslout,*) &
      "flinput_r4d : SIZE(var) = ",SIZE(var)
 !-
@@ -961,9 +961,9 @@
 !---------------------------------------------------------------------
   IF (.NOT.ALLOCATED(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r1d : allocate buff_tmp for buff_sz = ",SIZE(var)
     ALLOCATE (buff_tmp(SIZE(var)))
   ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r1d : re-allocate buff_tmp for buff_sz = ",SIZE(var)
     DEALLOCATE (buff_tmp)
@@ -999,9 +999,9 @@
 !---------------------------------------------------------------------
   IF (.NOT.ALLOCATED(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r2d : allocate buff_tmp for buff_sz = ",SIZE(var)
     ALLOCATE (buff_tmp(SIZE(var)))
   ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r2d : re-allocate buff_tmp for buff_sz = ",SIZE(var)
     DEALLOCATE (buff_tmp)
@@ -1040,9 +1040,9 @@
 !---------------------------------------------------------------------
   IF (.NOT.ALLOCATED(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r2d_zoom : allocate buff_tmp for buff_sz = ",SIZE(var)
     ALLOCATE (buff_tmp(SIZE(var)))
   ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r2d_zoom : re-allocate buff_tmp for buff_sz = ",SIZE(var)
     DEALLOCATE (buff_tmp)
@@ -1080,9 +1080,9 @@
 !---------------------------------------------------------------------
   IF (.NOT.ALLOCATED(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r3d : allocate buff_tmp for buff_sz = ",SIZE(var)
     ALLOCATE (buff_tmp(SIZE(var)))
   ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r3d : re-allocate buff_tmp for buff_sz = ",SIZE(var)
     DEALLOCATE (buff_tmp)
@@ -1123,9 +1123,9 @@
 !---------------------------------------------------------------------
   IF (.NOT.ALLOCATED(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r3d_zoom : allocate buff_tmp for buff_sz = ",SIZE(var)
     ALLOCATE (buff_tmp(SIZE(var)))
   ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r3d_zoom : re-allocate buff_tmp for buff_sz = ",SIZE(var)
     DEALLOCATE (buff_tmp)
@@ -1165,9 +1165,9 @@
 !---------------------------------------------------------------------
   IF (.NOT.ALLOCATED(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r4d : allocate buff_tmp for buff_sz = ",SIZE(var)
     ALLOCATE (buff_tmp(SIZE(var)))
   ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r4d : re-allocate buff_tmp for buff_sz = ",SIZE(var)
     DEALLOCATE (buff_tmp)
@@ -1210,9 +1210,9 @@
 !---------------------------------------------------------------------
   IF (.NOT.ALLOCATED(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r4d_zoom : allocate buff_tmp for buff_sz = ",SIZE(var)
     ALLOCATE (buff_tmp(SIZE(var)))
   ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       "flinget_r4d_zoom : re-allocate buff_tmp for buff_sz = ",SIZE(var)
     DEALLOCATE (buff_tmp)
@@ -1309,10 +1309,10 @@
 !-
   IF (check) THEN
-    WRITE(*,*) &
+    WRITE(ipslout,*) &
     'flinget_mat : fid_in, fid, varname :', fid_in, fid, TRIM(varname)
-    WRITE(*,*) &
+    WRITE(ipslout,*) &
     'flinget_mat : iim, jjm, llm, ttm, itau_dep, itau_fin :', &
     iim, jjm, llm, ttm, itau_dep, itau_fin
-    WRITE(*,*) &
+    WRITE(ipslout,*) &
     'flinget_mat : iideb, iilen, jjdeb, jjlen :', &
     iideb, iilen, jjdeb, jjlen
@@ -1336,7 +1336,7 @@
            ndims=ndims, dimids=dimids, nAtts=nb_atts)
   IF (check) THEN
-    WRITE(*,*) &
+    WRITE(ipslout,*) &
     'flinget_mat : fid, vid :', fid, vid
-    WRITE(*,*) &
+    WRITE(ipslout,*) &
     'flinget_mat : ndims, dimids(1:ndims), nb_atts :', &
     ndims, dimids(1:ndims), nb_atts
@@ -1347,5 +1347,5 @@
     iret  = NF90_INQUIRE_DIMENSION (fid, dimids(i), len=w_dim(i))
   ENDDO
-  IF (check) WRITE(*,*) &
+  IF (check) WRITE(ipslout,*) &
     'flinget_mat : w_dim :', w_dim(1:ndims)
 !-
@@ -1354,5 +1354,5 @@
   IF (nb_atts > 0) THEN
     IF (check) THEN
-      WRITE(*,*) 'flinget_mat : attributes for variable :'
+      WRITE(ipslout,*) 'flinget_mat : attributes for variable :'
     ENDIF
   ENDIF
@@ -1365,10 +1365,10 @@
       iret = NF90_GET_ATT (fid, vid, att_n, tmp_i)
       IF (check) THEN
-        WRITE(*,*) '   ',TRIM(att_n),' : ',tmp_i
+        WRITE(ipslout,*) '   ',TRIM(att_n),' : ',tmp_i
       ENDIF
     ELSE IF ( (x_typ == NF90_FLOAT).OR.(x_typ == NF90_DOUBLE) ) THEN
       iret = NF90_GET_ATT (fid, vid, att_n, tmp_r)
       IF (check) THEN
-        WRITE(*,*) '   ',TRIM(att_n),' : ',tmp_r
+        WRITE(ipslout,*) '   ',TRIM(att_n),' : ',tmp_r
       ENDIF
       IF (index(att_n,'missing_value') > 0) THEN
@@ -1379,5 +1379,5 @@
       iret = NF90_GET_ATT (fid, vid, att_n, tmp_n)
       IF (check) THEN
-        WRITE(*,*) '   ',TRIM(att_n),' : ',TRIM(tmp_n)
+        WRITE(ipslout,*) '   ',TRIM(att_n),' : ',TRIM(tmp_n)
       ENDIF
       IF (index(att_n,'axis') > 0) THEN
@@ -1402,5 +1402,5 @@
     iret = NF90_INQ_VARID (fid, tmp_n, cvid)
 !---
-    IF (check) WRITE(*,*) &
+    IF (check) WRITE(ipslout,*) &
       'Dimname, iret , NF90_NOERR : ',TRIM(tmp_n),iret,NF90_NOERR
 !---
@@ -1559,5 +1559,5 @@
 ! 3.0 Reading the data
 !-
-  IF (check) WRITE(*,*) &
+  IF (check) WRITE(ipslout,*) &
     'flinget_mat 3.0 : ', uncompress, w_sta, w_len
 !---
@@ -1584,5 +1584,5 @@
   ENDIF
 !-
-  IF (check) WRITE(*,*) 'flinget_mat 3.1 : ',NF90_STRERROR (iret)
+  IF (check) WRITE(ipslout,*) 'flinget_mat 3.1 : ',NF90_STRERROR (iret)
 !--------------------------
 END  SUBROUTINE flinget_mat
Index: IOIPSL/trunk/src/fliocom.f90
===================================================================
--- IOIPSL/trunk/src/fliocom.f90	(revision 1377)
+++ IOIPSL/trunk/src/fliocom.f90	(revision 1378)
@@ -11,5 +11,5 @@
 USE calendar,  ONLY : lock_calendar,ioget_calendar, &
  &                    ioconf_calendar,ju2ymds,ymds2ju
-USE errioipsl, ONLY : ipslerr,ipsldbg
+USE errioipsl, ONLY : ipslerr,ipsldbg, ipslout
 USE stringop,  ONLY : strlowercase,str_xfw
 !-
@@ -867,5 +867,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->fliocrfd - file name : ",TRIM(f_n)
+    WRITE(ipslout,*) "->fliocrfd - file name : ",TRIM(f_n)
   ENDIF
 !-
@@ -990,5 +990,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) '  fliocrfd, external model file-id : ',f_e
+    WRITE(ipslout,*) '  fliocrfd, external model file-id : ',f_e
   ENDIF
 !-
@@ -1040,5 +1040,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) '<-fliocrfd'
+    WRITE(ipslout,*) '<-fliocrfd'
   ENDIF
 !----------------------
@@ -1074,5 +1074,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->fliopstc"
+    WRITE(ipslout,*) "->fliopstc"
   ENDIF
 !-
@@ -1100,5 +1100,5 @@
 !---
     IF (l_dbg) THEN
-      WRITE(*,*) '  fliopstc : Define the Longitude axis'
+      WRITE(ipslout,*) '  fliopstc : Define the Longitude axis'
     ENDIF
 !---
@@ -1144,5 +1144,5 @@
 !---
     IF (l_dbg) THEN
-      WRITE(*,*) '  fliopstc : Define the Latitude axis'
+      WRITE(ipslout,*) '  fliopstc : Define the Latitude axis'
     ENDIF
 !---
@@ -1188,5 +1188,5 @@
 !---
     IF (l_dbg) THEN
-      WRITE(*,*) '  fliopstc : Define the Vertical axis'
+      WRITE(ipslout,*) '  fliopstc : Define the Vertical axis'
     ENDIF
 !---
@@ -1219,5 +1219,5 @@
 !---
     IF (l_dbg) THEN
-      WRITE(*,*) '  fliopstc : Define the Time axis'
+      WRITE(ipslout,*) '  fliopstc : Define the Time axis'
     ENDIF
 !---
@@ -1317,5 +1317,5 @@
   IF (PRESENT(x_axis).OR.PRESENT(x_axis_2d)) THEN
     IF (l_dbg) THEN
-      WRITE(*,*) '  fliopstc : Create the Longitude axis'
+      WRITE(ipslout,*) '  fliopstc : Create the Longitude axis'
     ENDIF
     IF (PRESENT(x_axis)) THEN
@@ -1330,5 +1330,5 @@
   IF (PRESENT(y_axis).OR.PRESENT(y_axis_2d)) THEN
     IF (l_dbg) THEN
-      WRITE(*,*) '  fliopstc : Create the Latitude axis'
+      WRITE(ipslout,*) '  fliopstc : Create the Latitude axis'
     ENDIF
     IF (PRESENT(y_axis)) THEN
@@ -1343,5 +1343,5 @@
   IF (PRESENT(z_axis)) THEN
     IF (l_dbg) THEN
-      WRITE(*,*) '  fliopstc : Create the Vertical axis'
+      WRITE(ipslout,*) '  fliopstc : Create the Vertical axis'
     ENDIF
     i_rc = NF90_PUT_VAR(f_e,levid,z_axis(:))
@@ -1352,5 +1352,5 @@
   IF (PRESENT(t_axis)) THEN
     IF (l_dbg) THEN
-      WRITE(*,*) '  fliopstc : Create the Time axis'
+      WRITE(ipslout,*) '  fliopstc : Create the Time axis'
     ENDIF
     i_rc = NF90_PUT_VAR(f_e,timeid,REAL(t_axis(:)))
@@ -1362,5 +1362,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-fliopstc"
+    WRITE(ipslout,*) "<-fliopstc"
   ENDIF
 !----------------------
@@ -1428,5 +1428,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->fliodefv ",TRIM(v_n)," ",n_d,"D"
+    WRITE(ipslout,*) "->fliodefv ",TRIM(v_n)," ",n_d,"D"
   ENDIF
 !-
@@ -1567,5 +1567,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-fliodefv"
+    WRITE(ipslout,*) "<-fliodefv"
   ENDIF
 !----------------------
@@ -2048,5 +2048,5 @@
     ELSE IF (PRESENT(r_85)) THEN; cvr_d = "R8 5D";
     ENDIF
-    WRITE(*,*) "->flioputv ",TRIM(v_n)," ",TRIM(cvr_d)
+    WRITE(ipslout,*) "->flioputv ",TRIM(v_n)," ",TRIM(cvr_d)
   ENDIF
 !-
@@ -2131,5 +2131,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-flioputv"
+    WRITE(ipslout,*) "<-flioputv"
   ENDIF
 !----------------------
@@ -2238,5 +2238,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->flioputa ",TRIM(v_n)," ",TRIM(a_n)
+    WRITE(ipslout,*) "->flioputa ",TRIM(v_n)," ",TRIM(a_n)
   ENDIF
 !-
@@ -2270,5 +2270,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-flioputa"
+    WRITE(ipslout,*) "<-flioputa"
   ENDIF
 !----------------------
@@ -2291,5 +2291,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) '->flioopfd, file name : ',TRIM(f_n)
+    WRITE(ipslout,*) '->flioopfd, file name : ',TRIM(f_n)
   ENDIF
 !-
@@ -2325,5 +2325,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) '  flioopfd, model file-id : ',f_e
+    WRITE(ipslout,*) '  flioopfd, model file-id : ',f_e
   ENDIF
 !-
@@ -2352,5 +2352,5 @@
     WRITE(*,'("   flioopfd - dimensions :",/,(5(1X,I10),:))') &
  &    nw_dl(:,f_i)
-    WRITE(*,*) "<-flioopfd"
+    WRITE(ipslout,*) "<-flioopfd"
   ENDIF
 !----------------------
@@ -2373,5 +2373,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->flioinqf"
+    WRITE(ipslout,*) "->flioinqf"
   ENDIF
 !-
@@ -2418,5 +2418,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-flioinqf"
+    WRITE(ipslout,*) "<-flioinqf"
   ENDIF
 !----------------------
@@ -2445,5 +2445,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->flioinqn"
+    WRITE(ipslout,*) "->flioinqn"
   ENDIF
 !-
@@ -2622,5 +2622,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-flioinqn"
+    WRITE(ipslout,*) "<-flioinqn"
   ENDIF
 !----------------------
@@ -2662,5 +2662,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->fliogstc"
+    WRITE(ipslout,*) "->fliogstc"
   ENDIF
 !-
@@ -2932,5 +2932,5 @@
 !---
     IF (l_dbg) THEN
-      WRITE(*,*) '  fliogstc - get time details'
+      WRITE(ipslout,*) '  fliogstc - get time details'
     ENDIF
 !---
@@ -2977,5 +2977,5 @@
 !---
     IF (l_dbg) THEN
-      WRITE(*,*) '  fliogstc - first time : ',t_axis(1:1)
+      WRITE(ipslout,*) '  fliogstc - first time : ',t_axis(1:1)
     ENDIF
   ENDIF
@@ -3015,8 +3015,8 @@
     CALL lock_calendar (new_status=l_tmp)
     IF (l_dbg) THEN
-      WRITE(*,*) '  fliogstc - time_type : '
-      WRITE(*,*) it_t
-      WRITE(*,*) '  fliogstc - year month day second t_init : '
-      WRITE(*,*) j_yy,j_mo,j_dd,r_ss,t_init
+      WRITE(ipslout,*) '  fliogstc - time_type : '
+      WRITE(ipslout,*) it_t
+      WRITE(ipslout,*) '  fliogstc - year month day second t_init : '
+      WRITE(ipslout,*) j_yy,j_mo,j_dd,r_ss,t_init
     ENDIF
   ENDIF
@@ -3080,5 +3080,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-fliogstc"
+    WRITE(ipslout,*) "<-fliogstc"
   ENDIF
 !----------------------
@@ -3108,5 +3108,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->flioinqv ",TRIM(v_n)
+    WRITE(ipslout,*) "->flioinqv ",TRIM(v_n)
   ENDIF
 !-
@@ -3221,5 +3221,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-flioinqv"
+    WRITE(ipslout,*) "<-flioinqv"
   ENDIF
 !----------------------
@@ -3702,5 +3702,5 @@
     ELSE IF (PRESENT(r_85)) THEN; cvr_d = "R8 5D";
     ENDIF
-    WRITE(*,*) "->fliogetv ",TRIM(v_n)," ",TRIM(cvr_d)
+    WRITE(ipslout,*) "->fliogetv ",TRIM(v_n)," ",TRIM(cvr_d)
   ENDIF
 !-
@@ -3785,5 +3785,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-fliogetv"
+    WRITE(ipslout,*) "<-fliogetv"
   ENDIF
 !----------------------
@@ -3806,5 +3806,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->flioinqa ",TRIM(v_n),"-",TRIM(a_n)
+    WRITE(ipslout,*) "->flioinqa ",TRIM(v_n),"-",TRIM(a_n)
   ENDIF
 !-
@@ -3836,5 +3836,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-flioinqa"
+    WRITE(ipslout,*) "<-flioinqa"
   ENDIF
 !----------------------
@@ -3948,5 +3948,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->fliogeta ",TRIM(v_n)," ",TRIM(a_n)
+    WRITE(ipslout,*) "->fliogeta ",TRIM(v_n)," ",TRIM(a_n)
   ENDIF
 !-
@@ -4012,5 +4012,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-fliogeta"
+    WRITE(ipslout,*) "<-fliogeta"
   ENDIF
 !----------------------
@@ -4031,5 +4031,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) &
+    WRITE(ipslout,*) &
  &    "->fliorenv ",TRIM(v_o_n),"->",TRIM(v_n_n)
   ENDIF
@@ -4052,5 +4052,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-fliorenv"
+    WRITE(ipslout,*) "<-fliorenv"
   ENDIF
 !----------------------
@@ -4071,5 +4071,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) &
+    WRITE(ipslout,*) &
  &    "->fliorena ",TRIM(v_n),"-",TRIM(a_o_n),"->",TRIM(a_n_n)
   ENDIF
@@ -4102,5 +4102,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-fliorena"
+    WRITE(ipslout,*) "<-fliorena"
   ENDIF
 !----------------------
@@ -4121,5 +4121,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->fliodela ",TRIM(v_n),"-",TRIM(a_n)
+    WRITE(ipslout,*) "->fliodela ",TRIM(v_n),"-",TRIM(a_n)
   ENDIF
 !-
@@ -4150,5 +4150,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-fliodela"
+    WRITE(ipslout,*) "<-fliodela"
   ENDIF
 !----------------------
@@ -4169,6 +4169,6 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->fliocpya - file",f_i_i,"-",TRIM(v_n_i),"-",TRIM(a_n)
-    WRITE(*,*) "  copied to file ",f_i_o,"-",TRIM(v_n_o)
+    WRITE(ipslout,*) "->fliocpya - file",f_i_i,"-",TRIM(v_n_i),"-",TRIM(a_n)
+    WRITE(ipslout,*) "  copied to file ",f_i_o,"-",TRIM(v_n_o)
   ENDIF
 !-
@@ -4216,5 +4216,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-fliocpya"
+    WRITE(ipslout,*) "<-fliocpya"
   ENDIF
 !----------------------
@@ -4238,5 +4238,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->flioqstc ",TRIM(c_type)
+    WRITE(ipslout,*) "->flioqstc ",TRIM(c_type)
   ENDIF
 !-
@@ -4260,5 +4260,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-flioqstc"
+    WRITE(ipslout,*) "<-flioqstc"
   ENDIF
 !----------------------
@@ -4276,5 +4276,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->fliosync"
+    WRITE(ipslout,*) "->fliosync"
   ENDIF
 !-
@@ -4302,5 +4302,5 @@
     IF (f_e > 0) THEN
       IF (l_dbg) THEN
-        WRITE(*,*) '  fliosync - synchronising file number ',i_f
+        WRITE(ipslout,*) '  fliosync - synchronising file number ',i_f
       ENDIF
       i_rc = NF90_SYNC(f_e)
@@ -4312,5 +4312,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-fliosync"
+    WRITE(ipslout,*) "<-fliosync"
   ENDIF
 !----------------------
@@ -4328,5 +4328,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->flioclo"
+    WRITE(ipslout,*) "->flioclo"
   ENDIF
 !-
@@ -4350,5 +4350,5 @@
     IF (f_e > 0) THEN
       IF (l_dbg) THEN
-        WRITE(*,*) '  flioclo - closing file number ',i_f
+        WRITE(ipslout,*) '  flioclo - closing file number ',i_f
       ENDIF
       i_rc = NF90_CLOSE(f_e)
@@ -4361,5 +4361,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-flioclo"
+    WRITE(ipslout,*) "<-flioclo"
   ENDIF
 !---------------------
@@ -4445,5 +4445,5 @@
       ELSE
         i_rc = NF90_GET_ATT(f_e,NF90_GLOBAL,c_name,tmp_i)
-        WRITE(*,*) '   ',TRIM(c_name),' : ',tmp_i
+        WRITE(ipslout,*) '   ',TRIM(c_name),' : ',tmp_i
       ENDIF
     ELSE IF ( (t_ea == NF90_REAL4).OR.(t_ea == NF90_REAL8) ) THEN
@@ -4456,10 +4456,10 @@
       ELSE
         i_rc = NF90_GET_ATT(f_e,NF90_GLOBAL,c_name,tmp_r)
-        WRITE(*,*) '   ',TRIM(c_name),' : ',tmp_r
+        WRITE(ipslout,*) '   ',TRIM(c_name),' : ',tmp_r
       ENDIF
     ELSE
       tmp_c = ''
       i_rc = NF90_GET_ATT(f_e,NF90_GLOBAL,c_name,tmp_c)
-      WRITE(*,*) '   ',TRIM(c_name),' : "',TRIM(tmp_c),'"'
+      WRITE(ipslout,*) '   ',TRIM(c_name),' : "',TRIM(tmp_c),'"'
     ENDIF
   ENDDO
@@ -4499,5 +4499,5 @@
         ELSE
           i_rc = NF90_GET_ATT(f_e,i_n,c_name,tmp_i)
-          WRITE(*,*) '   ',TRIM(c_name),' : ',tmp_i
+          WRITE(ipslout,*) '   ',TRIM(c_name),' : ',tmp_i
         ENDIF
       ELSE IF ( (t_ea == NF90_REAL4).OR.(t_ea == NF90_REAL8) ) THEN
@@ -4510,10 +4510,10 @@
         ELSE
           i_rc = NF90_GET_ATT(f_e,i_n,c_name,tmp_r)
-          WRITE(*,*) '   ',TRIM(c_name),' : ',tmp_r
+          WRITE(ipslout,*) '   ',TRIM(c_name),' : ',tmp_r
         ENDIF
       ELSE
         tmp_c = ''
         i_rc = NF90_GET_ATT(f_e,i_n,c_name,tmp_c)
-        WRITE(*,*) '   ',TRIM(c_name),' : "',TRIM(tmp_c),'"'
+        WRITE(ipslout,*) '   ',TRIM(c_name),' : "',TRIM(tmp_c),'"'
       ENDIF
     ENDDO
@@ -4937,5 +4937,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->flio_inf"
+    WRITE(ipslout,*) "->flio_inf"
   ENDIF
 !-
@@ -4960,5 +4960,5 @@
 !---
     IF (l_dbg) THEN
-      WRITE(*,*) "  flio_inf ",kv,ml," ",TRIM(f_d_n)
+      WRITE(ipslout,*) "  flio_inf ",kv,ml," ",TRIM(f_d_n)
     ENDIF
 !---
@@ -5005,5 +5005,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-flio_inf"
+    WRITE(ipslout,*) "<-flio_inf"
   ENDIF
 !----------------------
Index: IOIPSL/trunk/src/getincom.f90
===================================================================
--- IOIPSL/trunk/src/getincom.f90	(revision 1377)
+++ IOIPSL/trunk/src/getincom.f90	(revision 1378)
@@ -6,5 +6,5 @@
 ! See IOIPSL/IOIPSL_License_CeCILL.txt
 !---------------------------------------------------------------------
-USE errioipsl, ONLY : ipslerr,ipsldbg
+USE errioipsl, ONLY : ipslerr,ipsldbg,ipslout
 USE stringop, &
  &   ONLY : nocomma,cmpblank,strlowercase
@@ -853,5 +853,5 @@
     CALL ipslerr (1,'USING DEFAULT BEHAVIOUR FOR', &
  &   TRIM(targetname),' ',' ')
-    WRITE(*,*) 'USING DEFAULT BEHAVIOUR FOR ',TRIM(targetname)
+    WRITE(ipslout,*) 'USING DEFAULT BEHAVIOUR FOR ',TRIM(targetname)
   ELSE
     status_cnt = 0
@@ -860,22 +860,22 @@
         status_cnt = status_cnt+1
         IF      (status_cnt <= max_msgs) THEN
-          WRITE (UNIT=*,FMT='(" USING DEFAULTS : ",A)', &
+          WRITE (UNIT=ipslout,FMT='(" USING DEFAULTS : ",A)', &
  &               ADVANCE='NO') TRIM(targetname)
           IF (nb_to_ret > 1) THEN
-            WRITE (UNIT=*,FMT='("__")',ADVANCE='NO')
-            WRITE (UNIT=*,FMT=c_i_fmt,ADVANCE='NO') it
+            WRITE (UNIT=ipslout,FMT='("__")',ADVANCE='NO')
+            WRITE (UNIT=ipslout,FMT=c_i_fmt,ADVANCE='NO') it
           ENDIF
           SELECT CASE (k_typ)
           CASE(k_i)
-            WRITE (UNIT=*,FMT=*) "=",i_val(it)
+            WRITE (UNIT=ipslout,FMT=*) "=",i_val(it)
           CASE(k_r)
-            WRITE (UNIT=*,FMT=*) "=",r_val(it)
+            WRITE (UNIT=ipslout,FMT=*) "=",r_val(it)
           CASE(k_c)
-            WRITE (UNIT=*,FMT=*) "=",c_val(it)
+            WRITE (UNIT=ipslout,FMT=*) "=",c_val(it)
           CASE(k_l)
-            WRITE (UNIT=*,FMT=*) "=",l_val(it)
+            WRITE (UNIT=ipslout,FMT=*) "=",l_val(it)
           END SELECT
         ELSE IF (status_cnt == max_msgs+1) THEN
-          WRITE (UNIT=*,FMT='(" USING DEFAULTS ... ",A)')
+          WRITE (UNIT=ipslout,FMT='(" USING DEFAULTS ... ",A)')
         ENDIF
       ENDIF
@@ -1123,5 +1123,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) 'getin_readdef : Open file ',TRIM(filelist(current))
+    WRITE(ipslout,*) 'getin_readdef : Open file ',TRIM(filelist(current))
   ENDIF
 !-
@@ -1164,5 +1164,5 @@
       NEW_str  = TRIM(ADJUSTL(NEW_str))
       IF (l_dbg) THEN
-        WRITE(*,*) &
+        WRITE(ipslout,*) &
  &        '--> getin_readdef : ',TRIM(key_str),' :: ',TRIM(NEW_str)
       ENDIF
@@ -1202,5 +1202,5 @@
       nb_lastkey = 0
       IF (l_dbg) THEN
-        WRITE(*,*) 'getin_readdef : Have found an emtpy line '
+        WRITE(ipslout,*) 'getin_readdef : Have found an emtpy line '
       ENDIF
     ENDIF
@@ -1218,10 +1218,10 @@
 !-
   IF (l_dbg) THEN
-     WRITE(*,*) "nb_lines ",nb_lines,"nb_keys ",nb_keys
-     WRITE(*,*) "fichier ",fichier(1:nb_lines)
-     WRITE(*,*) "targetlist ",targetlist(1:nb_lines)
-     WRITE(*,*) "fromfile ",fromfile(1:nb_lines)
-     WRITE(*,*) "compline ",compline(1:nb_lines)
-    WRITE(*,*) '<-getin_readdef'
+     WRITE(ipslout,*) "nb_lines ",nb_lines,"nb_keys ",nb_keys
+     WRITE(ipslout,*) "fichier ",fichier(1:nb_lines)
+     WRITE(ipslout,*) "targetlist ",targetlist(1:nb_lines)
+     WRITE(ipslout,*) "fromfile ",fromfile(1:nb_lines)
+     WRITE(ipslout,*) "compline ",compline(1:nb_lines)
+     WRITE(ipslout,*) '<-getin_readdef'
   ENDIF
 !---------------------------
@@ -1410,18 +1410,18 @@
 
   IF (l_dbg) THEN
-     WRITE(*,*) "getin_decrypt ->",TRIM(NEW_str), " : "
-     WRITE(*,*) "getin_decrypt ->", nb_lines,&
+     WRITE(ipslout,*) "getin_decrypt ->",TRIM(NEW_str), " : "
+     WRITE(ipslout,*) "getin_decrypt ->", nb_lines,&
           & SIZE(fichier), &
           & SIZE(fromfile), &
           & SIZE(filelist)
      IF (nb_lines > 0) THEN
-        WRITE(*,*) "getin_decrypt ->",TRIM(NEW_str), " : ", &
+        WRITE(ipslout,*) "getin_decrypt ->", &
           & TRIM(fichier(nb_lines)), &
           & fromfile(nb_lines), &
           & TRIM(filelist(fromfile(nb_lines)))
-        WRITE(*,*) "                compline : ",compline(nb_lines)
-        WRITE(*,*) "                targetlist : ",TRIM(targetlist(nb_lines))
+        WRITE(ipslout,*) "                compline : ",compline(nb_lines)
+        WRITE(ipslout,*) "                targetlist : ",TRIM(targetlist(nb_lines))
      ENDIF
-     WRITE(*,*) "                last_key : ",last_key
+     WRITE(ipslout,*) "                last_key : ",last_key
   ENDIF
 !---------------------------
@@ -1451,14 +1451,14 @@
 !---
     IF (n_k > 0) THEN
-      WRITE(*,*) 'COUNT : ',n_k
-      WRITE(*,*) &
+      WRITE(ipslout,*) 'COUNT : ',n_k
+      WRITE(ipslout,*) &
  &  'getin_checkcohe : Found a problem on key ',TRIM(targetlist(line))
-      WRITE(*,*) &
+      WRITE(ipslout,*) &
  &  'getin_checkcohe : The following values were encoutered :'
-      WRITE(*,*) &
+      WRITE(ipslout,*) &
  &  '                ',TRIM(targetlist(line)),' == ',fichier(line)
-      WRITE(*,*) &
+      WRITE(ipslout,*) &
  &  '                ',TRIM(targetlist(k)),' == ',fichier(k)
-      WRITE(*,*) &
+      WRITE(ipslout,*) &
  &  'getin_checkcohe : We will keep only the last value'
        CALL ipslerr (2,'getin_checkcohe','Found a problem on key ', &
@@ -1858,7 +1858,7 @@
     used_filename = TRIM(usedfileprefix)//'_'//TRIM(filelist(if))
     IF (l_dbg) THEN
-      WRITE(*,*) &
+      WRITE(ipslout,*) &
  &      'getin_dump : opens file : ',TRIM(used_filename),' if = ',if
-      WRITE(*,*) 'GETIN_DUMP : NUMBER OF KEYS : ',nb_keys
+      WRITE(ipslout,*) 'GETIN_DUMP : NUMBER OF KEYS : ',nb_keys
     ENDIF
     OPEN (UNIT=22,FILE=used_filename,iostat=io_err)
@@ -1880,11 +1880,11 @@
       WRITE(22,*) '# '
       IF (l_dbg) THEN
-         WRITE(*,*) '# '
-         WRITE(*,*) '# This file is linked to the following files :'
-         WRITE(*,*) '# '
+         WRITE(ipslout,*) '# '
+         WRITE(ipslout,*) '# This file is linked to the following files :'
+         WRITE(ipslout,*) '# '
          DO iff=2,nbfiles
-            WRITE(*,*) 'INCLUDEDEF = ',TRIM(filelist(iff))
+            WRITE(ipslout,*) 'INCLUDEDEF = ',TRIM(filelist(iff))
          ENDDO
-         WRITE(*,*) '# '
+         WRITE(ipslout,*) '# '
       ENDIF
     ENDIF
@@ -1915,6 +1915,6 @@
         !-
         IF (l_dbg) THEN
-           WRITE(*,*) '#'
-           WRITE(*,*) '# Status of key ', ikey, ' : ',&
+           WRITE(ipslout,*) '#'
+           WRITE(ipslout,*) '# Status of key ', ikey, ' : ',&
  &          TRIM(key_tab(ikey)%keystr),key_tab(ikey)%keystatus
         ENDIF
Index: IOIPSL/trunk/src/histcom.f90
===================================================================
--- IOIPSL/trunk/src/histcom.f90	(revision 1377)
+++ IOIPSL/trunk/src/histcom.f90	(revision 1378)
@@ -12,5 +12,5 @@
   USE fliocom,  ONLY : flio_dom_file,flio_dom_att
   USE calendar
-  USE errioipsl, ONLY : ipslerr,ipsldbg
+  USE errioipsl, ONLY : ipslerr,ipsldbg,ipslout
 !-
   IMPLICIT NONE
@@ -340,5 +340,5 @@
   ENDIF
 !-
-  IF (l_dbg) WRITE(*,*) c_nam//" 0.0"
+  IF (l_dbg) WRITE(ipslout,*) c_nam//" 0.0"
 !-
 ! Search for a free index
@@ -358,5 +358,5 @@
 ! 1.0 Transfering into the common for future use
 !-
-  IF (l_dbg) WRITE(*,*) c_nam//" 1.0"
+  IF (l_dbg) WRITE(ipslout,*) c_nam//" 1.0"
 !-
   W_F(idf)%itau0  = pitau0
@@ -366,5 +366,5 @@
 ! 2.0 Initializes all variables for this file
 !-
-  IF (l_dbg) WRITE(*,*) c_nam//" 2.0"
+  IF (l_dbg) WRITE(ipslout,*) c_nam//" 2.0"
 !-
   W_F(idf)%n_var = 0
@@ -383,5 +383,5 @@
 ! 3.0 Opening netcdf file and defining dimensions
 !-
-  IF (l_dbg) WRITE(*,*) c_nam//" 3.0"
+  IF (l_dbg) WRITE(ipslout,*) c_nam//" 3.0"
 !-
 ! Add DOMAIN number and ".nc" suffix in file name if needed
@@ -425,5 +425,5 @@
 ! 4.0 Declaring the geographical coordinates and other attributes
 !-
-  IF (l_dbg) WRITE(*,*) c_nam//" 4.0"
+  IF (l_dbg) WRITE(ipslout,*) c_nam//" 4.0"
 !-
   iret = NF90_PUT_ATT(nfid,NF90_GLOBAL,'Conventions','CF-1.1')
@@ -436,5 +436,5 @@
 ! 5.0 Saving some important information on this file in the common
 !-
-  IF (l_dbg) WRITE(*,*) c_nam//" 5.0"
+  IF (l_dbg) WRITE(ipslout,*) c_nam//" 5.0"
 !-
   IF (PRESENT(domain_id)) THEN
@@ -612,5 +612,5 @@
 ! 1.1 Create all the variables needed
 !-
-  IF (l_dbg) WRITE(*,*) c_nam//" 1.0"
+  IF (l_dbg) WRITE(ipslout,*) c_nam//" 1.0"
 !-
   nfid = W_F(idf)%ncfid
@@ -671,5 +671,5 @@
 ! 2.0 Longitude
 !-
-  IF (l_dbg) WRITE(*,*) c_nam//" 2.0"
+  IF (l_dbg) WRITE(ipslout,*) c_nam//" 2.0"
 !-
   i_s = 1;
@@ -702,5 +702,5 @@
 ! 3.0 Latitude
 !-
-  IF (l_dbg) WRITE(*,*) c_nam//" 3.0"
+  IF (l_dbg) WRITE(ipslout,*) c_nam//" 3.0"
 !-
   i_e = 2;
@@ -736,5 +736,5 @@
 ! 4.0 storing the geographical coordinates
 !-
-  IF (l_dbg) WRITE(*,*) c_nam//" 4.0"
+  IF (l_dbg) WRITE(ipslout,*) c_nam//" 4.0"
 !-
   IF ( (k_typ == 1).OR.(k_typ == 2) ) THEN
@@ -833,5 +833,5 @@
 !    Is the name already in use ?
 !-
-  IF (l_dbg) WRITE(*,*) "histvert : 1.0 Verifications", &
+  IF (l_dbg) WRITE(ipslout,*) "histvert : 1.0 Verifications", &
  &                      pzaxname,'---',pzaxunit,'---',pzaxtitle
 !-
@@ -883,5 +883,5 @@
 !-
   IF (l_dbg) &
- &  WRITE(*,*) "histvert : 2.0 Add the information to the file"
+ &  WRITE(ipslout,*) "histvert : 2.0 Add the information to the file"
 !-
   nfid = W_F(idf)%ncfid
@@ -918,5 +918,5 @@
 !-
   IF (l_dbg) &
-  &  WRITE(*,*) "histvert : 3.0 add the information to the common"
+  &  WRITE(ipslout,*) "histvert : 3.0 add the information to the common"
 !-
   W_F(idf)%n_zax = iv
@@ -1016,5 +1016,5 @@
 !     and verify that it does not already exist
 !-
-  IF (l_dbg) WRITE(*,*) "histdef : 1.0"
+  IF (l_dbg) WRITE(ipslout,*) "histdef : 1.0"
 !-
   IF (iv > 1) THEN
@@ -1070,5 +1070,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "histdef : 2.0",idf,iv,W_F(idf)%W_V(iv)%nbopp, &
+    WRITE(ipslout,*) "histdef : 2.0",idf,iv,W_F(idf)%W_V(iv)%nbopp, &
  &    W_F(idf)%W_V(iv)%sopp(1:W_F(idf)%W_V(iv)%nbopp), &
  &    W_F(idf)%W_V(iv)%scal(1:W_F(idf)%W_V(iv)%nbopp)
@@ -1164,5 +1164,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "histdef : 3.0"
+    WRITE(ipslout,*) "histdef : 3.0"
   ENDIF
 !-
@@ -1177,5 +1177,5 @@
     W_F(idf)%W_V(iv)%t_bf(:) = 0.
     IF (l_dbg) THEN
-      WRITE(*,*) "histdef : 3.0 allocating time_buffer for", &
+      WRITE(ipslout,*) "histdef : 3.0 allocating time_buffer for", &
  &      " idf = ",idf," iv = ",iv," size = ",buff_sz
     ENDIF
@@ -1187,5 +1187,5 @@
 !     The strategy is to bring it back to seconds for the tests
 !-
-  IF (l_dbg) WRITE(*,*) "histdef : 4.0"
+  IF (l_dbg) WRITE(ipslout,*) "histdef : 4.0"
 !-
   W_F(idf)%W_V(iv)%freq_opp = pfreq_opp
@@ -1272,5 +1272,5 @@
 ! 5.0 Initialize other variables of the common
 !-
-  IF (l_dbg) WRITE(*,*) "histdef : 5.0"
+  IF (l_dbg) WRITE(ipslout,*) "histdef : 5.0"
 !-
   W_F(idf)%W_V(iv)%hist_wrt_rng = (PRESENT(var_range))
@@ -1298,5 +1298,5 @@
 ! 6.0 Get the time axis for this variable
 !-
-  IF (l_dbg) WRITE(*,*) "histdef : 6.0"
+  IF (l_dbg) WRITE(ipslout,*) "histdef : 6.0"
 !-
 ! No time axis for once, l_max, l_min or never operation
@@ -1331,5 +1331,5 @@
   ELSE
     IF (l_dbg) THEN
-      WRITE(*,*) "histdef : 7.0 ",TRIM(W_F(idf)%W_V(iv)%topp),'----'
+      WRITE(ipslout,*) "histdef : 7.0 ",TRIM(W_F(idf)%W_V(iv)%topp),'----'
     ENDIF
     W_F(idf)%W_V(iv)%t_axid = -99
@@ -1385,5 +1385,5 @@
 ! 1.0 Create the time axes
 !-
-  IF (l_dbg) WRITE(*,*) "histend : 1.0"
+  IF (l_dbg) WRITE(ipslout,*) "histend : 1.0"
 !-
 ! 1.1 Define the time dimensions needed for this file
@@ -1473,5 +1473,5 @@
 ! 2.0 declare the variables
 !-
-  IF (l_dbg) WRITE(*,*) "histend : 2.0"
+  IF (l_dbg) WRITE(ipslout,*) "histend : 2.0"
 !-
   DO iv=1,W_F(idf)%n_var
@@ -1575,5 +1575,5 @@
 !-
         IF (l_dbg) THEN
-          WRITE(*,*) "histend : 2.0.n, freq_opp, freq_wrt", &
+          WRITE(ipslout,*) "histend : 2.0.n, freq_opp, freq_wrt", &
  &          W_F(idf)%W_V(iv)%freq_opp,W_F(idf)%W_V(iv)%freq_wrt
         ENDIF
@@ -1596,5 +1596,5 @@
 ! 3.0 Put the netcdf file into write mode
 !-
-  IF (l_dbg) WRITE(*,*) "histend : 3.0"
+  IF (l_dbg) WRITE(ipslout,*) "histend : 3.0"
 !-
   iret = NF90_ENDDEF (nfid)
@@ -1602,5 +1602,5 @@
 ! 4.0 Give some informations to the user
 !-
-  IF (l_dbg) WRITE(*,*) "histend : 4.0"
+  IF (l_dbg) WRITE(ipslout,*) "histend : 4.0"
 !-
   WRITE(str70,'("All variables have been initialized on file :",I3)') idf
@@ -1682,5 +1682,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "histwrite : ",c_nam
+    WRITE(ipslout,*) "histwrite : ",c_nam
   ENDIF
 !-
@@ -1791,5 +1791,5 @@
     IF (.NOT.ALLOCATED(tbf_1)) THEN
       IF (l_dbg) THEN
-        WRITE(*,*) &
+        WRITE(ipslout,*) &
  &       c_nam//" : allocate tbf_1 for size = ", &
  &       W_F(idf)%W_V(iv)%datasz_max
@@ -1798,5 +1798,5 @@
     ELSE IF (W_F(idf)%W_V(iv)%datasz_max > SIZE(tbf_1)) THEN
       IF (l_dbg) THEN
-        WRITE(*,*) &
+        WRITE(ipslout,*) &
  &       c_nam//" : re-allocate tbf_1 for size = ", &
  &       W_F(idf)%W_V(iv)%datasz_max
@@ -1871,7 +1871,7 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "histwrite 0.0 : VAR : ",W_F(idf)%W_V(iv)%v_name
-    WRITE(*,*) "histwrite 0.0 : nbindex :",nbindex
-    WRITE(*,*) "histwrite 0.0 : nindex  :",nindex(1:MIN(3,nbindex)),'...'
+    WRITE(ipslout,*) "histwrite 0.0 : VAR : ",W_F(idf)%W_V(iv)%v_name
+    WRITE(ipslout,*) "histwrite 0.0 : nbindex :",nbindex
+    WRITE(ipslout,*) "histwrite 0.0 : nindex  :",nindex(1:MIN(3,nbindex)),'...'
   ENDIF
 !-
@@ -1888,10 +1888,10 @@
   IF (.NOT.ALLOCATED(tbf_2)) THEN
     IF (l_dbg) THEN
-      WRITE(*,*) "histwrite_real 1.1 allocate tbf_2 ",SIZE(tbf_1)
+      WRITE(ipslout,*) "histwrite_real 1.1 allocate tbf_2 ",SIZE(tbf_1)
     ENDIF
     ALLOCATE(tbf_2(W_F(idf)%W_V(iv)%datasz_max))
   ELSE IF (W_F(idf)%W_V(iv)%datasz_max > SIZE(tbf_2)) THEN
     IF (l_dbg) THEN
-      WRITE(*,*) "histwrite_real 1.2 re-allocate tbf_2 : ", &
+      WRITE(ipslout,*) "histwrite_real 1.2 re-allocate tbf_2 : ", &
      & SIZE(tbf_1)," instead of ",SIZE(tbf_2)
     ENDIF
@@ -1906,5 +1906,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "histwrite: 3.0",idf
+    WRITE(ipslout,*) "histwrite: 3.0",idf
   ENDIF
 !-
@@ -1924,5 +1924,5 @@
  &      nbout,tbf_2)
       IF (l_dbg) THEN
-        WRITE(*,*) &
+        WRITE(ipslout,*) &
  &       "histwrite: 3.4a nbout : ",nbin,nbout,W_F(idf)%W_V(iv)%sopp(io)
       ENDIF
@@ -1934,5 +1934,5 @@
  &      nbout,tbf_1)
       IF (l_dbg) THEN
-        WRITE(*,*) &
+        WRITE(ipslout,*) &
  &     "histwrite: 3.4b nbout : ",nbin,nbout,W_F(idf)%W_V(iv)%sopp(io+1)
       ENDIF
@@ -1942,16 +1942,16 @@
 !-
     IF (l_dbg) THEN
-      WRITE(*,*) &
+      WRITE(ipslout,*) &
  &     "histwrite: 3.5 size(tbf_1) : ",SIZE(tbf_1)
-      WRITE(*,*) &
+      WRITE(ipslout,*) &
  &     "histwrite: 3.5 slab in X :", &
  &     W_F(idf)%W_V(iv)%zorig(1),W_F(idf)%W_V(iv)%zsize(1)
-      WRITE(*,*) &
+      WRITE(ipslout,*) &
  &     "histwrite: 3.5 slab in Y :", &
  &     W_F(idf)%W_V(iv)%zorig(2),W_F(idf)%W_V(iv)%zsize(2)
-      WRITE(*,*) &
+      WRITE(ipslout,*) &
  &     "histwrite: 3.5 slab in Z :", &
  &     W_F(idf)%W_V(iv)%zorig(3),W_F(idf)%W_V(iv)%zsize(3)
-      WRITE(*,*) &
+      WRITE(ipslout,*) &
  &     "histwrite: 3.5 slab of input:", &
  &     W_F(idf)%W_V(iv)%scsize(1), &
@@ -1999,5 +1999,5 @@
 !-
     IF (l_dbg) THEN
-      WRITE(*,*) "histwrite: 4.0 tbf_1",idf,iv, &
+      WRITE(ipslout,*) "histwrite: 4.0 tbf_1",idf,iv, &
  &      TRIM(tmp_opp),' ---- ',LEN_TRIM(tmp_opp),nbindex
     ENDIF
@@ -2016,5 +2016,5 @@
 !-
     IF (l_dbg) THEN
-      WRITE(*,*) "histwrite: 5.0 idf : ",idf," iv : ",iv," tsz : ",tsz
+      WRITE(ipslout,*) "histwrite: 5.0 idf : ",idf," iv : ",iv," tsz : ",tsz
     ENDIF
 !-
@@ -2032,5 +2032,5 @@
 ! 6.0 Write to file if needed
 !-
-  IF (l_dbg) WRITE(*,*) "histwrite: 6.0",idf
+  IF (l_dbg) WRITE(ipslout,*) "histwrite: 6.0",idf
 !-
   IF (do_write) THEN
@@ -2041,5 +2041,5 @@
 !-- 6.1 Do the operations that are needed before writting
 !-
-    IF (l_dbg) WRITE(*,*) "histwrite: 6.1",idf
+    IF (l_dbg) WRITE(ipslout,*) "histwrite: 6.1",idf
 !-
     IF (     (TRIM(tmp_opp) /= "inst") &
@@ -2055,5 +2055,5 @@
  &      .AND.(TRIM(tmp_opp) /= "once") ) THEN
 !-
-      IF (l_dbg) WRITE(*,*) "histwrite: 6.2",idf
+      IF (l_dbg) WRITE(ipslout,*) "histwrite: 6.2",idf
 !-
       itax  = W_F(idf)%W_V(iv)%t_axid
@@ -2077,5 +2077,5 @@
 !-
     IF (l_dbg) THEN
-      WRITE(*,*) "histwrite: 6.3",idf,nfid,nvid,iv,itime
+      WRITE(ipslout,*) "histwrite: 6.3",idf,nfid,nvid,iv,itime
     ENDIF
 !-
@@ -2159,5 +2159,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) 'histvar_seq, start of the subroutine :',learning(idf)
+    WRITE(ipslout,*) 'histvar_seq, start of the subroutine :',learning(idf)
   ENDIF
 !-
@@ -2203,6 +2203,6 @@
  &       'of your code. Thus if you wish to save time'// &
  &       ' contact the IOIPSL team. ')
-        WRITE(*,*) 'The sequence we have found up to now :'
-        WRITE(*,*) varseq(idf,1:sp-1)
+        WRITE(ipslout,*) 'The sequence we have found up to now :'
+        WRITE(ipslout,*) varseq(idf,1:sp-1)
         varseq_err(idf) = -1
       ENDIF
@@ -2268,5 +2268,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) &
+    WRITE(ipslout,*) &
  &   'histvar_seq, end of the subroutine :',TRIM(pvarname),idv
   ENDIF
@@ -2294,5 +2294,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->histsync"
+    WRITE(ipslout,*) "->histsync"
   ENDIF
 !-
@@ -2319,5 +2319,5 @@
     IF (W_F(ifile)%ncfid > 0) THEN
       IF (l_dbg) THEN
-        WRITE(*,*) '  histsync - synchronising file number ',ifile
+        WRITE(ipslout,*) '  histsync - synchronising file number ',ifile
       ENDIF
       iret = NF90_SYNC(W_F(ifile)%ncfid)
@@ -2326,5 +2326,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-histsync"
+    WRITE(ipslout,*) "<-histsync"
   ENDIF
 !----------------------
@@ -2349,5 +2349,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "->histclo"
+    WRITE(ipslout,*) "->histclo"
   ENDIF
 !-
@@ -2374,5 +2374,5 @@
     IF (W_F(ifile)%ncfid > 0) THEN
       IF (l_dbg) THEN
-        WRITE(*,*) '  histclo - closing specified file number :',ifile
+        WRITE(ipslout,*) '  histclo - closing specified file number :',ifile
       ENDIF
       nfid = W_F(ifile)%ncfid
@@ -2382,5 +2382,5 @@
 !-----
       IF (l_dbg) THEN
-        WRITE(*,*) '  Entering loop on vars : ',W_F(ifile)%n_var
+        WRITE(ipslout,*) '  Entering loop on vars : ',W_F(ifile)%n_var
       ENDIF
       DO iv=1,W_F(ifile)%n_var
@@ -2388,7 +2388,7 @@
         IF (W_F(ifile)%W_V(iv)%hist_wrt_rng) THEN
           IF (l_dbg) THEN
-            WRITE(*,*) 'min value for file :',ifile,' var n. :',iv, &
+            WRITE(ipslout,*) 'min value for file :',ifile,' var n. :',iv, &
  &                     ' is : ',W_F(ifile)%W_V(iv)%hist_minmax(1)
-            WRITE(*,*) 'max value for file :',ifile,' var n. :',iv, &
+            WRITE(ipslout,*) 'max value for file :',ifile,' var n. :',iv, &
  &                     ' is : ',W_F(ifile)%W_V(iv)%hist_minmax(2)
           ENDIF
@@ -2420,5 +2420,5 @@
 !---- 2. Close the file
 !-----
-      IF (l_dbg) WRITE(*,*) '  close file :',nfid
+      IF (l_dbg) WRITE(ipslout,*) '  close file :',nfid
       iret = NF90_CLOSE(nfid)
       W_F(ifile)%ncfid = -1
@@ -2428,5 +2428,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) "<-histclo"
+    WRITE(ipslout,*) "<-histclo"
   ENDIF
 !---------------------
Index: IOIPSL/trunk/src/restcom.f90
===================================================================
--- IOIPSL/trunk/src/restcom.f90	(revision 1377)
+++ IOIPSL/trunk/src/restcom.f90	(revision 1378)
@@ -8,5 +8,5 @@
 USE netcdf
 !-
-USE errioipsl, ONLY : ipslerr,ipsldbg
+USE errioipsl, ONLY : ipslerr,ipsldbg, ipslout
 USE stringop
 USE calendar
@@ -230,5 +230,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) 'restini 0.0 : ',TRIM(fnamein),' , ',TRIM(fnameout)
+    WRITE(ipslout,*) 'restini 0.0 : ',TRIM(fnamein),' , ',TRIM(fnameout)
   ENDIF
 !-
@@ -254,5 +254,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) 'restini 0.1 l_fi, l_fo, l_rw : ',l_fi,l_fo,l_rw
+    WRITE(ipslout,*) 'restini 0.1 l_fi, l_fo, l_rw : ',l_fi,l_fo,l_rw
   ENDIF
 !-
@@ -261,5 +261,5 @@
   IF (l_fi) THEN
 !---
-    IF (l_dbg) WRITE(*,*) 'restini 1.0 : Open input file'
+    IF (l_dbg) WRITE(ipslout,*) 'restini 1.0 : Open input file'
 !-- Add DOMAIN number and ".nc" suffix in file names if needed
     fname = fnamein
@@ -284,5 +284,5 @@
 !-- 2.0 The case of a missing restart file is dealt with
 !---
-    IF (l_dbg) WRITE(*,*) 'restini 2.0'
+    IF (l_dbg) WRITE(ipslout,*) 'restini 2.0'
 !---
     IF (     (ALL(MINLOC(lon(:iim,:jjm)) == MAXLOC(lon(:iim,:jjm)))) &
@@ -340,5 +340,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) 'restini 2.3 : Configure calendar if needed : ', &
+    WRITE(ipslout,*) 'restini 2.3 : Configure calendar if needed : ', &
                 calend_str
   ENDIF
@@ -347,5 +347,5 @@
     CALL ioconf_calendar (calend_str)
     IF (l_dbg) THEN
-      WRITE(*,*) 'restini 2.3b : new calendar : ',calend_str
+      WRITE(ipslout,*) 'restini 2.3b : new calendar : ',calend_str
     ENDIF
   ENDIF
@@ -359,11 +359,11 @@
   fid = nb_fi
   IF (l_dbg) THEN
-    WRITE(*,*) 'SIZE of t_index :',SIZE(t_index), &
+    WRITE(ipslout,*) 'SIZE of t_index :',SIZE(t_index), &
                SIZE(t_index,dim=1),SIZE(t_index,dim=2)
-    WRITE(*,*) 't_index = ',t_index(fid,:)
+    WRITE(ipslout,*) 't_index = ',t_index(fid,:)
   ENDIF
   itau = t_index(fid,1)
 !-
-  IF (l_dbg) WRITE(*,*) 'restini END'
+  IF (l_dbg) WRITE(ipslout,*) 'restini END'
 !---------------------
 END SUBROUTINE restini
@@ -502,5 +502,5 @@
 ! 2.0 Get the list of variables
 !-
-  IF (l_dbg) WRITE(*,*) 'restopenin 1.2'
+  IF (l_dbg) WRITE(ipslout,*) 'restopenin 1.2'
 !-
   lat_vid = -1
@@ -663,5 +663,5 @@
       CALL ioconf_calendar (calendar)
       IF (l_dbg) THEN
-        WRITE(*,*) 'restsett : calendar of the restart ',calendar
+        WRITE(ipslout,*) 'restsett : calendar of the restart ',calendar
       ENDIF
     ENDIF
@@ -669,5 +669,5 @@
   CALL ioget_calendar (one_year,one_day)
   IF (l_dbg) THEN
-    WRITE(*,*) 'one_year,one_day = ',one_year,one_day
+    WRITE(ipslout,*) 'one_year,one_day = ',one_year,one_day
   ENDIF
 !-
@@ -681,5 +681,5 @@
       t_index(nb_fi,:) = itau
       IF (l_dbg) THEN
-        WRITE(*,*) "nb_fi,t_index",nb_fi,t_index(nb_fi,:)
+        WRITE(ipslout,*) "nb_fi,t_index",nb_fi,t_index(nb_fi,:)
       ENDIF
       CALL ju2ymds (date0,year0,month0,day0,sec0)
@@ -691,13 +691,13 @@
       strc=':'
       IF (l_dbg) THEN
-        WRITE(*,*) date0
+        WRITE(ipslout,*) date0
         WRITE (UNIT=itau_orig,FMT='(I4.4,5(A,I2.2))') &
  &       year0,'-',month0,'-',day0,' ',hours0,':',minutes0,':',seci
-        WRITE(*,*) "itau_orig : ",itau_orig
+        WRITE(ipslout,*) "itau_orig : ",itau_orig
       ENDIF
     ELSE
       iret = NF90_GET_VAR(ncfid,tind_varid_in(nb_fi),t_index(nb_fi,:))
       IF (l_dbg) THEN
-        WRITE(*,*) "restsett, time axis : ",t_index(nb_fi,:)
+        WRITE(ipslout,*) "restsett, time axis : ",t_index(nb_fi,:)
       ENDIF
       iret = NF90_GET_ATT(ncfid,tind_varid_in(nb_fi),'units',itau_orig)
@@ -727,5 +727,5 @@
     iret = NF90_GET_ATT(ncfid,tax_varid_in(nb_fi),'calendar',tmp_cal)
     IF (l_dbg) THEN
-      WRITE(*,*) 'restsett : tmp_calendar of the restart ',tmp_cal
+      WRITE(ipslout,*) 'restsett : tmp_calendar of the restart ',tmp_cal
     ENDIF
 !---
@@ -744,5 +744,5 @@
 !-- to get ride of the intial date.
 !---
-    IF (l_dbg) WRITE(*,*) 'tax_orig : ',TRIM(tax_orig)
+    IF (l_dbg) WRITE(ipslout,*) 'tax_orig : ',TRIM(tax_orig)
     READ (UNIT=tax_orig,FMT='(I4.4,5(a,I2.2))') &
       year0,strc,month0,strc,day0,strc, &
@@ -831,5 +831,5 @@
   CALL ipsldbg (old_status=l_dbg)
 !-
-  IF (l_dbg) WRITE(*,*) "restopenout 0.0 ",TRIM(fname)
+  IF (l_dbg) WRITE(ipslout,*) "restopenout 0.0 ",TRIM(fname)
 !-
 !  If we use the same file for input and output
@@ -863,5 +863,5 @@
 ! 1.0 Longitude
 !-
-  IF (l_dbg) WRITE(*,*) "restopenout 1.0"
+  IF (l_dbg) WRITE(ipslout,*) "restopenout 1.0"
 !-
   iret = NF90_DEF_VAR(ncfid,"nav_lon",NF90_FLOAT,(/x_id,y_id/),nlonid)
@@ -873,5 +873,5 @@
 ! 2.0 Latitude
 !-
-  IF (l_dbg) WRITE(*,*) "restopenout 2.0"
+  IF (l_dbg) WRITE(ipslout,*) "restopenout 2.0"
 !-
   iret = NF90_DEF_VAR(ncfid,"nav_lat",NF90_FLOAT,(/x_id,y_id/),nlatid)
@@ -883,5 +883,5 @@
 ! 3.0 Levels
 !-
-  IF (l_dbg) WRITE(*,*) "restopenout 3.0"
+  IF (l_dbg) WRITE(ipslout,*) "restopenout 3.0"
 !-
   iret = NF90_DEF_VAR(ncfid,"nav_lev",NF90_FLOAT,z_id,nlevid)
@@ -895,5 +895,5 @@
 ! 4.0 Time axis, this is the seconds since axis
 !-
-  IF (l_dbg) WRITE(*,*) "restopenout 4.0"
+  IF (l_dbg) WRITE(ipslout,*) "restopenout 4.0"
 !-
   iret = NF90_DEF_VAR(ncfid,"time",NF90_FLOAT, &
@@ -923,5 +923,5 @@
 ! 5.0 Time axis, this is the time steps since axis
 !-
-  IF (l_dbg) WRITE(*,*) "restopenout 5.0"
+  IF (l_dbg) WRITE(ipslout,*) "restopenout 5.0"
 !-
   iret = NF90_DEF_VAR(ncfid,"time_steps",NF90_INT, &
@@ -984,5 +984,5 @@
   iret = NF90_REDEF(ncfid)
 !-
-  IF (l_dbg) WRITE(*,*) "restopenout END"
+  IF (l_dbg) WRITE(ipslout,*) "restopenout END"
 !-------------------------
 END SUBROUTINE restopenout
@@ -1902,10 +1902,10 @@
 ! 1.0 Check if the variable is already present
 !-
-  IF (l_dbg) WRITE(*,*) 'RESTPUT 1.0 : ',TRIM(vname_q)
+  IF (l_dbg) WRITE(ipslout,*) 'RESTPUT 1.0 : ',TRIM(vname_q)
 !-
   CALL find_str (varname_out(fid,1:nbvar_out(fid)),vname_q,vnb)
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) 'RESTPUT 1.1 : ',varname_out(fid,1:nbvar_out(fid)),vnb
+    WRITE(ipslout,*) 'RESTPUT 1.1 : ',varname_out(fid,1:nbvar_out(fid)),vnb
   ENDIF
 !-
@@ -1919,5 +1919,5 @@
   vid = varid_out(fid,vnb)
 !-
-  IF (l_dbg) WRITE(*,*) 'RESTPUT 2.0 : ',vnb,vid
+  IF (l_dbg) WRITE(ipslout,*) 'RESTPUT 2.0 : ',vnb,vid
 !-
 ! 2.1 Is this file already in write mode ?
@@ -1932,5 +1932,5 @@
 !     If not then check that all variables of previous time is OK.
 !-
-  IF (l_dbg) WRITE(*,*) 'RESTPUT 3.0 : ',itau,itau_out(fid)
+  IF (l_dbg) WRITE(ipslout,*) 'RESTPUT 3.0 : ',itau,itau_out(fid)
 !-
   IF (itau /= itau_out(fid)) THEN
@@ -1942,5 +1942,5 @@
     IF (tstp_out(fid) == 0) THEN
       IF (nbvar_out(fid) < nbvar_read(fid)) THEN
-        WRITE(*,*) "ERROR :",tstp_out(fid), &
+        WRITE(ipslout,*) "ERROR :",tstp_out(fid), &
                    nbvar_out(fid),nbvar_read(fid)
         CALL ipslerr (1,'restput', &
@@ -1955,5 +1955,5 @@
       ENDDO
       IF (ierr > 0) THEN
-        WRITE(*,*) "ERROR :",nbvar_out(fid)
+        WRITE(ipslout,*) "ERROR :",nbvar_out(fid)
         CALL ipslerr (1,'restput', &
  &        'There are fewer variables in the output file for this', &
@@ -1971,5 +1971,5 @@
 !---
     IF (l_dbg) THEN
-      WRITE(*,*) 'RESTPUT 3.1 : ',itau,secsince,corner(1),edge(1)
+      WRITE(ipslout,*) 'RESTPUT 3.1 : ',itau,secsince,corner(1),edge(1)
     ENDIF
 !---
@@ -2058,5 +2058,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) 'restdefv 1.0 :',TRIM(varname),nbvar_out(fid)
+    WRITE(ipslout,*) 'restdefv 1.0 :',TRIM(varname),nbvar_out(fid)
   ENDIF
 !-
@@ -2134,5 +2134,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) 'restdefv 2.0 :',ndim,' :: ',dims(1:ndim),tdimid_out(fid)
+    WRITE(ipslout,*) 'restdefv 2.0 :',ndim,' :: ',dims(1:ndim),tdimid_out(fid)
   ENDIF
 !-
@@ -2169,5 +2169,5 @@
 !-
   IF (l_dbg) THEN
-    WRITE(*,*) &
+    WRITE(ipslout,*) &
  &    'restdefv 3.0 : LIST OF VARS ',varname_out(fid,1:nbvar_out(fid))
   ENDIF
@@ -2193,5 +2193,5 @@
   IF (.NOT.ALLOCATED(t_index) .AND. .NOT.ALLOCATED(t_julian)) THEN
     IF (l_msg) THEN
-      WRITE(*,*) TRIM(c_p)//' : Allocate times axes at :', &
+      WRITE(ipslout,*) TRIM(c_p)//' : Allocate times axes at :', &
  &               max_file,tax_size_in(nb_fi)
     ENDIF
@@ -2199,5 +2199,5 @@
     ALLOCATE(t_index(max_file,tax_size_in(nb_fi)),STAT=i_err)
     IF (i_err/=0) THEN
-      WRITE(*,*) "ERROR IN ALLOCATION of t_index : ",i_err
+      WRITE(ipslout,*) "ERROR IN ALLOCATION of t_index : ",i_err
       CALL ipslerr (3,TRIM(c_p), &
  &      'Problem in allocation of t_index','', &
@@ -2208,5 +2208,5 @@
     ALLOCATE(t_julian(max_file,tax_size_in(nb_fi)),STAT=i_err)
     IF (i_err/=0) THEN
-      WRITE(*,*) "ERROR IN ALLOCATION of t_julian : ",i_err
+      WRITE(ipslout,*) "ERROR IN ALLOCATION of t_julian : ",i_err
       CALL ipslerr (3,TRIM(c_p), &
  &      'Problem in allocation of max_file,tax_size_in','', &
@@ -2217,5 +2217,5 @@
  &         .OR.(SIZE(t_julian,DIM=2) < tax_size_in(nb_fi)) ) THEN
     IF (l_msg) THEN
-      WRITE(*,*) TRIM(c_p)//' : Reallocate times axes at :', &
+      WRITE(ipslout,*) TRIM(c_p)//' : Reallocate times axes at :', &
  &               max_file,tax_size_in(nb_fi)
     ENDIF
@@ -2223,5 +2223,5 @@
     ALLOCATE (tmp_index(max_file,tax_size_in(nb_fi)),STAT=i_err)
     IF (i_err/=0) THEN
-      WRITE(*,*) "ERROR IN ALLOCATION of tmp_index : ",i_err
+      WRITE(ipslout,*) "ERROR IN ALLOCATION of tmp_index : ",i_err
       CALL ipslerr (3,TRIM(c_p), &
  &      'Problem in allocation of tmp_index','', &
@@ -2233,5 +2233,5 @@
     ALLOCATE (t_index(max_file,tax_size_in(nb_fi)),STAT=i_err)
     IF (i_err/=0) THEN
-      WRITE(*,*) "ERROR IN ALLOCATION of t_index : ",i_err
+      WRITE(ipslout,*) "ERROR IN ALLOCATION of t_index : ",i_err
       CALL ipslerr (3,TRIM(c_p), &
  &     'Problem in reallocation of t_index','', &
@@ -2242,5 +2242,5 @@
     ALLOCATE (tmp_julian(max_file,tax_size_in(nb_fi)),STAT=i_err)
     IF (i_err/=0) THEN
-      WRITE(*,*) "ERROR IN ALLOCATION of tmp_julian : ",i_err
+      WRITE(ipslout,*) "ERROR IN ALLOCATION of tmp_julian : ",i_err
       CALL ipslerr (3,TRIM(c_p), &
  &     'Problem in allocation of tmp_julian','', &
@@ -2252,5 +2252,5 @@
     ALLOCATE (t_julian(max_file,tax_size_in(nb_fi)),STAT=i_err)
     IF (i_err/=0) THEN
-      WRITE(*,*) "ERROR IN ALLOCATION of t_julian : ",i_err
+      WRITE(ipslout,*) "ERROR IN ALLOCATION of t_julian : ",i_err
       CALL ipslerr (3,TRIM(c_p), &
  &      'Problem in reallocation of t_julian','', &
@@ -2308,7 +2308,7 @@
       IF (    (l_alloc1.AND.ALLOCATED(buff_tmp1)) &
  &        .OR.(l_alloc2.AND.ALLOCATED(buff_tmp2)) ) THEN
-        WRITE(*,*) TRIM(c_p)//" : re_allocate "//TRIM(cbn)//"=",i_qsz
+        WRITE(ipslout,*) TRIM(c_p)//" : re_allocate "//TRIM(cbn)//"=",i_qsz
       ELSE
-        WRITE(*,*) TRIM(c_p)//" : allocate "//TRIM(cbn)//"=",i_qsz
+        WRITE(ipslout,*) TRIM(c_p)//" : allocate "//TRIM(cbn)//"=",i_qsz
       ENDIF
     ENDIF
@@ -2479,5 +2479,5 @@
 !---
     IF (l_dbg) THEN
-      WRITE(*,*) &
+      WRITE(ipslout,*) &
         'restclo : Closing specified restart file number :', &
         fid,netcdf_id(fid,1:2)
@@ -2511,5 +2511,5 @@
   ELSE
 !---
-    IF (l_dbg) WRITE(*,*) 'restclo : Closing all files'
+    IF (l_dbg) WRITE(ipslout,*) 'restclo : Closing all files'
 !---
     DO ifnc=1,nb_fi
