| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer | :: | ifile |
subroutine saveamrfile(ifile) use mod_usr_methods, only: usr_print_log, usr_write_analysis use mod_global_parameters use mod_particles, only: write_particles_snapshot use mod_slice, only: write_slice use mod_collapse, only: write_collapsed use mod_convert_files, only: generate_plotfile use mod_physics, only: phys_req_diagonal use mod_ghostcells_update use mod_geometry, only: sync_geometry_host integer:: ifile, iigrid, igrid ! update (diagonal) ghostcells before moving to host: if(.not. phys_req_diagonal) then call getbc(global_time,0.d0,ps,iwstart,nwgc) end if ! Same idea for the cell metrics: everything below here that weights by ! dvolume, or builds corner positions from dx, reads them on the host. call sync_geometry_host() select case (ifile) case (fileout_) ! Write .dat snapshot call write_snapshot() ! Generate formatted output (e.g., VTK) if(autoconvert) call generate_plotfile if(use_particles) call write_particles_snapshot() snapshotnext = snapshotnext + 1 case (fileslice_) call write_slice case (filecollapse_) call write_collapsed case (filelog_) select case (typefilelog) case ('default') call printlog_default case ('regression_test') call printlog_regression_test() case ('special') if (.not. associated(usr_print_log)) then call mpistop("usr_print_log not defined") else call usr_print_log() end if case default call mpistop("Error in SaveFile: Unknown typefilelog") end select case (fileanalysis_) if (associated(usr_write_analysis)) then call usr_write_analysis() end if case default write(*,*) 'No save method is defined for ifile=',ifile call mpistop("") end select ! opedit: Flush stdout and stderr from time to time. flush(unit=unitterm) end subroutine saveamrfile