Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- subroutine output_header(filename)
- use amr_commons
- use hydro_commons
- use pm_commons
- implicit none
- include "mpif.h"
- integer::info
- character(LEN=*)::filename
- integer::ilun
- integer::npart_family_loc(-5:5), npart_family(-5:5), npart_all_loc, npart_all
- integer :: ifam, ipart
- if(verbose)write(*,*)'Entering output_header'
- ! Compute total number of particles
- ! Count number of particles
- npart_family_loc = 0; npart_all_loc = 0
- [ doing some stuff ]
- ! myid contains the id of the thread
- if (myid == 1) then
- ! Open file
- open(newunit=ilun,file=trim(filename),form='formatted',status='replace')
- write(ilun, '(a1,a12,a10)') '#', 'Family', 'Count'
- do ifam = -NFAMILIES, NFAMILIES
- write(ilun, '(a13, i10)') &
- trim(particle_family_keys(ifam)), npart_family(ifam)
- end do
- write(ilun, '(a13, i10)') &
- 'undefined', npart_all - sum(npart_family)
- [ do more stuff here ]
- close(ilun)
- endif
- end subroutine output_header
Add Comment
Please, Sign In to add comment