File: modules_58_module.f90

package info (click to toggle)
lfortran 0.58.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 54,512 kB
  • sloc: cpp: 162,179; f90: 68,251; python: 17,476; ansic: 6,278; yacc: 2,334; sh: 1,317; fortran: 892; makefile: 33; javascript: 15
file content (38 lines) | stat: -rw-r--r-- 951 bytes parent folder | download | duplicates (2)
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
MODULE module_58_module01
    IMPLICIT NONE
  
    INTEGER, PUBLIC :: nx1 = 1000
    INTEGER, PUBLIC :: nx2 = 1000
    REAL, ALLOCATABLE, DIMENSION(:), PUBLIC :: arr
  
  END MODULE
  
  MODULE module_58_module02
  
    USE module_58_module01
  
    IMPLICIT NONE
    REAL, ALLOCATABLE, DIMENSION(:), PUBLIC :: ref_flux
  
    REAL, ALLOCATABLE, DIMENSION(:), PUBLIC :: ref_fluxm
  
    CONTAINS
  
    SUBROUTINE mms_deallocate
    END SUBROUTINE mms_deallocate
  
    SUBROUTINE mms_allocate ( )
        nx1 = 555
      ALLOCATE( ref_flux(nx1), ref_fluxm(nx2) )
      print *,"Size of nx1",nx1
      if(size(ref_flux) /= 555) error stop
      print *,"Size of nx2",nx2
      if(size(ref_fluxm) /= 1000) error stop
    END SUBROUTINE mms_allocate

    SUBROUTINE test_alocate_external
      allocate(arr(nx1))
      print *, size(arr)
      if(size(ref_flux) /= 555) error stop
    end SUBROUTINE test_alocate_external
  END MODULE module_58_module02