File: sb_mem_fin.F

package info (click to toggle)
aces3 3.0.6-7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 82,460 kB
  • sloc: fortran: 225,647; ansic: 20,413; cpp: 4,349; makefile: 953; sh: 137
file content (59 lines) | stat: -rw-r--r-- 1,637 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

c This routine summarizes the memory usage.

      subroutine sb_mem_fin
      implicit none

#include "aces.h"
#include "machsp.com"
#include "sbcore.com"
#include "sb_mem.com"

      call callstack_push('SB_MEM_FIN')

      if (memknown.ne.1) then
         if (dynmem.eq.1) then
#ifdef _DEBUG_LVL0
            write(*,9000) ineeded
            write(*,9010) dneeded*iintfp
            write(*,9020) ineeded+dneeded*iintfp
            write(*,9030) maxmem
         else
            write(*,9000) ineeded
            write(*,9010) dneeded
            write(*,9040) i1-1
            write(*,9050) d1-1
#endif
         end if
      end if
#ifdef _DEBUG_LVL0
 9000 format(t3,'@SB_MEM, You need ',i9,' words of icore memory.')
 9010 format(t3,'       , You need ',i9,' words of dcore memory.')
 9020 format(t3,'       , You need ',i9,' total words of memory.')
 9030 format(t3,'       , You have ',i9,' words of memory.')
 9040 format(t3,'       , You have ',i9,' words of icore memory.')
 9050 format(t3,'       , You have ',i9,' words of dcore memory.')
#endif

      if (memknown.ne.0) then
c        Free memory if dynmem
      else
         if (dynmem.eq.1) then
            if (ineeded+dneeded*iintfp .gt. maxmem) then
               write(*,*) '@SB_MEM_FIN: exceeded available memory'
               call errex
               stop
            end if
         else
            if (ineeded.gt.i1-1 .or. dneeded.gt.d1-1) then
               write(*,*) '@SB_MEM_FIN: exceeded available memory'
               call errex
               stop
            end if
         end if
      end if

      call callstack_pop
      return
      end