9. Source code: data I/O The data I/O can be written by using gtool4 F90 library as follows. !---------------------- data I/O ---------------------------------------------- call HistoryCreate(file="output_file", title="title", source="shallow water model", & institution="GFD Dennou Club AGCM6 project", & dims=(/'lon', 'lat', 't '/), dimsizes=(/im, jm, 0/), & longnames=(/'longitude', 'latitude ', 'time '/), units=(/'deg.', 'deg.', 'sec.'/), & origin=real(tinit), interval=real(intrst*dt) ) ! create output file call HistoryPut('lon', x_Lon*180/pi) ! output of coordinate variable call HistoryPut('lat', y_Lat*180/pi) call HistoryAddVariable(varname='zeta', dims=(/'lon', 'lat', 't '/), & longname='vorticity', units='1/s', xtype='double') ! definition of output variable ... do it=1,n ... call HistoryPut('t', real(it*dt)) ! output time call HistoryPut('zeta', xy_Zeta) ! output vorticity end do ... call HistoryClose ! data I/O end !---------------------- end of data I/O ----------------------------------------------