Ignore:
Timestamp:
Mar 20, 2014, 10:57:19 AM (10 years ago)
Author:
Laurent Fairhead
Message:

Merged trunk changes r1920:1997 into testing branch

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/libf/dyn3d/caldyn.F

    r1910 r1999  
    11!
    2 ! $Header$
     2! $Id$
    33!
    4 c
    5 c
    64      SUBROUTINE caldyn
    75     $ (itau,ucov,vcov,teta,ps,masse,pk,pkf,phis ,
     
    108      IMPLICIT NONE
    119
    12 c=======================================================================
    13 c
    14 c  Auteur :  P. Le Van
    15 c
    16 c   Objet:
    17 c   ------
    18 c
    19 c   Calcul des tendances dynamiques.
    20 c
    21 c Modif 04/93 F.Forget
    22 c=======================================================================
     10!=======================================================================
     11!
     12!  Auteur :  P. Le Van
     13!
     14!   Objet:
     15!   ------
     16!
     17!   Calcul des tendances dynamiques.
     18!
     19! Modif 04/93 F.Forget
     20!=======================================================================
    2321
    24 c-----------------------------------------------------------------------
    25 c   0. Declarations:
    26 c   ----------------
     22!-----------------------------------------------------------------------
     23!   0. Declarations:
     24!   ----------------
    2725
    2826#include "dimensions.h"
     
    3230#include "comgeom.h"
    3331
    34 c   Arguments:
    35 c   ----------
     32!   Arguments:
     33!   ----------
    3634
    37       LOGICAL conser
     35      LOGICAL,INTENT(IN) :: conser ! triggers printing some diagnostics
     36      INTEGER,INTENT(IN) :: itau ! time step index
     37      REAL,INTENT(IN) :: vcov(ip1jm,llm) ! covariant meridional wind
     38      REAL,INTENT(IN) :: ucov(ip1jmp1,llm) ! covariant zonal wind
     39      REAL,INTENT(IN) :: teta(ip1jmp1,llm) ! potential temperature
     40      REAL,INTENT(IN) :: ps(ip1jmp1) ! surface pressure
     41      REAL,INTENT(IN) :: phis(ip1jmp1) ! geopotential at the surface
     42      REAL,INTENT(IN) :: pk(ip1jmp1,llm) ! Exner at mid-layer
     43      REAL,INTENT(IN) :: pkf(ip1jmp1,llm) ! filtered Exner
     44      REAL,INTENT(IN) :: phi(ip1jmp1,llm) ! geopotential
     45      REAL,INTENT(OUT) :: masse(ip1jmp1,llm) ! air mass
     46      REAL,INTENT(OUT) :: dv(ip1jm,llm) ! tendency on vcov
     47      REAL,INTENT(OUT) :: du(ip1jmp1,llm) ! tendency on ucov
     48      REAL,INTENT(OUT) :: dteta(ip1jmp1,llm) ! tenddency on teta
     49      REAL,INTENT(OUT) :: dp(ip1jmp1) ! tendency on ps
     50      REAL,INTENT(OUT) :: w(ip1jmp1,llm) ! vertical velocity
     51      REAL,INTENT(OUT) :: pbaru(ip1jmp1,llm) ! mass flux in the zonal direction
     52      REAL,INTENT(OUT) :: pbarv(ip1jm,llm) ! mass flux in the meridional direction
     53      REAL,INTENT(IN) :: time ! current time
    3854
    39       INTEGER itau
    40       REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm),teta(ip1jmp1,llm)
    41       REAL ps(ip1jmp1),phis(ip1jmp1)
    42       REAL pk(iip1,jjp1,llm),pkf(ip1jmp1,llm)
     55!   Local:
     56!   ------
     57
    4358      REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm)
    44       REAL phi(ip1jmp1,llm),masse(ip1jmp1,llm)
    45       REAL dv(ip1jm,llm),du(ip1jmp1,llm)
    46       REAL dteta(ip1jmp1,llm),dp(ip1jmp1)
    47       REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm)
    48       REAL time
    49 
    50 c   Local:
    51 c   ------
    52 
    5359      REAL ang(ip1jmp1,llm),p(ip1jmp1,llmp1)
    5460      REAL massebx(ip1jmp1,llm),masseby(ip1jm,llm),psexbarxy(ip1jm)
    5561      REAL vorpot(ip1jm,llm)
    56       REAL w(ip1jmp1,llm),ecin(ip1jmp1,llm),convm(ip1jmp1,llm)
     62      REAL ecin(ip1jmp1,llm),convm(ip1jmp1,llm)
    5763      REAL bern(ip1jmp1,llm)
    5864      REAL massebxy(ip1jm,llm)
     
    6167      INTEGER   ij,l
    6268
    63 c-----------------------------------------------------------------------
    64 c   Calcul des tendances dynamiques:
    65 c   --------------------------------
     69!-----------------------------------------------------------------------
     70!   Compute dynamical tendencies:
     71!--------------------------------
    6672
     73      ! compute contravariant winds ucont() and vcont
    6774      CALL covcont  ( llm    , ucov    , vcov , ucont, vcont        )
     75      ! compute pressure p()
    6876      CALL pression ( ip1jmp1, ap      , bp   ,  ps  , p            )
     77      ! compute psexbarxy() XY-area weighted-averaged surface pressure (what for?)
    6978      CALL psextbar (   ps   , psexbarxy                            )
     79      ! compute mass in each atmospheric mesh: masse()
    7080      CALL massdair (    p   , masse                                )
     81      ! compute X and Y-averages of mass, massebx() and masseby()
    7182      CALL massbar  (   masse, massebx , masseby                    )
     83      ! compute XY-average of mass, massebxy()
    7284      call massbarxy(   masse, massebxy                             )
     85      ! compute mass fluxes pbaru() and pbarv()
    7386      CALL flumass  ( massebx, masseby , vcont, ucont ,pbaru, pbarv )
     87      ! compute dteta() , horizontal converging flux of theta
    7488      CALL dteta1   (   teta , pbaru   , pbarv, dteta               )
     89      ! compute convm(), horizontal converging flux of mass
    7590      CALL convmas  (   pbaru, pbarv   , convm                      )
    7691
     92      ! compute pressure variation due to mass convergence
    7793      DO ij =1, ip1jmp1
    7894         dp( ij ) = convm( ij,1 ) / airesurg( ij )
    7995      ENDDO
    8096
     97      ! compute vertical velocity w()
    8198      CALL vitvert ( convm  , w                                  )
     99      ! compute potential vorticity vorpot()
    82100      CALL tourpot ( vcov   , ucov  , massebxy  , vorpot         )
     101      ! compute rotation induced du() and dv()
    83102      CALL dudv1   ( vorpot , pbaru , pbarv     , du     , dv    )
     103      ! compute kinetic energy ecin()
    84104      CALL enercin ( vcov   , ucov  , vcont     , ucont  , ecin  )
     105      ! compute Bernouilli function bern()
    85106      CALL bernoui ( ip1jmp1, llm   , phi       , ecin   , bern  )
     107      ! compute and add du() and dv() contributions from Bernouilli and pressure
    86108      CALL dudv2   ( teta   , pkf   , bern      , du     , dv    )
    87109
     
    90112         DO ij=1,ip1jmp1
    91113            ang(ij,l) = ucov(ij,l) + constang(ij)
    92       ENDDO
     114         ENDDO
    93115      ENDDO
    94116
    95 
     117      ! compute vertical advection contributions to du(), dv() and dteta()
    96118      CALL advect( ang, vcov, teta, w, massebx, masseby, du, dv,dteta )
    97119
    98 C  WARNING probleme de peridocite de dv sur les PC/linux. Pb d'arrondi
    99 C          probablement. Observe sur le code compile avec pgf90 3.0-1
     120!  WARNING probleme de peridocite de dv sur les PC/linux. Pb d'arrondi
     121!          probablement. Observe sur le code compile avec pgf90 3.0-1
    100122
    101123      DO l = 1, llm
    102124         DO ij = 1, ip1jm, iip1
    103125           IF( dv(ij,l).NE.dv(ij+iim,l) )  THEN
    104 c         PRINT *,'!!!ATTENTION!!! probleme de periodicite sur vcov', 
    105 c    ,   ' dans caldyn'
    106 c         PRINT *,' l,  ij = ', l, ij, ij+iim,dv(ij+iim,l),dv(ij,l)
     126!         PRINT *,'!!!ATTENTION!!! probleme de periodicite sur vcov', 
     127!    ,   ' dans caldyn'
     128!         PRINT *,' l,  ij = ', l, ij, ij+iim,dv(ij+iim,l),dv(ij,l)
    107129          dv(ij+iim,l) = dv(ij,l)
    108           endif
    109          enddo
    110       enddo
    111 c-----------------------------------------------------------------------
    112 c   Sorties eventuelles des variables de controle:
    113 c   ----------------------------------------------
     130           ENDIF
     131         ENDDO
     132      ENDDO
     133
     134!-----------------------------------------------------------------------
     135!   Output some control variables:
     136!---------------------------------
    114137
    115138      IF( conser )  THEN
    116139        CALL sortvarc
    117      $ ( itau,ucov,teta,ps,masse,pk,phis,vorpot,phi,bern,dp,time,vcov )
    118 
     140     & ( itau,ucov,teta,ps,masse,pk,phis,vorpot,phi,bern,dp,time,vcov )
    119141      ENDIF
    120142
    121       RETURN
    122143      END
Note: See TracChangeset for help on using the changeset viewer.