My Project
Functions/Subroutines
setup_domain.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine setup_domain
 

Function/Subroutine Documentation

◆ setup_domain()

subroutine setup_domain ( )

Definition at line 42 of file setup_domain.f90.

42 !==============================================================
43 ! IF(PAR):
44 ! Uses METIS to determine local domains
45 ! Create global to local and local to global maps
46 !==============================================================
47  USE mod_par
48  USE all_vars
49  USE mod_ncdio
50  USE mod_setup
51 
52  !==============================================================================|
53  ! GENERATE LOCAL NODE CONNECTIVITY (NV) FROM GLOBAL NODE CONNECTIVITY (NVG) |
54  ! USING LOCAL TO GLOBAL MAPPING FOR INTERIOR ELEMENTS (EGID) |
55  ! AND LOCAL TO GLOBAL MAPPING FOR HALO ELEMENTS (HE_LST) |
56  ! TRANSFER GLOBAL COORDINATES TO LOCAL DOMAINS
57  !==============================================================================|
58 
59  IMPLICIT NONE
60  INTEGER :: SENDER,STATUS
61  INTEGER :: nvals, IERR, I, EGL
62 
63 
64  if (dbg_set(dbg_log)) &
65  & write(ipt,*) "! SETTING UP FVCOM PROCESSOR ENVIRONMENT"
66 
67  ! SETUP OUTPUT MODE OR TURN IT OFF
69 
70  IF(serial) THEN
71 
72  ! DO NOT ALLOCATE EL_PID FOR NON-MULTIPROCESSOR CASES
73 
74  ! SHIFT GRID DIMENSIONS TO LOCAL FOR ANY SERIAL CASE
75  mt=mgl
76  nt=ngl
77 
78  m = mgl
79  n = ngl
80 
81  ! TRANSFER CONNECTIVTY TO LOCAL DOMAIN NAME VARIABLES
82  ALLOCATE(nv(0:nt,4))
83  nv = nvg
84  nv(0,:) = 0
85  !DEALLOCATE(NVG)
86 
87 
88  ! MUST ALLOCATE EL_PID FOR OUTPUT OF DATA
89  ALLOCATE(el_pid(ngl)) ; el_pid = 1
90 
91 
92  ! SETUP NGID
93  ALLOCATE(ngid(0:mgl)) ;
94  DO i=0,mgl
95  ngid(i)=i
96  END DO
97 
98  ngid_x => ngid
99 
100  ! SETUP NLID
101  ALLOCATE(nlid(0:mgl))
102  DO i=0,mgl
103  nlid(i) = i
104  END DO
105 
106  nlid_x => nlid
107 
108  ! SETUP EGID
109  ALLOCATE(egid(0:ngl)) ;
110  DO i=0,ngl
111  egid(i)=i
112  END DO
113 
114  egid_x => egid
115 
116  ! SETUP ELID
117  ALLOCATE(elid(0:ngl))
118  DO i=0,ngl
119  elid(i) = i
120  END DO
121 
122  elid_x => elid
123 
124  ALLOCATE(nde_id(mgl)); nde_id=0
125 
126  ELSE ! IF PAR
127 
128  END IF
129 
130 
131  ! PASS OBC TO LOCAL VARIABLES AND GENERATE MAP FROM GLOBAL
132 
134 
135  IF(obc_on) CALL genmap_obc
136 
137 
138  IF (use_mpi_io_mode) then
139  CALL fatal_error("'USE_MPI_IO_MODE' SHOULD NEVER BE TRUE WHEN C&
140  &OMPILED WITHOUT MULTIPROCESSOR")
141  END IF
142 
143  if(dbg_set(dbg_log)) write(ipt,*) "! Finished SETUP_LOCAL_DOMAINS"
144 
145 
logical serial
Definition: mod_main.f90:100
subroutine genmap_lsf
Definition: genmap_lsf.f90:42
integer mt
Definition: mod_main.f90:78
integer, dimension(:), pointer elid
Definition: mod_par.f90:53
logical function dbg_set(vrb)
Definition: mod_utils.f90:182
logical obc_on
Definition: mod_main.f90:585
integer, dimension(:), pointer ngid_x
Definition: mod_par.f90:63
logical use_mpi_io_mode
Definition: mod_main.f90:188
integer, dimension(:), pointer elid_x
Definition: mod_par.f90:55
integer, dimension(:), pointer nlid_x
Definition: mod_par.f90:56
integer, dimension(:), pointer nde_id
Definition: mod_par.f90:81
integer m
Definition: mod_main.f90:56
integer, dimension(:), pointer nlid
Definition: mod_par.f90:54
integer n
Definition: mod_main.f90:55
integer mpi_fvcom_group
Definition: mod_main.f90:107
logical obc_longshore_flow_on
Definition: mod_main.f90:598
integer, dimension(:,:), allocatable nvg
Definition: mod_main.f90:969
integer, dimension(:,:), allocatable, target nv
Definition: mod_main.f90:1018
subroutine setup_mpi_io_mode(TF, COMMGRP)
Definition: mod_ncdio.f90:4207
integer mgl
Definition: mod_main.f90:50
subroutine fatal_error(ER1, ER2, ER3, ER4)
Definition: mod_utils.f90:230
integer, dimension(:), pointer ngid
Definition: mod_par.f90:61
integer ipt
Definition: mod_main.f90:922
subroutine genmap_obc
Definition: genmap_obc.f90:42
integer, dimension(:), pointer el_pid
Definition: mod_par.f90:51
integer nt
Definition: mod_main.f90:77
integer, dimension(:), pointer egid
Definition: mod_par.f90:60
integer ngl
Definition: mod_main.f90:49
integer, parameter dbg_log
Definition: mod_utils.f90:65
integer, dimension(:), pointer egid_x
Definition: mod_par.f90:62
Here is the call graph for this function:
Here is the caller graph for this function: