source: LMDZ5/trunk/libf/dyn3d_common/caldyn0.F90 @ 2306

Last change on this file since 2306 was 2293, checked in by dcugnet, 9 years ago

Initial states creation routines have been reorganized and simplified.
As far as possible, dynamics and physics related routines have been
separated.
Some routines have been converted to fortran 90 and repeated codes sections
have been "factorized".
Array/vector arguments have become implicit in some routines to avoid usage
of "dimensions.h" ; possible for routines with explicit interfaces and if
iim and jjm can be deduced from arguments sizes.

  • dynlonlat_phylonlat/ce0l.F90 calls now phylmd/etat0phys_netcdf.F90 and dyn3d/etat0dyn_netcdf.F90 that replace phylmd/etat0_netcdf.F90. start.nc and startphy.nc creations are now independant.
  • startvar.F90 has been suppressed ; corresponding operations have been simplified and embedded in etat0*_netcdf.F90 routines as internal procedures.
  • Routines converted to fortran 90 and "factorized":
    • dyn3d_common/conf_dat_m.F90 (replaces dyn3d_common/conf_dat2d.F

and dyn3d_common/conf_dat3d.F)

  • dyn3d/dynredem.F90 (replaces dyn3d/dynredem.F)
  • dyn3d/dynetat0.F90 (replaces dyn3d/dynetat0.F)
  • phylmd/grid_noro_m.F90 (replaces dyn3d_common/grid_noro.F)
  • dynlonlat_phylonlat/grid_atob_m.F90 (replaces dyn3d_common/grid_atob.F)
  • dyn3d_common/caldyn0.F90 (replaces dyn3d_common/caldyn0.F)
  • dyn3d_common/covcont.F90 (replaces dyn3d_common/covcont.F)
  • dyn3d_common/pression.F90 (replaces dyn3d_common/pression.F)
  • phylmd/phyredem.F90 and phylmd/limit_netcdf.F90 have been slightly factorized.

TO DO:

  • little fix needed in grid_noro_m.F90 ; untouched yet to ensure results are exactly the same as before. Unsmoothed orography is used to compute "zphi", but smoothed (should be unsmoothed) one is used at poles.
  • add the dyn3dmem versions of dynredem.F90 and dynetat0.F90 (dynredem_loc.F90 and dynetat0_loc.F90, untested yet).
  • test compilation in parallel mode for a single processor.
File size: 3.1 KB
Line 
1SUBROUTINE caldyn0(itau,ucov,vcov,teta,ps,masse,pk,phis,phi,w,pbaru,pbarv,time)
2!
3!-------------------------------------------------------------------------------
4! Author: P. Le Van ; modif. 04/93: F.Forget.
5!-------------------------------------------------------------------------------
6! Purpose: Compute dynamic tendencies.
7!-------------------------------------------------------------------------------
8  USE control_mod, ONLY: resetvarc
9  IMPLICIT NONE
10  include "dimensions.h"
11  include "paramet.h"
12  include "comconst.h"
13  include "comvert.h"
14  include "comgeom.h"
15!===============================================================================
16! Arguments:
17  INTEGER, INTENT(IN)  :: itau                      !---
18  REAL,    INTENT(IN)  :: vcov (ip1jm    ,llm)      !--- V COVARIANT WIND
19  REAL,    INTENT(IN)  :: ucov (ip1jmp1  ,llm)      !--- U COVARIANT WIND
20  REAL,    INTENT(IN)  :: teta (ip1jmp1  ,llm)      !--- POTENTIAL TEMPERATURE
21  REAL,    INTENT(IN)  :: ps   (ip1jmp1)            !--- GROUND PRESSURE
22  REAL,    INTENT(IN)  :: masse(ip1jmp1  ,llm)      !--- MASS IN EACH CELL
23  REAL,    INTENT(IN)  :: pk   (iip1,jjp1,llm)      !--- PRESSURE
24  REAL,    INTENT(IN)  :: phis (ip1jmp1)            !--- GROUND GEOPOTENTIAL
25  REAL,    INTENT(IN)  :: phi  (ip1jmp1  ,llm)      !--- 3D GEOPOTENTIAL
26  REAL,    INTENT(OUT) :: w    (ip1jmp1  ,llm)      !--- VERTICAL WIND
27  REAL,    INTENT(IN)  :: pbaru(ip1jmp1  ,llm)      !--- U MASS FLUX
28  REAL,    INTENT(IN)  :: pbarv(ip1jm    ,llm)      !--- V MASS FLUX
29  REAL,    INTENT(IN)  :: time                      !--- TIME
30!===============================================================================
31! Local variables:
32  REAL, DIMENSION(ip1jmp1,llmp1) :: p
33  REAL, DIMENSION(ip1jmp1,llm)   :: ucont, massebx, ang, ecin, convm, bern
34  REAL, DIMENSION(ip1jmp1)       :: dp
35  REAL, DIMENSION(ip1jm  ,llm)   :: vcont, masseby, massebxy, vorpot
36  REAL, DIMENSION(ip1jm)         :: psexbarxy
37  INTEGER                        :: ij, l
38!===============================================================================
39  CALL covcont  ( llm    , ucov    , vcov , ucont, vcont        )
40  CALL pression ( ip1jmp1, ap      , bp   ,  ps  , p            )
41  CALL psextbar (   ps   , psexbarxy                            )
42  CALL massdair (    p   , masse                                )
43  CALL massbar  (   masse, massebx , masseby                    )
44  CALL massbarxy(   masse, massebxy                             )
45  CALL flumass  ( massebx, masseby , vcont, ucont ,pbaru, pbarv )
46  CALL convmas  (   pbaru, pbarv   , convm                      )
47  CALL vitvert  ( convm  , w                                    )
48  CALL tourpot  ( vcov   , ucov    , massebxy  , vorpot         )
49  CALL enercin  ( vcov   , ucov    , vcont     , ucont  , ecin  )
50  CALL bernoui  ( ip1jmp1, llm     , phi       , ecin   , bern  )
51  DO l=1,llm; ang(:,l) = ucov(:,l) + constang(:); END DO
52  resetvarc=.true. ! force a recomputation of initial values in sortvarc
53  dp(:)=convm(:,1)/airesurg(:)
54  CALL sortvarc( itau,ucov,teta,ps,masse,pk,phis,vorpot,phi,bern,dp,time,vcov )
55
56END SUBROUTINE caldyn0
Note: See TracBrowser for help on using the repository browser.