123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765 |
- !
- ! $Id: modcurgridfunctions.F90 4779 2014-09-19 14:21:37Z rblod $
- !
- ! AGRIF (Adaptive Grid Refinement In Fortran)
- !
- ! Copyright (C) 2003 Laurent Debreu (Laurent.Debreu@imag.fr)
- ! Christophe Vouland (Christophe.Vouland@imag.fr)
- !
- ! This program is free software; you can redistribute it and/or modify
- ! it under the terms of the GNU General Public License as published by
- ! the Free Software Foundation; either version 2 of the License, or
- ! (at your option) any later version.
- !
- ! This program is distributed in the hope that it will be useful,
- ! but WITHOUT ANY WARRANTY; without even the implied warranty of
- ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ! GNU General Public License for more details.
- !
- ! You should have received a copy of the GNU General Public License
- ! along with this program; if not, write to the Free Software
- ! Foundation, Inc., 59 Temple Place- Suite 330, Boston, MA 02111-1307, USA.
- !
- !> Module to define some procedures concerning the current grid
- !
- module Agrif_CurgridFunctions
- !
- use Agrif_Init
- !
- implicit none
- !
- contains
- !
- !===================================================================================================
- ! function Agrif_rel_dt
- !
- !> Returns the time step of the current grid, relatively to the root grid (for which dt=1.).
- !---------------------------------------------------------------------------------------------------
- function Agrif_rel_dt ( ) result( rel_dt )
- !---------------------------------------------------------------------------------------------------
- integer :: i
- real :: rel_dt
- !
- rel_dt = 1.
- !
- do i = 1,Agrif_Probdim
- rel_dt = min(rel_dt, Agrif_Curgrid % Agrif_dt(i))
- enddo
- !---------------------------------------------------------------------------------------------------
- end function Agrif_rel_dt
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_rel_idt
- !
- !> Returns the time refinement factor of the current grid, relatively to the root grid (for which idt=1).
- !---------------------------------------------------------------------------------------------------
- function Agrif_rel_idt ( ) result( rel_idt )
- !---------------------------------------------------------------------------------------------------
- integer :: rel_idt
- !
- rel_idt = nint(1./Agrif_rel_dt())
- !---------------------------------------------------------------------------------------------------
- end function Agrif_rel_idt
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_IRhot
- !
- !> Returns the time refinement factor of the current grid.
- !---------------------------------------------------------------------------------------------------
- function Agrif_IRhot ( ) result( irhot )
- !---------------------------------------------------------------------------------------------------
- integer :: i, irhot
- !
- irhot = 1
- !
- do i = 1,Agrif_Probdim
- irhot = max(irhot, Agrif_Curgrid % timeref(i))
- enddo
- !---------------------------------------------------------------------------------------------------
- end function Agrif_IRhot
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Rhot
- !
- !> Returns the time refinement factor of the current grid.
- !---------------------------------------------------------------------------------------------------
- function Agrif_Rhot ( ) result( rhot )
- !---------------------------------------------------------------------------------------------------
- real :: rhot
- !
- rhot = float(Agrif_IRhot())
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Rhot
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Parent_IRhot
- !
- !> Returns the time refinement factor of the parent of the current grid.
- !---------------------------------------------------------------------------------------------------
- function Agrif_Parent_IRhot ( ) result( irhot )
- !---------------------------------------------------------------------------------------------------
- integer :: i, irhot
- !
- irhot = 1
- !
- do i = 1,Agrif_Probdim
- irhot = max(irhot, Agrif_Curgrid % parent % timeref(i))
- enddo
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Parent_IRhot
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Parent_Rhot
- !
- !> Returns the time refinement factor of the parent of the current grid.
- !---------------------------------------------------------------------------------------------------
- function Agrif_Parent_Rhot ( ) result( rhot )
- !---------------------------------------------------------------------------------------------------
- real :: rhot
- !
- rhot = float(Agrif_Parent_IRhot())
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Parent_Rhot
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Nbstepint
- !
- !> function for the calculation of the coefficients used for the time interpolation
- !! (module #Agrif_Boundary).
- !---------------------------------------------------------------------------------------------------
- function Agrif_Nbstepint ( )
- !---------------------------------------------------------------------------------------------------
- integer :: Agrif_nbstepint ! result
- !
- Agrif_nbstepint = mod(Agrif_Curgrid % ngridstep, Agrif_iRhot())
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Nbstepint
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Parent_Nbstepint
- !
- !> function for the calculation of the coefficients used for the time interpolation
- !! (module #Agrif_Boundary).
- !---------------------------------------------------------------------------------------------------
- function Agrif_Parent_Nbstepint ( )
- !---------------------------------------------------------------------------------------------------
- integer :: Agrif_Parent_Nbstepint ! result
- !
- Agrif_Parent_Nbstepint = mod(Agrif_Curgrid % parent % ngridstep, int(Agrif_Parent_Rhot()))
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Parent_Nbstepint
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_InterpNearBorderX
- !
- !> Allows to interpolate (in the x direction) on a near border of the current grid if this one
- !! has a common border with the root coarse grid.
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_InterpNearBorderX ( )
- !---------------------------------------------------------------------------------------------------
- Agrif_Curgrid % NearRootBorder(1) = .FALSE.
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_InterpNearBorderX
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_InterpDistantBorderX
- !
- !> Allows to interpolate (in the x direction) on a distant border of the current grid if this one
- !! has a common border with the root coarse grid.
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_InterpDistantBorderX ( )
- !---------------------------------------------------------------------------------------------------
- Agrif_Curgrid % DistantRootBorder(1) = .FALSE.
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_InterpDistantBorderX
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_InterpNearBorderY
- !
- !> Allows to interpolate (in the y direction) on a near border of the current grid if this one
- !! has a common border with the root coarse grid.
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_InterpNearBorderY ( )
- !---------------------------------------------------------------------------------------------------
- Agrif_Curgrid % NearRootBorder(2) = .FALSE.
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_InterpNearBorderY
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_InterpDistantBorderY
- !
- !> Allows to interpolate (in the y direction) on a distant border of the current grid if this one
- !! has a common border with the root coarse grid.
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_InterpDistantBorderY ( )
- !---------------------------------------------------------------------------------------------------
- Agrif_Curgrid % DistantRootBorder(2) = .FALSE.
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_InterpDistantBorderY
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_InterpNearBorderZ
- !
- !> Allows to interpolate (in the z direction) on a near border of the current grid if this one
- !! has a common border with the root coarse grid.
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_InterpNearBorderZ ( )
- !---------------------------------------------------------------------------------------------------
- Agrif_Curgrid % NearRootBorder(3) = .FALSE.
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_InterpNearBorderZ
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_InterpDistantBorderZ
- !
- !> Allows to interpolate (in the z direction) on a distant border of the current grid if this one
- !! has a common border with the root coarse grid.
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_InterpDistantBorderZ()
- !---------------------------------------------------------------------------------------------------
- Agrif_Curgrid % DistantRootBorder(3) = .FALSE.
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_InterpDistantBorderZ
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Parent_Nb_Step
- !
- !> Returns the number of time steps of the parent of the current grid.
- !---------------------------------------------------------------------------------------------------
- function Agrif_Parent_Nb_Step ( )
- !---------------------------------------------------------------------------------------------------
- integer :: Agrif_Parent_Nb_Step ! Result
- !
- if (Agrif_Root()) then
- Agrif_Parent_Nb_Step = -1
- else
- Agrif_Parent_Nb_Step = Agrif_Curgrid % parent % ngridstep
- endif
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Parent_Nb_Step
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Root
- !
- !> Indicates if the current grid is or not the root grid.
- !---------------------------------------------------------------------------------------------------
- function Agrif_Root ( )
- !---------------------------------------------------------------------------------------------------
- logical :: Agrif_Root ! Result
- !
- Agrif_Root = (Agrif_Curgrid % fixedrank == 0)
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Root
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_GrandMother
- !
- !> Indicates if the current grid is or not the root grid.
- !---------------------------------------------------------------------------------------------------
- function Agrif_GrandMother ( )
- !---------------------------------------------------------------------------------------------------
- logical :: Agrif_GrandMother ! Result
- !
- Agrif_GrandMother = Agrif_Curgrid % grand_mother_grid
- !---------------------------------------------------------------------------------------------------
- end function Agrif_GrandMother
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Parent_Root
- !
- !> Indicates if the parent of the current grid is or not the root grid.
- !---------------------------------------------------------------------------------------------------
- function Agrif_Parent_Root ( )
- !---------------------------------------------------------------------------------------------------
- logical :: Agrif_Parent_Root ! Result
- !
- Agrif_Parent_Root = (Agrif_Curgrid % parent % fixedrank == 0)
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Parent_Root
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Fixed
- !
- !> Returns the number of the current grid.
- !---------------------------------------------------------------------------------------------------
- function Agrif_Fixed ( )
- !---------------------------------------------------------------------------------------------------
- integer :: Agrif_Fixed ! Result
- !
- if (Agrif_Curgrid % fixed) then
- Agrif_Fixed = Agrif_Curgrid % fixedrank
- else
- Agrif_Fixed = -1
- endif
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Fixed
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Parent_Fixed
- !
- !> Returns the number of the parent of the current grid.
- !---------------------------------------------------------------------------------------------------
- function Agrif_Parent_Fixed ( )
- !---------------------------------------------------------------------------------------------------
- integer :: Agrif_Parent_Fixed ! Result
- !
- if (Agrif_Curgrid % parent % fixed) then
- Agrif_Parent_Fixed = Agrif_Curgrid % parent % fixedrank
- else
- Agrif_Parent_Fixed = 0
- endif
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Parent_Fixed
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Is_Fixed
- !
- !> Returns .TRUE. if the current grid is fixed.
- !---------------------------------------------------------------------------------------------------
- function Agrif_Is_Fixed ( )
- !---------------------------------------------------------------------------------------------------
- logical :: Agrif_Is_Fixed ! Result
- !
- Agrif_Is_Fixed = Agrif_Curgrid % fixed
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Is_Fixed
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Parent_Is_Fixed
- !
- !> Returns .TRUE. if the parent of the current grid is fixed.
- !---------------------------------------------------------------------------------------------------
- function Agrif_Parent_Is_Fixed ( )
- !---------------------------------------------------------------------------------------------------
- logical :: Agrif_Parent_Is_Fixed ! Result
- !
- Agrif_Parent_Is_Fixed = Agrif_Curgrid % parent % fixed
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Parent_Is_Fixed
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_CFixed
- !
- !> Returns the number of the current grid.
- !---------------------------------------------------------------------------------------------------
- function Agrif_CFixed ( )
- !---------------------------------------------------------------------------------------------------
- character(3) :: Agrif_CFixed ! Result
- !
- character(3) :: cfixed
- integer :: fixed
- !
- fixed = Agrif_Fixed()
- !
- if (fixed /= -1) then
- !
- if (fixed <= 9) then
- write(cfixed,'(i1)') fixed
- else
- write(cfixed,'(i2)') fixed
- endif
- !
- Agrif_CFixed = cfixed
-
- if (associated(agrif_curgrid,agrif_coarsegrid)) then
- Agrif_CFixed = 'gm'
- endif
- !
- else
- print*,'Call to Agrif_CFixed() on a moving grid'
- stop
- endif
- !---------------------------------------------------------------------------------------------------
- end function Agrif_CFixed
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrid_Parent_CFixed
- !
- !> Returns the number of the parent of the current grid.
- !---------------------------------------------------------------------------------------------------
- function Agrid_Parent_CFixed ( )
- !---------------------------------------------------------------------------------------------------
- character(3) :: Agrid_Parent_CFixed ! Result
- !
- character(3) :: cfixed
- integer :: fixed
- !
- fixed = Agrif_Parent_Fixed()
- !
- if(fixed /= -1) then
- !
- if (fixed <= 9) then
- write(cfixed,'(i1)')fixed
- else
- write(cfixed,'(i2)')fixed
- endif
- !
- Agrid_Parent_CFixed=cfixed
- !
- else
- print*,'Illegal call to Agrid_Parent_CFixed()'
- stop
- endif
- !---------------------------------------------------------------------------------------------------
- end function Agrid_Parent_CFixed
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_ChildGrid_to_ParentGrid
- !
- !> Make the pointer #Agrif_Curgrid point on the parent grid of the current grid.
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_ChildGrid_to_ParentGrid ( )
- !---------------------------------------------------------------------------------------------------
- Agrif_Curgrid % parent % save_grid => Agrif_Curgrid
- call Agrif_Instance(Agrif_Curgrid%parent)
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_ChildGrid_to_ParentGrid
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_ParentGrid_to_ChildGrid
- !
- !> Make the pointer #Agrif_Curgrid point on the child grid after having called the
- !! #Agrif_ChildGrid_to_ParentGrid subroutine.
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_ParentGrid_to_ChildGrid ( )
- !---------------------------------------------------------------------------------------------------
- call Agrif_Instance(Agrif_Curgrid%save_grid)
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_ParentGrid_to_ChildGrid
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Get_Unit
- !
- !> Returns a unit not connected to any file.
- !---------------------------------------------------------------------------------------------------
- function Agrif_Get_Unit ( )
- !---------------------------------------------------------------------------------------------------
- integer :: Agrif_Get_Unit ! Result
- !
- integer :: n
- logical :: op
- !
- integer :: nunit
- integer :: iii, out, iiimax
- logical :: bexist
- integer,dimension(1:1000) :: forbiddenunit
- !
- ! Load forbidden Unit if the file Agrif_forbidenUnit exist
- !
- INQUIRE(file='Agrif_forbiddenUnit.txt', exist=bexist)
- !
- if (.not. bexist) then
- ! File Agrif_forbiddenUnit.txt not found
- else
- nunit = 777
- OPEN(nunit,file='Agrif_forbiddenUnit.txt', form='formatted', status="old")
- iii = 1
- do while ( .TRUE. )
- READ(nunit,*, end=99) forbiddenunit(iii)
- iii = iii + 1
- enddo
- 99 continue
- iiimax = iii
- close(nunit)
- endif
- !
- do n = 7,1000
- !
- INQUIRE(Unit=n,Opened=op)
- !
- out = 0
- if ( bexist .AND. (.NOT.op) ) then
- do iii = 1,iiimax
- if ( n == forbiddenunit(iii) ) out = 1
- enddo
- endif
- !
- if ( (.NOT.op) .AND. (out == 0) ) exit
- !
- enddo
- !
- Agrif_Get_Unit = n
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Get_Unit
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_Set_Extra_Boundary_Cells
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_Set_Extra_Boundary_Cells ( nb_extra_cells )
- !---------------------------------------------------------------------------------------------------
- integer, intent(in) :: nb_extra_cells
- !
- Agrif_Extra_Boundary_Cells = nb_extra_cells
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_Set_Extra_Boundary_Cells
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_Set_Efficiency
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_Set_Efficiency ( eff )
- !---------------------------------------------------------------------------------------------------
- real, intent(in) :: eff
- !
- if ( (eff < 0.) .OR. (eff > 1) ) then
- write(*,*) 'Error Efficiency should be between 0 and 1'
- stop
- else
- Agrif_Efficiency = eff
- endif
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_Set_Efficiency
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_Set_Regridding
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_Set_Regridding ( regfreq )
- !---------------------------------------------------------------------------------------------------
- integer, intent(in) :: regfreq
- !
- if (regfreq < 0) then
- write(*,*) 'Regridding frequency should be positive'
- stop
- else
- Agrif_Regridding = regfreq
- endif
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_Set_Regridding
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_Set_coeffref_x
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_Set_coeffref_x ( coeffref )
- !---------------------------------------------------------------------------------------------------
- integer, intent(in) :: coeffref
- if (coeffref < 0) then
- write(*,*) 'Coefficient of raffinement should be positive'
- stop
- else
- Agrif_coeffref(1) = coeffref
- endif
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_Set_coeffref_x
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_Set_coeffref_y
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_Set_coeffref_y ( coeffref )
- !---------------------------------------------------------------------------------------------------
- integer, intent(in) :: coeffref
- if (coeffref < 0) then
- write(*,*) 'Coefficient of raffinement should be positive'
- stop
- else
- Agrif_coeffref(2) = coeffref
- endif
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_Set_coeffref_y
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_Set_coeffref_z
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_Set_coeffref_z ( coeffref )
- !---------------------------------------------------------------------------------------------------
- integer, intent(in) :: coeffref
- !
- if (coeffref < 0) then
- write(*,*) 'Coefficient of raffinement should be positive'
- stop
- else
- Agrif_coeffref(3) = coeffref
- endif
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_Set_coeffref_z
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_Set_coeffreft_x
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_Set_coeffreft_x ( coeffref )
- !---------------------------------------------------------------------------------------------------
- integer, intent(in) :: coeffref
- if (coeffref < 0) then
- write(*,*) 'Coefficient of time raffinement should be positive'
- stop
- else
- Agrif_coeffreft(1) = coeffref
- endif
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_Set_coeffreft_x
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_Set_coeffreft_y
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_Set_coeffreft_y ( coeffref )
- !---------------------------------------------------------------------------------------------------
- integer, intent(in) :: coeffref
- !
- if (coeffref < 0) then
- write(*,*) 'Coefficient of time raffinement should be positive'
- stop
- else
- Agrif_coeffreft(2) = coeffref
- endif
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_Set_coeffreft_y
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_Set_coeffreft_z
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_Set_coeffreft_z ( coeffref )
- !---------------------------------------------------------------------------------------------------
- integer, intent(in) :: coeffref
- if (coeffref < 0) then
- write(*,*)'Coefficient of time raffinement should be positive'
- stop
- else
- Agrif_coeffreft(3) = coeffref
- endif
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_Set_coeffreft_z
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_Set_Minwidth
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_Set_Minwidth ( coefminwidth )
- !---------------------------------------------------------------------------------------------------
- integer, intent(in) :: coefminwidth
- !
- if (coefminwidth < 0) then
- write(*,*)'Coefficient of Minwidth should be positive'
- stop
- else
- Agrif_Minwidth = coefminwidth
- endif
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_Set_Minwidth
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_Set_Rafmax
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_Set_Rafmax ( coefrafmax )
- !---------------------------------------------------------------------------------------------------
- integer, intent(in) :: coefrafmax
- !
- integer :: i
- real :: res
- !
- if (coefrafmax < 0) then
- write(*,*)'Coefficient of should be positive'
- stop
- else
- res = 1.
- do i = 1,coefrafmax-1
- res = res * FLOAT(Agrif_coeffref(1))
- enddo
- if ( res == 0 ) res = 1
- Agrif_Mind(1) = 1. / res
- !
- res = 1.
- do i = 1,coefrafmax-1
- res = res * FLOAT(Agrif_coeffref(2))
- enddo
- if ( res == 0 ) res = 1
- Agrif_Mind(2) = 1. / res
- !
- res = 1.
- do i = 1,coefrafmax-1
- res = res * FLOAT(Agrif_coeffref(3))
- enddo
- if ( res == 0 ) res = 1
- Agrif_Mind(3) = 1. / res
- !
- endif
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_Set_Rafmax
- !===================================================================================================
- !
- !===================================================================================================
- ! subroutine Agrif_Set_MaskMaxSearch
- !---------------------------------------------------------------------------------------------------
- subroutine Agrif_Set_MaskMaxSearch ( mymaxsearch )
- !---------------------------------------------------------------------------------------------------
- integer, intent(in) :: mymaxsearch
- !
- MaxSearch = mymaxsearch
- !---------------------------------------------------------------------------------------------------
- end subroutine Agrif_Set_MaskMaxSearch
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_Level
- !---------------------------------------------------------------------------------------------------
- function Agrif_Level ( )
- !---------------------------------------------------------------------------------------------------
- integer :: Agrif_Level ! Result
- !
- Agrif_Level = Agrif_Curgrid % level
- !---------------------------------------------------------------------------------------------------
- end function Agrif_Level
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_MaxLevel
- !---------------------------------------------------------------------------------------------------
- function Agrif_MaxLevel ( )
- !---------------------------------------------------------------------------------------------------
- integer :: Agrif_MaxLevel ! Result
- !
- Agrif_MaxLevel = Agrif_MaxLevelLoc
- !---------------------------------------------------------------------------------------------------
- end function Agrif_MaxLevel
- !===================================================================================================
- !
- !===================================================================================================
- ! function Agrif_GridAllocation_is_done
- !---------------------------------------------------------------------------------------------------
- function Agrif_GridAllocation_is_done ( ) result(isdone)
- !---------------------------------------------------------------------------------------------------
- logical :: isdone
- !
- isdone = Agrif_Curgrid % allocation_is_done
- !---------------------------------------------------------------------------------------------------
- end function Agrif_GridAllocation_is_done
- !===================================================================================================
- !
- end module Agrif_CurgridFunctions
|