OpenMCTDHB v2.3

moduleextensions.F90

Go to the documentation of this file.
00001 ! vim:fdm=marker:
00002 
00003 !---------------------------------------------------------------------------------------
00009 MODULE moduleextensions
00010 IMPLICIT NONE
00011 
00012 CONTAINS
00013 
00014 
00015 !-------------------------------------------------------------------------------------
00016 !  (POSSIBLY) TIME DEPENDENT EXTERNAL POTENTIAL  
00023 SUBROUTINE get_V_ext(V_ext,NDX,NDY,NDZ,Dims,gridx,gridy,gridz,AbsTime)
00024 USE modulegrid
00025 !--{{{
00026 IMPLICIT NONE
00027 INTEGER,INTENT(IN)      :: NDX,NDY,NDZ,Dims
00028 REAL*8,INTENT(IN)       :: gridx(NDX),gridy(NDY),gridz(NDZ),AbsTime
00029 REAL*8,INTENT(OUT)      :: V_ext(NDX*NDY*NDZ)
00030 
00031 REAL*8                  :: x,y,z
00032 INTEGER                 :: i,j,k,m
00033 
00034 !e.g. a harmonic potential
00035 REAL*8                  :: w_x=1.d0,w_y=1.d0,w_z=1.d0
00036 REAL*8                  :: x0=0.d0,y0=0.d0,z0=0.d0
00037 
00038 w_x             = 1.0d0  ! V(x)       = 0.5* w_x**2 x**2 
00039 w_y             = 1.d00  ! V(y)       = 0.5* w_y**2 y**2 
00040 w_z             = 1.0d0  ! V(z)       = 0.5* w_z**2 z**2 
00041 
00042 DO m=1,NDX*NDY*NDZ
00043 
00044   CALL get_ijk_from_m(m,NDX,NDY,i,j,k)
00045   x=gridx(i)
00046   y=gridy(j)
00047   z=gridz(k)
00048 
00049 
00050   V_ext(m)= 0.5d0*w_x**2 * x**2 + 0.5d0*w_y**2 * y**2 +  0.5d0*w_z**2 * z**2
00051 
00052 END DO
00053 
00054 
00055 !---}}}
00056 END SUBROUTINE get_V_ext
00057 
00058 
00059 
00060 !----------------------------------------------------------------------------------
00083 REAL*8 FUNCTION Wint_IMEST(x,y,z)
00084 USE moduleparameters
00085 USE moduleinputvariables,ONLY:lambda0,Dims,imestParameter1
00086 USE modulederivesystemvariables, ONLY: weight
00087 IMPLICIT NONE
00088 REAL*8,INTENT(IN)        :: x,y,z
00089 REAL*8                   :: sigma
00090 
00091 sigma           =      imestParameter1
00092 
00093 Wint_IMEST = lambda0 / weight**2  * DEXP(-1.d0*(x**2+y**2+z**2)/(2.d0*sigma**2))
00094 
00095 END FUNCTION Wint_IMEST
00096 
00097 END MODULE moduleextensions
 All Namespaces Files Functions Variables