source: trunk/LMDZ.PLUTO/libf/phypluto/evolps.F90 @ 3959

Last change on this file since 3959 was 3932, checked in by tbertrand, 2 months ago

PLUTO PCM: Allow 1D model to be run with empirical seasonal cycles of N2 and CH4 (change in pressure and CH4 abundance with time)
TB

File size: 1.9 KB
Line 
1      subroutine evolps(pls,pps)
2      use datafile_mod
3      use comcstfi_mod, only: pi
4      use mod_phys_lmdz_para, only : is_master
5
6      implicit none
7
8!==================================================================
9!     Purpose
10!     -------
11!     Get tracer fields according to the solar longitude (for 1D purpose for now)
12!
13!     Inputs
14!     ------
15!     pls                 solar longitude
16!
17!     Outputs
18!     -------
19!     pps                 surface pressure
20
21!     Both
22!     ----
23!
24!     Authors
25!     -------
26!     Tanguy Bertrand
27!==================================================================
28
29!-----------------------------------------------------------------------
30!     Arguments
31
32      REAL,INTENT(IN) :: pls
33      REAL,INTENT(OUT) :: pps
34!-----------------------------------------------------------------------
35!     Local variables
36      LOGICAL,SAVE :: firstcall=.true.
37!$OMP THREADPRIVATE(firstcall)
38
39      integer Nfine
40      parameter(Nfine=143)
41      integer ifine
42      character(len=100) :: file_path
43      real,save,allocatable :: lssdat(:)
44      real,save,allocatable :: psdat(:)
45
46
47!---------------- INPUT ------------------------------------------------
48
49      IF (firstcall) then
50         firstcall=.false.
51
52!$OMP MASTER
53         file_path=trim(datadir)//'/cycle_ps.txt'
54         if (is_master) print*,file_path
55
56         open(222,file=file_path,form='formatted')
57
58            if(.not.allocated(lssdat)) then
59               allocate(lssdat(Nfine))
60            endif
61            if(.not.allocated(psdat)) then
62               allocate(psdat(Nfine))
63            endif
64
65            do ifine=1,Nfine
66               read(222,*) lssdat(ifine), psdat(ifine)
67            enddo
68            close(222)
69
70!$OMP END MASTER
71!$OMP BARRIER
72      ENDIF
73
74      CALL interp_line(lssdat,psdat,Nfine,pls*180./pi,pps,1)
75      !if (is_master) write(*,*) 'pps=',pps
76
77      end subroutine evolps
78
Note: See TracBrowser for help on using the repository browser.