! example heatsink.f90 ! Andrew Moylan, 2003 ! u3290095@anu.edu.au ! to compile: f90 heatsink.f90 -o heatsink -lmpi ! to run: prun -n [number of cpus] heatsink program heatsink use globals use sor_iterate use infin implicit none ! initialise MPI call MPI_Init (mpi_error_code) call MPI_Comm_rank (MPI_COMM_WORLD, mpi_cpu_id, mpi_error_code) call MPI_Comm_size (MPI_COMM_WORLD, mpi_cpu_count, mpi_error_code) ! allocate this process's slice of the heatsink design allocate (heatsink_design (0: grid_size + 1, 0: grid_size / mpi_cpu_count + 1, 0: grid_size + 1)) call load_heatsink_design ! allocate temperature grid allocate ( temp3d (0: grid_size + 1, 0: grid_size / mpi_cpu_count + 1, 0: grid_size + 1)) call initial_state ! solve system call sor_heatsink ! output call finalise call MPI_Finalize(mpi_error_code) end program heatsink