--- trunk/IOIPSL/Histcom/histend.f 2014/03/05 14:57:53 82 +++ trunk/Sources/IOIPSL/Histcom/histend.f 2016/03/11 18:47:26 178 @@ -1,7 +1,12 @@ module histend_m + use histcom_var, only: nb_files_max, nb_var_max + implicit none + INTEGER, SAVE:: ncvar_ids(nb_files_max, nb_var_max) + private nb_files_max, nb_var_max + contains SUBROUTINE histend(fileid) @@ -9,14 +14,13 @@ ! This subroutine ends the declaration of variables, sets the time ! axes in the NetCDF file and puts it into write mode. - USE ioipslmpp, ONLY: ioipslmpp_addatt USE errioipsl, ONLY: histerr - USE histcom_var, ONLY: date0, freq_opp, freq_wrt, fullop, & - missing_val, name, nb_tax, nb_var, ncdf_ids, ncvar_ids, regular, & - tax_name, tdimid, tid, title, topp, unit_name, var_axid, var_zaxid, & - xid, yid, zax_ids, zax_name - USE ioget_calendar_m, ONLY: ioget_calendar - USE calendar, ONLY: ju2ymds + use histbeg_totreg_m, ONLY: date0, regular + USE histcom_var, ONLY: freq_opp, freq_wrt, fullop, missing_val, name, & + nb_tax, nb_var, ncdf_ids, tax_name, tdimid, tid, title, topp, & + unit_name, var_axid, var_zaxid, xid, yid, zax_ids, zax_name + USE ioget_calendar_m, ONLY: ioget_calendar_str + USE ju2ymds_m, ONLY: ju2ymds USE netcdf, ONLY: nf90_float, nf90_unlimited use netcdf95, only: nf95_def_dim, nf95_def_var, nf95_put_att, nf95_enddef @@ -24,14 +28,14 @@ ! Local: INTEGER ncid, varid - INTEGER iret, ndim, iv, itx, ziv + INTEGER ndim, iv, itx, ziv INTEGER itax INTEGER dims(4), dim_cnt INTEGER year, month, day, hours, minutes REAL sec REAL rtime0 CHARACTER(len=20) tname, tunit - CHARACTER(len=30) str30 + CHARACTER(len=42) str30 CHARACTER(len=80) ttitle CHARACTER(len=120) assoc CHARACTER(len=70) str70 @@ -74,7 +78,7 @@ WRITE(str70, 7000) year, month, day, hours, minutes, int(sec) call nf95_put_att(ncid, tdimid(fileid, itx), 'units', trim(str70)) - CALL ioget_calendar(str30) + CALL ioget_calendar_str(str30) call nf95_put_att(ncid, tdimid(fileid, itx), 'calendar', trim(str30)) call nf95_put_att(ncid, tdimid(fileid, itx), 'title', 'Time') @@ -184,9 +188,6 @@ END IF END DO - ! Add MPP attributes - CALL ioipslmpp_addatt(ncid) - ! 3.0 Put the netcdf file into write mode call nf95_enddef(ncid)