source: trunk/LMDZ.PLUTO/libf/phypluto/lymalpha.F90 @ 3957

Last change on this file since 3957 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: 2.0 KB
Line 
1      subroutine lymalpha(pls,pflux)
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 the lyman alpha flux according to the solar longitude
12!
13!     Inputs
14!     ------
15!     pls                 solar longitude
16!
17!     Outputs
18!     -------
19!     pflux               Lyman alpha flux
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) :: pflux
34!-----------------------------------------------------------------------
35!     Local variables
36      LOGICAL,SAVE :: firstcall=.true.
37!$OMP THREADPRIVATE(firstcall)
38
39      !!read lyman alpha flux
40      integer Nfine
41      parameter(Nfine=9047)
42      integer ifine
43      character(len=100) :: file_path
44      ! real,save :: lsdat(Nfine),fluxdat(Nfine)
45      real,save,allocatable :: lsdat(:)
46      real,save,allocatable :: fluxdat(:)
47
48
49!---------------- INPUT ------------------------------------------------
50
51      IF (firstcall) then
52         firstcall=.false.
53
54!$OMP MASTER
55         file_path=trim(datadir)//'/sol_uv_flux.txt'
56         if (is_master) print*,file_path
57
58         open(222,file=file_path,form='formatted')
59
60            if(.not.allocated(lsdat)) then
61               allocate(lsdat(Nfine))
62            endif
63            if(.not.allocated(fluxdat)) then
64               allocate(fluxdat(Nfine))
65            endif
66
67            do ifine=1,Nfine
68               read(222,*) lsdat(ifine), fluxdat(ifine)
69            enddo
70            close(222)
71
72!$OMP END MASTER
73!$OMP BARRIER
74      ENDIF
75
76      CALL interp_line(lsdat,fluxdat,Nfine,pls*180./pi,pflux,1)
77      !if (is_master) write(*,*) 'flux=',pflux
78
79
80      end subroutine lymalpha
81
Note: See TracBrowser for help on using the repository browser.