--- trunk/IOIPSL/histwrite.f90 2013/11/15 18:45:49 76 +++ trunk/IOIPSL/histwrite.f 2018/02/05 10:39:38 254 @@ -2,8 +2,20 @@ ! From histcom.f90, version 2.1 2004/04/21 09:27:10 + USE errioipsl, ONLY: histerr + use histbeg_totreg_m, ONLY: nb_files, date0, deltat + USE histcom_var, ONLY: datasz_in, freq_opp, freq_wrt, fuchnbout, last_opp, & + last_opp_chk, last_wrt, last_wrt_chk, missing_val, nb_files_max, & + nb_var_max, nbopp, scal, scsize, sopps, topp + use histvar_seq_m, only: histvar_seq + use histwrite_real_m, only: histwrite_real + use isittime_m, only: isittime + USE mathop_m, ONLY: mathop + implicit none + INTEGER, SAVE:: datasz_max(nb_files_max, nb_var_max) = -1 + INTERFACE histwrite ! The "histwrite" procedures give the data to the input-output system. ! They trigger the operations to be performed and the writing to @@ -31,22 +43,13 @@ MODULE PROCEDURE histwrite_r1d, histwrite_r2d, histwrite_r3d END INTERFACE histwrite - PRIVATE histwrite_r1d, histwrite_r2d, histwrite_r3d + PRIVATE + public histwrite CONTAINS SUBROUTINE histwrite_r1d(fileid, varname, itau, pdata) - USE errioipsl, ONLY: histerr - use calendar, only: isittime - USE mathop_m, ONLY: mathop - USE histcom_var, ONLY: datasz_in, datasz_max, date0, deltat, & - freq_opp, freq_wrt, fuchnbout, last_opp, last_opp_chk, last_wrt, & - last_wrt_chk, missing_val, nbopp, nb_files, scal, scsize, sopps, & - topp - use histvar_seq_m, only: histvar_seq - use histwrite_real_m, only: histwrite_real - INTEGER, INTENT(IN):: fileid, itau CHARACTER(LEN=*), INTENT(IN):: varname REAL, INTENT(IN):: pdata(:) @@ -157,8 +160,8 @@ nbpt_out = datasz_max(fileid, varid) CALL mathop(sopps(fileid, varid, 1), nbpt_in, pdata, missing_val, & nbindex, nindex, scal(fileid, varid, 1), nbpt_out, buff_tmp) - CALL histwrite_real(fileid, varid, itau, nbpt_out, buff_tmp, nbindex, & - nindex, do_oper, do_write) + CALL histwrite_real(datasz_max, fileid, varid, itau, nbpt_out, & + buff_tmp, nbindex, nindex, do_oper, do_write) ENDIF ! 6.0 Manage time steps @@ -177,16 +180,6 @@ SUBROUTINE histwrite_r2d (fileid, varname, itau, pdata) - use calendar, only: isittime - USE errioipsl, ONLY: histerr - USE mathop_m, ONLY: mathop - USE histcom_var, ONLY: datasz_in, datasz_max, date0, deltat, & - freq_opp, freq_wrt, fuchnbout, last_opp, last_opp_chk, last_wrt, & - last_wrt_chk, missing_val, nbopp, nb_files, scal, scsize, sopps, & - topp - use histvar_seq_m, only: histvar_seq - use histwrite_real_m, only: histwrite_real - INTEGER, INTENT(IN):: fileid, itau REAL, INTENT(IN):: pdata(:, :) CHARACTER(LEN=*), INTENT(IN):: varname @@ -300,7 +293,7 @@ CALL mathop (sopps(fileid, varid, 1), nbpt_in, pdata, & missing_val, nbindex, nindex, & scal(fileid, varid, 1), nbpt_out, buff_tmp) - CALL histwrite_real (fileid, varid, itau, nbpt_out, & + CALL histwrite_real (datasz_max, fileid, varid, itau, nbpt_out, & buff_tmp, nbindex, nindex, do_oper, do_write) ENDIF @@ -320,16 +313,6 @@ SUBROUTINE histwrite_r3d (fileid, varname, itau, pdata) - use calendar, only: isittime - USE errioipsl, ONLY: histerr - USE mathop_m, ONLY: mathop - USE histcom_var, ONLY: datasz_in, datasz_max, date0, deltat, & - freq_opp, freq_wrt, fuchnbout, last_opp, last_opp_chk, last_wrt, & - last_wrt_chk, missing_val, nbopp, nb_files, scal, scsize, sopps, & - topp - use histvar_seq_m, only: histvar_seq - use histwrite_real_m, only: histwrite_real - INTEGER, INTENT(IN):: fileid, itau REAL, DIMENSION(:, :, :), INTENT(IN):: pdata CHARACTER(LEN=*), INTENT(IN):: varname @@ -447,7 +430,7 @@ CALL mathop (sopps(fileid, varid, 1), nbpt_in, pdata, & missing_val, nbindex, nindex, & scal(fileid, varid, 1), nbpt_out, buff_tmp) - CALL histwrite_real (fileid, varid, itau, nbpt_out, & + CALL histwrite_real(datasz_max, fileid, varid, itau, nbpt_out, & buff_tmp, nbindex, nindex, do_oper, do_write) ENDIF