source: trunk/LMDZ.PLUTO.old/libf/phypluto/testconservfast.F90

Last change on this file was 3175, checked in by emillour, 11 months ago

Pluto PCM:
Add the old Pluto LMDZ for reference (required prior step to making
an LMDZ.PLUTO using the same framework as the other physics packages).
TB+EM

File size: 2.6 KB
Line 
1      subroutine testconservfast(ngrid,nlayer,nq,ptimestep, &
2          pplev,zdq,zdqs,car1,car2)
3
4      use comgeomfi_h         
5      implicit none
6
7!==================================================================
8!     Purpose
9!     -------
10!     Test conservation of tracers
11
12!     Inputs
13!     ------
14!     ngrid                 Number of vertical columns
15!     nlayer                Number of layers
16!     pplev(ngrid,nlayer+1) Pressure levels
17!     zdq
18!     
19!     Outputs
20!     -------
21!     
22!     Both
23!     ----
24!
25!     Authors
26!     -------
27!     Tanguy Bertrand 2015
28!     
29!==================================================================
30
31#include "dimensions.h"
32#include "dimphys.h"
33#include "comcstfi.h"
34#include "surfdat.h"
35#include "comvert.h"
36#include "callkeys.h"
37#include "tracer.h"
38
39!-----------------------------------------------------------------------
40!     Arguments
41
42      INTEGER ngrid, nlayer, nq
43      REAL zdq(ngrid)
44      REAL zdqs(ngrid)
45      REAL ptimestep
46      REAL pplev(ngrid,nlayer+1)
47      character(len=3) :: car1     
48      character(len=7) :: car2     
49
50      ! LOCAL VARIABLES
51      INTEGER l,ig,iq
52      REAL masse
53
54      ! OUTPUT
55      REAL dWtot   
56      REAL dWtots
57      REAL nconsMAX
58      INTEGER myig
59      REAL vdifcncons(ngrid)
60!-----------------------------------------------------------------------
61
62      dWtot=0.0
63      dWtots=0.0
64      nconsMAX=0.0
65      do ig = 1, ngrid
66         vdifcncons(ig)=0.0
67
68        ! sum of atmospheric mass : kg
69         dWtot = dWtot + zdq(ig)*ptimestep*area(ig)*pplev(ig,1)/g
70        ! for each column, total mass lost per sec : kg(tracer) / m2 /s
71         vdifcncons(ig)=vdifcncons(ig) + pplev(ig,1)/g*zdq(ig)
72 
73         dWtots = dWtots + zdqs(ig)*ptimestep*area(ig)
74         vdifcncons(ig)=vdifcncons(ig)+zdqs(ig)
75
76             
77             ! vdifcncons is the total amount of material that appear or
78             ! disapear per second in the routine
79             ! it is the non conservative factor
80
81         if(vdifcncons(ig).gt.nconsMAX)then
82              nconsMAX=vdifcncons(ig)
83              myig=ig
84         endif
85
86      enddo
87
88      dWtot  = dWtot/totarea
89      dWtots = dWtots/totarea
90      print*,'-------------------------------------------'
91      print*,'In ',car2,' atmospheric ',car1,' change=',dWtot,' kg m-2'
92      print*,'In ',car2,' surface ',car1,' change  =',dWtots,' kg m-2'
93      print*,'--> non-cons factor     =',dWtot+dWtots,' kg m-2'
94      print*,'--> MAX non-cons factor =',nconsMAX,' kg m-2 s-1'
95      IF (nconsMAX.gt.0.) then
96        print*,'--> obtained at lat/lon=',lati(myig)*180./pi,long(myig)*180./pi
97      ENDIF
98      end subroutine testconservfast
99
Note: See TracBrowser for help on using the repository browser.