source: codes/icosagcm/devel/src/dynamics/compute_caldyn.f90 @ 938

Last change on this file since 938 was 938, checked in by dubos, 5 years ago

devel : interfaces for caldyn_coriolis

File size: 3.9 KB
Line 
1MODULE compute_caldyn_mod
2  USE prec, ONLY : rstd
3  IMPLICIT NONE
4  SAVE
5 
6  ! fake array dimensions, for interfaces
7  INTEGER, PARAMETER :: iim_jjm_i=1, iim_jjm_u=1, iim_jjm_v =1, llm_=1, llm1=1, nqdyn_=1
8
9  INTERFACE
10     
11    SUBROUTINE comp_pvort_only(u,rhodz,qu,qv, hv)
12      IMPORT
13      REAL(rstd),INTENT(IN)  :: u(iim_jjm_i, llm_)
14      REAL(rstd),INTENT(INOUT) :: rhodz(iim_jjm_i, llm_)
15      REAL(rstd),INTENT(OUT) :: qu(iim_jjm_u, llm_)
16      REAL(rstd),INTENT(OUT) :: qv(iim_jjm_v, llm_)
17      REAL(rstd),INTENT(OUT) :: hv(iim_jjm_v, llm_)
18    END SUBROUTINE comp_pvort_only
19
20    SUBROUTINE comp_theta(mass_col,theta_rhodz, rhodz,theta)
21      IMPORT
22      REAL(rstd),INTENT(IN)    :: mass_col(iim_jjm_i)
23      REAL(rstd),INTENT(IN)    :: theta_rhodz(iim_jjm_i, llm_, nqdyn_)
24      REAL(rstd),INTENT(INOUT) :: rhodz(iim_jjm_i, llm_)
25      REAL(rstd),INTENT(OUT)   :: theta(iim_jjm_i, llm_, nqdyn_)
26    END SUBROUTINE comp_theta
27
28    SUBROUTINE comp_geopot(rhodz,theta, ps,pk,geopot) 
29      IMPORT
30      REAL(rstd),INTENT(IN)    :: rhodz(iim_jjm_i, llm_)         ! rho*dz = mass per unit surface in each full model level
31      REAL(rstd),INTENT(IN)    :: theta(iim_jjm_i, llm_, nqdyn_) ! active scalars : theta/entropy, moisture, ...
32      REAL(rstd),INTENT(INOUT) :: ps(iim_jjm_i)                  ! surface pressure
33      REAL(rstd),INTENT(OUT)   :: pk(iim_jjm_i, llm_)            ! Exner function (compressible) /Lagrange multiplier (Boussinesq)
34      REAL(rstd),INTENT(INOUT) :: geopot(iim_jjm_i, llm1)        ! geopotential
35    END SUBROUTINE comp_geopot
36
37    SUBROUTINE comp_caldyn_fast(tau,theta,geopot, pk,berni,du,u)
38      IMPORT
39      REAL(rstd),INTENT(IN)    :: tau                ! "solve" u-tau*du/dt = rhs
40      REAL(rstd),INTENT(IN)    :: theta(iim_jjm_i, llm_, nqdyn_)
41      REAL(rstd),INTENT(IN)    :: geopot(iim_jjm_i, llm1)
42      REAL(rstd),INTENT(INOUT) :: pk(iim_jjm_i, llm_)
43      REAL(rstd),INTENT(INOUT) :: berni(iim_jjm_i, llm_)  ! partial Bernoulli function
44      REAL(rstd),INTENT(INOUT) :: du(iim_jjm_u, llm_)
45      REAL(rstd),INTENT(INOUT) :: u(iim_jjm_u, llm_)   ! INOUT if tau>0
46    END SUBROUTINE comp_caldyn_fast
47
48    SUBROUTINE comp_caldyn_slow_hydro(zero, u,rhodz,hv,Kv, berni, hflux,du)
49      IMPORT
50      LOGICAL, INTENT(IN) :: zero
51      REAL(rstd),INTENT(IN)  :: u(iim_jjm_u, llm_)    ! prognostic "velocity"
52      REAL(rstd),INTENT(IN)  :: rhodz(iim_jjm_i, llm_)
53      REAL(rstd),INTENT(IN)  :: hv(iim_jjm_v, llm_)   ! height/mass averaged to vertices
54      REAL(rstd),INTENT(IN)  :: Kv(iim_jjm_v, llm_)   ! kinetic energy at vertices
55      REAL(rstd), INTENT(OUT) :: berni(iim_jjm_i, llm_)  ! Bernoulli function
56      REAL(rstd),INTENT(OUT) :: hflux(iim_jjm_u, llm_) ! hflux in kg/s
57      REAL(rstd),INTENT(INOUT) :: du(iim_jjm_u, llm_)
58    END SUBROUTINE comp_caldyn_slow_hydro
59   
60    SUBROUTINE comp_caldyn_coriolis(hflux,theta,qu, Ftheta, convm,dtheta_rhodz,du)
61      IMPORT
62      REAL(rstd),INTENT(IN)    :: hflux(iim_jjm_u, llm_)  ! hflux in kg/s
63      REAL(rstd),INTENT(IN)    :: theta(iim_jjm_i, llm_, nqdyn_) ! active scalars
64      REAL(rstd),INTENT(IN)    :: qu(iim_jjm_u, llm_)
65      REAL(rstd), INTENT(OUT)  :: Ftheta(iim_jjm_u, llm_)  ! potential temperature flux
66      REAL(rstd),INTENT(OUT)   :: convm(iim_jjm_i, llm_)  ! mass flux convergence
67      REAL(rstd),INTENT(OUT)   :: dtheta_rhodz(iim_jjm_i, llm_, nqdyn_)
68      REAL(rstd),INTENT(INOUT) :: du(iim_jjm_u, llm_)
69    END SUBROUTINE comp_caldyn_coriolis
70
71  END INTERFACE
72
73  PROCEDURE(comp_pvort_only),        POINTER :: compute_pvort_only        => NULL()
74  PROCEDURE(comp_theta),             POINTER :: compute_theta             => NULL()
75  PROCEDURE(comp_geopot),            POINTER :: compute_geopot            => NULL()
76  PROCEDURE(comp_caldyn_fast),       POINTER :: compute_caldyn_fast       => NULL()
77  PROCEDURE(comp_caldyn_slow_hydro), POINTER :: compute_caldyn_slow_hydro => NULL()
78  PROCEDURE(comp_caldyn_coriolis),   POINTER :: compute_caldyn_coriolis   => NULL()
79
80END MODULE compute_caldyn_mod
Note: See TracBrowser for help on using the repository browser.