[396] | 1 | C Agrif (Adaptive Grid Refinement In Fortran) |
---|
| 2 | C |
---|
| 3 | C Copyright (C) 2003 Laurent Debreu (Laurent.Debreu@imag.fr) |
---|
| 4 | C Christophe Vouland (Christophe.Vouland@imag.fr) |
---|
| 5 | C |
---|
| 6 | C This program is free software; you can redistribute it and/or modify |
---|
| 7 | C it under the terms of the GNU General Public License as published by |
---|
| 8 | C the Free Software Foundation; either version 2 of the License, or |
---|
| 9 | C (at your option) any later version. |
---|
| 10 | C |
---|
| 11 | C This program is distributed in the hope that it will be useful, |
---|
| 12 | C but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | C GNU General Public License for more details. |
---|
| 15 | C |
---|
| 16 | C You should have received a copy of the GNU General Public License |
---|
| 17 | C along with this program; if not, write to the Free Software |
---|
| 18 | C Foundation, Inc., 59 Temple Place-Suite 330, Boston, MA 02111-1307, USA. |
---|
| 19 | C |
---|
| 20 | C |
---|
| 21 | C |
---|
| 22 | CCC Module Agrif_types |
---|
| 23 | C |
---|
| 24 | Module Agrif_types |
---|
| 25 | C |
---|
| 26 | CCC Description: |
---|
| 27 | CCC Definition of data types used in Agrif, of several variables and |
---|
| 28 | C PARAMETERs. |
---|
| 29 | C |
---|
| 30 | IMPLICIT NONE |
---|
[662] | 31 | |
---|
| 32 | C Maximum refinement ratio |
---|
| 33 | |
---|
| 34 | INTEGER, PARAMETER :: Agrif_MaxRaff = 7 |
---|
[396] | 35 | C |
---|
| 36 | C ************************************************************************** |
---|
| 37 | CCC TYPE Agrif_LRECTANGLE |
---|
| 38 | C ************************************************************************** |
---|
| 39 | C |
---|
| 40 | CCC Description: |
---|
| 41 | CCC Data TYPE allowing a grid to reach a grid on the same level or its child |
---|
| 42 | CCC grids. |
---|
| 43 | C |
---|
| 44 | TYPE Agrif_lrectangle |
---|
| 45 | TYPE(Agrif_rectangle) , Pointer :: r ! to reach a child grid |
---|
| 46 | TYPE(Agrif_lrectangle), Pointer :: next ! to reach a grid on the |
---|
| 47 | ! same level |
---|
| 48 | End TYPE Agrif_lrectangle |
---|
| 49 | C |
---|
| 50 | C ************************************************************************** |
---|
| 51 | CCC TYPE Agrif_RECTANGLE: |
---|
| 52 | C ************************************************************************** |
---|
| 53 | C |
---|
| 54 | CCC Description: |
---|
| 55 | CCC Data TYPE to define several CHARACTERistics of a grid (number,position, |
---|
| 56 | CCC time and space refinement factors,...). |
---|
| 57 | C |
---|
| 58 | TYPE Agrif_rectangle |
---|
| 59 | INTEGER :: number ! Number of the grid |
---|
| 60 | ! Number of child grids |
---|
| 61 | INTEGER :: nbgridchild |
---|
| 62 | ! Minimal position in the x,y and z direction |
---|
| 63 | INTEGER, DIMENSION(3) :: imin |
---|
| 64 | ! Maximal position in the x,y and z direction |
---|
| 65 | INTEGER, DIMENSION(3) :: imax |
---|
| 66 | ! Space refinement factor in the x,y and z direction |
---|
| 67 | INTEGER, DIMENSION(3) :: spaceref |
---|
| 68 | ! Time refinement factor in the x,y and z direction |
---|
| 69 | INTEGER, DIMENSION(3) :: timeref |
---|
| 70 | ! Pointer to reach a grid on the same level or a child grid |
---|
| 71 | TYPE(Agrif_lrectangle), Pointer :: childgrids |
---|
| 72 | End TYPE Agrif_rectangle |
---|
| 73 | C |
---|
| 74 | C |
---|
| 75 | C |
---|
| 76 | C ************************************************************************** |
---|
| 77 | CCC TYPE Agrif_PGrid |
---|
| 78 | C ************************************************************************** |
---|
| 79 | C |
---|
| 80 | CCC Description: |
---|
| 81 | CCC Data TYPE to go over the grid hierarchy (used for the creation of this |
---|
| 82 | CCC grid hierarchy and during the time integration). |
---|
| 83 | C |
---|
| 84 | TYPE Agrif_pgrid |
---|
| 85 | ! allows to reach a child grid |
---|
| 86 | TYPE(Agrif_grid) , Pointer :: gr |
---|
| 87 | ! allows to reach the grids of the same level |
---|
| 88 | TYPE(Agrif_pgrid), Pointer :: next |
---|
| 89 | End TYPE Agrif_pgrid |
---|
| 90 | C |
---|
| 91 | C |
---|
| 92 | C |
---|
| 93 | C ************************************************************************** |
---|
| 94 | CCC TYPE Agrif_PVariable |
---|
| 95 | C ************************************************************************** |
---|
| 96 | C |
---|
| 97 | CCC Description: |
---|
| 98 | CCC Data TYPE to define a grid variable. |
---|
| 99 | C |
---|
| 100 | TYPE Agrif_PVariable |
---|
| 101 | ! This field allows to get the various CHARACTERistics |
---|
| 102 | ! of the variable (defined by the Agrif_Variable data TYPE) |
---|
| 103 | TYPE(Agrif_Variable) , Pointer :: var |
---|
| 104 | ! Pointer on the parent grid |
---|
| 105 | TYPE(Agrif_PVariable), Pointer :: parent_var |
---|
| 106 | End TYPE Agrif_PVariable |
---|
| 107 | C |
---|
| 108 | C ************************************************************************** |
---|
| 109 | CCC TYPE Agrif_Grid |
---|
| 110 | C ************************************************************************** |
---|
| 111 | C |
---|
| 112 | CCC Description: |
---|
| 113 | CCC Data TYPE to define a grid (position, space and time refinement factors). |
---|
| 114 | C |
---|
| 115 | TYPE Agrif_grid |
---|
| 116 | ! pointer on the parent grid |
---|
| 117 | TYPE(Agrif_grid) ,Pointer :: parent |
---|
| 118 | ! pointer on the child grids |
---|
| 119 | TYPE(Agrif_pgrid) ,Pointer :: child_grids |
---|
| 120 | ! List of the grid variables |
---|
| 121 | TYPE(Agrif_PVariable), DIMENSION(:) ,Pointer :: tabvars |
---|
| 122 | C |
---|
| 123 | ! Global x,y and z position |
---|
| 124 | REAL ,DIMENSION(3) :: Agrif_x |
---|
| 125 | ! Global space step in the x,y and z direction |
---|
| 126 | REAL ,DIMENSION(3) :: Agrif_d |
---|
| 127 | ! number of cells in the x,y and z direction |
---|
| 128 | INTEGER ,DIMENSION(3) :: nb |
---|
| 129 | ! minimal position in the x,y and z direction |
---|
| 130 | INTEGER ,DIMENSION(3) :: ix |
---|
| 131 | ! Space refinement factor in the x,y and z direction |
---|
| 132 | INTEGER ,DIMENSION(3) :: spaceref |
---|
| 133 | ! Time refinement factor in the x,y and z direction |
---|
| 134 | INTEGER ,DIMENSION(3) :: timeref |
---|
| 135 | INTEGER ,DIMENSION(:) ,Pointer :: restore1D |
---|
| 136 | INTEGER ,DIMENSION(:,:) ,Pointer :: restore2D |
---|
| 137 | INTEGER ,DIMENSION(:,:,:) ,Pointer :: restore3D |
---|
| 138 | INTEGER ,DIMENSION(:,:,:,:) ,Pointer :: restore4D |
---|
| 139 | INTEGER ,DIMENSION(:,:,:,:,:) ,Pointer :: restore5D |
---|
| 140 | INTEGER ,DIMENSION(:,:,:,:,:,:),Pointer :: restore6D |
---|
| 141 | ! number of time step |
---|
| 142 | INTEGER :: ngridstep |
---|
| 143 | INTEGER :: rank |
---|
| 144 | !moving grid id |
---|
| 145 | INTEGER :: grid_id |
---|
| 146 | ! number of the grid |
---|
| 147 | INTEGER :: fixedrank |
---|
| 148 | ! fixed or moving grid ? |
---|
| 149 | LOGICAL :: fixed |
---|
| 150 | LOGICAL :: oldgrid |
---|
| 151 | C LOGICALs indicating if the current grid has a common border |
---|
| 152 | C with the root coarse grid |
---|
| 153 | LOGICAL ,DIMENSION(3) :: NearRootBorder |
---|
| 154 | LOGICAL ,DIMENSION(3) :: DistantRootBorder |
---|
| 155 | C Arrays for adaptive grid refinement |
---|
| 156 | REAL ,DIMENSION(:) ,Pointer :: valtabpoint1D |
---|
| 157 | REAL ,DIMENSION(:,:) ,Pointer :: valtabpoint2D |
---|
| 158 | REAL ,DIMENSION(:,:,:) ,Pointer :: valtabpoint3D |
---|
| 159 | INTEGER ,DIMENSION(:) ,Pointer :: tabpoint1D |
---|
| 160 | INTEGER ,DIMENSION(:,:) ,Pointer :: tabpoint2D |
---|
| 161 | INTEGER ,DIMENSION(:,:,:) ,Pointer :: tabpoint3D |
---|
[662] | 162 | |
---|
| 163 | Type(Agrif_Flux), Pointer :: fluxes => NULL() |
---|
[396] | 164 | End TYPE Agrif_grid |
---|
| 165 | C |
---|
| 166 | C ************************************************************************** |
---|
| 167 | CCC TYPE Agrif_VARIABLE |
---|
| 168 | C ************************************************************************** |
---|
| 169 | C |
---|
| 170 | CCC Description: |
---|
| 171 | CCC Data TYPE to CHARACTERize a grid variable. |
---|
| 172 | C |
---|
| 173 | TYPE Agrif_Variable |
---|
| 174 | C |
---|
| 175 | ! Pointer on the variable of the root grid |
---|
| 176 | TYPE(Agrif_Variable), Pointer :: root_var |
---|
| 177 | C |
---|
| 178 | ! index of the first point in the REAL domain (x,y and z direction) |
---|
| 179 | INTEGER ,DIMENSION(6) :: point |
---|
| 180 | ! position of the variable on the cell (1 for the boarder of |
---|
| 181 | ! the edge, 2 for the center) |
---|
| 182 | INTEGER ,DIMENSION(:) ,Pointer :: posvar => NULL() |
---|
| 183 | ! Indication for the space interpolation (module Agrif_Boundary) |
---|
| 184 | INTEGER ,Pointer :: interpIndex => NULL() |
---|
| 185 | ! number of DIMENSIONs of the grid variable |
---|
| 186 | INTEGER :: nbdim = 0 |
---|
| 187 | ! Array indicating the TYPE of DIMENSION (space or not) for |
---|
| 188 | ! each of them |
---|
| 189 | CHARACTER(6),DIMENSION(:) ,Pointer :: interptab => NULL() |
---|
| 190 | C Arrays containing the values of the grid variables (REAL) |
---|
| 191 | REAL :: array0 |
---|
| 192 | REAL , DIMENSION(:) ,Pointer :: array1 => NULL() |
---|
| 193 | REAL , DIMENSION(:,:) ,Pointer :: array2 => NULL() |
---|
| 194 | REAL , DIMENSION(:,:,:) ,Pointer :: array3 => NULL() |
---|
| 195 | REAL , DIMENSION(:,:,:,:) ,Pointer :: array4 => NULL() |
---|
| 196 | REAL , DIMENSION(:,:,:,:,:) ,Pointer :: array5 => NULL() |
---|
| 197 | REAL , DIMENSION(:,:,:,:,:,:),Pointer :: array6 => NULL() |
---|
| 198 | C Arrays containing the values of the grid variables (REAL*8) |
---|
[662] | 199 | REAL*8 :: darray0 |
---|
| 200 | REAL*8, DIMENSION(:) ,Pointer :: darray1 => NULL() |
---|
| 201 | REAL*8, DIMENSION(:,:) ,Pointer :: darray2 => NULL() |
---|
| 202 | REAL*8, DIMENSION(:,:,:) ,Pointer :: darray3 => NULL() |
---|
| 203 | REAL*8, DIMENSION(:,:,:,:) ,Pointer :: darray4 => NULL() |
---|
| 204 | REAL*8, DIMENSION(:,:,:,:,:) ,Pointer :: darray5 => NULL() |
---|
| 205 | REAL*8, DIMENSION(:,:,:,:,:,:),Pointer :: darray6 => NULL() |
---|
[396] | 206 | C Arrays containing the values of the grid variables (LOGICAL) |
---|
| 207 | LOGICAL :: larray0 |
---|
| 208 | LOGICAL, DIMENSION(:) ,Pointer :: larray1 => NULL() |
---|
| 209 | LOGICAL, DIMENSION(:,:) ,Pointer :: larray2 => NULL() |
---|
| 210 | LOGICAL, DIMENSION(:,:,:) ,Pointer :: larray3 => NULL() |
---|
| 211 | LOGICAL, DIMENSION(:,:,:,:) ,Pointer :: larray4 => NULL() |
---|
| 212 | LOGICAL, DIMENSION(:,:,:,:,:) ,Pointer :: larray5 => NULL() |
---|
| 213 | LOGICAL, DIMENSION(:,:,:,:,:,:),Pointer :: larray6 => NULL() |
---|
| 214 | C Arrays containing the values of the grid variables (INTEGER) |
---|
| 215 | INTEGER :: iarray0 |
---|
| 216 | INTEGER, DIMENSION(:) ,Pointer :: iarray1 => NULL() |
---|
| 217 | INTEGER, DIMENSION(:,:) ,Pointer :: iarray2 => NULL() |
---|
| 218 | INTEGER, DIMENSION(:,:,:) ,Pointer :: iarray3 => NULL() |
---|
| 219 | INTEGER, DIMENSION(:,:,:,:) ,Pointer :: iarray4 => NULL() |
---|
| 220 | INTEGER, DIMENSION(:,:,:,:,:) ,Pointer :: iarray5 => NULL() |
---|
| 221 | INTEGER, DIMENSION(:,:,:,:,:,:),Pointer :: iarray6 => NULL() |
---|
| 222 | C |
---|
| 223 | INTEGER, DIMENSION(:) ,Pointer :: restore1D => NULL() |
---|
| 224 | INTEGER, DIMENSION(:,:) ,Pointer :: restore2D => NULL() |
---|
| 225 | INTEGER, DIMENSION(:,:,:) ,Pointer :: restore3D => NULL() |
---|
| 226 | INTEGER, DIMENSION(:,:,:,:) ,Pointer :: restore4D => NULL() |
---|
| 227 | INTEGER, DIMENSION(:,:,:,:,:) ,Pointer :: restore5D => NULL() |
---|
| 228 | INTEGER, DIMENSION(:,:,:,:,:,:),Pointer :: restore6D => NULL() |
---|
| 229 | C |
---|
| 230 | CHARACTER(2050) :: carray0 |
---|
| 231 | CHARACTER(200), DIMENSION(:) ,Pointer :: carray1 => NULL() |
---|
| 232 | CHARACTER(200), DIMENSION(:,:) ,Pointer :: carray2 => NULL() |
---|
| 233 | C |
---|
| 234 | ! Array used for the time interpolation |
---|
| 235 | REAL , DIMENSION(:,:) ,Pointer :: oldvalues2D => NULL() |
---|
| 236 | |
---|
| 237 | ! if the variable should be restore -> =1 |
---|
| 238 | LOGICAL :: restaure = .FALSE. |
---|
| 239 | ! the interpolation should be made in any case |
---|
| 240 | LOGICAL :: Interpolationshouldbemade = .FALSE. |
---|
| 241 | INTEGER :: bcinf ! option bc |
---|
| 242 | INTEGER :: bcsup ! option bc |
---|
| 243 | INTEGER :: updateinf ! option update |
---|
| 244 | INTEGER :: updatesup ! option update |
---|
[774] | 245 | INTEGER, DIMENSION(6,6) :: bcTYPEinterp ! option bcinterp |
---|
[396] | 246 | INTEGER, DIMENSION(6) :: TYPEinterp ! option interp |
---|
| 247 | INTEGER, DIMENSION(6) :: TYPEupdate ! option update |
---|
[662] | 248 | |
---|
| 249 | Type(Agrif_List_Interp_Loc), Pointer :: list_interp => NULL() |
---|
| 250 | Type(Agrif_List_Interp_Loc), Pointer :: list_update => NULL() |
---|
[396] | 251 | C |
---|
[662] | 252 | End TYPE Agrif_Variable |
---|
| 253 | |
---|
| 254 | Type Agrif_Interp_Loc |
---|
| 255 | integer,dimension(6) :: pttab,petab, |
---|
| 256 | & pttab_Child,pttab_Parent = -99 |
---|
| 257 | integer,dimension(6) :: indmin, indmax |
---|
| 258 | INTEGER,DIMENSION(6) :: pttruetab,cetruetab |
---|
| 259 | logical :: member, memberin |
---|
| 260 | #if !defined AGRIF_MPI |
---|
| 261 | integer,dimension(6) :: indminglob,indmaxglob |
---|
| 262 | #else |
---|
| 263 | integer,dimension(6) :: indminglob2,indmaxglob2 |
---|
| 264 | INTEGER,DIMENSION(6,2,2) :: parentarray |
---|
| 265 | INTEGER,DIMENSION(:,:,:), POINTER :: tab4t |
---|
| 266 | LOGICAL, DIMENSION(:), POINTER :: memberinall |
---|
| 267 | INTEGER,DIMENSION(:,:,:), POINTER :: tab5t |
---|
| 268 | LOGICAL, DIMENSION(:), POINTER :: memberinall2 |
---|
| 269 | #endif |
---|
| 270 | End Type Agrif_Interp_Loc |
---|
| 271 | |
---|
| 272 | Type Agrif_List_Interp_Loc |
---|
| 273 | Type(Agrif_Interp_Loc), Pointer :: interp_loc |
---|
| 274 | Type(Agrif_List_Interp_Loc), Pointer :: suiv |
---|
| 275 | End Type Agrif_List_Interp_Loc |
---|
| 276 | |
---|
| 277 | TYPE Agrif_Profile |
---|
| 278 | character*80 :: profilename |
---|
[396] | 279 | C |
---|
[662] | 280 | ! index of the first point in the REAL domain (x,y and z direction) |
---|
| 281 | INTEGER ,DIMENSION(6) :: point |
---|
| 282 | ! position of the variable on the cell (1 for the boarder of |
---|
| 283 | ! the edge, 2 for the center) |
---|
| 284 | INTEGER ,DIMENSION(:) ,Pointer :: posvar => NULL() |
---|
| 285 | ! Indication for the space interpolation (module Agrif_Boundary) |
---|
| 286 | INTEGER ,Pointer :: interpIndex => NULL() |
---|
| 287 | ! number of DIMENSIONs of the grid variable |
---|
| 288 | INTEGER :: nbdim = 0 |
---|
| 289 | ! Array indicating the TYPE of DIMENSION (space or not) for |
---|
| 290 | ! each of them |
---|
| 291 | CHARACTER(6),DIMENSION(:) ,Pointer :: interptab => NULL() |
---|
| 292 | Type(Agrif_Profile), Pointer :: nextprofile => NULL() |
---|
| 293 | END TYPE Agrif_Profile |
---|
| 294 | |
---|
| 295 | Type(Agrif_Profile), Pointer :: Agrif_MyProfiles => NULL() |
---|
| 296 | |
---|
| 297 | C Boundaries Fluxes |
---|
| 298 | |
---|
| 299 | Type Agrif_Flux |
---|
| 300 | Character*80 fluxname |
---|
| 301 | Type(Agrif_Variable), Pointer :: fluxtabx |
---|
| 302 | Type(Agrif_Variable), Pointer :: fluxtaby |
---|
| 303 | Type(Agrif_Variable), Pointer :: fluxtabz |
---|
| 304 | Type(Agrif_Profile), Pointer :: profile |
---|
| 305 | Logical :: Fluxallocated = .FALSE. |
---|
| 306 | Type(Agrif_Flux), Pointer :: nextflux => NULL() |
---|
| 307 | End Type Agrif_Flux |
---|
| 308 | C |
---|
[396] | 309 | C ************************************************************************** |
---|
| 310 | CCC Different PARAMETERs |
---|
| 311 | C ************************************************************************** |
---|
| 312 | TYPE(Agrif_PVariable), DIMENSION(:) ,Pointer :: Agrif_tabvars |
---|
| 313 | C |
---|
| 314 | ! this pointer always points on the root grid of the grid hierarchy |
---|
| 315 | TYPE(Agrif_grid) ,Pointer :: Agrif_Mygrid |
---|
| 316 | ! Pointer used in the Agrif_regrid subroutine (Agrif_Util module). |
---|
| 317 | ! It contains the safeguard of the grid hierarchy. |
---|
| 318 | TYPE(Agrif_pgrid) ,Pointer :: Agrif_oldmygrid |
---|
| 319 | ! pointer to the current grid (the link is done by using the |
---|
| 320 | ! Agrif_Instance procedure (module Agrif_Init)) |
---|
| 321 | TYPE(Agrif_grid) ,Pointer :: Agrif_Curgrid |
---|
| 322 | ! Pointer used in the Agrif_ChildGrid_to_ParentGrid and |
---|
| 323 | ! Agrif_ParentGrid_to_ChildGrid subroutines |
---|
| 324 | ! (Agrif_CurgridFunctions module). It contains the |
---|
| 325 | ! safeguard of the current grid hierarchy. |
---|
| 326 | TYPE(Agrif_grid) ,Pointer :: Agrif_saveCURGRID |
---|
| 327 | C |
---|
| 328 | ! Problem DIMENSION |
---|
| 329 | INTEGER :: Agrif_Probdim |
---|
| 330 | ! number of variables |
---|
| 331 | INTEGER :: Agrif_NbVariables |
---|
| 332 | ! number of fixed grids in the grid hierarchy |
---|
| 333 | INTEGER :: Agrif_nbfixedgrids |
---|
| 334 | ! space refinement factor |
---|
| 335 | INTEGER ,DIMENSION(3) :: Agrif_coeffref |
---|
| 336 | ! time refinement factor |
---|
| 337 | INTEGER ,DIMENSION(3) :: Agrif_coeffreft |
---|
| 338 | ! LOGICAL to use special values on the parent grid |
---|
| 339 | LOGICAL :: Agrif_UseSpecialValue |
---|
| 340 | ! LOGICAL to use special values on the parent grid |
---|
| 341 | LOGICAL :: Agrif_UseSpecialValueInUpdate |
---|
| 342 | ! LOGICAL to use special values on the current grid |
---|
| 343 | LOGICAL :: Agrif_UseSpecialValueFineGrid |
---|
| 344 | ! Special values on the parent grid |
---|
| 345 | REAL :: Agrif_SpecialValue |
---|
| 346 | ! Special values on the current grid |
---|
| 347 | REAL :: Agrif_SpecialValueFineGrid |
---|
| 348 | C clustering PARAMETERs |
---|
| 349 | INTEGER :: Agrif_Regridding |
---|
| 350 | INTEGER :: Agrif_Minwidth |
---|
[662] | 351 | REAL :: Agrif_Efficiency = 0.7 |
---|
[396] | 352 | REAL ,DIMENSION(3) :: Agrif_mind |
---|
| 353 | C PARAMETERs for the interpolation of the child grids |
---|
| 354 | ! linear interpolation |
---|
| 355 | INTEGER ,PARAMETER :: Agrif_linear=1 |
---|
| 356 | ! lagrange interpolation |
---|
| 357 | INTEGER ,PARAMETER :: Agrif_lagrange=2 |
---|
| 358 | ! spline interpolation |
---|
| 359 | INTEGER ,PARAMETER :: Agrif_eno=3 |
---|
| 360 | ! user s interpolation |
---|
| 361 | INTEGER ,PARAMETER :: Agrif_user_interp=4 |
---|
| 362 | ! constant interpolation |
---|
| 363 | INTEGER ,PARAMETER :: Agrif_constant=5 |
---|
| 364 | ! linear conservative interpolation |
---|
| 365 | INTEGER ,PARAMETER :: Agrif_linearconserv=6 |
---|
| 366 | ! linear conservative interpolation |
---|
| 367 | INTEGER ,PARAMETER :: Agrif_linearconservlim=7 |
---|
[662] | 368 | INTEGER ,PARAMETER :: Agrif_ppm=8 |
---|
| 369 | INTEGER ,PARAMETER :: Agrif_weno=9 |
---|
[396] | 370 | C PARAMETERs for the update of the parent grids |
---|
| 371 | INTEGER ,PARAMETER :: Agrif_Update_Copy=1 ! copy |
---|
| 372 | INTEGER ,PARAMETER :: Agrif_Update_Average=2 ! average |
---|
| 373 | INTEGER ,PARAMETER :: Agrif_Update_Full_Weighting=3 ! full-weighting |
---|
| 374 | C Raffinement grid switch definition |
---|
| 375 | ! Agrif_USE_ONLY_FIXED_GRIDS =1 if fixed grid mode |
---|
| 376 | INTEGER :: Agrif_USE_ONLY_FIXED_GRIDS |
---|
| 377 | ! Agrif_USE_FIXED_GRIDS = 1 if AMR mode + fixed grid |
---|
| 378 | ! else only AMR mode |
---|
| 379 | INTEGER :: Agrif_USE_FIXED_GRIDS |
---|
| 380 | C |
---|
| 381 | #ifdef AGRIF_MPI |
---|
| 382 | INTEGER :: Agrif_Nbprocs ! Number of processors |
---|
| 383 | INTEGER :: Agrif_ProcRank ! Rank of the current processor |
---|
| 384 | INTEGER :: Agrif_Group ! Group associated to MPI_COMM_WORLD |
---|
| 385 | INTEGER :: Agrif_MPIPREC |
---|
| 386 | #endif |
---|
| 387 | C |
---|
| 388 | contains |
---|
| 389 | C |
---|
| 390 | Integer Function agrif_ceiling(x) |
---|
| 391 | C |
---|
| 392 | Real :: x |
---|
| 393 | Integer ::i |
---|
| 394 | C |
---|
| 395 | i = floor(x) |
---|
| 396 | C |
---|
| 397 | if( abs(x - i).le.0.0001 )then |
---|
| 398 | agrif_ceiling = i |
---|
| 399 | else |
---|
| 400 | agrif_ceiling = i+1 |
---|
| 401 | endif |
---|
| 402 | C |
---|
| 403 | End Function |
---|
| 404 | C |
---|
| 405 | Integer Function agrif_int(x) |
---|
| 406 | C |
---|
| 407 | Real :: x |
---|
| 408 | Integer ::i |
---|
| 409 | C |
---|
| 410 | i = floor(x) + 1 |
---|
| 411 | C |
---|
| 412 | if( abs(x - i).le.0.0001 )then |
---|
| 413 | agrif_int = i |
---|
| 414 | else |
---|
| 415 | agrif_int = i-1 |
---|
| 416 | endif |
---|
| 417 | C |
---|
| 418 | End Function |
---|
| 419 | End Module Agrif_TYPEs |
---|